From 4871bcf8e6850a4a665c76b1be1fcea67907d9aa Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期一, 04 八月 2025 16:20:11 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index ba7eda3..0298d74 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -97,6 +97,8 @@
 
     @Value("${wms.url}")
     private String wmsUrl;
+    @Value("${inventory.number}")
+    private Integer inventoryNumber;
 
     public Integer wrkNo = 10000;
 
@@ -737,7 +739,7 @@
                 } else {
                     staProtocol = staProtocol.clone();
                 }
-                if (staProtocol.isAutoing() ) {
+                if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == null)) {
                     // 鏌ヨ宸ヤ綔妗�
                     WrkMast wrkMast = wrkMastMapper.selectPakOutStep2(staProtocol.getSiteId());
                     if (wrkMast == null) {
@@ -1076,6 +1078,12 @@
                 if (wrkMast == null) {
                     continue;
                 }
+                if (wrkMast.getIoType() == 107){
+                    int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("io_type", wrkMast.getIoType()).eq("wrk_sts", 14));
+                    if (count >= inventoryNumber) {
+                        continue;
+                    }
+                }
                 // 宸ヤ綔妗g姸鎬佸垽鏂�
                 if (wrkMast.getIoType() < 100 || wrkMast.getSourceStaNo() == null) {
                     News.error(""+mark+" - 2"+" - 1"+" - 鏌ヨ宸ヤ綔妗f暟鎹笉绗﹀悎鏉′欢--鍏ュ嚭绫诲瀷/绔欑偣, 宸ヤ綔鍙�={}锛屾簮搴撲綅={}锛屽叆鍑虹被鍨�={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getIoType());
@@ -1113,8 +1121,16 @@
 //                    continue;
                 }
                 // 鍒ゆ柇鍫嗗灈鏈哄嚭搴撶珯鐘舵��
-                if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")
-                        && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
+//                if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")
+//                        && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
+
+                if (staProtocol.isAutoing() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")
+                        ) {
+                    if (slave.getId() == 1 || slave.getId() == 2){
+                        if (staProtocol.isLoading() || staProtocol.getWorkNo() != 0 || !staProtocol.isOutEnable()){
+                            continue;
+                        }
+                    }
                     // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
 
                     // 鍫嗗灈鏈烘帶鍒惰繃婊�
@@ -1983,7 +1999,7 @@
             wrkMast.setCrnNo(crn.getId());
             wrkMast.setSourceLocNo(shallowLoc.getLocNo()); // 婧愬簱浣�
             wrkMast.setLocNo(loc.getLocNo()); // 鐩爣搴撲綅
-            wrkMast.setFullPlt(shallowLoc.getFullPlt()); // 婊℃澘
+            wrkMast.setFullPlt(shallowLoc.getLocSts().equals("F") ? "Y" : "N"); // 婊℃澘
             wrkMast.setPicking("N"); // 鎷f枡
             wrkMast.setExitMk("N"); // 閫�鍑�
             wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("D") ? "Y" : "N"); // 绌烘澘
@@ -2279,7 +2295,7 @@
     public synchronized void autoEmptyOut() {
         SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
         List<Integer> list = new ArrayList<>();
-        list.add(101);list.add(112);
+        list.add(1108);list.add(112);
         Map<Integer,Integer> map = new HashMap<>();
         map.put(101,102);map.put(112,111);
         for (Integer site:list){
@@ -2335,7 +2351,7 @@
     public synchronized void autoEmptyIn() {
         SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
         List<Integer> list = new ArrayList<>();
-        list.add(153);list.add(157);
+        list.add(1038);
         for (Integer site:list){
             StaProtocol staProtocol = devpThread.getStation().get(site);
             if (staProtocol == null) {
@@ -2489,6 +2505,15 @@
         }
     }
 
+//    /**
+//     *  鑷姩鐢熸垚RGV鎺ラ┏浠诲姟
+//     */
+//    public synchronized  void rgvCreateWrkMastSta(){
+//        try{
+//
+//        }
+//    }
+
 
     /**
      *  瀹屾垚灏忚溅浠诲姟

--
Gitblit v1.9.1