From 2da22bb80f786b5ba45dbdf927102510b2c86c67 Mon Sep 17 00:00:00 2001
From: cl <418351270@qq.com>
Date: 星期三, 17 七月 2024 11:03:13 +0800
Subject: [PATCH] 修改OP020

---
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java |   44 +++++++++++++++++++++++++-------------------
 1 files changed, 25 insertions(+), 19 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 7386efc..0b40d26 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
@@ -205,25 +205,31 @@
                         if(ObjectUtil.isNull(cellCodeList) || cellCodeList.size() != 4 ){
                             result = 23;
                         }else{
-                            String cellCode1 = cellCodeList.get(0);
-                            String cellCode2 = cellCodeList.get(1);
-                            String cellCode3 = cellCodeList.get(2);
-                            String cellCode4 = cellCodeList.get(3);
-
-                            if(cellCode1.isEmpty() || cellCode2.isEmpty()){
-                                result = 23;
-                                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build());
-                                return;
-                            }
-                            if(!cellCode3.isEmpty() && cellCode4.isEmpty()){
-                                result = 23;
-                                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build());
-                                return;
-                            }
-                            if(cellCode3.isEmpty() && !cellCode4.isEmpty()){
-                                result = 23;
-                                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build());
-                                return;
+                            if(Constants.OP020.contains(device)) {
+                                String cellCode1 = cellCodeList.get(0);
+                                String cellCode2 = cellCodeList.get(1);
+                                String cellCode3 = cellCodeList.get(2);
+                                String cellCode4 = cellCodeList.get(3);
+                                if (!cellCode1.isEmpty() && cellCode2.isEmpty()) {
+                                    result = 23;
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build());
+                                    return;
+                                }
+                                if (cellCode1.isEmpty() && !cellCode2.isEmpty()) {
+                                    result = 23;
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build());
+                                    return;
+                                }
+                                if (!cellCode3.isEmpty() && cellCode4.isEmpty()) {
+                                    result = 23;
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build());
+                                    return;
+                                }
+                                if (!cellCode4.isEmpty() && cellCode3.isEmpty()) {
+                                    result = 23;
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build());
+                                    return;
+                                }
                             }
 
                             result = savePassingStation(thoroughfare, device,cellCodeList);//淇濆瓨杩囩珯

--
Gitblit v1.9.3