From 273d640de28fc7fe55add05a9bc7ea1c19eca830 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期一, 15 七月 2024 20:09:05 +0800
Subject: [PATCH] -切换大模组代码更改

---
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java   |   47 ++
 jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java                                       |    2 
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue                                                     |  122 ++-----
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java      |   63 +++
 jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java |   58 +--
 jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml                        |   22 +
 jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue                                                |   21 
 jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java                    |  175 ++-------
 jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue                                                 |    4 
 jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java                |   18 +
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java                    |   13 
 jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js                                                    |   27 +
 jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java  |    7 
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java                              |  380 +++++++++------------
 jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml                    |   19 +
 15 files changed, 481 insertions(+), 497 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 eaa2c2e..0a067bd 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
@@ -5,8 +5,11 @@
 import javax.servlet.http.HttpServletResponse;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jcdm.main.constant.Constants;
+import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
+import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService;
 import com.kangaroohy.milo.model.ReadWriteEntity;
 import com.kangaroohy.milo.service.MiloService;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -42,7 +45,64 @@
     private IBsFormulaChildInfoService bsFormulaChildInfoService;
 
     @Autowired
+    private IOmProductionOrdeInfoService omProductionOrdeInfoService;
+
+    @Autowired
     private MiloService miloService;
+
+    /**
+     * 鎵爜纭
+     */
+    @GetMapping("/inPlaceInspection")
+    public AjaxResult inPlaceInspection(BsFormulaChildInfo bsFormulaChildInfo)
+    {
+        Integer recordDataDone = 0;
+        try {
+            Object orderNumberObject = miloService.readFromOpcUa("PACK."+bsFormulaChildInfo.getProcessesCode()+".RecordDataDone").getValue();
+            if(ObjectUtil.isNotEmpty(orderNumberObject)){
+                if(Integer.valueOf(orderNumberObject.toString()) == 11){
+                    recordDataDone = 1;
+                }
+            }
+
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return AjaxResult.success(recordDataDone);
+    }
+
+    /**
+     * 鎵爜纭
+     */
+    @GetMapping("/unfinishedProcess")
+    public AjaxResult unfinishedProcess(BsFormulaChildInfo bsFormulaChildInfo)
+    {
+        try {
+            String str = "PACK."+bsFormulaChildInfo.getProcessesCode()+".RecordDataDone";
+            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(bsFormulaChildInfo.getRecordDataDone()).build());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return AjaxResult.success();
+    }
+
+    @GetMapping("/manualNgOffline")
+    public AjaxResult manualNgOffline(BsFormulaChildInfo bsFormulaChildInfo)
+    {
+        Integer stepNumber = 90;
+        try {
+            String str = "PACK."+bsFormulaChildInfo.getLocationCode()+".MStepNumber";
+            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(stepNumber).build());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        OmProductionOrdeInfo one = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>()
+                .eq(OmProductionOrdeInfo::getProductNum, bsFormulaChildInfo.getSfcBarcode())
+        );
+        one.setArtificialNgFlag("1");
+        omProductionOrdeInfoService.saveOrUpdate(one);
+        return AjaxResult.success(stepNumber);
+    }
 
     /**
      * 鎵爜纭
@@ -93,9 +153,6 @@
             list.addAll(collect2);
         }
         for (BsFormulaChildInfo formulaChildInfo : list) {
-//            formulaChildInfo.setSort(formulaChildInfo.getStepSort());
-//            formulaChildInfo.setAddress(formulaChildInfo.getTechRequirement());
-//            formulaChildInfo.setImg(formulaChildInfo.getOperationSteps());
             if(formulaChildInfo.getCollectData()!=null&& !"".equals(formulaChildInfo.getCollectData())){
                 if(formulaChildInfo.getCollectData().contains("[")){
                     String data = formulaChildInfo.getCollectData();
diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java
index ee0cf8c..a1e0f80 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java
@@ -103,6 +103,16 @@
     @Excel(name = "缁撴灉")
     private String results;
 
+    @Excel(name = "ng娆℃暟")
+    private Integer ngTimes;
+
+    @Excel(name = "ng閲囬泦鏁版嵁")
+    private String ngCollectData;
+
+    /** 缁撴灉 */
+    @Excel(name = "ng缁撴灉")
+    private String ngResults;
+
     @TableField(exist = false)
     private String sort;
 
@@ -131,6 +141,9 @@
     private String scanBarcode;
 
     @TableField(exist = false)
+    private Integer recordDataDone;
+
+    @TableField(exist = false)
     private String sfcBarcode;
 
     @TableField(exist = false)
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 38654eb..fd7517a 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
@@ -8,6 +8,7 @@
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -190,6 +191,12 @@
                 }
             }
         }
+//        for (BsFormulaChildInfo formulaChildInfo : infos) {
+//            if(bsFormulaChildInfo.getScanBarcode().contains(formulaChildInfo.getMaterialCode())) {
+//                bsFormulaChildInfos.add(formulaChildInfo);
+//                break;
+//            }
+//        }
         if(bsFormulaChildInfos.size()>0){
             String spareField4 = bsFormulaChildInfos.get(0).getSpareField4();
             bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getScanBarcode());
@@ -387,6 +394,7 @@
         updateWrapper.set(BsFormulaChildInfo::getCollectData, "");
         updateWrapper.set(BsFormulaChildInfo::getResults,"");
         updateWrapper.eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode());
+        updateWrapper.eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode());
         BsFormulaChildInfo info = new BsFormulaChildInfo();
         boolean update = this.update(info,updateWrapper);
         return AjaxResult.success(update);
@@ -495,9 +503,10 @@
         daParamCollectionTemp.setParamValue(bsFormulaChildInfo.getParamValue());
         daParamCollectionTemp.setProductCode(bsFormulaChildInfo.getProductCode());
         daParamCollectionTemp.setCollectionTime(new Date());
-        daParamCollection.setSfcCode(scanBarCode);
+        daParamCollectionTemp.setSfcCode(scanBarCode);
 
-        daParamCollectionTempService.save(daParamCollectionTemp);
+        boolean save = daParamCollectionTempService.save(daParamCollectionTemp);
+        System.out.println(save);
     }
 
     @Override
@@ -536,12 +545,16 @@
 
         String paramCode = bsFormulaChildInfo.getTightenTheArray();
         if(paramCode.contains("NG")){
-       /*     List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery);
-            bsFormulaChildInfos.get(0).setResults("NG");
-            bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getTightenTheArray());
-*/
             bsFormulaChildInfo.setResults("NG");
             bsFormulaChildInfo.setCollectData(bsFormulaChildInfo.getTightenTheArray());
+
+//            Integer ngTimes = bsFormulaChildInfo.getNgTimes();
+//            bsFormulaChildInfo.setNgTimes(ngTimes+1);
+//            if(ngTimes > 3){
+//                WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), "NG");
+//                this.recordNgTighteningData(bsFormulaChildInfo.getLocationCode(), bsFormulaChildInfo.getProductCode());
+//                return AjaxResult.error("瓒呰繃涓夋鎷х揣 pack NG涓嬬嚎锛�");
+//            }
             bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfo);
             return AjaxResult.error("鎷х揣缁撴灉NG,璇烽噸鏂版嫥绱э紒");
         }else {
@@ -568,13 +581,6 @@
                     // 鎵ц鎿嶄綔
                     if(spareField4.equals("1")){
                         try {
-    //                        //鏇存柊杩囩珯璁板綍琛ㄥ嚭绔欐椂闂�
-    //                        DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection();
-    //                        daPassingStationCollection.setWorkOrderNo(bsFormulaChildInfo.getWorkOrderNo());
-    //                        List<DaPassingStationCollection> daPassingStationCollections = daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection);
-    //                        daPassingStationCollections.get(0).setOutboundTime(new Date());
-    //                        daPassingStationCollectionMapper.updateDaPassingStationCollection(daPassingStationCollections.get(0));
-//                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build());
                             WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), "OUT");
                         } catch (Exception e) {
                             throw new RuntimeException(e);
@@ -597,6 +603,21 @@
         return AjaxResult.success("鎷х揣鎴愬姛锛�");
     }
 
+    public void recordNgTighteningData(String locationCode,String productCode){
+        List<BsFormulaChildInfo> ngFormulaList = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>()
+                .eq(BsFormulaChildInfo::getProcessesCode, locationCode)
+                .eq(BsFormulaChildInfo::getProductCode, productCode)
+        );
+        List<BsFormulaChildInfo> filteredList = ngFormulaList.stream()
+                .filter(formula -> formula.getResults() != null && !formula.getResults().isEmpty())
+                .collect(Collectors.toList());
+        for (BsFormulaChildInfo childInfo : filteredList) {
+            childInfo.setNgCollectData(childInfo.getCollectData());
+            childInfo.setNgResults(childInfo.getResults());
+            bsFormulaChildInfoMapper.updateBsFormulaChildInfo(childInfo);
+        }
+    }
+
 
 
 
diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
index 24935b5..ac40ca2 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -259,6 +259,7 @@
                 daParamCollectionTemp.setSfcCode(daParamCollection.getProductBarcode());
                 daParamCollectionTemp.setLocationCode(daParamCollection.getLocationCode());
                 daParamCollectionTemp.setProductCode(daParamCollection.getProductCode());
+                daParamCollectionTemp.setWorkOrderNo(daParamCollection.getWorkOrderNo());
                 daParamCollectionTempService.save(daParamCollectionTemp);
             }
         }
@@ -339,7 +340,7 @@
 
                 //缁檕pc鍙�21
                 miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build());
-                if(daParamCollection.getLocationCode().equals("OP240")){
+                if(daParamCollection.getLocationCode().equals("POP240")){
                     try{
                         CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                             logger.info("OP230鎶ュ伐寮�濮�-宸ュ巶MES寮傛鏂规硶");
@@ -520,20 +521,8 @@
             for (DaParamCollectionTemp daParamCollection : paramList) {
                 ChildVO childVO = new ChildVO();
                 childVO.setItemCode(daParamCollection.getParamCode());
-//                BsFormulaChildInfo childOne = bsFormulaChildInfoService.getOne(new LambdaQueryWrapper<BsFormulaChildInfo>().eq(BsFormulaChildInfo::getParamCode, daParamCollection.getParamCode()));
-//                DaCollectionParamConf paramConfOne = daCollectionParamConfService.getOne(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode()));
                 List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode()));
                 DaCollectionParamConf paramConfOne = paramConfOneList.get(0);
-//                if(childOne!=null){
-//                    String operationType = childOne.getOperationType();
-//                    if(operationType.equals("1")){
-//                        childVO.setItemType("2");
-//                    }else if(operationType.equals("2")){
-//                        childVO.setItemType("1");
-//                    }
-//                }else {
-//                    childVO.setItemType("3");
-//                }
                 if(paramConfOne!=null){
                     childVO.setItemType(paramConfOne.getSpareField1());
                     childVO.setItemText(paramConfOne.getCollectParameterName());
@@ -559,26 +548,21 @@
             parentVO.setCheckList(listChildVo);
             try{
                 CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
-                    logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�");
+                    logger.info("宸ヤ綅{}---寮�濮嬫墽琛屽紓姝ユ柟娉�---pack鐮佹槸{}"+stationCode,packID);
                     HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
-                    logger.info("寮傛鏂规硶鎵ц缁撴潫");
-                    logger.info("鎵嬪姩宸ヤ綅{}浼犲伐鍘傚叆鍙俈O{}" + stationCode,new Gson().toJson(parentVO));
-                    logger.info("鎵嬪姩宸ヤ綅{}浼犲伐鍘侻ES寮傛鏂规硶{}"+stationCode,execute.body());
+                    logger.info("宸ヤ綅{}---寮傛鏂规硶鎵ц缁撴潫---pack鐮佹槸{}"+stationCode,packID);
+                    logger.info("鎵嬪姩宸ヤ綅{}浼犲伐鍘傚叆鍙俈O{}---pack鐮佹槸{}" + stationCode,new Gson().toJson(parentVO),packID);
+                    logger.info("鎵嬪姩宸ヤ綅{}浼犲伐鍘侻ES寮傛鏂规硶{}---pack鐮佹槸{}"+stationCode,execute.body(),packID);
 
                     DaParamCollectionTemp daParamCollectionTemp = new DaParamCollectionTemp();
                     daParamCollectionTemp.setSfcCode(packID);
                     daParamCollectionTemp.setLocationCode(stationCode);
                     int i = daParamCollectionTempService.deleteDaParamCollectionTempBySfcCodeAndLocationCode(daParamCollectionTemp);
                     logger.info("鍒犻櫎涓存椂琛ㄦ暟鎹潯鏁皗}-宸ヤ綅{}-pack鐮亄}",i,stationCode,packID);
-//                    List<Long> idsList = paramList.stream().map(DaParamCollectionTemp::getId).collect(Collectors.toList());
-//                    Long[] array = idsList.toArray(new Long[0]);
-//                    int i = daParamCollectionTempService.deleteDaParamCollectionTempByIds(array);
-//                    logger.info("鍒犻櫎涓存椂琛ㄦ暟鎹潯鏁皗}-宸ヤ綅{}-pack鐮亄}",i,stationCode,packID);
                 });
             }catch (Exception e){
                 System.out.println(e.getMessage());
             }
-//            HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
             logger.info("缁撴潫浜哄伐宸ヤ綅鎺ㄩ�佸伐鍘侻ES鏁版嵁鏂规硶-pushGeelycvMesFeedback-宸ヤ綅{}-pack鐮亄}",stationCode,packID);
         }
 
@@ -588,8 +572,8 @@
     public void automaticWorkstationPushGeelycvMesFeedback(String packID, String stationCode,List<DaParamCollection> paramList) {
         logger.info("杩涘叆宸ヤ綅{}-宸ュ巶MES鎺ㄩ�佹暟鎹柟娉昦utomaticWorkstationPushGeelycvMesFeedback",stationCode);
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
-        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
+        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
+//        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
         String totalResult = "0";
         if(paramList.size() > 0){
             logger.info("杩涘叆宸ヤ綅{}-鎷兼暟鎹�",stationCode);
@@ -608,16 +592,6 @@
 //                DaCollectionParamConf paramConfOne = daCollectionParamConfService.getOne(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode()));
                 List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode()));
                 DaCollectionParamConf paramConfOne = paramConfOneList.get(0);
-//                if(childOne!=null){
-//                    String operationType = childOne.getOperationType();
-//                    if(operationType.equals("1")){
-//                        childVO.setItemType("2");
-//                    }else if(operationType.equals("2")){
-//                        childVO.setItemType("1");
-//                    }
-//                }else {
-//                    childVO.setItemType("3");
-//                }
                 if(paramConfOne!=null){
                     childVO.setItemType(paramConfOne.getSpareField1());
                     childVO.setItemText(paramConfOne.getCollectParameterName());
@@ -644,9 +618,9 @@
             logger.info("杩涘叆宸ヤ綅{}-宸ュ巶MES鎺ㄩ�佹暟鎹柟娉旽ttpResponseSend",stationCode);
             try{
                 CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
-                    logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�");
+                    logger.info("宸ヤ綅{}---鑷姩宸ヤ綅寮�濮嬫墽琛屽紓姝ユ柟娉�---pack鐮佹槸{}"+stationCode,packID);
                     HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
-                    logger.info("寮傛鏂规硶鎵ц缁撴潫");
+                    logger.info("宸ヤ綅{}---鑷姩宸ヤ綅寮傛鏂规硶鎵ц缁撴潫---pack鐮佹槸{}"+stationCode,packID);
                     logger.info("鑷姩宸ヤ綅{}浼犲伐鍘傚叆鍙俈O{}" + stationCode,new Gson().toJson(parentVO));
                     logger.info("鑷姩宸ヤ綅{}浼犲伐鍘侻ES寮傛鏂规硶杩斿洖{}"+stationCode,execute.body());
                 });
@@ -745,6 +719,18 @@
             saveData.setCollectionTime(new Date());
             saveData.setParamValue(value);
             daParamCollectionMapper.insertDaParamCollection(saveData);
+
+            DaParamCollectionTemp saveDataTemp = new DaParamCollectionTemp();
+            saveDataTemp.setWorkOrderNo(daParamCollection.getWorkOrderNo());
+            saveDataTemp.setProductCode(daParamCollection.getProductCode());
+            saveDataTemp.setLocationCode(daParamCollection.getLocationCode());
+            saveDataTemp.setSfcCode(daParamCollection.getProductBarcode());
+            saveDataTemp.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId());
+            saveDataTemp.setParamName(daCollectionParamConfs.get(0).getCollectParameterName());
+            saveDataTemp.setCollectionTime(new Date());
+            saveDataTemp.setParamValue(value);
+            daParamCollectionTempService.save(saveDataTemp);
+
         });
     }
 
diff --git a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
index d53e15a..b1e4310 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
@@ -138,11 +138,12 @@
                 omProductionOrdeInfo.setMaterialCode(dataObject.getStr("materialCode"));
                 omProductionOrdeInfo.setOnlineCompletionMark("0");
                 omProductionOrdeInfo.setSfResult("0");
