#
tqs
2024-05-17 6dc8121c05bec103386cd85df1b1f7603ec52788
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -177,7 +177,7 @@
                        && staProtocol.isLoading()
                        && staProtocol.isInEnable()
                        && !staProtocol.isEmptyMk()
                        && staProtocol.isPakMk()) {// && !Cools.isEmpty(barcode)) {
                        && staProtocol.isPakMk() && !back) {// && !Cools.isEmpty(barcode)) {
                    if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) {
                        News.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
@@ -437,33 +437,39 @@
                }
                String barcode = barcodeThread.getBarcode();
                if (!Cools.isEmpty(barcode)) {
                WrkMast wrkMast1 = wrkMastMapper.selectPickStep1(staProtocol.getWorkNo().intValue());
                //任务号如果在工作档中存在,就不用去判断条码
                if(Cools.isEmpty(wrkMast1)) {
                    if (!Cools.isEmpty(barcode)) {
//                    log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode);
                    if ("NG".endsWith(barcode) || "NoRead".equals(barcode) ) {
                        if (!staProtocol.isLoading()) {
                        if ("NG".endsWith(barcode) || "NoRead".equals(barcode) && staProtocol.isPakMk()) {
                            if (!staProtocol.isLoading()) {
                                continue;
                            }
                            if (!staProtocol.isPakMk()) {
                                continue;
                            }
                            if (staProtocol.getWorkNo() != 0) {
                                continue;
                            }
                            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;
                        }
                        if (!staProtocol.isPakMk()) {
                            continue;
                        }
                        if(staProtocol.getWorkNo() != 0) {
                            continue;
                        }
                        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));
                        }
                    } else {
                        continue;
                    }
                } else {
                    continue;
                }
@@ -477,7 +483,12 @@
//                        && (staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9997 || staProtocol.getWorkNo() == 9995)
                        && staProtocol.isPakMk()) {
                    WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
                    WrkMast wrkMast = null;
                    //优先查询任务号对应的工作档有没有,如果有的话就不用查条码号
                    wrkMast = wrkMastMapper.selectPickStep1(staProtocol.getWorkNo().intValue());
                    if(Cools.isEmpty(wrkMast)) {
                        wrkMast = wrkMastMapper.selectPickStep(barcode);
                    }
//                    WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
                    if (wrkMast == null) {
                        // 无拣料数据
@@ -809,6 +820,12 @@
            // 堆垛机控制过滤
            if (!crnProtocolNow.getStatusType().equals(CrnStatusType.IDLE) || crnProtocolNow.getTaskNo() != 0) {
                continue;
            }
            // 已经存在吊车执行任务时,则过滤
            if (wrkMastMapper.selectWorking(slave.getId()) != null) {
                break;
//                        return;
            }
            // 命令下发区 --------------------------------------------------------------------------
@@ -1909,14 +1926,24 @@
            for (Integer staNo : led.getStaArr()) {
                // 获取叉车站点
                StaProtocol staProtocol = devpThread.getStation().get(staNo);
                StaProtocol staProtocol1 = devpThread.getStation().get(staNo+1);
                if (staProtocol == null) { continue; }
                if (staProtocol.getWorkNo() != 0) {
                if (staProtocol1 == null) { continue; }
                if (staProtocol.getWorkNo() != 0 || staProtocol.isLoading()) {
                    reset = false;
                    break;
                }
                if (staProtocol1.isLoading() || staProtocol1.getWorkNo() != 0) {
                    reset = false;
                    break;
                }
                if (!staProtocol.isLoading() && staProtocol.getWorkNo() == 0 && !staProtocol1.isLoading() && staProtocol1.getWorkNo() == 0){
//                    News.error("{}号LED入库口2个站点都没有数据,准备reset复位显示器!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                }
            }
            // 获取led线程
            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getDevpPlcId());
//            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getDevpPlcId());
            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
            // led显示默认内容
            if (reset) {
                if (ledThread == null) {