From 9aed07e4b8044d48b317a8d06fb7a061361f4449 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期二, 25 二月 2025 18:54:02 +0800
Subject: [PATCH] Merge branch 'master' of http://dlindusit.com:53929/r/ansteel

---
 ansteel-biz/src/main/java/com/iailab/module/ansteel/framework/rpc/config/RpcConfiguration.java |    5 ++
 ansteel-biz/src/main/java/com/iailab/module/ansteel/mq/common/constant/CommonConstant.java     |   32 ++++++++++++++-
 ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/RunPredictModuleTask.java         |   52 ++++++++++++++++++++++++++
 ansteel-biz/pom.xml                                                                            |   10 +++++
 4 files changed, 95 insertions(+), 4 deletions(-)

diff --git a/ansteel-biz/pom.xml b/ansteel-biz/pom.xml
index b2f5458..b678ed3 100644
--- a/ansteel-biz/pom.xml
+++ b/ansteel-biz/pom.xml
@@ -29,6 +29,16 @@
             <artifactId>iailab-module-infra-api</artifactId>
             <version>${revision}</version>
         </dependency>
+        <dependency>
+            <groupId>com.iailab</groupId>
+            <artifactId>iailab-module-model-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.iailab</groupId>
+            <artifactId>iailab-module-data-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
 
         <!-- 业务组件 -->
         <dependency>
diff --git a/ansteel-biz/src/main/java/com/iailab/module/ansteel/framework/rpc/config/RpcConfiguration.java b/ansteel-biz/src/main/java/com/iailab/module/ansteel/framework/rpc/config/RpcConfiguration.java
index 0aa1447..2629374 100644
--- a/ansteel-biz/src/main/java/com/iailab/module/ansteel/framework/rpc/config/RpcConfiguration.java
+++ b/ansteel-biz/src/main/java/com/iailab/module/ansteel/framework/rpc/config/RpcConfiguration.java
@@ -1,14 +1,17 @@
 package com.iailab.module.ansteel.framework.rpc.config;
 
+import com.iailab.module.data.api.point.DataPointApi;
 import com.iailab.module.infra.api.config.ConfigApi;
 import com.iailab.module.infra.api.db.DataSourceConfigServiceApi;
 import com.iailab.module.infra.api.file.FileApi;
 import com.iailab.module.infra.api.websocket.WebSocketSenderApi;
+import com.iailab.module.model.api.mcs.McsApi;
+import com.iailab.module.model.api.mdk.MdkApi;
 import com.iailab.module.system.api.tenant.TenantApi;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.Configuration;
 
 @Configuration(proxyBeanMethods = false)
-@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, DataSourceConfigServiceApi.class, ConfigApi.class, TenantApi.class})
+@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, DataSourceConfigServiceApi.class, ConfigApi.class, TenantApi.class, McsApi.class, MdkApi.class, DataPointApi.class})
 public class RpcConfiguration {
 }
diff --git a/ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/RunPredictModuleTask.java b/ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/RunPredictModuleTask.java
new file mode 100644
index 0000000..4debbd0
--- /dev/null
+++ b/ansteel-biz/src/main/java/com/iailab/module/ansteel/job/task/RunPredictModuleTask.java
@@ -0,0 +1,52 @@
+package com.iailab.module.ansteel.job.task;
+
+import com.iailab.module.model.api.mdk.MdkApi;
+import com.iailab.module.model.api.mdk.dto.MdkPredictReqDTO;
+import org.apache.commons.lang3.StringUtils;
+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 java.util.*;
+
+/**
+ * 执行模块预测定时任务
+ */
+@Component("runPredictModuleTask")
+public class RunPredictModuleTask implements ITask {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private MdkApi mdkApi;
+
+    @Autowired
+    private RabbitTemplate rabbitTemplate;
+
+    @Override
+    public void run(String params) {
+        logger.info("runPredictModuleTask定时任务正在执行,参数为:{}", params);
+        try {
+            Calendar calendar = Calendar.getInstance();
+            calendar.set(Calendar.SECOND, 0);
+            calendar.set(Calendar.MILLISECOND, 0);
+            Date predictTime = calendar.getTime();
+            if (StringUtils.isEmpty(params)) {
+                logger.info("参数为空");
+                return;
+            }
+            List<String> moduleTypeList = Arrays.asList(params.split(","));
+            moduleTypeList.forEach(type -> {
+                MdkPredictReqDTO dto = new MdkPredictReqDTO();
+                dto.setPredictTime(predictTime);
+                dto.setModuleType(type);
+                mdkApi.predictModule(dto);
+                logger.info(type + "模块预测完成。");
+            });
+        } catch (Exception ex) {
+            logger.error("runPredictModuleTask运行异常",ex);
+        }
+        logger.info("runPredictModuleTask运行完成");
+    }
+}
diff --git a/ansteel-biz/src/main/java/com/iailab/module/ansteel/mq/common/constant/CommonConstant.java b/ansteel-biz/src/main/java/com/iailab/module/ansteel/mq/common/constant/CommonConstant.java
index 67376ce..cfbb438 100644
--- a/ansteel-biz/src/main/java/com/iailab/module/ansteel/mq/common/constant/CommonConstant.java
+++ b/ansteel-biz/src/main/java/com/iailab/module/ansteel/mq/common/constant/CommonConstant.java
@@ -1,6 +1,5 @@
 package com.iailab.module.ansteel.mq.common.constant;
 
-
 /**
  * @Description: 通用常量
  */
@@ -18,9 +17,36 @@
     //氧气系统优化调度决策方案code
     String OXYGEN_TWO_CODE = "oxygen02";
 
+    //煤气调度code
+    String GAS_MODEL_CODE = "GAS01";
+
     //超上限
-    String EXCEEDING_UPPER_LIMIT = "UpperLimit";
+    String EXCEEDING_UPPER_LIMIT = "超上限";
 
     //超下限
-    String EXCEEDING_LOWER_LIMIT = "LowerLimit";
+    String EXCEEDING_LOWER_LIMIT = "超下限";
+
+    //电力管网触发条件
+    String TRIGGER_CONDITION_ELEC = "NET_ELE";
+
+    String NET_COG = "NET_COG";
+
+    String NET_BFG = "NET_BFG";
+
+    String NET_ELE = "NET_ELE";
+
+    String NET_O2 = "NET_O2";
+
+    String NET_LDG = "NET_LDG";
+    String NET_LDG1 = "NET_LDG1";
+    String NET_LDG2 = "NET_LDG2";
+    String NET_LDG3 = "NET_LDG3";
+
+    String NET_STEAM = "NET_STEAM";
+
+    String NET_N2 = "NET_N2";
+
+    String NET_TEST = "NET_TEST";
+
+    String NET_GAS = "NET_GAS";
 }

--
Gitblit v1.9.3