From 3216ed3fb2d9dc9cf61da21bda3175e66ec46426 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期五, 06 十二月 2024 17:04:11 +0800 Subject: [PATCH] IailabClient 配置 --- shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleModuleTask.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleModuleTask.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleModuleTask.java new file mode 100644 index 0000000..c9e0a62 --- /dev/null +++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunScheduleModuleTask.java @@ -0,0 +1,45 @@ +package com.iailab.module.shasteel.job.task; + +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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Calendar; + +/** + * 执行调度方案定时任务 + * + */ +@Component("runScheduleModuleTask") +public class RunScheduleModuleTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private MdkApi mdkApi; + + + @Override + public void run(String params) { + logger.info("runScheduleModuleTask定时任务正在执行,参数为:{}",params ); + try { + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.SECOND,0); + calendar.set(Calendar.MILLISECOND,0); + + MdkScheduleReqDTO dto = new MdkScheduleReqDTO(); + dto.setScheduleTime(calendar.getTime()); + dto.setScheduleCode(params); + MdkScheduleRespDTO mdkScheduleRespDTO = mdkApi.doSchedule(dto); + logger.info(params + "调度方案执行完成," + mdkScheduleRespDTO); + + } catch (Exception ex) { + logger.error("runScheduleModuleTask运行异常"); + ex.printStackTrace(); + } + logger.info("runScheduleModuleTask运行完成"); + } +} -- Gitblit v1.9.3