-                if(dataObject.getStr("model").equals("PE01A")){
-                    omProductionOrdeInfo.setProductCode("PE01B");
+                if(dataObject.getStr("model").equals("PE01B")){
+                    omProductionOrdeInfo.setSoftwareVersionCode("2");
                 }else {
-                    omProductionOrdeInfo.setProductCode(dataObject.getStr("model"));
+                    omProductionOrdeInfo.setSoftwareVersionCode("0");
                 }
+                omProductionOrdeInfo.setProductCode(dataObject.getStr("model"));
                 omProductionOrdeInfo.setCreateTime(new Date());
                 omProductionOrdeInfo.setCreateUser("宸ュ巶MES");
                 omProductionOrdeInfoService.save(omProductionOrdeInfo);
diff --git a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java
index fec6e50..5843a16 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfo.java
@@ -4,6 +4,7 @@
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.jcdm.common.annotation.Excel;
@@ -15,6 +16,7 @@
  * @author ruimin
  * @date 2023-12-11
  */
+@Data
 public class OmProductionOrdeInfo extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -190,6 +192,22 @@
     /** 棰勭暀瀛楁4 */
     private String spareField4;
 
+    /** 鑷姩绔檔g鏍囪锛岀敤浜庤繑淇ˉ鏁版嵁 */
+    @Excel(name = "鑷姩绔檔g鏍囪锛岀敤浜庤繑淇ˉ鏁版嵁")
+    private String automaticNgFlag;
+
+    /** 鑷姩绔檔g宸ヤ綅 */
+    @Excel(name = "鑷姩绔檔g宸ヤ綅")
+    private String automaticNgStation;
+
+    /** 鑷姩绔檔g铻轰笣鍙� */
+    @Excel(name = "鑷姩绔檔g铻轰笣鍙�")
+    private String automaticNgScrewNumber;
+
+    /** 浜哄伐绔檔g鏍囪 */
+    @Excel(name = "浜哄伐绔檔g鏍囪")
+    private String artificialNgFlag;
+
     @TableField(exist = false)
     private Long[] idNums;
 
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 93a8fff..c9fe985 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
@@ -110,7 +110,7 @@
         lists.add(OPCElement.PACK_POP286_RecordData);//璇锋眰璁板綍鏁版嵁
 //        lists.add(OPCElement.PACK_OP350B_RecordData);//璇锋眰璁板綍鏁版嵁
         lists.add(OPCElement.PACK_POP290_RecordData);//璇锋眰璁板綍鏁版嵁
-//        lists.add(OPCElement.PACK_OP365_RecordData);//璇锋眰璁板綍鏁版嵁
+        lists.add(OPCElement.PACK_OP365_RecordData);//璇锋眰璁板綍鏁版嵁
         lists.add(OPCElement.PACK_POP300_RecordData);//璇锋眰璁板綍鏁版嵁
         lists.add(OPCElement.PACK_POP320_RecordData);//璇锋眰璁板綍鏁版嵁
         lists.add(OPCElement.PACK_POP400_RecordData);//璇锋眰璁板綍鏁版嵁
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 5624a2a..cf7f1fb 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
@@ -2,12 +2,10 @@
 
 
 import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.jcdm.common.utils.StringUtils;
 import com.jcdm.framework.websocket.WebSocketUsers;
 import com.jcdm.main.constant.Constants;
@@ -17,28 +15,23 @@
 import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
 import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
 import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
-import com.jcdm.main.da.testDeviceInterface.domain.DaTestDeviceInterface;
 import com.jcdm.main.da.testDeviceInterface.service.IDaTestDeviceInterfaceService;
 import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
 import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService;
-import com.jcdm.main.plcserver.conf.OPCElement;
 import com.jcdm.main.plcserver.util.TimeUtil;
 import com.jcdm.main.restful.factoryMes.service.RestfulService;
-import com.jcdm.main.restful.qingYan.doman.ChildVO;
-import com.jcdm.main.restful.qingYan.doman.ParentVO;
 import com.kangaroohy.milo.model.ReadWriteEntity;
 import com.kangaroohy.milo.runner.subscription.SubscriptionCallback;
 import com.kangaroohy.milo.service.MiloService;
 import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import javax.websocket.Session;
 import java.text.SimpleDateFormat;
-import java.time.Instant;
 import java.util.*;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -122,146 +115,134 @@
                 String tab = nodes[2];//鏍囪
                 String tabVlaue = value.toString();//鍦板潃鍊�
 
-                if (("RecordData").equals(tab)) {
-                    String recordDataDoneValue = "";
-
-                    if("1".equals(tabVlaue)){
-
-                        //璇锋眰宸ュ崟
-//                        if(device.equals("OP230")){
-//                            getFactoryOrder("OP230");
-//                        }
-
-                        //鑷姩宸ヤ綅
-                        if(automaticList.stream().anyMatch(s -> s.equals(device))){
-                            //plc缁欐垜浠竴涓ā缁勭爜锛屾嬁妯$粍鐮佹牎楠屽嚭鍨嬪彿
-                            if(moduleCodeList.stream().anyMatch(s -> s.equals(device))) {
-                                String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
-                                //璇绘ā缁勭爜
-                                Object moduleCode = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCode").getValue();
-                                if(device.equals("OP365")){
-                                    Object moduleCodeA = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCodeA").getValue();
-                                    Object moduleCodeB = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCodeB").getValue();
-                                    if(moduleCodeA!=null && moduleCodeB!=null){
-                                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
-                                    }else {
-                                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(12).build());
-                                    }
-                                    return;
-                                }
-
-                                if(moduleCode!=null){
-                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
-                                }else {
-                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(12).build());
-                                }
-                            }else {
-                                if(agvId.stream().anyMatch(s -> s.equals(device))){
-                                    Object agvIdObject = miloService.readFromOpcUa(thoroughfare + "." + device + ".AGVID").getValue();
-                                    //agvId 灏忚溅鐮佹槸鍚︿负绌�
-                                    if(agvIdObject!=null){
-                                        String PACKCode = thoroughfare + "." + device + ".MPACKCode";
-                                        OmProductionOrdeInfo one = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getTrolleyYard, agvIdObject.toString()));
-                                        //灏忚溅鐮佹煡鎵惧伐鍗曟槸鍚︿负绌�
-                                        if(one!=null){
-                                            String packId = one.getProductNum();
-                                            miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(PACKCode).value(packId).build());
-                                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(11).build());
-                                        }else {
-                                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build());
-                                        }
-                                    }else {
-                                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build());
-                                    }
-
-                                }else {
-                                    String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
-                                    Object packCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + ".PACKCode").getValue();
-                                    if(packCodeObject!=null){
-                                        //pack 濡傛灉鍖哄垎鍨嬪彿鐨勮瘽灏辫澶勭悊
-                                        //璁板綍鏁版嵁瀹屾垚
-                                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
-                                    }else {
-                                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(12).build());
-                                    }
-                                }
-                            }
-                        }else {
-                            //鎵嬪姩宸ヤ綅澶勭悊閫昏緫
-//                            if (map.containsKey(device)){
-                                WebSocketUsers.sendMessageToUserByText(map.get(device), "IN");
-                                String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
-                                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
-//                            }
-                        }
-
-
-                    }else if("2".equals(tabVlaue)){
-                        if(automaticList.stream().anyMatch(s -> s.equals(device))){
-                            //鑷姩宸ヤ綅
-                            //鍑虹珯淇濆瓨鏁版嵁
-                            outSaveDate(thoroughfare,device);
-                            //璁板綍鏁版嵁瀹屾垚
-                            /*String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
-                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(Integer.valueOf(recordDataDoneValue)).build());*/
-                        }else {
-                            //鎵嬪姩宸ヤ綅
-//                            if(device.contains("OP330")){
-//                                String str = device.substring(0,5);
-//                                WebSocketUsers.sendMessageToUserByText(map.get(str), "END");
-//                            }else {
-                                WebSocketUsers.sendMessageToUserByText(map.get(device), "END");
-//                            }
-                            if(testList.stream().anyMatch(s -> s.equals(device))){
-                                String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
-                                miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build());
-//                                Object packCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCode").getValue();
-//                                DaTestDeviceInterface deviceInterfaceOne = null;
-//
-//                                if (ObjectUtil.isNotNull(packCodeObject)) {
-//                                    String modelCode = packCodeObject.toString();
-//                                    deviceInterfaceOne = daTestDeviceInterfaceService.getOne(new LambdaQueryWrapper<DaTestDeviceInterface>()
-//                                            .eq(DaTestDeviceInterface::getProductNum, modelCode)
-//                                            .eq(DaTestDeviceInterface::getStationCode, device));
-//                                }
-//
-//                                if (deviceInterfaceOne != null && "1".equals(deviceInterfaceOne.getTotalResult())) {
-//                                writeToOpcShort(RecordDataDoneAddress, (short) 21);
-//                                } else {
-//                                    writeToOpc(RecordDataDoneAddress, (short) 22);
-//                                }
-//                                writeToOpc(RecordDataDoneAddress, (short) 21);
-                            }
-
-
-                        }
-                    }else {
-                        System.out.println("^");
-                    }
-                }
-                //淇濆瓨鎷х揣鏁版嵁
-                else if (("TighteningFrequency").equals(tab)) {
-                    if(!"0".equals(tabVlaue)){
-                        List<String> list = new ArrayList<>();
-                        String[] suffixes = {"Torque", "Angle", "TorqueResult", "AngleResult"};
-
-                        for (String suffix : suffixes) {
-                            String string = thoroughfare + "." + device + "." + suffix;
-                            list.add(string);
-                        }
-                        List<ReadWriteEntity> list1 = miloService.readFromOpcUa(list);
-                        List<Object> collect = list1.stream().map(ReadWriteEntity::getValue).collect(Collectors.toList());
-                        String joinedString = String.join(",", collect.toString());
-                        WebSocketUsers.sendMessageToUserByText(map.get(device), TightenTheConversionOkNg(joinedString));
-                        logger.info("璇诲彇鍒板伐浣峽}鐨凷caner鏁版嵁锛歿}",device,TightenTheConversionOkNg(joinedString));
-                    }
-                }
+                CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
+                    subHandle(thoroughfare,device,tab,tabVlaue);
+                });
             }
         } catch (Exception e) {
             logger.info("璁㈤槄鏂规硶鎶ラ敊:{}"+e.getMessage());
             logger.error("璁㈤槄鏂规硶鎶ラ敊",e);
         }
     }
