From 16714e1a824acd878b105e6ac433866cfc50ed89 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期三, 05 六月 2024 16:44:47 +0800
Subject: [PATCH] -

---
 jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue                                              |    4 ++
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java |    4 +-
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue                                                   |   24 +++++++++---
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java                            |   86 ++++++++++++++++++++++---------------------
 4 files changed, 68 insertions(+), 50 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
index 8b053a4..2f3d4ae 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -221,7 +221,7 @@
         }
         BsFormulaChildInfo listQuery = new BsFormulaChildInfo();
         listQuery.setParamCode(bsFormulaChildInfo.getParamCode());
-        listQuery.setLocationCode(bsFormulaChildInfo.getLocationCode());
+        listQuery.setProcessesCode(bsFormulaChildInfo.getLocationCode());
         String paramCode = bsFormulaChildInfo.getTightenTheArray();
         if(paramCode.contains("N")){
             result = "3";
@@ -455,7 +455,7 @@
         }
         BsFormulaChildInfo listQuery = new BsFormulaChildInfo();
         listQuery.setParamCode(bsFormulaChildInfo.getParamCode());
-        listQuery.setLocationCode(bsFormulaChildInfo.getLocationCode());
+        listQuery.setProcessesCode(bsFormulaChildInfo.getLocationCode());
         String paramCode = bsFormulaChildInfo.getTightenTheArray();
         if(paramCode.contains("N")){
             List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery);
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 18c3ed1..d432dc1 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
@@ -251,7 +251,7 @@
             }
         } catch (Exception e) {
             logger.info("璁㈤槄鏂规硶鎶ラ敊:{}"+e.getMessage());
-            e.printStackTrace();
+            logger.error("璁㈤槄鏂规硶鎶ラ敊",e);
         }
     }
 
@@ -279,51 +279,53 @@
                     read = read + "ModuleCode";
                     if(device.equals("OP365")){
                         try {
-                            saveStationInfo365(thoroughfare,device);
+                            result = saveStationInfo365(thoroughfare,device);
+                            return result;
                         }catch (Exception e){
                             e.printStackTrace();
                         }
                     }
                 }else {
                     read = read + "PACKCode";
+                    snCode = miloService.readFromOpcUa(read).getValue().toString();
+
+                    if(null == snCode || "".equals(snCode)){
+                        result = "22";
+                    }else{
+
+                        String workOrderNo = "";
+                        String productCode = "";
+                        //2銆佷繚瀛樿繃绔欓噰闆嗘暟鎹�
+                        Object orderNumberObject = miloService.readFromOpcUa(thoroughfare + "." + device + "." + "WorkOrderNumber").getValue();
+                        if(orderNumberObject!=null){
+                            workOrderNo = orderNumberObject.toString();
+                        }
+
+                        Object productCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + "." + "ProductType").getValue();
+                        if(productCodeObject!=null){
+                            productCode = productCodeObject.toString();
+                        }
+
+                        saveStationInfo(snCode,thoroughfare,device,workOrderNo,productCode);
+                        //3銆佷繚瀛樺弬鏁伴噰闆嗘暟鎹�
+                        SaveParamData(snCode,thoroughfare,device,workOrderNo,productCode);
+
+                        //濡傛灉鏄湯灏惧伐绔欒鎶ュ伐
+                        if(device.equals("OP500")){
+                            RestfulService.getWorkReportResultFeedback(snCode,device,format.format(new Date()));
+                            //1銆佹洿鏂板伐鍗曚俊鎭�
+                            updateOrderInfo(snCode);
+                        }
+                        try{
+                            daParamCollectionService.pushGeelycvMesFeedback(snCode,device);
+                        }catch (Exception e){
+                        }
+                        result = "21";
+
+                    }
                 }
             }
-            snCode = miloService.readFromOpcUa(read).getValue().toString();
 
