From 0caf8761b4af8163a691ebb56723286926529ee4 Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期五, 29 三月 2024 15:29:38 +0800
Subject: [PATCH] -

---
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java |   30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 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 f178415..16ea856 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
@@ -24,7 +24,7 @@
 public class OPCUaSubscription implements SubscriptionCallback {
 
     //鑷姩宸ヤ綅
-    public List<String> automaticList = Arrays.asList("OP230","OP300","OP280", "OP320", "OP340", "OP350", "OP360","OP370", "OP390", "OP470", "OP530", "OP540");
+    public List<String> automaticList = Arrays.asList("OP300","OP280", "OP320", "OP340", "OP350", "OP360","OP370", "OP390", "OP470", "OP530", "OP540");
 
     public static MiloService miloService;
 
@@ -32,9 +32,9 @@
 
     public IDaPassingStationCollectionService daPassingStationCollectionService;
 
-    public IDaCollectionParamConfService collectionParamConfService;
+    public static IDaCollectionParamConfService collectionParamConfService;
 
-    public IDaParamCollectionService daParamCollectionService;
+    public static IDaParamCollectionService daParamCollectionService;
 
     public OPCUaSubscription(MiloService miloService,
                              IDaPassingStationCollectionService daPassingStationCollectionService,
@@ -109,18 +109,9 @@
                 }
                 //淇濆瓨鎷х揣鏁版嵁
                 else if (("AngleResult").equals(tab)) {
-                    if("1".equals(tabVlaue)||"2".equals(tabVlaue)){
-//                        String Torque = thoroughfare + "." + device + ".Torque";
-//                        String Angle = thoroughfare + "." + device + ".Angle";
-//                        String Result = thoroughfare + "." + device + ".Result";
-//                        String Result1 = thoroughfare + "." + device + ".Result1";
-//                        List<String> list = new ArrayList();
-//                        list.add(Torque);
-//                        list.add(Angle);
-//                        list.add(Result);
-//                        list.add(Result1);
+                    if("OK".equals(tabVlaue)||"NG".equals(tabVlaue)){
                         List<String> list = new ArrayList<>();
-                        String[] suffixes = {"Torque", "Angle", "Result", "Result1"};
+                        String[] suffixes = {"Torque", "Angle", "TorqueResult", "AngleResult"};
 
                         for (String suffix : suffixes) {
                             String string = thoroughfare + "." + device + "." + suffix;
@@ -167,7 +158,7 @@
                 //2銆佷繚瀛樿繃绔欓噰闆嗘暟鎹�
                 saveStationInfo(PACKCodeParam,thoroughfare,device);
                 //3銆佷繚瀛樺弬鏁伴噰闆嗘暟鎹�
-                SaveParamData(PACKCodeParam,thoroughfare,device);
+                SaveParamData(PACKCodeParam,thoroughfare,device,"","");
 
                 result = "21";
 
@@ -198,7 +189,7 @@
         daPassingStationCollectionService.insertDaPassingStationCollection(daPassingStationCollection);
     }
 
-    public void SaveParamData(String packCode,String thoroughfare,String device) throws Exception {
+    public static void SaveParamData(String packCode,String thoroughfare,String device,String workOrderNo,String productType) throws Exception {
         List<DaCollectionParamConf> list;
         DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf();
         daCollectionParamConf.setGatherAddress(thoroughfare+ "." + device);
@@ -227,10 +218,13 @@
                     //ParamCollection.setState("鍚堟牸");
                     ParamCollection.setType(list.get(i).getCollectParameterType());
                     ParamCollection.setCollectionTime(new Date());
-                    daParamCollectionService.insertDaParamCollection(ParamCollection);
+                    ParamCollection.setWorkOrderNo(workOrderNo);
+                    ParamCollection.setProductCode(productType);
+                    daParamCollectionlist.add(ParamCollection);
+//                    daParamCollectionService.insertDaParamCollection(ParamCollection);
                 }
             }
-    //            daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist);
+            daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist);
         }
 
     }

--
Gitblit v1.9.3