+
+    public void subHandle(String thoroughfare,String device,String tab,String tabVlaue){
+        try {
+            String prefix = thoroughfare + "." + device + ".";
+            if (("RecordData").equals(tab)) {
+                String recordDataDoneValue = "";
+
+                if("1".equals(tabVlaue)){
+                    //鑷姩宸ヤ綅
+                    if(automaticList.stream().anyMatch(s -> s.equals(device))){
+                        //plc缁欐垜浠竴涓ā缁勭爜锛屾嬁妯$粍鐮佹牎楠屽嚭鍨嬪彿
+                        if(moduleCodeList.stream().anyMatch(s -> s.equals(device))) {
+                            String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
+                            //璇绘ā缁勭爜
+                            Object moduleCode = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCode").getValue();
+                            if(device.equals("OP365")){
+//                                Object moduleCodeA = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCodeA").getValue();
+//                                Object moduleCodeB = miloService.readFromOpcUa(thoroughfare + "." + device + ".ModuleCodeB").getValue();
+//                                if(moduleCodeA!=null && moduleCodeB!=null){
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
+//                                }else {
+//                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(12).build());
+//                                }
+                            }else {
+                                if(moduleCode!=null){
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
+                                }else {
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(12).build());
+                                }
+                            }
+                        }else {
+                            if(agvId.stream().anyMatch(s -> s.equals(device))){
+                                Object agvIdObject = miloService.readFromOpcUa(thoroughfare + "." + device + ".AGVID").getValue();
+                                //agvId 灏忚溅鐮佹槸鍚︿负绌�
+                                if(agvIdObject!=null){
+                                    String PACKCode = thoroughfare + "." + device + ".MPACKCode";
+                                    OmProductionOrdeInfo one = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getTrolleyYard, agvIdObject.toString()));
+                                    //灏忚溅鐮佹煡鎵惧伐鍗曟槸鍚︿负绌�
+                                    if(one!=null){
+                                        String packId = one.getProductNum();
+                                        String workOrderNo = one.getWorkOrderNo();
+                                        if(!one.getSoftwareVersionCode().equals("") &&one.getSoftwareVersionCode()!=null){
+                                            Integer packModel = Integer.valueOf(one.getSoftwareVersionCode());
+                                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(prefix + "MProductType").value(packModel).build());
+                                        }
+                                        miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(PACKCode).value(packId).build());
+                                        miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(prefix + "MWorkOrderNumber").value(workOrderNo).build());
+                                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(11).build());
+                                    }else {
+                                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build());
+                                    }
+                                }else {
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build());
+                                }
+
+                            }else {
+                                String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
+                                Object packCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + ".PACKCode").getValue();
+                                if(packCodeObject!=null){
+                                    //pack 濡傛灉鍖哄垎鍨嬪彿鐨勮瘽灏辫澶勭悊
+                                    //璁板綍鏁版嵁瀹屾垚
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
+                                }else {
+                                    miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(12).build());
+                                }
+                            }
+                        }
+                    }else {
+                        //鎵嬪姩宸ヤ綅澶勭悊閫昏緫
+                        WebSocketUsers.sendMessageToUserByText(map.get(device), "IN");
+                        String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
+                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(11).build());
+                    }
+
+
+                }else if("2".equals(tabVlaue)){
+                    if(automaticList.stream().anyMatch(s -> s.equals(device))){
+                        //鑷姩宸ヤ綅
+                        //鍑虹珯淇濆瓨鏁版嵁
+                        outSaveDate(thoroughfare,device);
+                        //璁板綍鏁版嵁瀹屾垚
+                            /*String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
+                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(Integer.valueOf(recordDataDoneValue)).build());*/
+                    }else {
+                        //鎵嬪姩宸ヤ綅娴嬭瘯宸ヤ綅鍑虹珯
+                        WebSocketUsers.sendMessageToUserByText(map.get(device), "END");
+                        if(testList.stream().anyMatch(s -> s.equals(device))){
+                            String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
+                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build());
+                        }
+
+
+                    }
+                }else {
+                    System.out.println("^");
+                }
+            }
+            //淇濆瓨鎷х揣鏁版嵁
+            else if (("TighteningFrequency").equals(tab)) {
+                if(!"0".equals(tabVlaue)){
+                    List<String> list = new ArrayList<>();
+                    String[] suffixes = {"Torque", "Angle", "TorqueResult", "AngleResult"};
+
+                    for (String suffix : suffixes) {
+                        String string = thoroughfare + "." + device + "." + suffix;
+                        list.add(string);
+                    }
+                    List<ReadWriteEntity> list1 = miloService.readFromOpcUa(list);
+                    List<Object> collect = list1.stream().map(ReadWriteEntity::getValue).collect(Collectors.toList());
+                    String joinedString = String.join(",", collect.toString());
+                    WebSocketUsers.sendMessageToUserByText(map.get(device), TightenTheConversionOkNg(joinedString));
+                    logger.info("璇诲彇鍒板伐浣峽}鐨凷caner鏁版嵁锛歿}",device,TightenTheConversionOkNg(joinedString));
+                }
+            }
+        }catch (Exception e){
+            logger.error("璁㈤槄鏂规硶鎶ラ敊",e);
+        }
+    }
+
 
 
 
@@ -339,37 +320,6 @@
         }
     }
 
-
-//    /**
-//     * 鍑虹珯淇濆瓨鏁版嵁
-//     */
-//    public String outSaveDate(String thoroughfare,String device) {
-//        String result = "";
-//        try {
-//            //璇诲彇SNCode
-//            String PACKCode = thoroughfare + "." + device + ".PACKCode";
-//            Object PACKCodeObject = miloService.readFromOpcUa(PACKCode).getValue();
-//            if(null == PACKCodeObject || "".equals(PACKCodeObject)){
-//               result = "22";
-//            }else{
-//                String PACKCodeParam = PACKCodeObject.toString();
-//                //1銆佹洿鏂板伐鍗曚俊鎭�
-//                //updateOrderInfo();
-//                //2銆佷繚瀛樿繃绔欓噰闆嗘暟鎹�
-//                saveStationInfo(PACKCodeParam,thoroughfare,device);
-//                //3銆佷繚瀛樺弬鏁伴噰闆嗘暟鎹�
-//                SaveParamData(PACKCodeParam,thoroughfare,device,"","");
-//
-//                result = "21";
-//
-//            }
-//
-//        }catch (Exception e) {
-//
-//        }
-//        return result;
-//    }
-
     /**
      * 淇濆瓨杩囩珯閲囬泦
      */
@@ -425,9 +375,9 @@
                     ParamCollection.setParamValue(readWriteEntityList.get(i).getValue().toString());
                 }
                 ParamCollection.setSfcCode(packCode);
-                if(device.contains("OP360")){
+                if(device.contains("POP290")){
                     String node = nodeIdList.get(i);
-                    Object value = miloService.readFromOpcUa("PACK.OP360.ModuleSNCode"+node.charAt(node.length()-1)).getValue();
+                    Object value = miloService.readFromOpcUa("PACK.POP290.ModuleSNCode"+node.charAt(node.length()-1)).getValue();
                     if(value!=null){
                         ParamCollection.setModuleCode(value.toString());
                     }
@@ -573,47 +523,47 @@
      */
     public void saveStationInfo365(String thoroughfare,String device) throws Exception {
         String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
-        String prefix = thoroughfare+"."+device+".";
-        List<DaPassingStationCollection> passingStationCollections = new ArrayList<>();
-        String ModuleCodeA = "";
-        String ModuleCodeB = "";
-        String StationStatusA = "";
-        String StationStatusB = "";
-
-        Object objectModuleCodeA = miloService.readFromOpcUa(prefix + "ModuleCodeA").getValue();
-        Object objectModuleCodeB = miloService.readFromOpcUa(prefix + "ModuleCodeB").getValue();
-        Object objectStationStatusA = miloService.readFromOpcUa(prefix + "StationStatusA").getValue();
-        Object objectStationStatusB = miloService.readFromOpcUa(prefix + "StationStatusB").getValue();
-
-        if(ObjectUtil.isNotNull(objectModuleCodeA) && ObjectUtil.isNotNull(objectStationStatusA) && ObjectUtil.isNotNull(objectModuleCodeB) && ObjectUtil.isNotNull(objectStationStatusB)){
-            ModuleCodeA = objectModuleCodeA.toString();
-            ModuleCodeB = objectModuleCodeB.toString();
-            StationStatusA = objectStationStatusA.toString();
-            StationStatusB = objectStationStatusB.toString();
-
-            String[] modeles = {ModuleCodeA,ModuleCodeB};
-            String[] StationStatus = {StationStatusA,StationStatusB};
-
-            String startTime = miloService.readFromOpcUa(prefix + "StartTime").getValue().toString();
-            String stopTime = miloService.readFromOpcUa(prefix + "StopTime").getValue().toString();
-            for (int i = 0; i < 2; i++) {
-                DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection();
-                String strt = TimeUtil.stringProcessing(startTime);
-                String end = TimeUtil.stringProcessing(stopTime);
-                daPassingStationCollection.setInboundTime(format.parse(TimeUtil.test(strt)));//鍏ョ珯鏃堕棿
-                daPassingStationCollection.setOutboundTime(format.parse(TimeUtil.test(end)));//鍑虹珯鏃堕棿
-                daPassingStationCollection.setSfcCode(modeles[i]);
-                daPassingStationCollection.setLocationCode(device);
-                daPassingStationCollection.setOutRsSign(StationStatus[i]);//鍑虹珯鏄惁鍚堟牸
-                passingStationCollections.add(daPassingStationCollection);
-            }
-            daPassingStationCollectionService.saveBeachDaPassingStationCollection(passingStationCollections);
+//        String prefix = thoroughfare+"."+device+".";
+//        List<DaPassingStationCollection> passingStationCollections = new ArrayList<>();
+//        String ModuleCodeA = "";
+//        String ModuleCodeB = "";
+//        String StationStatusA = "";
+//        String StationStatusB = "";
+//
+//        Object objectModuleCodeA = miloService.readFromOpcUa(prefix + "ModuleCodeA").getValue();
+//        Object objectModuleCodeB = miloService.readFromOpcUa(prefix + "ModuleCodeB").getValue();
+//        Object objectStationStatusA = miloService.readFromOpcUa(prefix + "StationStatusA").getValue();
+//        Object objectStationStatusB = miloService.readFromOpcUa(prefix + "StationStatusB").getValue();
+//
+//        if(ObjectUtil.isNotNull(objectModuleCodeA) && ObjectUtil.isNotNull(objectStationStatusA) && ObjectUtil.isNotNull(objectModuleCodeB) && ObjectUtil.isNotNull(objectStationStatusB)){
+//            ModuleCodeA = objectModuleCodeA.toString();
+//            ModuleCodeB = objectModuleCodeB.toString();
+//            StationStatusA = objectStationStatusA.toString();
+//            StationStatusB = objectStationStatusB.toString();
+//
+//            String[] modeles = {ModuleCodeA,ModuleCodeB};
+//            String[] StationStatus = {StationStatusA,StationStatusB};
+//
+//            String startTime = miloService.readFromOpcUa(prefix + "StartTime").getValue().toString();
+//            String stopTime = miloService.readFromOpcUa(prefix + "StopTime").getValue().toString();
+//            for (int i = 0; i < 2; i++) {
+//                DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection();
+//                String strt = TimeUtil.stringProcessing(startTime);
+//                String end = TimeUtil.stringProcessing(stopTime);
+//                daPassingStationCollection.setInboundTime(format.parse(TimeUtil.test(strt)));//鍏ョ珯鏃堕棿
+//                daPassingStationCollection.setOutboundTime(format.parse(TimeUtil.test(end)));//鍑虹珯鏃堕棿
+//                daPassingStationCollection.setSfcCode(modeles[i]);
+//                daPassingStationCollection.setLocationCode(device);
+//                daPassingStationCollection.setOutRsSign(StationStatus[i]);//鍑虹珯鏄惁鍚堟牸
+//                passingStationCollections.add(daPassingStationCollection);
+//            }
+//            daPassingStationCollectionService.saveBeachDaPassingStationCollection(passingStationCollections);
             miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build());
-            logger.info("宸ヤ綅{}鍥炲21",device);
-
-        }else {
-            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build());
-        }
+//            logger.info("宸ヤ綅{}鍥炲21",device);
+//
+//        }else {
+//            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build());
+//        }
     }
 
     private static void writeToOpcShort(String identifier, short value) {
diff --git a/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java b/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
index a114020..c1bd0af 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
@@ -84,7 +84,7 @@
      * 瀵煎嚭鐐规浠诲姟鍒楄〃
      */
     @PostMapping("/deviceResultFeedback")
-    public AjaxResult hdy(@RequestBody ParentVO parentVO)
+    public AjaxResult deviceResultFeedback(@RequestBody ParentVO parentVO)
     {
         ObjectMapper mapper = new ObjectMapper();
         List<ChildVO> li = parentVO.getCheckList();
@@ -130,27 +130,25 @@
 
     @GetMapping("/productionWorkOrderRequest")
     public AjaxResult productionWorkOrderRequest(){
-        List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list();
         List<RestFulOrder> restFulOrders = new ArrayList<>();
-        for (OmProductionOrdeInfo omProductionOrdeInfo : list) {
-            RestFulOrder order = new RestFulOrder();
-            order.setProductionOrderNum(omProductionOrdeInfo.getWorkOrderNo());
-            order.setProductNum(omProductionOrdeInfo.getProductNum());
-            order.setMaterialCode(omProductionOrdeInfo.getMaterialCode());
-            order.setStationCode(omProductionOrdeInfo.getStationCode());
-            order.setPlanQty(omProductionOrdeInfo.getPlanQty());
-            order.setCreateTime(format.format(omProductionOrdeInfo.getCreateTime()));
-            restFulOrders.add(order);
-        }
+//        try{
+//            CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
+//                List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list();
+//                for (OmProductionOrdeInfo omProductionOrdeInfo : list) {
+//                    RestFulOrder order = new RestFulOrder();
+//                    order.setProductionOrderNum(omProductionOrdeInfo.getWorkOrderNo());
+//                    order.setProductNum(omProductionOrdeInfo.getProductNum());
+//                    order.setMaterialCode(omProductionOrdeInfo.getMaterialCode());
+//                    order.setStationCode(omProductionOrdeInfo.getStationCode());
+//                    order.setPlanQty(omProductionOrdeInfo.getPlanQty());
+//                    order.setCreateTime(format.format(omProductionOrdeInfo.getCreateTime()));
+//                    restFulOrders.add(order);
+//                }
+//            });
+//        }catch (Exception e){
+//            System.out.println(e.getMessage());
+//        }
         return AjaxResult.success(restFulOrders);
-    }
-
-    public static void main(String[] args) {
-        String str = "0RSPB0011A2E3AE5P0000002  2024-05-28 15:48:51";
-        String[] split = str.split("  ");
-        System.out.println(split[0]);
-        System.out.println(split[1]);
-
     }
 
     @GetMapping("/getQualityData")
@@ -160,22 +158,22 @@
 //        Map<String,Integer> map = new HashMap<>();
 //        map.put("qualified",qualified.size());
 //        map.put("unQualified",unQualified.size());
-        for (BsBeatSetting bsBeatSetting : bsBeatSettingService.list()) {
-            String str = bsBeatSetting.getProductCode();
-            String[] split = str.split("  ");
-            String reportResult = RestfulService.getWorkReportResultFeedback(split[0], "", "2024-06-27 15:48:51");
-            JSONObject jsonObject = new JSONObject(reportResult);
-            String code = jsonObject.getStr("code");
-            String status = jsonObject.getJSONObject("data").getStr("resultCode");
-            if("success".equals(code)&&"S".equals(status)){
-                //濡傛灉鎴愬姛锛屾墽琛屾姤宸ユ垚鍔熸柟娉曪紝淇敼鏄惁鎶ュ伐涓�1锛屾坊鍔犳姤宸ユ椂闂�
-                bsBeatSetting.setProductName("S");
-                this.bsBeatSettingService.saveOrUpdate(bsBeatSetting);
-            }else{
-                bsBeatSetting.setProductName("F");
-                this.bsBeatSettingService.saveOrUpdate(bsBeatSetting);
-            }
-        }
+//        for (BsBeatSetting bsBeatSetting : bsBeatSettingService.list()) {
+//            String str = bsBeatSetting.getProductCode();
+//            String[] split = str.split("  ");
+//            String reportResult = RestfulService.getWorkReportResultFeedback(split[0], "", "2024-06-27 15:48:51");
+//            JSONObject jsonObject = new JSONObject(reportResult);
+//            String code = jsonObject.getStr("code");
+//            String status = jsonObject.getJSONObject("data").getStr("resultCode");
+//            if("success".equals(code)&&"S".equals(status)){
+//                //濡傛灉鎴愬姛锛屾墽琛屾姤宸ユ垚鍔熸柟娉曪紝淇敼鏄惁鎶ュ伐涓�1锛屾坊鍔犳姤宸ユ椂闂�
+//                bsBeatSetting.setProductName("S");
+//                this.bsBeatSettingService.saveOrUpdate(bsBeatSetting);
+//            }else{
+//                bsBeatSetting.setProductName("F");
+//                this.bsBeatSettingService.saveOrUpdate(bsBeatSetting);
+//            }
+//        }
         return AjaxResult.success();
     }
 
@@ -183,50 +181,24 @@
 
     @GetMapping("/productionOrderComponentRequest")
     public AjaxResult productionOrderComponentRequest(BsFormulaChildInfo bsFormulaChildInfo){
-        Map<String,List<String>> map = new HashMap<>();
-        List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>()
-                .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getProcessesCode())
-                .eq(BsFormulaChildInfo::getOperationType, "2")
-        );
         List<ProductionOrderComponentRequest> requests = new ArrayList<>();
