From 02e5449fc0e582a1d3bbd160f6557218eca013b0 Mon Sep 17 00:00:00 2001
From: pjb <123456>
Date: 星期二, 02 七月 2024 12:44:12 +0800
Subject: [PATCH] 修改led显示

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   47 +++++++++++++++++++++++++----------------------
 1 files changed, 25 insertions(+), 22 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 68c88ca..976588f 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -210,22 +210,24 @@
                         }
                     }
                     if (wrkMast != null) {
-//                        News.warn(""+mark+" - 4"+" - 宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
-//                        if (devp.getId() == 2) {
+                        News.warn(""+mark+" - 4"+" - 婊℃墭鐩樺叆搴撳伐浣滄。涓凡瀛樺湪璇ョ珯鐘舵�佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
+                        if (devp.getId() == 2) {
 //                            staProtocol.setWorkNo((short)9999);
 //                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
-//                            devpThread.setPakMk(staProtocol.getSiteId(), false);
-//                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
-//                            if (!result) {
-//                                throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
-//                            }
-//                        }
-//
-//                        // led 寮傚父鏄剧ず
-//                        if (ledThread != null) {
-//                            String errorMsg = "宸ヤ綔妗e凡瀛樺湪璇ユ潯鐮佸彿===>>" + barcode;
+                            staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue());
+                            staProtocol.setStaNo(wrkMast.getStaNo().shortValue());
+                            devpThread.setPakMk(staProtocol.getSiteId(), false);
+                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
+                            if (!result) {
+                                throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
+                            }
+                        }
+
+                        // led 寮傚父鏄剧ず
+                        if (ledThread != null) {
+                            String errorMsg = "宸ヤ綔妗e凡瀛樺湪璇ユ潯鐮佸彿===>>" + barcode;
 //                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
-//                        }
+                        }
                         continue;
                     }
 
@@ -275,9 +277,9 @@
                                 ledCommand.setBarcode(barcode);
                                 commands.add(ledCommand);
                                 if (devp.getId() == 1) {
-                                     if (MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(1, commands))){
-                                         ledThread.setLedMk(false);
-                                     }
+//                                     if (MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(1, commands))){
+//                                         ledThread.setLedMk(false);
+//                                     }
                                 } else {
                                     if (MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands))){
                                         ledThread.setLedMk(false);
@@ -286,7 +288,7 @@
 //                                ledThread.errorReset();
                             }
                         } else {
-                            News.error(""+mark+" - 5"+" - 璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
+                            News.error(""+mark+" - 5"+" - 婊℃澘鍏ュ簱璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
                             if(devp.getId() == 2) {
                                 staProtocol.setWorkNo((short)9999);
                                 staProtocol.setStaNo(inSta.getBackSta().shortValue());
@@ -536,9 +538,9 @@
                     ledCommand.setMatDtos(matDtos);
                     commands.add(ledCommand);
                     if (devp.getId() == 1) {
-                        if (MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(1, commands))) {
-                            ledThread.setLedMk(false);
-                        }
+//                        if (MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(1, commands))) {
+//                            ledThread.setLedMk(false);
+//                        }
                     } else {
                         if (MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(3, commands))){
                             ledThread.setLedMk(false);
@@ -1602,12 +1604,13 @@
                                 ledCommand.setMatDtos(matDtos);
                                 commands.add(ledCommand);
                                 if (devp.getId() == 1) {
-                                    MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(1, commands));
+//                                    MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(1, commands));
                                 } else {
                                     MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(3, commands));
                                 }
 //                                ledThread.errorReset();
                             }
+                            Thread.sleep(500);
                         } else {
                             staProtocol.setWorkNo((short)9991);
                             staProtocol.setStaNo((short)100);
@@ -1624,7 +1627,7 @@
                                     MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(5, errorMsg));
                                 }
                             }
-                            News.error(""+mark+" - 3"+" - 璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
+                            News.error(""+mark+" - 3"+" - 绌烘澘鍏ュ簱璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
                         }
                     } catch (Exception e) {
                         e.printStackTrace();

--
Gitblit v1.9.1