From 3bdd9109b9e1ab9414e2a7a90a0023b3c631a895 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 03 一月 2025 16:45:36 +0800
Subject: [PATCH] 压缩空气运行指标

---
 shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java
index 6b30eb1..802d502 100644
--- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java
+++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/ModelPredictFinishConsumer.java
@@ -6,6 +6,7 @@
 import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO;
 import com.iailab.module.model.api.mcs.dto.AlarmMessageRespDTO;
 import com.iailab.module.model.api.mcs.dto.PreDataJsonReqVO;
+import com.iailab.module.shasteel.mq.common.constant.CommonConstant;
 import com.iailab.module.shasteel.mq.common.constant.RoutingConstant;
 import com.iailab.module.shasteel.mq.config.QueuePredictFinishConfig;
 import lombok.extern.slf4j.Slf4j;
@@ -59,14 +60,14 @@
             if (CollectionUtils.isEmpty(configList)) {
                 return;
             }
-            List<String> OutputIdList = new ArrayList<>();
+            List<String> outputIdList = new ArrayList<>();
             configList.forEach(item -> {
-                OutputIdList.add(item.getOutId());
+                outputIdList.add(item.getOutId());
             });
             configList.forEach(item -> {
                 PreDataJsonReqVO reqVO = new PreDataJsonReqVO();
                 reqVO.setPredictTime(DateUtils.parse(messageJson.get("predictTime").toString(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND));
-                reqVO.setOutputIdList(OutputIdList);
+                reqVO.setOutputIdList(outputIdList);
                 Map<String, List<Object[]>> preData = mcsApi.getPreDataCur(reqVO);
                 if (CollectionUtils.isEmpty(preData)) {
                     return;
@@ -84,9 +85,9 @@
                         AlarmMessageRespDTO alarmMessage = new AlarmMessageRespDTO();
                         alarmMessage.setConfigId(item.getId());
                         if (dataValue.compareTo(item.getLowerLimit()) < 0) {
-                            alarmMessage.setAlarmType("1");//超下限
+                            alarmMessage.setAlarmType(CommonConstant.EXCEEDING_LOWER_LIMIT);//超下限
                         } else if (dataValue.compareTo(item.getUpperLimit()) > 0) {
-                            alarmMessage.setAlarmType("2");//超上限
+                            alarmMessage.setAlarmType(CommonConstant.EXCEEDING_UPPER_LIMIT);//超上限
                         }
                         alarmMessage.setAlarmTime(DateUtils.parse(data[0].toString(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND));
                         StringBuffer sb = new StringBuffer();
@@ -94,9 +95,9 @@
                         sb.append(" ");
                         sb.append(item.getAlarmObj());
                         if ("1".equals(alarmMessage.getAlarmType())) {
-                            sb.append("超下限");
+                            sb.append(CommonConstant.EXCEEDING_LOWER_LIMIT);
                         } else if ("2".equals(alarmMessage.getAlarmType())) {
-                            sb.append("超上限");
+                            sb.append(CommonConstant.EXCEEDING_UPPER_LIMIT);
                         }
                         sb.append(dataValue);
                         sb.append(item.getUnit());

--
Gitblit v1.9.3