zhangchao
2024-09-01 0541f3ddbb30faea5907c7e04f6521e7fec651cc
对照协议调整
1个文件已修改
136 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -165,7 +165,7 @@
                if (back) {
                    log.info("errmsg: " + errMsg);
//                        News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg);
                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg));
                    MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg));
                    if (!staProtocol.isLoading()) {
                        continue;
                    }
@@ -212,7 +212,7 @@
                    News.warnNoLog("" + mark + " - 0" + " - 开始执行");
                    if (!Cools.isEmpty(barcode)) {
                        News.info("" + mark + " - 1" + " - {}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                        News.infoNoLog("" + mark + " - 1" + " - {}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                        if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) {
                            staProtocol.setWorkNo((short) 9999);
                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
@@ -428,10 +428,75 @@
            for (DevpSlave.Sta pickSta : devp.getPickSta()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed());
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(pickSta.getStaNo());
                if (staProtocol == null) {
                    continue;
                } else {
                    staProtocol = staProtocol.clone();
                }
                if (barcodeThread == null) {
                    continue;
                }
                String barcode = barcodeThread.getBarcode();
                // 尺寸检测异常
                boolean back = false;
                String errMsg = "";
                if (staProtocol.isFrontErr()) {
                    errMsg = "前超限";
                    back = true;
                }
                if (!back && staProtocol.isBackErr()) {
                    errMsg = "后超限";
                    back = true;
                }
                if (!back && staProtocol.isHighErr()) {
                    errMsg = "高超限";
                    back = true;
                }
                if (!back && staProtocol.isLeftErr()) {
                    errMsg = "左超限";
                    back = true;
                }
                if (!back && staProtocol.isRightErr()) {
                    errMsg = "右超限";
                    back = true;
                }
                if (!back && staProtocol.isWeightErr()) {
                    errMsg = "超重";
                    back = true;
                }
                if (!back && staProtocol.isBarcodeErr()) {
                    errMsg = "扫码失败";
                    back = true;
                }
                // 退回
                if (back) {
                    log.info("errmsg: " + errMsg);
//                        News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg);
                    MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(5, errMsg));
                    if (!staProtocol.isLoading()) {
                        continue;
                    }
                    if (!staProtocol.isPakMk()) {
                        continue;
                    }
                    staProtocol.setWorkNo((short) 9999);
                    News.info("{}入库回退:{},任务号:{}", pickSta.getStaNo(), errMsg, (short) 9999);
                    staProtocol.setStaNo(pickSta.getBackSta().shortValue());
                    devpThread.setPakMk(staProtocol.getSiteId(), false);
                    MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                    log.error("输送线下发1:" + 9999 + "," + pickSta.getBackSta());
                    // led 异常显示
                    if (ledThread != null) {
                        MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(5, errMsg));
                    }
                    continue;
                }
                if (!Cools.isEmpty(barcode)) {
                    News.info("" + mark + " - 1" + " - {}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode);
                    if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
@@ -442,8 +507,6 @@
                }
                // 获取拣料入库站信息
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(pickSta.getStaNo());
                if (staProtocol == null) {
                    continue;
                } else {
@@ -488,7 +551,6 @@
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        //LED
                        LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed());
                        // led 异常显示
                        if (ledThread != null) {
                            String errorMsg = "此为拣料、并板、盘点再入库.请放在" + pickSta.getBackSta().shortValue() + "站点";
@@ -1493,6 +1555,8 @@
            // 遍历空板入库口
            for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) {
                // 获取空板入库站信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, emptyInSta.getBarcode());
                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, emptyInSta.getLed());
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(emptyInSta.getStaNo());
                if (staProtocol == null) {
@@ -1501,9 +1565,65 @@
                    staProtocol = staProtocol.clone();
                }
                LedThread ledThread = null;
                if (!Cools.isEmpty(emptyInSta.getLed())) {
                    ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, emptyInSta.getLed());
                if (barcodeThread == null) {
                    continue;
                }
                String barcode = barcodeThread.getBarcode();
                // 尺寸检测异常
                boolean back = false;
                String errMsg = "";
                if (staProtocol.isFrontErr()) {
                    errMsg = "前超限";
                    back = true;
                }
                if (!back && staProtocol.isBackErr()) {
                    errMsg = "后超限";
                    back = true;
                }
                if (!back && staProtocol.isHighErr()) {
                    errMsg = "高超限";
                    back = true;
                }
                if (!back && staProtocol.isLeftErr()) {
                    errMsg = "左超限";
                    back = true;
                }
                if (!back && staProtocol.isRightErr()) {
                    errMsg = "右超限";
                    back = true;
                }
                if (!back && staProtocol.isWeightErr()) {
                    errMsg = "超重";
                    back = true;
                }
                if (!back && staProtocol.isBarcodeErr()) {
                    errMsg = "扫码失败";
                    back = true;
                }
                // 退回
                if (back) {
                    log.info("errmsg: " + errMsg);
//                        News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg);
                    MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(5, errMsg));
                    if (!staProtocol.isLoading()) {
                        continue;
                    }
                    if (!staProtocol.isPakMk()) {
                        continue;
                    }
                    staProtocol.setWorkNo((short) 9999);
                    News.info("{}入库回退:{},任务号:{}", emptyInSta.getStaNo(), errMsg, (short) 9999);
                    staProtocol.setStaNo(emptyInSta.getBackSta().shortValue());
                    devpThread.setPakMk(staProtocol.getSiteId(), false);
                    MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                    log.error("输送线下发1:" + 9999 + "," + emptyInSta.getBackSta());
                    // led 异常显示
                    if (ledThread != null) {
                        MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(5, errMsg));
                    }
                    continue;
                }
                if (!staProtocol.isLoading()) {