From a759f5fd41414651325494926583843568bac334 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期二, 04 六月 2024 20:42:47 +0800
Subject: [PATCH] -

---
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 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 6d0be5b..8b053a4 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
@@ -20,11 +20,15 @@
 import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
 import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
 import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper;
+import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
 import com.jcdm.main.da.testDeviceInterface.service.IDaTestDeviceInterfaceService;
 import com.jcdm.main.plcserver.util.TimeUtil;
 import com.kangaroohy.milo.model.ReadWriteEntity;
 import com.kangaroohy.milo.service.MiloService;
+import lombok.extern.slf4j.Slf4j;
 import org.aspectj.weaver.loadtime.Aj;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.jcdm.main.bs.formulaChild.mapper.BsFormulaChildInfoMapper;
@@ -40,8 +44,10 @@
  * @date 2023-12-26
  */
 @Service
+@Slf4j
 public class BsFormulaChildInfoServiceImpl extends ServiceImpl<BsFormulaChildInfoMapper,BsFormulaChildInfo> implements IBsFormulaChildInfoService
 {
+    private static final Logger logger = LoggerFactory.getLogger("sys-user");
     @Autowired
     private BsFormulaChildInfoMapper bsFormulaChildInfoMapper;
 
@@ -62,6 +68,9 @@
 
     @Autowired
     private IDaParamCollectionService daParamCollectionService;
+
+    @Autowired
+    private IDaPassingStationCollectionService daPassingStationCollectionService;
 
     Map<String, Session> map = WebSocketUsers.getUsers();
 
@@ -212,6 +221,7 @@
         }
         BsFormulaChildInfo listQuery = new BsFormulaChildInfo();
         listQuery.setParamCode(bsFormulaChildInfo.getParamCode());
+        listQuery.setLocationCode(bsFormulaChildInfo.getLocationCode());
         String paramCode = bsFormulaChildInfo.getTightenTheArray();
         if(paramCode.contains("N")){
             result = "3";
@@ -232,7 +242,8 @@
                 bsFormulaChildInfos.get(0).setResults("OK");
                 bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getTightenTheArray());
                 bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0));
-
+                logger.info("yzUpdateTighteningFormula--鏌ヨ鏉′欢鍙傛暟锛�"+listQuery);
+                logger.info("yzUpdateTighteningFormula--鏌ヨ缁撴灉锛�"+bsFormulaChildInfos.get(0));
                 Integer stepNumber = Integer.valueOf(bsFormulaChildInfos.get(0).getStepSort());
                 try {
                     miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".MStepNumber").value(stepNumber+1).build());
@@ -406,10 +417,6 @@
 
     @Override
     public AjaxResult workpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
-        try {
-            daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
-        }catch (Exception e){
-        }
         List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>()
                 .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode())
                 .eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode()));
@@ -417,6 +424,18 @@
             info.setCollectData("");
             info.setResults("");
             bsFormulaChildInfoService.saveOrUpdate(info);
+        }
+        try {
+            daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
+            String barCode = bsFormulaChildInfo.getProductBarcode();
+            String locationCode = bsFormulaChildInfo.getLocationCode();
+            DaPassingStationCollection passingStationCollectionOne = daPassingStationCollectionService.getOne(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getSfcCode, barCode).eq(DaPassingStationCollection::getLocationCode, locationCode));
+            if (passingStationCollectionOne != null) {
+                passingStationCollectionOne.setOutRsSign("1");
+                passingStationCollectionOne.setOutboundTime(new Date());
+                daPassingStationCollectionService.saveOrUpdate(passingStationCollectionOne);
+            }
+        }catch (Exception e){
         }
         return AjaxResult.success();
     }
@@ -436,6 +455,7 @@
         }
         BsFormulaChildInfo listQuery = new BsFormulaChildInfo();
         listQuery.setParamCode(bsFormulaChildInfo.getParamCode());
+        listQuery.setLocationCode(bsFormulaChildInfo.getLocationCode());
         String paramCode = bsFormulaChildInfo.getTightenTheArray();
         if(paramCode.contains("N")){
             List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery);
@@ -454,6 +474,8 @@
                 bsFormulaChildInfos.get(0).setResults("OK");
                 bsFormulaChildInfos.get(0).setCollectData(bsFormulaChildInfo.getTightenTheArray());
                 bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0));
+                logger.info("鏌ヨ鏉′欢鍙傛暟锛�"+listQuery);
+                logger.info("鏌ヨ缁撴灉锛�"+bsFormulaChildInfos.get(0));
                 Integer stepNumber = Integer.valueOf(bsFormulaChildInfos.get(0).getStepSort());
                 try {
                     miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+bsFormulaChildInfo.getLocationCode()+".MStepNumber").value(stepNumber+1).build());

--
Gitblit v1.9.3