From f18ebf7887f1a633e59345c9382058032af922bb Mon Sep 17 00:00:00 2001
From: cl <418351270@qq.com>
Date: 星期四, 04 七月 2024 19:12:19 +0800
Subject: [PATCH] 修改参数采集

---
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
index 93762ef..61a1d56 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -778,7 +778,10 @@
                 miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(2).build());
             }
             daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode);
-
+        }else {
+            flag = false;
+            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(2).build());
+            log.info("璇诲彇鍒板伐浣峽},娴嬭瘯璁惧杩斿洖鐨勬暟鎹煡璇笉鍒帮紝鐢佃姱鐮佷负锛歿}",device,cellCode);
         }
         return flag;
     }
@@ -806,6 +809,10 @@
                 }
                 daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode);
             }
+        }else {
+            flag = false;
+            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(2).build());
+            log.info("璇诲彇鍒板伐浣峽},PLC娌℃湁缁欑數鑺爜",device);
         }
         Object value2 = miloService.readFromOpcUa(thoroughfare + "." + device + ".CellCode_2").getValue();
         if (ObjectUtil.isNotNull(value2)){
@@ -823,6 +830,10 @@
                 }
                 daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode);
             }
+        }else {
+            flag = false;
+            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_2").value(2).build());
+            log.info("璇诲彇鍒板伐浣峽},PLC娌℃湁缁欑數鑺爜",device);
         }
 
         Object value3 = miloService.readFromOpcUa(thoroughfare + "." + device + ".CellCode_3").getValue();
@@ -841,6 +852,10 @@
                 }
                 daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode);
             }
+        }else {
+            flag = false;
+            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_3").value(2).build());
+            log.info("璇诲彇鍒板伐浣峽},PLC娌℃湁缁欑數鑺爜",device);
         }
 
         Object value4 = miloService.readFromOpcUa(thoroughfare + "." + device + ".CellCode_4").getValue();
@@ -859,6 +874,10 @@
                 }
                 daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode);
             }
+        }else {
+            flag = false;
+            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_4").value(2).build());
+            log.info("璇诲彇鍒板伐浣峽},PLC娌℃湁缁欑數鑺爜",device);
         }
 
         return flag;

--
Gitblit v1.9.3