Commit ca3b71bc authored by ZWT's avatar ZWT

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

1.新建油田配置表同时生成相关代码及mapper文件,修改部分第三方数据抽取定时任务,增加针对不同井场开关控制逻辑,同时修改首页页面展示逻辑,通过油田配置功能区分不同首页展示功能;
2.新建定时任务配置表同时生成相关代码及mapper文件,定时任务模块增加mybatis配置,用以操作数据库,修改部分第三方数据抽取定时任务,修改使用方式使其脱离框架方便动态控制;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 06051798
package pps.core.task.job; package pps.core.task.job;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import pps.cloud.base.service.IBaseWeatherCloudService; import pps.cloud.base.service.IBaseWeatherCloudService;
import pps.core.common.cache.TaskLockCache; import pps.core.common.cache.TaskLockCache;
import pps.core.task.constant.TaskConstant; import pps.core.task.constant.TaskConstant;
import pps.core.task.utils.ServiceUtil; import pps.core.task.utils.ServiceUtil;
import xstartup.annotation.XService;
import xstartup.annotation.XText; import xstartup.annotation.XText;
import xstartup.base.XContext; import xstartup.base.XContext;
import xstartup.data.XServiceResult; import xstartup.data.XServiceResult;
import xstartup.service.job.XJob;
import xstartup.service.job.annotation.XCronTrigger;
/** /**
* 天气数据邮件接收定时任务 * 天气数据邮件接收定时任务
...@@ -20,27 +16,20 @@ import xstartup.service.job.annotation.XCronTrigger; ...@@ -20,27 +16,20 @@ import xstartup.service.job.annotation.XCronTrigger;
* @date 2023/11/13 17:15 * @date 2023/11/13 17:15
*/ */
@XText("天气数据邮件接收定时任务") @XText("天气数据邮件接收定时任务")
@XService public class WeatherReceiveJob {
public class WeatherReceiveJob implements XJob {
/** /**
* 半小时隔5分钟执行一次 * 半小时隔5分钟执行一次
* *
* @param xContext x上下文 * @param xContext x上下文
* @return {@link XServiceResult} * @param oilFieldCode 油田代码
* @return {@link XServiceResult }
*/ */
@XCronTrigger(value = TaskConstant.HALF_HOUR_35) public XServiceResult execute(XContext xContext, String oilFieldCode) {
@Override
public XServiceResult execute(XContext xContext) {
xContext.getLogger().info("------ WeatherReceiveJob start:{}", System.currentTimeMillis()); xContext.getLogger().info("------ WeatherReceiveJob start:{}", System.currentTimeMillis());
String key = TaskConstant.TASK_LOCK_KEY + "WeatherReceiveJob"; String key = TaskConstant.TASK_LOCK_KEY + "WeatherReceiveJob";
TaskLockCache exist = TaskLockCache.exist(xContext, key); TaskLockCache exist = TaskLockCache.exist(xContext, key);
if (ObjectUtil.isNull(exist)) { if (ObjectUtil.isNull(exist)) {
String oilFieldCode = ServiceUtil.getCurrentConfig(xContext).getOilFieldCode();
if (CharSequenceUtil.isBlank(oilFieldCode)) {
xContext.getLogger().info("------ WeatherReceiveJob oilFieldCode is blank");
return XServiceResult.OK;
}
ServiceUtil.setCache(xContext, key); ServiceUtil.setCache(xContext, key);
try { try {
IBaseWeatherCloudService service = xContext.getBean(IBaseWeatherCloudService.class); IBaseWeatherCloudService service = xContext.getBean(IBaseWeatherCloudService.class);
......
...@@ -32,7 +32,6 @@ public class DeployPpsAllApplication { ...@@ -32,7 +32,6 @@ public class DeployPpsAllApplication {
startup.enable(XJobFeature.class).config(new XJobServiceConf(SpaceOptimizeUltraJob.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(SpaceOptimizeShortJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(DailyElectricityTrendJob.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(EnergyConsumptionAnalysisJob.class)); startup.enable(XJobFeature.class).config(new XJobServiceConf(EnergyConsumptionAnalysisJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(PlantPredictedPowerLongTermDataJob.class)); startup.enable(XJobFeature.class).config(new XJobServiceConf(PlantPredictedPowerLongTermDataJob.class));
startup.run(args); startup.run(args);
......
...@@ -18,7 +18,6 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\ ...@@ -18,7 +18,6 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\
pps.core.task.job.SpaceOptimizeShortJob,\ pps.core.task.job.SpaceOptimizeShortJob,\
pps.core.task.job.SpaceOptimizeUltraJob,\ pps.core.task.job.SpaceOptimizeUltraJob,\
pps.core.task.job.DailyElectricityTrendJob,\ pps.core.task.job.DailyElectricityTrendJob,\
pps.core.task.job.WeatherReceiveJob,\
pps.core.task.job.EnergyConsumptionAnalysisJob,\ pps.core.task.job.EnergyConsumptionAnalysisJob,\
pps.core.task.job.PlantPredictedPowerLongTermDataJob pps.core.task.job.PlantPredictedPowerLongTermDataJob
# redis # redis
......
...@@ -30,7 +30,6 @@ public class DeployPpsTaskApplication { ...@@ -30,7 +30,6 @@ public class DeployPpsTaskApplication {
startup.enable(XJobFeature.class).config(new XJobServiceConf(SpaceCalibrationJob.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(SpaceOptimizeShortJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(DailyElectricityTrendJob.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(EnergyConsumptionAnalysisJob.class)); startup.enable(XJobFeature.class).config(new XJobServiceConf(EnergyConsumptionAnalysisJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(PlantPredictedPowerLongTermDataJob.class)); startup.enable(XJobFeature.class).config(new XJobServiceConf(PlantPredictedPowerLongTermDataJob.class));
startup.enable(XRpcFeature.class); startup.enable(XRpcFeature.class);
......
...@@ -6,7 +6,6 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\ ...@@ -6,7 +6,6 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\
pps.core.task.job.SpaceCalibrationJob,\ pps.core.task.job.SpaceCalibrationJob,\
pps.core.task.job.SpaceOptimizeShortJob,\ pps.core.task.job.SpaceOptimizeShortJob,\
pps.core.task.job.DailyElectricityTrendJob,\ pps.core.task.job.DailyElectricityTrendJob,\
pps.core.task.job.WeatherReceiveJob,\
pps.core.task.job.EnergyConsumptionAnalysisJob,\ pps.core.task.job.EnergyConsumptionAnalysisJob,\
pps.core.task.job.PlantPredictedPowerLongTermDataJob pps.core.task.job.PlantPredictedPowerLongTermDataJob
x.log.level=@x.log.level@ x.log.level=@x.log.level@
......
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