-        for (BsFormulaChildInfo info : list) {
-            ProductionOrderComponentRequest request = new ProductionOrderComponentRequest();
-            request.setMaterialCode(info.getMaterialCode());
-            request.setOperationSteps(info.getOperationSteps());
-            requests.add(request);
-        }
+//        try{
+//            CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
+//                List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>()
+//                        .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getProcessesCode())
+//                        .eq(BsFormulaChildInfo::getOperationType, "2")
+//                );
+//                for (BsFormulaChildInfo info : list) {
+//                    ProductionOrderComponentRequest request = new ProductionOrderComponentRequest();
+//                    request.setMaterialCode(info.getMaterialCode());
+//                    request.setOperationSteps(info.getOperationSteps());
+//                    requests.add(request);
+//                }
+//            });
+//        }catch (Exception e){
+//            System.out.println(e.getMessage());
+//        }
         return AjaxResult.success(requests);
-    }
-
-
-    @PostMapping("/pushParamData")
-    public void receivingData(@RequestBody PostEntity postEntity) throws JsonProcessingException {
-//        ObjectMapper objectMapper = new ObjectMapper();
-//        PostEntity person = objectMapper.readValue(postEntity, PostEntity.class);
-
-
-        Class<?> entityClass = PostEntity.class; // 鏇挎崲涓轰綘鐨勫疄浣撶被
-        String packId = postEntity.getPEOL_PackID();
-        OmProductionOrdeInfo one = productionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, packId));
-        String productType = "type";
-        String workOrderNo = one.getWorkOrderNo();
-        for (Field field : entityClass.getDeclaredFields()) {
-            String fieldName = field.getName();
-            DaParamCollection daParamCollection = new DaParamCollection();
-            daParamCollection.setWorkOrderNo(workOrderNo);
-            daParamCollection.setProductCode(productType);
-            daParamCollection.setSfcCode(packId);
-            daParamCollection.setParamCode(field.getName());
-            daParamCollection.setParamValue((String) getFieldValue(postEntity, fieldName));
-            if(fieldName.contains("GDBH")){
-                daParamCollection.setParamValue(workOrderNo);
-            }
-            if(fieldName.contains("CPXH")){
-                daParamCollection.setParamValue(productType);
-            }
-            daParamCollectionService.save(daParamCollection);
-        }
-
     }
 
     /**
@@ -237,51 +209,4 @@
     {
         WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), bsFormulaChildInfo.getResults());
     }
-
-    /**
-     * 浣跨敤鍙嶅皠鑾峰彇瀵硅薄鐨勫睘鎬у��
-     *
-     * @param obj       鐩爣瀵硅薄
-     * @param fieldName 灞炴�у悕
-     * @return 灞炴�у�硷紝濡傛灉鑾峰彇澶辫触鍒欒繑鍥瀗ull
-     */
-    public static Object getFieldValue(Object obj, String fieldName) {
-        if (obj == null) {
-            throw new IllegalArgumentException("Object must not be null");
-        }
-        try {
-            Field field = obj.getClass().getDeclaredField(fieldName);
-            field.setAccessible(true); // 璁剧疆鍙闂�э紝浠ヤ究璁块棶绉佹湁瀛楁
-            return field.get(obj);
-        } catch (NoSuchFieldException e) {
-            // 濡傛灉褰撳墠绫绘病鏈夎瀛楁锛屽垯灏濊瘯浠庣埗绫讳腑鑾峰彇
-            Class<?> superClass = obj.getClass().getSuperclass();
-            if (superClass != null && !superClass.equals(Object.class)) {
-                return getFieldValue(obj, fieldName, superClass);
-            }
-            e.printStackTrace();
-        } catch (IllegalAccessException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    private static Object getFieldValue(Object obj, String fieldName, Class<?> superClass) {
-        try {
-            Field field = superClass.getDeclaredField(fieldName);
-            field.setAccessible(true);
-            return field.get(obj);
-        } catch (NoSuchFieldException e) {
-            // 濡傛灉鐖剁被涔熸病鏈夎瀛楁锛屽垯缁х画鍚戜笂鏌ユ壘
-            Class<?> grandParentClass = superClass.getSuperclass();
-            if (grandParentClass != null && !grandParentClass.equals(Object.class)) {
-                return getFieldValue(obj, fieldName, grandParentClass);
-            }
-            e.printStackTrace();
-        } catch (IllegalAccessException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
 }
diff --git a/jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml b/jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml
index 05bb608..3900c59 100644
--- a/jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml
+++ b/jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml
@@ -29,12 +29,15 @@
         <result property="spareField4"    column="spare_field4"    />
         <result property="collectData"    column="collect_data"    />
         <result property="results"    column="results"    />
+        <result property="ngCollectData"    column="ng_collect_data"    />
+        <result property="ngResults"    column="ng_results"    />
+        <result property="ngTimes"    column="ng_times"    />
         <result property="counts"    column="counts"    />
 
     </resultMap>
 
     <sql id="selectBsFormulaChildInfoVo">
-        select id, workshop_code, line_code, processes_code, product_code, operation_steps, tech_requirement, operation_type, step_sort, param_code, material_code, formula_code, picture, remarks, create_user, create_time, update_user, update_time, spare_field1, spare_field2, spare_field3, spare_field4, collect_data, results from bs_formula_child_info
+        select id, workshop_code, line_code, ng_times,ng_results,ng_results, processes_code, product_code, operation_steps, tech_requirement, operation_type, step_sort, param_code, material_code, formula_code, picture, remarks, create_user, create_time, update_user, update_time, spare_field1, spare_field2, spare_field3, spare_field4, collect_data, results from bs_formula_child_info
     </sql>
 
     <select id="selectBsFormulaChildInfoList" parameterType="BsFormulaChildInfo" resultMap="BsFormulaChildInfoResult">
@@ -89,7 +92,10 @@
             <if test="spareField4 != null">spare_field4,</if>
             <if test="collectData != null">collect_data,</if>
             <if test="results != null">results,</if>
-         </trim>
+            <if test="ngCollectData != null">ng_collect_data,</if>
+            <if test="ngResults != null">ng_results,</if>
+            <if test="ngTimes != null">ng_times,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="workshopCode != null">#{workshopCode},</if>
             <if test="lineCode != null">#{lineCode},</if>
@@ -112,9 +118,12 @@
             <if test="spareField2 != null">#{spareField2},</if>
             <if test="spareField3 != null">#{spareField3},</if>
             <if test="spareField4 != null">#{spareField4},</if>
-            <if test="collectData != null">collect_data,</if>
-            <if test="results != null">results,</if>
-         </trim>
+            <if test="collectData != null">#{collectData},</if>
+            <if test="results != null">#{results},</if>
+            <if test="ngCollectData != null">#{ngCollectData},</if>
+            <if test="ngResults != null">#{ngResults},</if>
+            <if test="ngTimes != null">#{ngTimes},</if>
+        </trim>
     </insert>
 
     <update id="updateBsFormulaChildInfo" parameterType="BsFormulaChildInfo">
@@ -143,6 +152,9 @@
             <if test="spareField4 != null">spare_field4 = #{spareField4},</if>
             <if test="collectData != null">collect_data = #{collectData},</if>
             <if test="results != null">results = #{results},</if>
+            <if test="ngCollectData != null">ng_collect_data = #{ngCollectData},</if>
+            <if test="ngResults != null">ng_results = #{ngResults},</if>
+            <if test="ngTimes != null">ng_times = #{ngTimes},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml b/jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml
index efc2d79..4f1daa3 100644
--- a/jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml
+++ b/jcdm-main/src/main/resources/mapper/om/productionOrde/OmProductionOrdeInfoMapper.xml
@@ -50,11 +50,15 @@
         <result property="resultText"    column="result_text"    />
         <result property="sfResult"    column="sf_result"    />
         <result property="productModel"    column="product_model"    />
+        <result property="automaticNgFlag"    column="automatic_ng_flag"    />
+        <result property="automaticNgStation"    column="automatic_ng_station"    />
+        <result property="automaticNgScrewNumber"    column="automatic_ng_screw_number"    />
+        <result property="artificialNgFlag"    column="artificial_ng_flag"    />
 
     </resultMap>
 
     <sql id="selectOmProductionOrdeInfoVo">
-        select id,site_code,product_num,station_code, product_model,result_code,result_text,sf_result ,work_order_no, sales_order_code, product_code, product_name, workshop_code, line_code, route_code, bom_code, recipe_code, plan_qty, actual_qty, bad_qty, scrap_qty, repair_qty, actual_online_qty, online_completion_mark, demand_date, plan_start_time, plan_end_time, actual_start_time, actual_end_time, serial_number, order_status, create_time, update_time, create_user, update_user, remarks, stream_number, custom, material_code, software_version_code, product_company_code, trolley_yard, spare_field2, spare_field3, spare_field4 from om_production_orde_info
+        select id,site_code,product_num,station_code, product_model,result_code,result_text,sf_result ,work_order_no, sales_order_code, product_code, product_name, workshop_code, line_code, route_code, bom_code, recipe_code, plan_qty, actual_qty, bad_qty, scrap_qty, repair_qty, actual_online_qty, online_completion_mark, demand_date, plan_start_time, plan_end_time, actual_start_time, actual_end_time, serial_number, order_status, create_time, update_time, create_user, update_user, remarks, stream_number, custom, material_code, software_version_code, product_company_code, trolley_yard, spare_field2, spare_field3, spare_field4, automatic_ng_flag, automatic_ng_station, automatic_ng_screw_number, artificial_ng_flag from om_production_orde_info
     </sql>
 
     <select id="selectOmProductionOrdeInfoList" parameterType="OmProductionOrdeInfo" resultMap="OmProductionOrdeInfoResult">
@@ -140,6 +144,10 @@
             <if test="resultCode != null">result_code,</if>
             <if test="sfResult != null">sf_result,</if>
             <if test="productModel != null">product_model,</if>
+            <if test="automaticNgFlag != null">automatic_ng_flag,</if>
+            <if test="automaticNgStation != null">automatic_ng_station,</if>
+            <if test="automaticNgScrewNumber != null">automatic_ng_screw_number,</if>
+            <if test="artificialNgFlag != null">artificial_ng_flag,</if>
 
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -188,6 +196,10 @@
             <if test="resultCode != null">#{resultCode},</if>
             <if test="sfResult != null">#{sfResult},</if>
             <if test="productModel != null">#{productModel},</if>
+            <if test="automaticNgFlag != null">#{automaticNgFlag},</if>
+            <if test="automaticNgStation != null">#{automaticNgStation},</if>
+            <if test="automaticNgScrewNumber != null">#{automaticNgScrewNumber},</if>
+            <if test="artificialNgFlag != null">#{artificialNgFlag},</if>
 
         </trim>
     </insert>
@@ -239,7 +251,10 @@
             <if test="resultCode != null">result_code = #{resultCode},</if>
             <if test="sfResult != null">sf_result = #{sfResult},</if>
             <if test="productModel != null">product_model = #{productModel},</if>
-
+            <if test="automaticNgFlag != null">automatic_ng_flag = #{automaticNgFlag},</if>
+            <if test="automaticNgStation != null">automatic_ng_station = #{automaticNgStation},</if>
+            <if test="automaticNgScrewNumber != null">automatic_ng_screw_number = #{automaticNgScrewNumber},</if>
+            <if test="artificialNgFlag != null">artificial_ng_flag = #{artificialNgFlag},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js b/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
index 1abc42e..3ce8a4b 100644
--- a/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
+++ b/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
@@ -37,6 +37,24 @@
   })
 }
 
