whycq
2024-10-09 f9c94d8ed81d4897f063fbf0e2d36cdfeda79456
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;
@@ -503,6 +507,28 @@
                            || Cools.isEmpty(wrkMast.getStaNo()) || Cools.isEmpty(wrkMast.getSourceStaNo())) {
                        continue;
                    }
                    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;
                            }
                        }
                    }
                    // 拣、盘、并 作业站转换
//                    int stnNo = 0;
@@ -1895,6 +1921,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 +1979,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;
                }