Commit c8a50d9d authored by ZWT's avatar ZWT

feat(零碳): 长庆演示系统新增功能

1.能耗分析模块功能重构,新增今日/昨日/同期电量统计查询接口,添加线上接口文档并完成接口冒烟测试同时添加用例;
2.能耗分析模块功能重构,新增今日天气查询接口,添加线上接口文档并完成接口冒烟测试同时添加用例;
3.能耗分析模块功能重构,新增井场用能分析查询接口,添加线上接口文档并完成接口冒烟测试同时添加用例;
4.能耗分析模块功能重构,新增井场发电趋势查询接口,添加线上接口文档并完成接口冒烟测试同时添加用例;
5.能耗分析模块功能重构,新增井场实时监控查询接口,添加线上接口文档并完成接口冒烟测试同时添加用例;
6.能耗分析模块功能重构,新增本日用电对比查询接口,添加线上接口文档并完成接口冒烟测试同时添加用例;
7.能耗分析模块功能重构,新增发电详情查询接口,添加线上接口文档并完成接口冒烟测试同时添加用例;
8.能耗分析模块功能重构,新增用电趋势查询接口,添加线上接口文档并完成接口冒烟测试同时添加用例;
9.能耗分析模块功能重构,新增用电分析查询接口,添加线上接口文档并完成接口冒烟测试同时添加用例;
10.间开配置Cloud模块添加查询生效中间开井口列表接口;
11.创建日用电趋势结果录入表,同时生成相关代码;
12.创建日用电趋势结果计算定时任务;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent a1f48a4b
......@@ -51,7 +51,12 @@ public class TaskConstant {
/**
* 每一天 00:00:00
*/
public static final String EVERY_DAY_ZERO = "0 0 0 * * ?";
public static final String EVERY_DAY_0 = "0 0 0 * * ?";
/**
* 每一天 00:02:00
*/
public static final String EVERY_DAY_2 = "0 2 0 * * ?";
/**
* 每一天 00:05:00
......
package pps.core.task.job;
import cn.hutool.core.util.ObjectUtil;
import pps.cloud.space.service.IDailyElectricityTrendCloudService;
import pps.core.common.cache.TaskLockCache;
import pps.core.task.constant.TaskConstant;
import xstartup.annotation.XService;
import xstartup.annotation.XText;
import xstartup.base.XContext;
import xstartup.data.XServiceResult;
import xstartup.service.job.XJob;
import xstartup.service.job.annotation.XCronTrigger;
/**
* 日用电趋势定时任务
*
* @author ZWT
* @date 2024/05/22 17:12
*/
@XText("日用电趋势定时任务")
@XService
public class DailyElectricityTrendJob implements XJob {
/**
* 每天0点02执行(跑前一天数据)
*
* @param xContext x上下文
* @return {@link XServiceResult}
*/
@XCronTrigger(value = TaskConstant.EVERY_DAY_2)
@Override
public XServiceResult execute(XContext xContext) {
xContext.getLogger().info("------ DailyElectricityTrendJob start:{}", System.currentTimeMillis());
String key = TaskConstant.TASK_LOCK_KEY + "DailyElectricityTrendJob";
TaskLockCache exist = TaskLockCache.exist(xContext, key);
if (ObjectUtil.isNull(exist)) {
TaskLockCache cache = new TaskLockCache();
cache.setRedisKey(key);
cache.setRedisValue(key);
TaskLockCache.set(xContext, cache);
try {
IDailyElectricityTrendCloudService service = xContext.getBean(IDailyElectricityTrendCloudService.class);
XServiceResult result = service.dailyElectricityTrendJob(xContext);
result.throwIfFail();
} catch (Exception e) {
xContext.getLogger().error("------ DailyElectricityTrendJob Exception: ", e);
} finally {
xContext.getLogger().info("------ DailyElectricityTrendJob end:{}", System.currentTimeMillis());
TaskLockCache.delete(xContext, key);
}
}
return XServiceResult.OK;
}
}
......@@ -27,7 +27,7 @@ public class WellTechDailyJob implements XJob {
* @param xContext x上下文
* @return {@link XServiceResult}
*/
@XCronTrigger(value = TaskConstant.EVERY_DAY_ZERO)
@XCronTrigger(value = TaskConstant.EVERY_DAY_0)
@Override
public XServiceResult execute(XContext xContext) {
xContext.getLogger().info("------ WellTechDailyJob start:{}", System.currentTimeMillis());
......
package pps.cloud.space.service;
import xstartup.annotation.XService;
import xstartup.annotation.XText;
import xstartup.base.XContext;
import xstartup.data.XServiceResult;
/**
* 日用电趋势计算Cloud模块
*
* @author ZWT
* @date 2024/05/22 17:15
*/
@XService
@XText("日用电趋势计算Cloud模块")
public interface IDailyElectricityTrendCloudService {
/**
* 日用电趋势计算Cloud模块--定时任务
*
* @param context 上下文
* @return {@link XServiceResult}
*/
@XText("日用电趋势计算Cloud模块--定时任务")
XServiceResult dailyElectricityTrendJob(XContext context);
}
package pps.core.space.service;
import pps.cloud.space.service.IDailyElectricityTrendCloudService;
import xstartup.annotation.XService;
import xstartup.base.XContext;
import xstartup.data.XServiceResult;
/**
* 日用电趋势计算Cloud模块
*
* @author ZWT
* @date 2024/05/22 17:17
*/
@XService
public class DailyElectricityTrendCloudServiceImpl implements IDailyElectricityTrendCloudService {
@Override
public XServiceResult dailyElectricityTrendJob(XContext context) {
return null;
}
}
......@@ -32,6 +32,7 @@ public class DeployPpsAllApplication {
startup.enable(XJobFeature.class).config(new XJobServiceConf(SpaceCalibrationJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(SpaceOptimizeUltraJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(SpaceOptimizeShortJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(DailyElectricityTrendJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(WeatherReceiveJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(WeatherApiReceiveJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(WellTechDailyJob.class));
......
......@@ -48,6 +48,7 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\
pps.core.task.job.SpaceCalibrationJob,\
pps.core.task.job.SpaceOptimizeShortJob,\
pps.core.task.job.SpaceOptimizeUltraJob,\
pps.core.task.job.DailyElectricityTrendJob,\
pps.core.task.job.WeatherReceiveJob,\
pps.core.task.job.WeatherApiReceiveJob,\
pps.core.task.job.WellTechDailyJob,\
......
......@@ -33,6 +33,7 @@ public class DeployPpsTaskApplication {
startup.enable(XJobFeature.class).config(new XJobServiceConf(SpaceOptimizeUltraJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(SpaceCalibrationJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(SpaceOptimizeShortJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(DailyElectricityTrendJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(WeatherReceiveJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(WeatherApiReceiveJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(WellTechDailyJob.class));
......
......@@ -10,6 +10,7 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\
pps.core.task.job.SpaceOptimizeUltraJob,\
pps.core.task.job.SpaceCalibrationJob,\
pps.core.task.job.SpaceOptimizeShortJob,\
pps.core.task.job.DailyElectricityTrendJob,\
pps.core.task.job.WeatherReceiveJob,\
pps.core.task.job.WeatherApiReceiveJob,\
pps.core.task.job.WellTechDailyJob,\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment