Commit ad2f14d8 authored by ZWT's avatar ZWT

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

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

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 53bf3cf4
package pps.core.task.job; package pps.core.task.job;
import cn.hutool.core.util.ObjectUtil;
import pps.cloud.base.service.IConfigOilFieldCloudService; import pps.cloud.base.service.IConfigOilFieldCloudService;
import pps.cloud.base.service.data.config_oil_field.GetConfigOilFieldOutput; import pps.cloud.base.service.data.config_oil_field.GetConfigOilFieldOutput;
import pps.core.common.cache.TaskLockCache; import pps.core.common.cache.TaskLockCache;
import pps.core.common.constant.BusinessConstant;
import xstartup.base.XContext; import xstartup.base.XContext;
import xstartup.data.XSingleResult; import xstartup.data.XSingleResult;
...@@ -29,16 +27,6 @@ public class JobCommonService { ...@@ -29,16 +27,6 @@ public class JobCommonService {
return currentConfig.getResult(); return currentConfig.getResult();
} }
/**
* 已关闭
*
* @param config 配置
* @return boolean
*/
public boolean isClosed(GetConfigOilFieldOutput config) {
return ObjectUtil.hasNull(config, config.getApiTaskIsEnable()) || config.getApiTaskIsEnable().equals(BusinessConstant.ONE);
}
/** /**
* 设置缓存 * 设置缓存
* *
......
...@@ -4,12 +4,9 @@ import cn.hutool.core.util.ObjectUtil; ...@@ -4,12 +4,9 @@ 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 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;
/** /**
* 天气API数据邮件接收定时任务 * 天气API数据邮件接收定时任务
...@@ -18,8 +15,7 @@ import xstartup.service.job.annotation.XCronTrigger; ...@@ -18,8 +15,7 @@ import xstartup.service.job.annotation.XCronTrigger;
* @date 2024/04/22 17:24 * @date 2024/04/22 17:24
*/ */
@XText("天气API数据邮件接收定时任务") @XText("天气API数据邮件接收定时任务")
@XService public class WeatherApiReceiveJob extends JobCommonService {
public class WeatherApiReceiveJob extends JobCommonService implements XJob {
/** /**
* 早/晚九点十五分执行 * 早/晚九点十五分执行
...@@ -27,13 +23,7 @@ public class WeatherApiReceiveJob extends JobCommonService implements XJob { ...@@ -27,13 +23,7 @@ public class WeatherApiReceiveJob extends JobCommonService implements XJob {
* @param xContext x上下文 * @param xContext x上下文
* @return {@link XServiceResult} * @return {@link XServiceResult}
*/ */
@XCronTrigger(value = TaskConstant.NINE_OF_DAY)
@Override
public XServiceResult execute(XContext xContext) { public XServiceResult execute(XContext xContext) {
if (this.isClosed(this.getCurrentConfig(xContext))) {
xContext.getLogger().info("------ WeatherApiReceiveJob not enabled");
return XServiceResult.OK;
}
xContext.getLogger().info("------ WeatherApiReceiveJob start:{}", System.currentTimeMillis()); xContext.getLogger().info("------ WeatherApiReceiveJob start:{}", System.currentTimeMillis());
String key = TaskConstant.TASK_LOCK_KEY + "WeatherApiReceiveJob"; String key = TaskConstant.TASK_LOCK_KEY + "WeatherApiReceiveJob";
TaskLockCache exist = TaskLockCache.exist(xContext, key); TaskLockCache exist = TaskLockCache.exist(xContext, key);
......
...@@ -33,7 +33,6 @@ public class DeployPpsAllApplication { ...@@ -33,7 +33,6 @@ public class DeployPpsAllApplication {
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(WeatherReceiveJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(WeatherApiReceiveJob.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);
......
...@@ -19,7 +19,6 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\ ...@@ -19,7 +19,6 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\
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.WeatherReceiveJob,\
pps.core.task.job.WeatherApiReceiveJob,\
pps.core.task.job.EnergyConsumptionAnalysisJob,\ pps.core.task.job.EnergyConsumptionAnalysisJob,\
pps.core.task.job.PlantPredictedPowerLongTermDataJob pps.core.task.job.PlantPredictedPowerLongTermDataJob
# redis # redis
......
...@@ -31,7 +31,6 @@ public class DeployPpsTaskApplication { ...@@ -31,7 +31,6 @@ public class DeployPpsTaskApplication {
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(WeatherReceiveJob.class));
startup.enable(XJobFeature.class).config(new XJobServiceConf(WeatherApiReceiveJob.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);
......
...@@ -7,7 +7,6 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\ ...@@ -7,7 +7,6 @@ x.job.service=pps.core.task.job.SpaceOptimizeLongJob,\
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.WeatherReceiveJob,\
pps.core.task.job.WeatherApiReceiveJob,\
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