From 930dc44a8c0e7fb61cc18184fa810868328da0ee Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期六, 27 十二月 2025 10:32:43 +0800
Subject: [PATCH] 1.rcs请求wcs放货申请 2.wcs反馈rcs继续执行 3.rcs放货完成,已退出输送线,反馈end到wcs 4.rcs请求wcs取货申请 5.wcs反馈rcs继续执行 6.rcs取货完成,已退出输送线,重置站点工作号和目标站

---
 src/main/java/com/zy/asrs/controller/SiteController.java |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/SiteController.java b/src/main/java/com/zy/asrs/controller/SiteController.java
index e0aba4d..8726646 100644
--- a/src/main/java/com/zy/asrs/controller/SiteController.java
+++ b/src/main/java/com/zy/asrs/controller/SiteController.java
@@ -7,6 +7,7 @@
 import com.zy.asrs.domain.vo.SiteTableVo;
 import com.zy.asrs.entity.BasDevp;
 import com.zy.asrs.service.BasDevpService;
+import com.zy.core.Slave;
 import com.zy.core.cache.MessageQueue;
 import com.zy.core.cache.OutputQueue;
 import com.zy.core.cache.SlaveConnection;
@@ -16,6 +17,7 @@
 import com.zy.core.model.protocol.StaProtocol;
 import com.zy.core.properties.SlaveProperties;
 import com.zy.core.DevpThread;
+import com.zy.core.thread.SiemensDevpThread;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -36,6 +38,21 @@
     private SlaveProperties slaveProperties;
     @Autowired
     private BasDevpService basDevpService;
+
+    @GetMapping("/io/mode/info/site")
+    @ManagerAuth(memo = "鍏ュ嚭搴撴ā寮�")
+    public R ioMode(){
+        List<Map<String, Object>> res = new ArrayList<>();
+        for (DevpSlave devp : slaveProperties.getDevp()) {
+            SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
+            Map<String, Object> map2 = new HashMap<>();
+            map2.put("floor", 2);
+            map2.put("modeVal", devpThread.ioModeOf2F.id);
+            map2.put("modeDesc", devpThread.ioModeOf2F.desc);
+            res.add(map2);
+        }
+        return R.ok().add(res);
+    }
 
     @PostMapping("/table/site")
     @ManagerAuth(memo = "绔欑偣淇℃伅琛�")
@@ -64,7 +81,8 @@
             vo.setEmptyMk(staProtocol.isEmptyMk()?"Y":"N");     // 绌烘澘淇″彿
             vo.setStaNo(staProtocol.getStaNo());                // 鐩爣绔�
 //            vo.setLocType1(staProtocol.isHigh() != staProtocol.isLow() && staProtocol.isLow() ? "浣�" : "楂�");     //楂樹綆搴撲綅
-            vo.setLocType1(devp.getDevNo()==102 ? "楂�" : "浣�");
+            vo.setLocType1(staProtocol.isHigh() ? "楂�" : "浣�");
+            vo.setEmptyOutType(staProtocol.isEmptyOutType() ? "Y" : "N");
         }
         return R.ok().add(list);
     }
@@ -152,6 +170,7 @@
     public R siteDetlUpdate(@RequestParam Integer siteId,
                             @RequestParam Short workNo,
                             @RequestParam Short staNo,
+                            @RequestParam Short palletSize,
                             @RequestParam String pakMk){
         for (DevpSlave devp : slaveProperties.getDevp()) {
             DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
@@ -170,9 +189,13 @@
                     if (staNo != null) {
                         staProtocol.setStaNo(staNo);
                     }
+                    if (palletSize != null) {
+                        staProtocol.setPalletSize(palletSize);
+                    }
                     if (pakMk != null) {
                         staProtocol.setPakMk(pakMk.equals("Y"));
                     }
+
                     boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                     if (result) {
                         return R.ok();
@@ -185,5 +208,19 @@
         return R.error("plc宸叉帀绾�");
     }
 
+    @GetMapping("/site/{siteId}")
+    public R site(@PathVariable("siteId") Integer siteId){
+        List<DevpSlave> devp = slaveProperties.getDevp();
+        for (DevpSlave slave : devp) {
+            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, slave.getId());
+            Map<Integer, StaProtocol> station = devpThread.getStation();
+            StaProtocol staProtocol = station.get(siteId);
+            if (staProtocol == null) {
+                continue;
+            }
+            return R.ok().add(staProtocol);
+        }
+        return R.error();
+    }
 
 }

--
Gitblit v1.9.1