From 862168537a9edd9d681221fe7243e5d5e4b48ff5 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期六, 12 十月 2024 10:28:00 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java |   49 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 45 insertions(+), 4 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 0596fc3..cf8db66 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -40,14 +40,16 @@
 import com.zy.core.thread.LedThread;
 import com.zy.core.thread.SiemensDevpThread;
 import lombok.extern.slf4j.Slf4j;
-import net.bytebuddy.asm.Advice;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -160,7 +162,9 @@
                 // 閫�鍥�
                 if (back) {
 //                        News.warn("鎵爜鍏ュ簱澶辫触锛寋}鍏ュ簱绔欏洜{}寮傚父锛屾墭鐩樺凡琚��鍥�", inSta.getStaNo(), errMsg);
-                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg));
+                    if(!staProtocol.isOutEnable()){
+                        continue;
+                    }
 
                     if (!staProtocol.isLoading()){
                         continue;
@@ -221,7 +225,7 @@
 
                     WrkMast checkPick = wrkMastService.selectOne(new EntityWrapper<WrkMast>()
                             .eq("barcode", barcode)
-                            .in("io_type", 107,103,57,53));
+                            .in("io_type", 107,103,104,57,53));
                     if (!Cools.isEmpty(checkPick)) {
                         continue;
                     } else {
@@ -446,7 +450,14 @@
 
                 //浠诲姟鍙峰鏋滃湪宸ヤ綔妗d腑瀛樺湪锛屽氨涓嶇敤鍘诲垽鏂潯鐮�
                 if(Cools.isEmpty(wrkMast1)) {
+//                    WrkMast mast = wrkMastMapper.selectPickStep(barcode);
+//                    if (Cools.isEmpty(mast)) {
+//                        break;
+//                    }
+
                     if (!Cools.isEmpty(barcode)) {
+
+
 //                    log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode);
                         if ("NG".endsWith(barcode) || "NoRead".equals(barcode) && staProtocol.isPakMk()) {
                             if (!staProtocol.isLoading()) {
@@ -503,6 +514,32 @@
                             || Cools.isEmpty(wrkMast.getStaNo()) || Cools.isEmpty(wrkMast.getSourceStaNo())) {
                         continue;
                     }
+//                    濡傛灉鏄苟鏉垮叆搴�
+                    if (wrkMast.getIoType() == 104) {
+                        LocMast locMast1 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("barcode", barcode));
+                        if (Cools.isEmpty(locMast1)) {
+                            continue;
+                        } else {
+                            if (locMast1.getLocType1().equals((short)2)) {
+                                if (staProtocol.isWeight()) {
+                                    staProtocol.setWorkNo(wrkNo);
+                                    wrkNo++;
+                                    staProtocol.setStaNo(pickSta.getBackSta().shortValue());
+                                    devpThread.setPakMk(staProtocol.getSiteId(), false);
+                                    MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
+                                    // led 寮傚父鏄剧ず
+                                    if (ledThread != null) {
+                                        String errorMsg = "骞舵澘鍏ュ簱閲嶉噺澶т簬搴撲綅閲嶉噺锛岃閲嶆柊璋冩暣";
+                                        News.error(methodName + ":骞舵澘鍏ュ簱閲嶉噺澶т簬搴撲綅閲嶉噺锛岃閲嶆柊璋冩暣");
+                                        MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(3, errorMsg));
+                                    }
+                                    continue;
+                                }
+                            }
+                        }
+                    }
+
+
 
                     // 鎷c�佺洏銆佸苟 浣滀笟绔欒浆鎹�
 //                    int stnNo = 0;
@@ -1195,6 +1232,7 @@
 //                    continue;
                 }
                 // 鍒ゆ柇鍫嗗灈鏈哄嚭搴撶珯鐘舵��
+
                 if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")
                         && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
                     // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
@@ -1895,6 +1933,8 @@
                 if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) {
                     News.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
                     continue;
+                } else {
+                    News.info("{}鍙稬ED鍛戒护涓嬪彂鎴愬姛锛侊紒锛乕ip锛歿}] [port锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort(),commands);
                 }
             }
 
@@ -1951,6 +1991,7 @@
             LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
             // led鏄剧ず榛樿鍐呭
             if (reset) {
+                //News.info("{}鍙稬ED鍛戒护閲嶇疆锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
                 if (ledThread == null) {
                     continue;
                 }

--
Gitblit v1.9.1