-            if(null == snCode || "".equals(snCode)){
-                result = "22";
-            }else{
-
-                String workOrderNo = "";
-                String productCode = "";
-                //2銆佷繚瀛樿繃绔欓噰闆嗘暟鎹�
-                Object orderNumberObject = miloService.readFromOpcUa(thoroughfare + "." + device + "." + "WorkOrderNumber").getValue();
-                if(orderNumberObject!=null){
-                    workOrderNo = orderNumberObject.toString();
-                }
-
-                Object productCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + "." + "ProductType").getValue();
-                if(productCodeObject!=null){
-                    productCode = productCodeObject.toString();
-                }
-
-                saveStationInfo(snCode,thoroughfare,device,workOrderNo,productCode);
-                //3銆佷繚瀛樺弬鏁伴噰闆嗘暟鎹�
-                SaveParamData(snCode,thoroughfare,device,workOrderNo,productCode);
-
-                //濡傛灉鏄湯灏惧伐绔欒鎶ュ伐
-                if(device.equals("OP500")){
-                    RestfulService.getWorkReportResultFeedback(snCode,device,format.format(new Date()));
-                    //1銆佹洿鏂板伐鍗曚俊鎭�
-                    updateOrderInfo(snCode);
-                }
-                try{
-                    daParamCollectionService.pushGeelycvMesFeedback(snCode,device);
-                }catch (Exception e){
-                }
-                result = "21";
-
-            }
 
         }catch (Exception e) {
             System.out.println(e.getMessage());
@@ -551,7 +553,7 @@
     /**
      * 淇濆瓨杩囩珯閲囬泦
      */
-    public void saveStationInfo365(String thoroughfare,String device) throws Exception {
+    public String saveStationInfo365(String thoroughfare,String device) throws Exception {
         String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
         String prefix = thoroughfare+"."+device+".";
         List<DaPassingStationCollection> passingStationCollections = new ArrayList<>();
@@ -588,11 +590,11 @@
                 passingStationCollections.add(daPassingStationCollection);
             }
             daPassingStationCollectionService.saveBeachDaPassingStationCollection(passingStationCollections);
-            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build());
-            return;
+            //miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build());
+            return "21";
         }else {
-            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build());
-            return;
+            //miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build());
+            return "22";
         }
     }
 
diff --git a/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue b/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
index dbc4206..c637493 100644
--- a/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
@@ -533,6 +533,10 @@
             locationCode: self.headContent.processesCode,
             productBarcode: self.headContent.sfcCode,
           }
+          if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){
+            self.$message('鏈壘鍒板弬鏁扮爜锛岃妫�鏌ュ弬鏁扮爜鏄惁姝g‘');
+            return;
+          }
           addTighteningParameters(param).then(response => {});
           yzUpdateTighteningFormula(param).then(response => {
             console.log(response)
diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index a0ab8d7..acc3d9b 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -675,6 +675,12 @@
           const orderParam = {
             productNum: self.headContent.sfcCode,
           }
+
+          if(self.headContent.sfcCode=== ''||self.headContent.sfcCode=== null){
+            self.$message('鎬绘垚鐮佷负绌猴紝璇锋鏌ワ紒')
+            return
+          }
+
           checkCarCode(orderParam).then(response => {
             console.log(response.data)
             if(response.data === 1){
@@ -734,12 +740,18 @@
             locationCode: self.headContent.processesCode,
             productBarcode: self.headContent.sfcCode,
           }
-          addTighteningParameters(param).then(response => {});
-          updateTighteningFormula(param).then(response => {
-            self.getListFormulaChild()
-          }).catch(error =>{
-            self.getListFormulaChild()
-          });
+          if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){
+            self.$message('鏈壘鍒板弬鏁扮爜锛岃妫�鏌ュ弬鏁扮爜鏄惁姝g‘');
+            return;
+          }
+          if(self.headContent.sfcCode!==null||self.headContent.sfcCode!==''){
+            addTighteningParameters(param).then(response => {});
+            updateTighteningFormula(param).then(response => {
+              self.getListFormulaChild()
+            }).catch(error =>{
+              self.getListFormulaChild()
+            });
+          }
         }
       };
     },

--
Gitblit v1.9.3