+export function unfinishedProcess(query) {
+  return request({
+    url: '/bs/formulaChild/unfinishedProcess',
+    method: 'get',
+    params: query
+
+  })
+}
+
+export function inPlaceInspection(query) {
+  return request({
+    url: '/bs/formulaChild/inPlaceInspection',
+    method: 'get',
+    params: query
+
+  })
+}
+
 // 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛�
 export function fistSetpNumber(query) {
   return request({
@@ -48,6 +66,15 @@
 }
 
 // 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛�
+export function manualNgOffline(query) {
+  return request({
+    url: '/bs/formulaChild/manualNgOffline',
+    method: 'get',
+    params: query
+  })
+}
+
+// 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛�
 export function jrmUpdateResults(query) {
   return request({
     url: '/bs/formulaChild/jrmUpdateResults',
diff --git a/jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue b/jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue
index 87359ce..ae6a172 100644
--- a/jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue
@@ -331,6 +331,7 @@
       },
       content: '',
       activeName: 'first',
+      // url: "ws://192.168.2.248:8080/websocket/message/",
       url: "ws://10.103.210.248:8080/websocket/message/",
       // url: "ws://192.168.2.76:8080/websocket/message/",
       message: "",
@@ -681,9 +682,10 @@
         console.log("涓插彛鏀跺埌鏁版嵁-------------------"+scanValue)
 
         if(this.headContent.module !== ''){
+          this.$message('鎵爜妯$粍鐗╂枡鐮�'+scanValue);
           this.serialPortMethod(scanValue)
         } else {
-          if(scanValue.includes("9900168136")){
+          if(scanValue.includes("ORSM")){
             this.headContent.module = scanValue;
             this.$message('鎵爜璇嗗埆浜у搧搴忓垪鍙�'+scanValue);
             this.getList()
diff --git a/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue b/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
index 4e0e4df..49ea7ba 100644
--- a/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
@@ -263,8 +263,9 @@
       },
       content: '',
       activeName: 'first',
-      url: "ws://10.103.210.248:8080/websocket/message/",
-      // url: "ws://192.168.2.76:8080/websocket/message/",
+      // url: "ws://192.168.2.248:8080/websocket/message/",
+      // url: "ws://10.103.210.248:8080/websocket/message/",
+      url: "ws://192.168.2.76:8080/websocket/message/",
       message: "",
       text_content: "",
       ws: null,
@@ -414,7 +415,7 @@
     },
     clearClick(){
       const param = {
-        productCode: '1P102S',
+        productCode: 'PE01B',
         locationCode: this.headContent.processesCode,
       }
       clearWorkpieceRelease(param).then(response => {});
@@ -542,7 +543,8 @@
                   const param = {
                     locationCode: self.headContent.processesCode,
                     productBarcode: self.headContent.sfcCode,
-                    inboundTime: self.headContent.inboundTime
+                    inboundTime: self.headContent.inboundTime,
+                    productCode: "PE01B"
                   }
                   preInstallOut(param).then(response => {});
                   workpieceRelease(param).then(response => {});
@@ -571,9 +573,14 @@
           console.log(scanValue)
           this.serialPortMethod(scanValue)
         } else {
-          this.headContent.sfcCode = scanValue;
-          this.headContent.inboundTime = this.getCurrentTime();
-          this.getList()
+          if(scanValue.includes("P9900183275") || scanValue.includes("P9900173252")){
+            this.headContent.sfcCode = scanValue;
+            this.headContent.inboundTime = this.getCurrentTime();
+            this.getList()
+          }else {
+            this.$message.error('鎬绘垚鐮佹壂鎻忛敊璇紒');
+          }
+
         }
 
       }
diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index e91c97d..4c35bf7 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -308,10 +308,10 @@
 import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
 import {
   clearWorkpieceRelease,
-  fistSetpNumber,
-  listFormulaChild,
+  fistSetpNumber, inPlaceInspection,
+  listFormulaChild, manualNgOffline,
   noPageListFormulaChild,
-  releaseCheck,
+  releaseCheck, unfinishedProcess,
   updateResults,
   updateTighteningFormula,
   workpieceRelease
@@ -392,8 +392,8 @@
       content: '',
       activeName: 'first',
       // url: "ws://192.168.2.248:8080/websocket/message/",
-      url: "ws://10.103.210.248:8080/websocket/message/",
-      // url: "ws://192.168.2.76:8080/websocket/message/",
+      // url: "ws://10.103.210.248:8080/websocket/message/",
+      url: "ws://192.168.2.76:8080/websocket/message/",
       message: "",
       text_content: "",
       ws: null,
@@ -680,14 +680,11 @@
         }
         this.headContent.processesName = rows.processesName
         this.headContent.processesCode = rows.processesCode
-        if(this.headContent.processesCode === 'OP240'){
-          this.onLineBinDing = true
-        }
-        if(this.headContent.processesCode === 'OP260'){
-          // this.showInput = true
-        }
-
         console.log('璁剧疆宸ヤ綅缂栫爜' + this.headContent.processesCode)
+        inPlaceInspection({processesCode: this.headContent.processesCode}).then(response => {
+          console.log(response)
+          this.cakeLamp.InPlace = response.data
+        });
 
       });
       this.conCom()
@@ -702,13 +699,16 @@
       this.ws.onmessage = function (event) {
         if (event.data === "IN") {
           self.cakeLamp.InPlace = 1;
-          console.log(self.headContent.processesCode);
-          // const param = {
-          //   processesCode: self.headContent.processesCode,
-          // }
-          // fistSetpNumber(param).then(response => {});
-        } else if (event.data === "IN0") {
-          self.cakeLamp.InPlace = 0;
+        } else if (event.data === "NG") {
+          //缁檖lc鍙戜笅绾夸俊鍙�
+          //娓呴櫎鏁版嵁
+          this.$confirm('<span style="font-size: 20px;color: red">鎷х揣瓒呰繃涓夋璇ヤ骇鍝丯G涓嬬嚎锛岃纭锛�</span>', '閫氱煡', {
+            confirmButtonText: '纭畾',
+            type: 'warning'
+          }).then(() => {
+            self.ngFunction();
+          })
+
         } else if (event.data === "OUT") {
           self.cakeLamp.release = 1;
         } else if (event.data === "END") {
@@ -716,12 +716,14 @@
           const formulaChildIndex = self.formulaChildList.length-1
 
           if(self.headContent.sfcCode=== ''||self.headContent.sfcCode=== null){
+            unfinishedProcess({processesCode: self.headContent.processesCode,recordDataDone: 26}).then(response => {});
             self.$message('鎬绘垚鐮佷负绌猴紝璇锋壂鐮侊紒')
             return;
           }
 
           if(self.formulaChildList[formulaChildIndex].results !== 'OK'){
             self.$message('鏈仛瀹屽伐搴忕姝㈡斁琛�');
+            unfinishedProcess({processesCode: self.headContent.processesCode,recordDataDone: 25}).then(response => {});
             return;
           }
 
@@ -736,70 +738,6 @@
 
           console.log("杩涘叆鏈�缁堟柟娉�")
           self.endSaveData(param)
-
-
-          // if(self.headContent.processesCode === "OP260"){
-          //   checkYzSfcCode(orderParam).then(response => {
-          //     if(response.data === 0){
-          //       self.$message('鏈粦瀹氭�绘垚鐮佺姝㈡斁琛�');
-          //       return;
-          //     }else {
-          //       self.endSaveData(param)
-          //       // saveCampaignTimeParameters(param).then(response => {
-          //       //   self.cakeLamp.release = 1;
-          //       //   self.endClear()
-          //       //   workpieceRelease(param).then(response => {});});
-          //     }
-          //   })
-          // }else {
-          //   self.endSaveData(param)
-          //   // saveCampaignTimeParameters(param).then(response => {
-          //   //   self.cakeLamp.release = 1;
-          //   //   self.endClear()
-          //   //   workpieceRelease(param).then(response => {});
-          //   // });
-          // }
-
-          // checkCarCode(orderParam).then(response => {
-          //   console.log(response.data)
-          //   if(response.data === 1){
-          //     if(self.headContent.processesCode === "OP260"){
-          //       checkYzSfcCode(orderParam).then(response => {
-          //         if(response.data === 1){
-          //           saveCampaignTimeParameters(param).then(response => {
-          //             checkRecordDataDone(param).then(response => {
-          //               if(response.msg === "21"){
-          //                 self.cakeLamp.release = 1;
-          //                 self.endClear()
-          //                 workpieceRelease(param).then(response => {});
-          //               }else {
-          //                 self.$message('鏈仛瀹屽伐搴忕姝㈡斁琛�');
-          //               }
-          //             });
-          //           });
-          //         }else {
-          //           self.$message('璇峰厛缁戝畾棰勮鎬绘垚');
-          //         }
-          //       });
-          //     }else {
-          //       saveCampaignTimeParameters(param).then(response => {
-          //         checkRecordDataDone(param).then(response => {
-          //           if(response.msg === "21"){
-          //             self.cakeLamp.release = 1;
-          //             self.endClear()
-          //             workpieceRelease(param).then(response => {});
-          //           }else {
-          //             self.$message('鏈仛瀹屽伐搴忕姝㈡斁琛�');
-          //           }
-          //         });
-          //       });
-          //     }
-          //   }else {
-          //     self.$alert('<strong style="color: red;font-size: 30px">鏈壂鎻忓皬杞︾爜绂佹鏀捐</strong>', '鎻愮ず', {
-          //       dangerouslyUseHTMLString: true
-          //     });
-          //   }
-          // });
         } else if (event.data.includes("[")) {
           let formulaChilds = "";
           self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort);
@@ -830,7 +768,8 @@
             spareField2: formulaChilds.spareField2,
             spareField3: formulaChilds.spareField3,
             spareField4: formulaChilds.spareField4,
-            stepSort: formulaChilds.stepSort
+            stepSort: formulaChilds.stepSort,
+            ngTimes: formulaChilds.ngTimes,
           }
           if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){
             self.$message('鏈壘鍒板弬鏁扮爜锛岃妫�鏌ュ弬鏁扮爜鏄惁姝g‘');
@@ -856,6 +795,17 @@
       });
     },
 
