From 2aae2ddd866c3fc88f37c44f69a38f6de076b502 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期五, 12 七月 2024 10:39:55 +0800
Subject: [PATCH] 人工工位未做完工序给plc回22 未扫总成码回26

---
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 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 c1676a3..b93706a 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,6 +5,7 @@
 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.kangaroohy.milo.model.ReadWriteEntity;
@@ -45,6 +46,40 @@
     private MiloService miloService;
 
     /**
+     * 鏈仛瀹屽伐搴忓洖澶峱lc淇″彿
+     */
+    @GetMapping("/unfinishedProcess")
+    public AjaxResult unfinishedProcess(BsFormulaChildInfo bsFormulaChildInfo)
+    {
+        try {
+            String str = "MOZU1."+bsFormulaChildInfo.getProcessesCode()+".RecordDataDone";
+            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(bsFormulaChildInfo.getRecordDataDone()).build());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 鎵爜纭
+     */
+    @GetMapping("/initializedData")
+    public AjaxResult initializedData(BsFormulaChildInfo bsFormulaChildInfo)
+    {
+        String productNum = "";
+        try {
+            String str = "MOZU1."+bsFormulaChildInfo.getLocationCode()+".ModuleCode";
+            Object productNumObject = miloService.readFromOpcUa(str).getValue();
+            if(ObjectUtil.isNotNull(productNumObject)){
+                productNum = productNumObject.toString();
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return AjaxResult.success(productNum);
+    }
+
+    /**
      * 鎵爜纭
      */
     @GetMapping("/fistSetpNumber")

--
Gitblit v1.9.3