#
mrzhssss
2023-01-09 44cf1e2793733f703cfe7ccad5e2727a81a98cad
#
2个文件已修改
45 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/LedThread.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -121,7 +121,7 @@
                    log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                    if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
                        staProtocol.setWorkNo((short) 9998);
                        staProtocol.setStaNo((short)14);
                        staProtocol.setStaNo((short) 14);
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        // led 异常显示
@@ -211,7 +211,7 @@
                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, successMsg));
                        } else {
                            staProtocol.setWorkNo((short) 9998);
                            staProtocol.setStaNo((short)14);
                            staProtocol.setStaNo((short) 14);
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            if (ledThread != null) {
@@ -378,11 +378,11 @@
                }
                String barcode = barcodeThread.getBarcode();
                if(!Cools.isEmpty(barcode) && (staProtocol.getWorkNo() != 9998 || staProtocol.getWorkNo() != 9996 )) {
                if (!Cools.isEmpty(barcode) && (staProtocol.getWorkNo() != 9998 || staProtocol.getWorkNo() != 9996)) {
                    log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode);
                    if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
                    if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
                        staProtocol.setWorkNo((short) 9998);
                        staProtocol.setStaNo((short)14);
                        staProtocol.setStaNo((short) 14);
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        // led 异常显示
@@ -397,9 +397,6 @@
                }
//                // 入出库模式判断
//                if (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; }
@@ -407,7 +404,7 @@
                        && staProtocol.isLoading()
                        && staProtocol.isInEnable()
                        && !staProtocol.isEmptyMk()
                        && ( staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9997 || staProtocol.getWorkNo() == 9995)
                        && (staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9997 || staProtocol.getWorkNo() == 9995)
                        && staProtocol.isPakMk()) {
                    WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
@@ -1526,26 +1523,19 @@
            // 获取LED线程
            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
            // 相同工作号集合则过滤
            if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) {
                continue;
            }
//            if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) {
//                continue;
//            }
            // 命令下发 -------------------------------------------------------------------------------
            if (!commands.isEmpty()) {
                if (led.getId() == 7) {
                    if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) {
                        log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                        continue;
                    } else {
                        ledThread.setLedMk(false);
                    }
                String errMsg = "";
                if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) {
                    log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                    continue;
                } else {
                    if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) {
                        log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort());
                        continue;
                    } else {
                        ledThread.setLedMk(false);
                    }
                    ledThread.setLedMk(false);
                }
            }
@@ -2092,7 +2082,7 @@
                    JSONObject data = (JSONObject) jsonObject.get("data");
                    log.info((String) data.get("msg"));
                } else {
                    log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyOut/v1","", response);
                    log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyOut/v1", "", response);
                }
            } catch (Exception e) {
                e.printStackTrace();
src/main/java/com/zy/core/thread/LedThread.java
@@ -92,6 +92,8 @@
                        case 6:
                            errorReset();
                            break;
                        case 7:
                            write7((List<LedCommand>) task.getData());
                        default:
                            break;
                    }
@@ -202,6 +204,7 @@
        close();
    }
    private void write7(List<LedCommand> list) {
        commandList = list;
        StringBuilder sb = new StringBuilder();