From d15f2d6c0eb8abf9c40f30aa729c90bdc1db883f Mon Sep 17 00:00:00 2001
From: lsh <lsh123456>
Date: 星期二, 27 十二月 2022 10:49:26 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   45 +++++++++++++++++++++++++++------------------
 1 files changed, 27 insertions(+), 18 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 3ea5906..4c8e014 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -152,6 +152,15 @@
                     WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
                     if (wrkMast != null) {
                         log.error("宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
+                        if (inSta.getStaNo()==100 || inSta.getStaNo()==108 || inSta.getStaNo()==116){
+                            staProtocol.setWorkNo((short)9999);
+                            staProtocol.setStaNo((short)100);
+                            devpThread.setPakMk(staProtocol.getSiteId(), false);
+                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
+                            if (!result) {
+                                throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
+                            }
+                        }
                         continue;
                     }
 //                    // 鑾峰彇鍏ュ簱閫氱煡妗�
@@ -329,20 +338,20 @@
         for (DevpSlave devp : slaveProperties.getDevp()) {
             // 閬嶅巻鎷f枡鍏ュ簱鍙�
             for (DevpSlave.Sta pickSta : devp.getPickSta()) {
-//                // 鑾峰彇鏉$爜鎵弿浠俊鎭�
-//                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
-//                if (barcodeThread == null) {
-//                    continue;
-//                }
-//                String barcode = barcodeThread.getBarcode();
-//                if(!Cools.isEmpty(barcode)) {
-//                    log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode);
-//                    if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
-//                        continue;
-//                    }
-//                } else {
-//                    continue;
-//                }
+                // 鑾峰彇鏉$爜鎵弿浠俊鎭�
+                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
+                if (barcodeThread == null) {
+                    continue;
+                }
+                String barcode = barcodeThread.getBarcode();
+                if(!Cools.isEmpty(barcode)) {
+                    log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode);
+                    if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
+                        continue;
+                    }
+                } else {
+                    continue;
+                }
 
                 // 鑾峰彇鎷f枡鍏ュ簱绔欎俊鎭�
                 SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
@@ -357,8 +366,8 @@
 //                if (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; }
 
                 if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()) {
-//                    WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
-                    WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
+                    WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
+//                    WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
                     if (wrkMast == null) {
                         // 鏃犳嫞鏂欐暟鎹�
                         continue;
@@ -712,7 +721,7 @@
             CrnCommand crnCommand = new CrnCommand();
             crnCommand.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙�
             crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 宸ヤ綔鍙�
-            crnCommand.setAckFinish((short) 0);  // 浠诲姟瀹屾垚纭浣�
+//            crnCommand.setAckFinish((short) 0);  // 浠诲姟瀹屾垚纭浣�
             crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 浠诲姟妯″紡:  搴撲綅绉昏浆
             crnCommand.setSourcePosX(crnStn.getRow().shortValue());     // 婧愬簱浣嶆帓
             crnCommand.setSourcePosY(crnStn.getBay().shortValue());     // 婧愬簱浣嶅垪
@@ -860,7 +869,7 @@
                     CrnCommand crnCommand = new CrnCommand();
                     crnCommand.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙�
                     crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 宸ヤ綔鍙�
-                    crnCommand.setAckFinish((short) 0);  // 浠诲姟瀹屾垚纭浣�
+//                    crnCommand.setAckFinish((short) 0);  // 浠诲姟瀹屾垚纭浣�
                     crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 浠诲姟妯″紡:  搴撲綅绉昏浆
                     crnCommand.setSourcePosX(sourceSta.getRow1().shortValue());     // 婧愬簱浣嶆帓
                     crnCommand.setSourcePosY(sourceSta.getBay1().shortValue());     // 婧愬簱浣嶅垪

--
Gitblit v1.9.1