From a9b46aa4ed75c5ed35a5ecfddbf36f0fef46e65b Mon Sep 17 00:00:00 2001
From: Jay <csj123456>
Date: 星期三, 30 四月 2025 11:55:52 +0800
Subject: [PATCH] 修改点位插入逻辑

---
 shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunMachineStateTask.java |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunMachineStateTask.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunMachineStateTask.java
index 04762b0..574d95b 100644
--- a/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunMachineStateTask.java
+++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/job/task/RunMachineStateTask.java
@@ -74,6 +74,10 @@
         put("F0000101228", Arrays.asList("F0000101195", "F0000101206", "F0000101217", "C0000101220"));
     }};
 
+    private static final HashMap<String, List<String>> qhPoints = new HashMap<String, List<String>>() {{
+        put("1", Arrays.asList("F0000100098", "F0000100099", "F0000100100", "F0000100101","F0000100105", "F0000100106", "F0000100107", "F0000100108","F0000100102", "F0000100103"));
+    }};
+
     private boolean qhFlag1 = false;
     private boolean qhFlag2 = false;
     private boolean qhFlag135 = false;
@@ -86,6 +90,58 @@
         try {
             List<String> partPointNos = partPoints.values().stream().flatMap(List::stream).collect(Collectors.toList());
             Map<String, Object> partPointsRealValue = dataPointApi.queryPointsRealValue(partPointNos);
+            logger.info("运行状态点值:{}", partPointsRealValue);
+            List<String> qhPointNos = qhPoints.values().stream().flatMap(List::stream).collect(Collectors.toList());
+            Map<String, Object> qhPointsRealValue = dataPointApi.queryPointsRealValue(qhPointNos);
+            for (Map.Entry<String, List<String>> entry : qhPoints.entrySet()) {
+                for (String pointNo : entry.getValue()) {
+                    Double value = Double.valueOf(String.format("%.2f", Double.valueOf(qhPointsRealValue.get(pointNo).toString())));
+                    if ("F0000100098".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100109", 0);
+                        partPointsRealValue.replace("C0000101223", 0);
+                        partPointsRealValue.replace("C0000101210", 0);
+                        partPointsRealValue.replace("C0000101214", 0);
+                    }else if ("F0000100099".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100110", 0);
+                        partPointsRealValue.replace("C0000101224", 0);
+                        partPointsRealValue.replace("C0000101211", 0);
+                        partPointsRealValue.replace("C0000101215", 0);
+                    }else if ("F0000100100".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100111", 0);
+                        partPointsRealValue.replace("C0000101225", 0);
+                        partPointsRealValue.replace("C0000101212", 0);
+                        partPointsRealValue.replace("C0000101216", 0);
+                    }else if ("F0000100101".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100112", 0);
+                        partPointsRealValue.replace("C0000101226", 0);
+                        partPointsRealValue.replace("C0000101213", 0);
+                        partPointsRealValue.replace("C0000101217", 0);
+                    }else if ("F0000100105".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100116", 0);
+                        partPointsRealValue.replace("C0000101227", 0);
+                    }else if ("F0000100106".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100117", 0);
+                        partPointsRealValue.replace("C0000101228", 0);
+                    }else if ("F0000100107".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100118", 0);
+                        partPointsRealValue.replace("C0000101229", 0);
+                    }else if ("F0000100108".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100119", 0);
+                        partPointsRealValue.replace("C0000101230", 0);
+                    }else if ("F0000100102".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100113", 0);
+                        partPointsRealValue.replace("C0000101231", 0);
+                        partPointsRealValue.replace("C0000101221", 0);
+                        partPointsRealValue.replace("C0000101218", 0);
+                    }else if ("F0000100103".equals(pointNo) && value == 0.00) {
+                        partPointsRealValue.replace("F0000100114", 0);
+                        partPointsRealValue.replace("C0000101232", 0);
+                        partPointsRealValue.replace("C0000101222", 0);
+                        partPointsRealValue.replace("C0000101219", 0);
+                    }
+                }
+            }
+            logger.info("替换后的点位值:{}", partPointsRealValue);
             for (Map.Entry<String, List<String>> entry : partPoints.entrySet()) {
                 ApiPointValueWriteDTO writeDTO = new ApiPointValueWriteDTO();
                 double dataValue = 0d;

--
Gitblit v1.9.3