From f6b9ee557155c205ea465f494292317d33541068 Mon Sep 17 00:00:00 2001
From: wujian <14790700720@163.com>
Date: 星期六, 20 四月 2024 15:04:01 +0800
Subject: [PATCH] add open write

---
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 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 5f7ab2d..d8cd55b 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
@@ -111,7 +111,7 @@
                                 if (0==i){
                                     map.put(identifier + "鐨剆aveRequest鐨勪俊鍙�",i+1);
                                 }
-//                                miloService.writeToOpcByte(entity);
+                                miloService.writeToOpcByte(entity);
                             }else if ("SaveRequestLast".equals(parts[2])){
                                 ReadWriteEntity entity = new ReadWriteEntity(parts[0] + "." + parts[1] + ".SaveFeedLast", 1);
                                 log.info("-------鐩戝惉鍒�,{}鐨凷aveRequestLast鐨勪俊鍙�",identifier);
@@ -119,7 +119,7 @@
                                 if (0==i){
                                     map.put(identifier + "鐨凷aveRequestLast鐨勪俊鍙�",i+1);
                                 }
-//                                miloService.writeToOpcByte(entity);
+                                miloService.writeToOpcByte(entity);
                             }
                         }
                     }
@@ -175,20 +175,20 @@
                         }
 
                         ReadWriteEntity entity2 = new ReadWriteEntity(parts[0]+"."+parts[1]+".OrderNumber", orderNum);
-//                        miloService.writeToOpcByte(entity2);
+                        miloService.writeToOpcByte(entity2);
                     }
                     //濡傛灉鏄繑淇伐浣嶉渶瑕佷紶杈撹繑淇伐浣嶅彿
                     if (OPCElement.OP465_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP355_ZZ_CODE_CHECK.equals(Node)){
                         rework(SNCode);
                     }
-//                miloService.writeToOpcByte(entity);
+                miloService.writeToOpcByte(entity);
                 }
 
             }
         }
     }
 
-    private void rework(String SNCode) {
+    private void rework(String SNCode)  throws Exception{
         BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
         bsOrderScheduling.setEngineNo(SNCode);
         List<String> allProcessCoed = new ArrayList<>();
@@ -227,13 +227,11 @@
                 writeList.add(readWriteEntity);
             });
         }
-        if (CollUtil.isNotEmpty(writeList)){
-            ReadWriteEntity readWriteEntity = new ReadWriteEntity();
-            readWriteEntity.setIdentifier("Repair_sign");
-            readWriteEntity.setValue(1);
-            writeList.add(readWriteEntity);
-//                            miloService.writeToOpcByte(writeList);
-        }
+        ReadWriteEntity readWriteEntity = new ReadWriteEntity();
+        readWriteEntity.setIdentifier("Repair_sign");
+        readWriteEntity.setValue(1);
+        writeList.add(readWriteEntity);
+        miloService.writeToOpcByte(writeList);
     }
 
 

--
Gitblit v1.9.3