From d09aac232174908a8492d53e3b4c5556d6bc6514 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期五, 13 九月 2024 13:58:39 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   67 ++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 19 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 9a7a479..cef8ccb 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -4010,16 +4010,31 @@
                 } else {
                     staProtocol = staProtocol.clone();
                 }
-                if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==607 && staProtocol.getWorkNo()>20000 && staProtocol.isLoading() && staProtocol.isAutoing()){
+                String barcode = staProtocol.getBarcode();
+                if (!Cools.isEmpty(barcode)) {
+//                    log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode);
+                    if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) {
+                        continue;
+                    }
+                } else {
+                    continue;
+                }
+                if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==607 && staProtocol.getWorkNo()==0
+                        && staProtocol.isLoading() && staProtocol.isAutoing() && staProtocol.isInEnable()){
                     try {
                         BasDevp basDevp = basDevpService.selectById(staProtocol.getStaNo());
                         if (basDevp.getReportSign()==0){
+                            WrkMast wrkMast = wrkMastMapper.selectByBarcodeTwo(barcode);
+                            if (!Cools.isEmpty(wrkMast)){
+                                continue;
+                            }
                             LocTypeDto locTypeDto = new LocTypeDto(staProtocol);
 
                             SearchLocParam param = new SearchLocParam();
                             param.setIoType(10);
                             param.setSourceStaNo(emptyInSta.getStaNo());
                             param.setLocType1(locTypeDto.getLocType1());
+                            param.setBarcode(barcode);
                             String response = new HttpHandler.Builder()
                                     .setUri(wmsUrl)
                                     .setPath("/rpc/pakin/loc/v1")
@@ -5863,21 +5878,21 @@
                     return false;
                 }
 
-                //涓存椂
-                if (basJar.getJarCode()==1){
-                    JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
-                    JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
-                    if (jarOtherProtocol == null) {
-                        return false;
-                    }
-
-                    if (!jarOtherProtocol.isAutoing() || jarOtherProtocol.jarErr!=0
-                            || !jarOtherProtocol.isLeftDoor() || !jarOtherProtocol.isRightDoor()
-                            || jarOtherProtocol.leftDoorOpen==1  || jarOtherProtocol.leftDoorClose==1 || jarOtherProtocol.rightDoorOpen==1  || jarOtherProtocol.rightDoorClose==1){
-                        log.error("{}鍙风~鍖栫綈鏌ヨ璁惧涓嶆弧瓒冲墠寰�鍐峰嵈姹犳潯浠讹紝浠e彿2纭寲缃愰棬娌″紑锛侊紒锛�",jarOtherProtocol.getJarNo());
-                        return false;
-                    }
-                }
+//                //涓存椂
+//                if (basJar.getJarCode()==1){
+//                    JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
+//                    JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
+//                    if (jarOtherProtocol == null) {
+//                        return false;
+//                    }
+//
+//                    if (!jarOtherProtocol.isAutoing() || jarOtherProtocol.jarErr!=0
+//                            || !jarOtherProtocol.isLeftDoor() || !jarOtherProtocol.isRightDoor()
+//                            || jarOtherProtocol.leftDoorOpen==1  || jarOtherProtocol.leftDoorClose==1 || jarOtherProtocol.rightDoorOpen==1  || jarOtherProtocol.rightDoorClose==1){
+//                        log.error("{}鍙风~鍖栫綈鏌ヨ璁惧涓嶆弧瓒冲墠寰�鍐峰嵈姹犳潯浠讹紝浠e彿2纭寲缃愰棬娌″紑锛侊紒锛�",jarOtherProtocol.getJarNo());
+//                        return false;
+//                    }
+//                }
 
                 //闂ㄤ綔涓�  鏃�
 //                if (jarProtocol.isAutoing() && jarProtocol.statusType == JarStatusType.WAITING4 && jarProtocol.jarErr==0
@@ -8538,9 +8553,23 @@
         if (staNo1!=0){
             SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2);
             StaProtocol staProtocol607 = devpThread.getStation().get(607);
-            if (staProtocol607.getWorkNo()<9001 && staProtocol607.getWorkNo()!=0 && staProtocol607.isLoading() && staProtocol607.isAutoing() && staProtocol607.getStaNo() == 607){
-                staProtocol607.setStaNo(staNo1);
-                boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(5, staProtocol607));
+            String barcode = staProtocol607.getBarcode();
+            if (!Cools.isEmpty(barcode)) {
+//                    log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode);
+                if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) {
+                    return;
+                }
+            } else {
+                return;
+            }
+            if (staProtocol607.getWorkNo()==0 && staProtocol607.isLoading() && staProtocol607.isAutoing()
+                    && staProtocol607.getStaNo() == 607 && staProtocol607.isInEnable()){
+                WrkMast wrkMast = wrkMastMapper.selectByBarcodeTwo(barcode);
+                if (!Cools.isEmpty(wrkMast)){
+                    staProtocol607.setWorkNo(wrkMast.getWrkNo());
+                    staProtocol607.setStaNo(staNo1);
+                    boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(5, staProtocol607));
+                }
             }
         } else {
 

--
Gitblit v1.9.1