+    ngFunction(){
+      const param = {
+        locationCode: this.headContent.processesCode,
+        sfcBarcode: this.headContent.sfcCode,
+        productCode: this.workpieceInformation.productCode,
+      }
+      manualNgOffline(param).then(response => {});
+      clearWorkpieceRelease(param).then(releaseCheck =>{});
+      this.endClear()
+    },
+
     //鎺ュ彈鏁版嵁鐨勫洖璋�
     callBack(value) {
       if (this.form1.isShowHistory) this.form1.desc = this.readLi().join("");
@@ -869,7 +819,7 @@
           //   this.headContent.yzSfcCode = scanValue
           //   this.bindYzSfc();
           // }else
-          if(scanValue.includes("0RSP1TE") && this.headContent.processesCode === 'POP240'){
+          if(scanValue.includes("0RSP1TE") && this.headContent.processesCode === 'POP230'){
             this.headContent.cardCode = scanValue
             this.bindcardCode(scanValue);
             this.serialPortMethod(scanValue)
@@ -879,7 +829,7 @@
             this.serialPortMethod(scanValue)
           }
         } else {
-          if(this.headContent.processesCode === 'POP240'){
+          if(this.headContent.processesCode === 'POP230'){
             this.headContent.sfcCode = scanValue;
             this.queryParams.productNum = scanValue;
             this.getList()

--
Gitblit v1.9.3