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/RunPredictModuleTask.java | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunPredictModuleTask.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunPredictModuleTask.java index f6e5f46..a8e3732 100644 --- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunPredictModuleTask.java +++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunPredictModuleTask.java @@ -1,12 +1,18 @@ package com.iailab.module.shasteel.job.task; import com.iailab.module.model.api.mdk.MdkApi; +import com.iailab.module.model.api.mdk.dto.MdkPredictModuleRespDTO; import com.iailab.module.model.api.mdk.dto.MdkPredictReqDTO; +import com.iailab.module.shasteel.mq.common.RoutingConstant; +import com.iailab.module.shasteel.mq.consumer.AlarmMessage; +import com.iailab.module.shasteel.mq.consumer.PredictFinishMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import javax.annotation.Resource; import java.util.Calendar; /** @@ -18,7 +24,9 @@ private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired - MdkApi mdkApi; + private MdkApi mdkApi; + @Autowired + private RabbitTemplate rabbitTemplate; @Override @@ -32,9 +40,9 @@ MdkPredictReqDTO dto = new MdkPredictReqDTO(); dto.setPredictTime(calendar.getTime()); dto.setModuleType(params); - mdkApi.predictModule(dto); - logger.info(params + "模块预测完成"); - + MdkPredictModuleRespDTO mdkPredictModuleRespDTO = mdkApi.predictModule(dto); + logger.info(params + "模块预测完成," + mdkPredictModuleRespDTO); + rabbitTemplate.convertAndSend(PredictFinishMessage.EXCHANGE, PredictFinishMessage.PREDICTFINISH_ROUTING_KEY, mdkPredictModuleRespDTO); } catch (Exception ex) { logger.error("runPredictModuleTask运行异常"); -- Gitblit v1.9.3