From 96c02a0f71f1f42db5f235bc380103bb667ba30a Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期一, 09 十二月 2024 15:53:05 +0800
Subject: [PATCH] wcs调试修改

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   49 ++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 36 insertions(+), 13 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 6a7a9fb..f2e9c42 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -270,7 +270,7 @@
                         param.setLocType1(locTypeDto.getLocType1());
                         if (inSta.getStaNo() == 102) {
                             param.setLocType2((short) 3);
-                        } else if (inSta.getStaNo() == 211) {
+                        } else if (inSta.getStaNo() == 211 || inSta.getStaNo() == 104) {
                             param.setLocType1((short) 5);
                             param.setLocType2((short) 4);
                         } else if (inSta.getStaNo() == 201) {
@@ -310,16 +310,17 @@
                             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 = jsonObject.getString("msg");
                                 MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
                             }
+                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
+                            if (!result) {
+                                throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
+                            }
+
+
                         }
 
                     } catch (Exception e) {
@@ -417,10 +418,20 @@
                     staProtocol = staProtocol.clone();
                 }
 
-                if (barcodeThread == null) {
+                String barcode = "";
+                if (barcodeThread == null && staProtocol.getSiteId() != 104) {
                     continue;
+                } else if (staProtocol.getSiteId() == 104) {
+                    if (staProtocol.getWorkNo() == 9996) {
+                        // 鑾峰彇鍒版嫞鏂欎换鍔$殑鎵樼洏鐮�
+                        WrkMast wrkMast = wrkMastMapper.selectOne(new QueryWrapper<WrkMast>().eq("wrk_sts", 14).eq("io_type", 103).eq("source_sta_no", 104));
+                        if (wrkMast != null) {
+                            barcode = wrkMast.getBarcode();
+                        }
+                    }
+                } else {
+                    barcode = barcodeThread.getBarcode();
                 }
-                String barcode = barcodeThread.getBarcode();
                 // 灏哄妫�娴嬪紓甯�
                 boolean back = false;
                 String errMsg = "";
@@ -909,6 +920,9 @@
                 crnCommand.setDestinationPosXTwo(locMast.getRow1().shortValue());     // 鐩爣搴撲綅鎺�
                 crnCommand.setDestinationPosYTwo(locMast.getBay1().shortValue());     // 鐩爣搴撲綅鍒�
                 crnCommand.setDestinationPosZTwo(locMast.getLev1().shortValue());     // 鐩爣搴撲綅灞�
+                if (crnStn.getStaNo() == 202) {
+                    crnCommand.setSourcePosYTwo((short) 6);     // 婧愬簱浣嶅垪
+                }
             } else {
                 if (workMode == 1) {
                     crnCommand.setTaskMode(CrnTaskModeType.PAKIN);
@@ -921,6 +935,9 @@
                 crnCommand.setDestinationPosX(locMast.getRow1().shortValue());     // 鐩爣搴撲綅鎺�
                 crnCommand.setDestinationPosY(locMast.getBay1().shortValue());     // 鐩爣搴撲綅鍒�
                 crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 鐩爣搴撲綅灞�
+                if (workMode == 1 && crnStn.getStaNo() == 202) {
+                    crnCommand.setSourcePosY((short) 6);     // 婧愬簱浣嶅垪
+                }
             }
 //            crnCommand.setAckFinish((short) 0);  // 浠诲姟瀹屾垚纭浣�
 
@@ -1087,6 +1104,9 @@
                         crnCommand.setDestinationPosXTwo(crnStn.getRow().shortValue());     // 鐩爣搴撲綅鎺�
                         crnCommand.setDestinationPosYTwo(crnStn.getBay().shortValue());     // 鐩爣搴撲綅鍒�
                         crnCommand.setDestinationPosZTwo(crnStn.getLev().shortValue());     // 鐩爣搴撲綅灞�
+                        if (crnStn.getStaNo() == 202) {
+                            crnCommand.setDestinationPosYTwo((short) 6);     // 婧愬簱浣嶅垪
+                        }
                     } else {
                         if (workMode == 1) {
                             crnCommand.setTaskMode(CrnTaskModeType.PAKIN);
@@ -1099,6 +1119,9 @@
                         crnCommand.setDestinationPosX(crnStn.getRow().shortValue());     // 鐩爣搴撲綅鎺�
                         crnCommand.setDestinationPosY(crnStn.getBay().shortValue());     // 鐩爣搴撲綅鍒�
                         crnCommand.setDestinationPosZ(crnStn.getLev().shortValue());     // 鐩爣搴撲綅灞�
+                        if (workMode == 1 && crnStn.getStaNo() == 202) {
+                            crnCommand.setDestinationPosY((short) 6);     // 婧愬簱浣嶅垪
+                        }
                     }
 
                     if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) {
@@ -1539,10 +1562,10 @@
                     staProtocol = staProtocol.clone();
                 }
 
-                if (barcodeThread == null) {
-                    continue;
-                }
-                String barcode = barcodeThread.getBarcode();
+//                if (barcodeThread == null) {
+//                    continue;
+//                }
+//                String barcode = barcodeThread.getBarcode();
                 // 灏哄妫�娴嬪紓甯�
                 boolean back = false;
                 String errMsg = "";
@@ -1617,7 +1640,7 @@
                         param.setLocType1(locTypeDto.getLocType1());
                         if (emptyInSta.getStaNo() == 102) {
                             param.setLocType2((short) 3);
-                        } else if (emptyInSta.getStaNo() == 211) {
+                        } else if (emptyInSta.getStaNo() == 211 || emptyInSta.getStaNo() == 104) {
                             param.setLocType1((short) 5);
                             param.setLocType2((short) 4);
                         } else if (emptyInSta.getStaNo() == 201) {

--
Gitblit v1.9.1