Commit 06051798 authored by ZWT's avatar ZWT

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

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

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 65b61f1d
...@@ -30,6 +30,10 @@ public class ConfigTimeTaskEnt implements Serializable { ...@@ -30,6 +30,10 @@ public class ConfigTimeTaskEnt implements Serializable {
@TableField @TableField
private String methodName; private String methodName;
@XText("扩展参数(多个参数','拼接)")
@TableField
private String otherParam;
@XText("cron表达式") @XText("cron表达式")
@TableField @TableField
private String schedulingPattern; private String schedulingPattern;
......
...@@ -26,6 +26,10 @@ public class ConfigTimeTaskView implements Serializable { ...@@ -26,6 +26,10 @@ public class ConfigTimeTaskView implements Serializable {
@TableField @TableField
private String methodName; private String methodName;
@XText("扩展参数(多个参数','拼接)")
@TableField
private String otherParam;
@XText("cron表达式") @XText("cron表达式")
@TableField @TableField
private String schedulingPattern; private String schedulingPattern;
......
...@@ -35,14 +35,14 @@ public class PpsCoreTaskModule extends XModule { ...@@ -35,14 +35,14 @@ public class PpsCoreTaskModule extends XModule {
//配置信息 自定义实现类 //配置信息 自定义实现类
XProviderManager.setDefaultImplement(context, XConfigProvider.class, PpsConfigProviderCommonImpl.class); XProviderManager.setDefaultImplement(context, XConfigProvider.class, PpsConfigProviderCommonImpl.class);
ManifestComponentInfoHelper.init(this.getClass().getClassLoader()); ManifestComponentInfoHelper.init(this.getClass().getClassLoader());
// 启动 Cron 线程
CronUtil.setMatchSecond(true);
CronUtil.start(true);
//查定时任务配置 //查定时任务配置
ConfigTimeTaskMapper taskMapper = context.getBean(ConfigTimeTaskMapper.class); ConfigTimeTaskMapper taskMapper = context.getBean(ConfigTimeTaskMapper.class);
List<ConfigTimeTaskEnt> configList = taskMapper.selectList(new LambdaQueryWrapper<ConfigTimeTaskEnt>() List<ConfigTimeTaskEnt> configList = taskMapper.selectList(new LambdaQueryWrapper<ConfigTimeTaskEnt>()
.eq(ConfigTimeTaskEnt::getIsEnable, BusinessConstant.ZERO) .eq(ConfigTimeTaskEnt::getIsEnable, BusinessConstant.ZERO)
); );
// 启动 Cron 线程
CronUtil.setMatchSecond(true);
CronUtil.start(true);
//控制启动部分定时任务 //控制启动部分定时任务
for (ConfigTimeTaskEnt config : configList) { for (ConfigTimeTaskEnt config : configList) {
CronUtil.schedule(config.getSchedulingPattern(), (Task) () -> { CronUtil.schedule(config.getSchedulingPattern(), (Task) () -> {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<id column="id" property="id" jdbcType="BIGINT" /> <id column="id" property="id" jdbcType="BIGINT" />
<result column="class_path" property="classPath" jdbcType="VARCHAR" /> <result column="class_path" property="classPath" jdbcType="VARCHAR" />
<result column="method_name" property="methodName" jdbcType="VARCHAR" /> <result column="method_name" property="methodName" jdbcType="VARCHAR" />
<result column="other_param" property="otherParam" jdbcType="VARCHAR" />
<result column="scheduling_pattern" property="schedulingPattern" jdbcType="VARCHAR" /> <result column="scheduling_pattern" property="schedulingPattern" jdbcType="VARCHAR" />
<result column="task_describe" property="taskDescribe" jdbcType="VARCHAR" /> <result column="task_describe" property="taskDescribe" jdbcType="VARCHAR" />
<result column="is_enable" property="isEnable" jdbcType="TINYINT" /> <result column="is_enable" property="isEnable" jdbcType="TINYINT" />
...@@ -15,6 +16,7 @@ ...@@ -15,6 +16,7 @@
, ,
class_path, class_path,
method_name, method_name,
other_param,
scheduling_pattern, scheduling_pattern,
task_describe, task_describe,
is_enable, is_enable,
......
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