#
mrzhssss
2023-01-09 44cf1e2793733f703cfe7ccad5e2727a81a98cad
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 异常显示
@@ -207,9 +207,11 @@
                            if (!result) {
                                throw new CoolException("更新plc站点信息失败");
                            }
                            String successMsg = "入库工作档--工作号:" + dto.getWorkNo() + " 目标库位:" + dto.getLocNo();
                            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) {
@@ -376,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 异常显示
@@ -395,9 +397,6 @@
                }
//                // 入出库模式判断
//                if (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; }
@@ -405,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);
@@ -1524,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);
                }
            }
@@ -2090,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();