#
whycq
2024-10-09 eca908362077754463173155ba81c51ca6328dd1
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 @@
                //任务号如果在工作档中存在,就不用去判断条码
                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()) {
@@ -1195,6 +1206,7 @@
//                    continue;
                }
                // 判断堆垛机出库站状态
                if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y")
                        && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) {
                    // 命令下发区 --------------------------------------------------------------------------
@@ -1895,6 +1907,8 @@
                if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) {
                    News.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                    continue;
                } else {
                    News.info("{}号LED命令下发成功!!![ip:{}] [port:{}] [port:{}]", led.getId(), led.getIp(), led.getPort(),commands);
                }
            }
@@ -1951,6 +1965,7 @@
            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
            // led显示默认内容
            if (reset) {
                //News.info("{}号LED命令重置!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                if (ledThread == null) {
                    continue;
                }