From 616068b49ed7ca709877a30d8abc56ecb6454218 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期六, 14 九月 2024 21:00:30 +0800
Subject: [PATCH] 230优化

---
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 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 8b0121b..4dfcc1e 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
@@ -10,6 +10,8 @@
 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;
@@ -43,6 +45,9 @@
 {
     @Autowired
     private IBsFormulaChildInfoService bsFormulaChildInfoService;
+
+    @Autowired
+    private IOmProductionOrdeInfoService omProductionOrdeInfoService;
 
     @Autowired
     private MiloService miloService;
@@ -113,11 +118,13 @@
             String str = thoroughfare+"."+bsFormulaChildInfo.getProcessesCode()+".MESScrew";
             miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(stepNumber).build());//鎷х揣姝ラ
             if("OP230".equals(bsFormulaChildInfo.getProcessesCode())){
+                List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().like(OmProductionOrdeInfo::getProductNum, bsFormulaChildInfo.getSfcBarcode()));
+                String sfcCode = list.get(0).getProductNum();
                 //鎵�鏈夎繘绔欏皢杩涚珯鏃堕棿鍐欑粰PLC
                 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                 String currentDate = dateFormat.format(new Date());
                 miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".StartTime").value(currentDate).build());
-                miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".SNCode").value(bsFormulaChildInfo.getSfcBarcode()).build());
+                miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".SNCode").value(sfcCode).build());
                 miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".RecordDataDone").value(11).build());
             }else if("OP220".equals(bsFormulaChildInfo.getProcessesCode())){
                 miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".RecordDataDone").value(11).build());

--
Gitblit v1.9.3