From fd4ea6a620c5d079d3ee8ee30b943f3dea93f4eb Mon Sep 17 00:00:00 2001
From: cl <418351270@qq.com>
Date: 星期三, 07 八月 2024 11:18:35 +0800
Subject: [PATCH] 修改采集参数

---
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java |    4 +++-
 jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java                                     |    4 ++--
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue                                                   |   49 ++++++++++++++++++++++++++++++++++++++++++++++++-
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java    |    3 ++-
 4 files changed, 55 insertions(+), 5 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
index f448716..bc9536a 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
@@ -102,7 +102,8 @@
                 stepNumber = Integer.valueOf(filteredList.get(filteredList.size()-1).getStepSort())+1;
             }
 
-            String str = "PACK."+bsFormulaChildInfo.getProcessesCode()+".MStepNumber";
+            String thoroughfare = Constants.thoroughfareMap.get(bsFormulaChildInfo.getLocationCode());//鑾峰彇閫氶亾
+            String str = thoroughfare+"."+bsFormulaChildInfo.getProcessesCode()+".MESScrew";
             miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(stepNumber).build());
         } catch (Exception e) {
             throw new RuntimeException(e);
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 3221f31..5ab1ba3 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
@@ -17,6 +17,7 @@
 import com.jcdm.common.utils.DateUtils;
 import com.jcdm.common.utils.StringUtils;
 import com.jcdm.framework.websocket.WebSocketUsers;
+import com.jcdm.main.constant.Constants;
 import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
 import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper;
 import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
@@ -636,7 +637,8 @@
 
                 Integer stepNumber = Integer.valueOf(bsFormulaChildInfo.getStepSort());
                 try {
-                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".MStepNumber").value(stepNumber+1).build());
+                    String thoroughfare = Constants.thoroughfareMap.get(bsFormulaChildInfo.getLocationCode());//鑾峰彇閫氶亾
+                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare+"."+bsFormulaChildInfo.getLocationCode()+".MESScrew").value(stepNumber+1).build());
                 } catch (Exception e) {
                     throw new RuntimeException(e);
                 }
diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java
index 7dc65d6..fb506ff 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java
@@ -54,8 +54,8 @@
     public void run(ApplicationArguments args) throws Exception {
 
         //PLC鍒癕ES鐗╂枡杞崲
-        Constants.materialMap.put("1","9900199052A");
-        Constants.materialMap.put("2","9900199053B");
+        Constants.materialMap.put("1","9900200461");//寰崱鐢甸┍鍔ㄧ郴缁熸�绘垚
+        Constants.materialMap.put("2","9900207783");//寰潰鐢甸┍鍔ㄧ郴缁熸�绘垚
 
         //閫氶亾
         Constants.thoroughfareMap.put(Constants.OP010,"JCDM035-1");
diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index b1fca02..2c88940 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -469,7 +469,7 @@
           console.log("杩涘叆鏈�缁堟柟娉�")
           self.endSaveData(param)
 
-        } else if(event.data.includes("productNum")){
+        } else if(event.data.includes("productNum")){//浜у搧搴忓垪鍙�
           let productNum = event.data.split(',')[1];
           self.headContent.sfcCode = productNum;
           self.queryParams.productNum = productNum;
@@ -478,6 +478,53 @@
           self.cakeLamp.startWork = 1
           self.cakeLamp.InPlace = 1
 
+        }else if (event.data.includes("[")) {//鎷х揣
+          let formulaChilds = "";
+          self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort);
+          self.formulaChildList
+            .filter((formulaChild) => formulaChild.operationType === '1');
+          for (let i = 0; i < self.formulaChildList.length; i++) {
+            let formulaChild = self.formulaChildList[i];
+            let results = formulaChild.results;
+
+            if (results === '' || results === null || results === 'NG') {
+              formulaChilds = formulaChild;
+              break;
+            }
+          }
+          if(formulaChilds === ""){
+            self.$message.error('鏈伐浣嶅凡宸ヤ綔瀹屾垚锛�');
+            return;
+          }
+          const param = {
+            id: formulaChilds.id,
+            tightenTheArray: event.data,
+            paramCode: formulaChilds.paramCode,
+            workOrderNo: self.workpieceInformation.workOrderNo,
+            productCode: self.workpieceInformation.productCode,
+            locationCode: self.headContent.processesCode,
+            productBarcode: self.headContent.sfcCode,
+            spareField1: formulaChilds.spareField1,
+            spareField2: formulaChilds.spareField2,
+            spareField3: formulaChilds.spareField3,
+            spareField4: formulaChilds.spareField4,
+            stepSort: formulaChilds.stepSort,
+            ngTimes: formulaChilds.ngTimes,
+          }
+          if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){
+            self.$message('鏈壘鍒板弬鏁扮爜锛岃妫�鏌ュ弬鏁扮爜鏄惁姝g‘');
+            return;
+          }
+          self.formulaChildParams.artificialNgFlag = null
+          console.log("self.formulaChildParams.artificialNgFlag"+self.formulaChildParams.artificialNgFlag)
+          if(self.headContent.sfcCode!==null||self.headContent.sfcCode!==''){
+            updateTighteningFormula(param).then(response => {
+              //addTighteningParameters(param).then(response => {});
+              self.getListFormulaChild()
+            }).catch(error =>{
+              self.getListFormulaChild()
+            });
+          }
         }
       };
     },

--
Gitblit v1.9.3