From 7c1d912558f9917f06a520fc8153f01426b1de76 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期二, 31 十二月 2024 14:04:36 +0800 Subject: [PATCH] 去掉TriggerConditionEnum --- /dev/null | 20 -------------------- shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinish2Consumer.java | 8 ++------ shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelAlarmConsumer.java | 7 ++----- shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirTask.java | 2 +- 4 files changed, 5 insertions(+), 32 deletions(-) diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirTask.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirTask.java index 40aab2b..3c0a4ef 100644 --- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirTask.java +++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleAirTask.java @@ -47,7 +47,7 @@ } // 根据条件查找方案 - List<StScheduleSchemeDTO> schemeList = mcsApi.listScheduleScheme(ScheduleTriggerMethodEnum.EVENT.getCode(), params); + List<StScheduleSchemeDTO> schemeList = mcsApi.listScheduleScheme(ScheduleTriggerMethodEnum.JOB.getCode(), params); if (CollectionUtils.isEmpty(schemeList)) { logger.info("方案为空"); return; diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/common/enums/TriggerConditionEnum.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/common/enums/TriggerConditionEnum.java deleted file mode 100644 index 7057ea8..0000000 --- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/common/enums/TriggerConditionEnum.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.iailab.module.shasteel.mq.common.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author lirm - * @Description - * @createTime 2024年12月19日 - */ -@Getter -@AllArgsConstructor -public enum TriggerConditionEnum { - - EVENT("1"), - - REGULAR("2"); - - private String code; -} diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelAlarmConsumer.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelAlarmConsumer.java index 5da7ffa..b7f0e18 100644 --- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelAlarmConsumer.java +++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelAlarmConsumer.java @@ -9,8 +9,8 @@ import com.iailab.module.model.api.mdk.MdkApi; import com.iailab.module.model.api.mdk.dto.MdkScheduleReqDTO; import com.iailab.module.model.api.mdk.dto.MdkScheduleRespDTO; +import com.iailab.module.model.enums.ScheduleTriggerMethodEnum; import com.iailab.module.shasteel.mq.common.constant.CommonConstant; -import com.iailab.module.shasteel.mq.common.enums.TriggerConditionEnum; import com.iailab.module.shasteel.mq.config.QueueModelAlarmConfig; import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.core.Message; @@ -62,10 +62,7 @@ return; } // 查找需要执行的调度方案 - Map<String, Object> params = new HashMap<>(); - params.put("trigger_method", TriggerConditionEnum.EVENT); - params.put("trigger_condition", routingKey); - List<StScheduleSchemeDTO> scheduleSchemeList = mcsApi.listScheduleScheme(params);//根据触发条件获取调度方案列表 + List<StScheduleSchemeDTO> scheduleSchemeList = mcsApi.listScheduleScheme(ScheduleTriggerMethodEnum.EVENT.getCode(), routingKey); for(StScheduleSchemeDTO stScheduleSchemeDTO : scheduleSchemeList){ MdkScheduleReqDTO mdkScheduleReqDTO = new MdkScheduleReqDTO(); mdkScheduleReqDTO.setScheduleCode(stScheduleSchemeDTO.getCode()); diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinish2Consumer.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinish2Consumer.java index e3626c7..0234ae1 100644 --- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinish2Consumer.java +++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinish2Consumer.java @@ -10,9 +10,8 @@ import com.iailab.module.model.api.mdk.MdkApi; import com.iailab.module.model.api.mdk.dto.MdkScheduleReqDTO; import com.iailab.module.model.api.mdk.dto.MdkScheduleRespDTO; +import com.iailab.module.model.enums.ScheduleTriggerMethodEnum; import com.iailab.module.shasteel.mq.common.constant.CommonConstant; -import com.iailab.module.shasteel.mq.common.enums.TriggerConditionEnum; -import com.iailab.module.shasteel.mq.config.QueueModelAlarmConfig; import com.iailab.module.shasteel.mq.config.QueuePredictFinishConfig; import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.core.Message; @@ -59,10 +58,7 @@ return; } // 查找需要执行的调度方案 - Map<String, Object> params = new HashMap<>(); - params.put("trigger_method", TriggerConditionEnum.EVENT); - params.put("trigger_condition", routingKey); - List<StScheduleSchemeDTO> scheduleSchemeList = mcsApi.listScheduleScheme(params);//根据触发条件获取调度方案列表 + List<StScheduleSchemeDTO> scheduleSchemeList = mcsApi.listScheduleScheme(ScheduleTriggerMethodEnum.EVENT.getCode(), routingKey); for(StScheduleSchemeDTO stScheduleSchemeDTO : scheduleSchemeList){ MdkScheduleReqDTO mdkScheduleReqDTO = new MdkScheduleReqDTO(); mdkScheduleReqDTO.setScheduleCode(stScheduleSchemeDTO.getCode()); -- Gitblit v1.9.3