From c5e9c5922da7de2bf6df6dce42e7162dbe5cdd2d Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期五, 12 四月 2024 13:21:26 +0800
Subject: [PATCH] -

---
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 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 7f64c48..4f21d59 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
@@ -145,8 +145,10 @@
         return bsFormulaChildInfoMapper.releaseCheck(bsFormulaChildInfo);
     }
 
+    //1-闈炴湰宸ヤ綅鐗╂枡 2-姝e父鎵弿鍙户缁笅娆� 3-鎵弿缁撴潫宸茬粡鏄渶鍚庝竴浣嶅伐姝�
     @Override
     public AjaxResult updateResults(BsFormulaChildInfo bsFormulaChildInfo) {
+        String result = "";
         BsFormulaChildInfo checkInfo = new BsFormulaChildInfo();
         checkInfo.setProcessesCode(bsFormulaChildInfo.getLocationCode());
         checkInfo.setProductCode(bsFormulaChildInfo.getProductCode());
@@ -154,6 +156,7 @@
 //        bsFormulaChildInfo.setMaterialCode(bsFormulaChildInfo.getScanBarcode().substring(1,2));
         List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(checkInfo);
         if(bsFormulaChildInfos.size()>0){
+            String spareField4 = bsFormulaChildInfos.get(0).getSpareField4();
             bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getScanBarcode());
             bsFormulaChildInfos.get(0).setResults("OK");
             bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0));
@@ -161,10 +164,21 @@
             bsFormulaChildInfo.setParamCode(bsFormulaChildInfos.get(0).getParamCode());
             bsFormulaChildInfo.setSfcBarcode(bsFormulaChildInfo.getSfcBarcode());
             addParameterCollection(bsFormulaChildInfo);
+            if (spareField4 != null && !spareField4.isEmpty()) {
+                // 鎵ц鎿嶄綔
+                if(bsFormulaChildInfos.get(0).getSpareField4().equals("1")){
+                    try {
+                        result = "3";
+                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".RecordDataDone").value(21).build());
+                    } catch (Exception e) {
+                        throw new RuntimeException(e);
+                    }
+                }
+            }
         }else {
-            return AjaxResult.error("闈炴湰宸ヤ綅鐗╂枡锛岃閲嶆柊鎵弿");
+            result = "1";
         }
-        return AjaxResult.success("鎴愬姛");
+        return AjaxResult.success(result);
     }
 
     public void addParameterCollection(BsFormulaChildInfo bsFormulaChildInfo){

--
Gitblit v1.9.3