From 62e2362ad2d62678712e3a40c5d611ddc9cd95f0 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期五, 26 九月 2025 09:30:26 +0800
Subject: [PATCH] 1

---
 src/main/java/com/zy/asrs/controller/CrnController.java |   84 +++++++++++++++++++++++------------------
 1 files changed, 47 insertions(+), 37 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/CrnController.java b/src/main/java/com/zy/asrs/controller/CrnController.java
index 95052a6..abfdd84 100644
--- a/src/main/java/com/zy/asrs/controller/CrnController.java
+++ b/src/main/java/com/zy/asrs/controller/CrnController.java
@@ -35,6 +35,7 @@
 import com.zy.core.model.protocol.CrnProtocol;
 import com.zy.core.properties.SlaveProperties;
 import com.zy.core.properties.SystemProperties;
+import com.zy.core.thread.RgvThread;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -126,6 +127,9 @@
             vo.setForkOffset(crnProtocol.getForkPosType().desc);    // 璐у弶浣嶇疆
             vo.setLiftPos(crnProtocol.getLiftPosType().desc);
             vo.setWalkPos(crnProtocol.getWalkPos()==1?"涓嶅湪瀹氫綅":"鍦ㄥ畾浣�");
+            if(crnProtocol.getAlarm() == 10){
+                crnProtocol.setAlarm((short) 0);
+            }
             vo.setWarnCode(String.valueOf(crnProtocol.getAlarm()));
             if (crnProtocol.getAlarm() > 0) {
                 BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm());
@@ -234,43 +238,43 @@
     /************************** 鎵嬪姩鎿嶄綔 ******************************/
     /****************************************************************/
 
-    @ManagerAuth(memo = "鍏ュ簱")
-    @PostMapping("/operator/put")
-    public R crnPut(CrnOperatorParam param){
-        CrnCommand command = new CrnCommand();
-        command.setCrnNo(param.getCrnNo()); // 鍫嗗灈鏈虹紪鍙�
-        command.setTaskNo((short) 0); // 宸ヤ綔鍙�
-        command.setAckFinish((short) 0);  // 浠诲姟瀹屾垚纭浣�
-        command.setTaskMode(CrnTaskModeType.PAKIN); // 浠诲姟妯″紡
-        command.setSourcePosX(param.getSourceRow());     // 婧愬簱浣嶆帓
-        command.setSourcePosY(param.getSourceBay());     // 婧愬簱浣嶅垪
-        command.setSourcePosZ(param.getSourceLev());     // 婧愬簱浣嶅眰
-        command.setDestinationPosX(param.getRow());     // 鐩爣搴撲綅鎺�
-        command.setDestinationPosY(param.getBay());     // 鐩爣搴撲綅鍒�
-        command.setDestinationPosZ(param.getLev());     // 鐩爣搴撲綅灞�
-        boolean locSts = isLocSts(param.getRow().toString(), param.getBay().toString(), param.getLev().toString());
-        command.setTraySize(locSts);
-        return crnControl(command)?R.ok():R.error();
-    }
+//    @ManagerAuth(memo = "鍏ュ簱")
+//    @PostMapping("/operator/put")
+//    public R crnPut(CrnOperatorParam param){
+//        CrnCommand command = new CrnCommand();
+//        command.setCrnNo(param.getCrnNo()); // 鍫嗗灈鏈虹紪鍙�
+//        command.setTaskNo((short) 0); // 宸ヤ綔鍙�
+//        command.setAckFinish((short) 0);  // 浠诲姟瀹屾垚纭浣�
+//        command.setTaskMode(CrnTaskModeType.PAKIN); // 浠诲姟妯″紡
+//        command.setSourcePosX(param.getSourceRow());     // 婧愬簱浣嶆帓
+//        command.setSourcePosY(param.getSourceBay());     // 婧愬簱浣嶅垪
+//        command.setSourcePosZ(param.getSourceLev());     // 婧愬簱浣嶅眰
+//        command.setDestinationPosX(param.getRow());     // 鐩爣搴撲綅鎺�
+//        command.setDestinationPosY(param.getBay());     // 鐩爣搴撲綅鍒�
+//        command.setDestinationPosZ(param.getLev());     // 鐩爣搴撲綅灞�
+//        boolean locSts = isLocSts(param.getRow().toString(), param.getBay().toString(), param.getLev().toString());
+//        command.setTraySize(locSts);
+//        return crnControl(command)?R.ok():R.error();
+//    }
 
