#
luxiaotao1123
2022-09-28 94860d0ab6d9fedf9413b2083eb9af17d8bd7d54
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -114,11 +114,33 @@
                    }
                    String barcode = barcodeThread.getBarcode();
                    if(!Cools.isEmpty(barcode)) {
                        log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                        if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
//                        log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                        if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) {
                            staProtocol.setWorkNo((short) 9995);
                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            // led 异常显示
                            LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                            if (ledThread != null) {
                                String errorMsg = "扫码失败,请重试";
                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                            }
                            continue;
                        }
                    } else {
                        staProtocol.setWorkNo((short) 9995);
                        staProtocol.setStaNo(inSta.getBackSta().shortValue());
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        // led 异常显示
                        LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                        if (ledThread != null) {
                            String errorMsg = "扫码失败,请重试";
                            MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
                        }
                        continue;
                    }
@@ -235,21 +257,21 @@
                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()){
                    // 获取条码扫描仪信息
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
                    if (barcodeThread == null) {
                        continue;
                    }
                    String barcode = barcodeThread.getBarcode();
                    if(!Cools.isEmpty(barcode)) {
                        log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode);
                        if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
                            continue;
                        }
                    } else {
                        continue;
                    }
//                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
//                    if (barcodeThread == null) {
//                        continue;
//                    }
//                    String barcode = barcodeThread.getBarcode();
//                    if(!Cools.isEmpty(barcode)) {
//                        log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode);
//                        if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
//                            continue;
//                        }
//                    } else {
//                        continue;
//                    }
                    WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
                    WrkMast wrkMast = wrkMastMapper.selectPickStep(staProtocol.getWorkNo());
                    if (wrkMast == null) {
                        // 无拣料数据
                        continue;
@@ -293,6 +315,9 @@
                        if (wrkMastMapper.updateById(wrkMast) == 0) {
                            throw new CoolException("更新工作档数据状态失败");
                        }
                        if (wrkMastMapper.setSteEmpty(wrkMast.getWrkNo()) == 0) {
//                            throw new CoolException("更新工作档数据状态失败");
                        }
                        // 修改库位状态 Q.拣料/盘点/并板再入库
                        LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
                        locMast.setLocSts("Q");