From df407d0f867f5063895be21fde14963b0ae4776e Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期二, 10 三月 2026 15:01:20 +0800
Subject: [PATCH] 电视机显示出库运行状态;空托盘入库

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   92 ++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 85 insertions(+), 7 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 13af51d..8e0f034 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -171,11 +171,46 @@
                         News.error("" + mark + " - 4" + " - 宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 3.寮�濮嬫墽琛屽叆搴撲换鍔� 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
 
                         // led 寮傚父鏄剧ず
-                        if (ledThread != null) {
-                            String errorMsg = "宸ヤ綔妗e凡瀛樺湪璇ユ潯鐮佸彿===>>" + barcode;
-                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
+//                        if (ledThread != null) {
+//                            String errorMsg = "宸ヤ綔妗e凡瀛樺湪璇ユ潯鐮佸彿===>>" + barcode;
+//                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
+//                        }
+                        LiftProtocol liftProtocol = devpThread.getLiftStatus();
+
+                        if (liftProtocol == null) {
+                            continue;
                         }
-                        continue;
+                        if (liftProtocol.getMode() != 1) {
+                            continue;
+                        }
+                        if (liftProtocol.getDeviceStatus() != 0) {
+                            continue;
+                        }
+                        if (liftProtocol.getWorkNo() > 0) {
+                            continue;
+                        }
+
+                        Integer staNo = Utils.getStaNoByLocNo(wrkMast.getLocNo());
+
+                        LiftCommand command = new LiftCommand();
+                        command.setWorkNo(wrkMast.getWrkNo());
+                        command.setSourceStaNo(inSta.getStaNo());
+                        command.setTargetStaNo(staNo);
+
+                        barcodeThread.setBarcode("");
+
+                        boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, command));
+                        if (result) {
+                            News.info("WCS--->PLC涓嬪彂浠诲姟鎴愬姛:{}",command.toString());
+                        }
+                        if (!result) {
+                            throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
+                        }
+
+                        wrkMast.setWrkSts(3L);// 3.璁惧鎵ц涓�
+                        wrkMast.setCrnStrTime(new Date());
+                        wrkMastService.updateById(wrkMast);
+                        break;
                     }
 
                     LiftProtocol liftProtocol = devpThread.getLiftStatus();
@@ -458,6 +493,7 @@
 
         //妫�娴嬪嚭搴撶珯鏄惁鍙嚭
         StaProtocol staProtocol = devpThread.getStation().get(100);
+        StaProtocol staProtocol101 = devpThread.getStation().get(101);
         if (staProtocol == null) {
             return;
         }
@@ -467,6 +503,18 @@
         }
 
         if (staProtocol.isLoading()) {
+            return;
+        }
+
+        if (staProtocol101 == null){
+            return;
+        }
+
+        if (staProtocol101.isLoading()){
+            return;
+        }
+
+        if (!staProtocol101.isAutoing()){
             return;
         }
 
@@ -821,7 +869,7 @@
                                     , wrkDetl.getKpCstmrName()
                                     , wrkDetl.getOrderNo()
                                     , wrkDetl.getBatch()
-//                                , wrkDetl.getCstateid$()
+                                    , locNo
                             ));
                         }
                     } else {
@@ -855,7 +903,7 @@
                                         , wrkDetlLog.getKpCstmrName()
                                         , wrkDetlLog.getOrderNo()
                                         , wrkDetlLog.getBatch()
-//                                    , wrkDetlLog.getCstateid$()
+                                        , locNo
                                 ));
                             }
                         }
@@ -925,6 +973,16 @@
                 // 鑾峰彇鍙夎溅绔欑偣
                 StaProtocol staProtocol = devpThread.getStation().get(staNo);
                 StaProtocol staProtocol1 = devpThread.getStation().get(122);
+                WrkMast wrkMastOut = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 12).eq("sta_no",staNo));
+                WrkMast wrkMastIn = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 3).eq("source_sta_no", staNo));
+                if (!Cools.isEmpty(wrkMastOut)){
+                    reset = false;
+                    continue;
+                }
+                if (!Cools.isEmpty(wrkMastIn)){
+                    reset = false;
+                    continue;
+                }
                 if (staProtocol == null) {
                     continue;
                 }
@@ -1036,7 +1094,8 @@
                             wrkDetl.getSupp(),
                             wrkDetl.getKpCstmrName(),
                             wrkDetl.getOrderNo(),
-                            wrkDetl.getBatch()
+                            wrkDetl.getBatch(),
+                            locNo
                     ));
                 }
             }
@@ -1090,4 +1149,23 @@
             }
         }
     }
+
+    public void deviceRunning(int mark) {
+        for (LedSlave led : slaveProperties.getLed()){
+            // 鍛戒护闆嗗悎
+            List<LedCommand> commands = new ArrayList<>();
+            WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 12));
+            if (Cools.isEmpty(wrkMast)){
+                return;
+            }
+            // 鑾峰彇LED绾跨▼
+            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
+
+            if (ledThread == null) {
+                News.error("鏈壘鍒癓ED绾跨▼锛歔id锛歿}]", led.getId());
+                continue;
+            }
+            MessageQueue.offer(SlaveType.Led, led.getId(), new Task(5, "璁惧鍑哄簱浠诲姟杩愯涓�"));
+        }
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.1