-    @ManagerAuth(memo = "鍑哄簱")
-    @PostMapping("/operator/take")
-    public R crnTake(CrnOperatorParam param){
-        CrnCommand command = new CrnCommand();
-        command.setCrnNo(param.getCrnNo()); // 鍫嗗灈鏈虹紪鍙�
-        command.setTaskNo((short) 0); // 宸ヤ綔鍙�
-        command.setAckFinish((short) 0);  // 浠诲姟瀹屾垚纭浣�
-        command.setTaskMode(CrnTaskModeType.PAKOUT); // 浠诲姟妯″紡
-        command.setSourcePosX(param.getSourceRow());     // 婧愬簱浣嶆帓
-        command.setSourcePosY(param.getSourceBay());     // 婧愬簱浣嶅垪
-        command.setSourcePosZ(param.getSourceLev());     // 婧愬簱浣嶅眰
-        command.setDestinationPosX(param.getRow());     // 鐩爣搴撲綅鎺�
-        command.setDestinationPosY(param.getBay());     // 鐩爣搴撲綅鍒�
-        command.setDestinationPosZ(param.getLev());     // 鐩爣搴撲綅灞�
-        boolean locSts = isLocSts(param.getSourceRow().toString(), param.getSourceBay().toString(), param.getSourceLev().toString());
-        command.setTraySize(locSts);
-        return crnControl(command)?R.ok():R.error();
-    }
+//    @ManagerAuth(memo = "鍑哄簱")
+//    @PostMapping("/operator/take")
+//    public R crnTake(CrnOperatorParam param){
+//        CrnCommand command = new CrnCommand();
+//        command.setCrnNo(param.getCrnNo()); // 鍫嗗灈鏈虹紪鍙�
+//        command.setTaskNo((short) 0); // 宸ヤ綔鍙�
+//        command.setAckFinish((short) 0);  // 浠诲姟瀹屾垚纭浣�
+//        command.setTaskMode(CrnTaskModeType.PAKOUT); // 浠诲姟妯″紡
+//        command.setSourcePosX(param.getSourceRow());     // 婧愬簱浣嶆帓
+//        command.setSourcePosY(param.getSourceBay());     // 婧愬簱浣嶅垪
+//        command.setSourcePosZ(param.getSourceLev());     // 婧愬簱浣嶅眰
+//        command.setDestinationPosX(param.getRow());     // 鐩爣搴撲綅鎺�
+//        command.setDestinationPosY(param.getBay());     // 鐩爣搴撲綅鍒�
+//        command.setDestinationPosZ(param.getLev());     // 鐩爣搴撲綅灞�
+//        boolean locSts = isLocSts(param.getSourceRow().toString(), param.getSourceBay().toString(), param.getSourceLev().toString());
+//        command.setTraySize(locSts);
+//        return crnControl(command)?R.ok():R.error();
+//    }
 
     @ManagerAuth(memo = "搴撲綅杞Щ")
     @PostMapping("/operator/stockMove")
@@ -293,6 +297,7 @@
         if (sourceLoc.getLocType1() != loc.getLocType1()){
             return R.error("搴撲綅绫诲瀷涓嶄竴鑷�");
         }
+        command.setTraySize(loc.getLocType1() == 2);
 //        VersionUtils.locMoveCheckLocType(sourceLoc, loc);
         return crnControl(command)?R.ok():R.error();
     }
@@ -382,6 +387,8 @@
         command.setDestinationPosZ((short) 0);     // 鐩爣搴撲綅灞�
         return crnControl(command)?R.ok():R.error();
     }
+
+
 
 //    @ManagerAuth(memo = "鏆傚仠")
 //    @PostMapping("/operator/pause")
@@ -509,7 +516,10 @@
     }
 
     private boolean isLocSts(String row,String bay,String lev){
-        String loc = String.format("%2d",row)+String.format("%3d",bay)+String.format("%2d",lev);
+        int rowInt = Integer.parseInt(row);
+        int bayInt = Integer.parseInt(bay);
+        int levInt = Integer.parseInt(lev);
+        String loc = String.format("%2d",rowInt)+String.format("%3d",bayInt)+String.format("%2d",levInt);
         LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", loc));
         if (Cools.isEmpty(locMast)){
             return false;

--
Gitblit v1.9.1