zc
2025-05-17 c946b206b0923e8b9567a529b8fd5d2d684c8265
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -309,6 +309,10 @@
            if (wrkMast == null) {
                return;
            }
            if (wrkMast.getPltType().shortValue() != staProtocol.getFinishWorkNo()) {
                log.info("工作档和完结工作号不匹配,{},{}", wrkMast.getPltType(), staProtocol.getFinishWorkNo());
                return;
            }
            Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "2.5F_Mode"));
            if (Cools.isEmpty(config) || config.getValue().equals("false")) {
                return;
@@ -352,11 +356,19 @@
            // 遍历拣料入库口
            for (DevpSlave.Sta pickSta : devp.getPickSta()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
                if (barcodeThread == null) {
//                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
//                if (barcodeThread == null) {
//                    continue;
//                }
                // 获取拣料入库站信息
                DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(pickSta.getStaNo());
                if (staProtocol == null) {
                    continue;
                } else {
                    staProtocol = staProtocol.clone();
                }
                String barcode = barcodeThread.getBarcode();
                String barcode = staProtocol.getBarcode();
                if (!Cools.isEmpty(barcode)) {
//                    News.info(""+mark+" - 1"+" - {}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode);
                    if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
@@ -366,14 +378,6 @@
                    continue;
                }
                // 获取拣料入库站信息
                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 (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; }
@@ -465,7 +469,7 @@
                    // 更新站点信息 且 下发plc命令
                    staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue());
                    staProtocol.setStaNo((short) 161);
                    staProtocol.setStaNo(wrkMast.getStaNo().shortValue());
                    devpThread.setPakMk(staProtocol.getSiteId(), false);
                    boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                    log.error("输送线下发5:" + wrkMast.getWrkNo() + "," + wrkMast.getStaNo());
@@ -506,11 +510,8 @@
                        && staProtocol.isPakMk()) {
                    // 获取条码扫描仪信息
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
                    if (barcodeThread == null) {
                        continue;
                    }
                    String barcode = barcodeThread.getBarcode();
                    String barcode = staProtocol.getBarcode();
                    if (!Cools.isEmpty(barcode)) {
//                        log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode);
                        if ("00000000".equals(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) {
@@ -604,7 +605,7 @@
                                try {
                                    // 更新站点信息 且 下发plc命令
                                    staProtocol.setWorkNo(dto.getWorkNo().shortValue());
                                    staProtocol.setStaNo((short) 161);
                                    staProtocol.setStaNo(wrkMast.getStaNo().shortValue());
                                    devpThread.setPakMk(staProtocol.getSiteId(), false);
                                    boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -753,6 +754,9 @@
                    if (wrkMast == null) {
                        continue;
                    }
                    if (wrkMast.getWrkNo().shortValue() != staProtocol.getFinishWorkNo()) {
                        continue;
                    }
                    // 判断工作档条件
                    if (wrkMast.getIoType() < 100 || wrkMast.getStaNo() == null || wrkMast.getSourceStaNo() == null) {
                        continue;
@@ -760,7 +764,7 @@
                    // 下发站点信息
                    staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue());
                    staProtocol.setStaNo(RouteUtils.CrnStaEnd(1031, 1135));
                    staProtocol.setStaNo((short) 1031);
                    if (!MessageQueue.offer(SlaveType.Devp, devpSlave.getId(), new Task(2, staProtocol))) {
                        log.info(staProtocol.getWorkNo() + "," + staProtocol.getStaNo() + "输送线出库命令下发失败222");
                        continue;