From 83def9d705c2883cc3a50f7ffeff5596b43fe437 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期五, 14 二月 2025 14:08:17 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/asrs/controller/MonitorController.java |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/MonitorController.java b/src/main/java/com/zy/asrs/controller/MonitorController.java
index 0a845fc..6e9fcdf 100644
--- a/src/main/java/com/zy/asrs/controller/MonitorController.java
+++ b/src/main/java/com/zy/asrs/controller/MonitorController.java
@@ -17,9 +17,11 @@
 import com.zy.core.model.LedSlave;
 import com.zy.core.model.command.LedCommand;
 import com.zy.core.model.protocol.CrnProtocol;
+import com.zy.core.model.protocol.StaProtocol;
 import com.zy.core.properties.SlaveProperties;
 import com.zy.core.thread.BarcodeThread;
 import com.zy.core.thread.LedThread;
+import com.zy.core.thread.SiemensDevpThread;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -47,12 +49,25 @@
      */
     @PostMapping("/barcode/two")
     public R barcodeTwo(@RequestParam Integer palletizingNo) {
+        Date now = new Date();
 
         String barcode = "";
         for (DevpSlave devp : slaveProperties.getDevp()) {
             // 閬嶅巻鍏ュ簱鍙�
             for (DevpSlave.Sta inSta : devp.getDriveSta()) {
                 if (inSta.getStaNo().equals(palletizingNo)){
+                    SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2);
+                    StaProtocol staProtocol = devpThread.getStation().get(inSta);
+                    if (staProtocol == null) {
+                        continue;
+                    } else {
+                        staProtocol = staProtocol.clone();
+                    }
+
+                    if (!staProtocol.isAutoing() || !staProtocol.isLoading() || staProtocol.getWorkNo() != 0 || !staProtocol.isPakMk()){
+                        return R.error("鏈氨缁紒锛侊紒");
+                    }
+
                     // 鑾峰彇鏉$爜鎵弿浠俊鎭�
                     BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
                     if (barcodeThread == null) {
@@ -71,10 +86,6 @@
                 }
             }
         }
-
-
-
-        Date now = new Date();
 //        Calendar calendar = Calendar.getInstance();
 //        calendar.setTime(now);
         return R.ok(

--
Gitblit v1.9.1