*
lsh
2025-03-10 3c2450c66d792b2e020ab954e902df9706f1cd7d
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -145,7 +145,8 @@
                    }
                }
                if (staProtocol.isAutoing() && staProtocol.isInEnable()
                        && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990)
                        && !staProtocol.isEmptyMk() && staProtocol.getWorkNo() > 9990
                        && staProtocol.getWorkNo()!=9999 && staProtocol.getWorkNo()!=9992 && staProtocol.getWorkNo()!=0
                        && staProtocol.isPakMk() && staProtocol.getStamp()>=2 && staProtocol.getStamp()!=3) {// && !Cools.isEmpty(barcode)) {
                    News.warnNoLog(""+mark+" - 0"+" - 开始执行");
//                    try {
@@ -156,7 +157,7 @@
                    if(!Cools.isEmpty(barcode)) {
                        News.info(""+mark+" - 1"+" - {}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                        if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) {
                            staProtocol.setWorkNo((short) 9999);
                            staProtocol.setWorkNo((short) 9992);
                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -170,7 +171,7 @@
                            continue;
                        }
                    } else {
                        staProtocol.setWorkNo((short) 9999);
                        staProtocol.setWorkNo((short) 9992);
                        staProtocol.setStaNo(inSta.getBackSta().shortValue());
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -195,7 +196,7 @@
                    }
                    if (wrkMast != null) {
                        News.error(""+mark+" - 4"+" - 工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo());
                        staProtocol.setWorkNo((short)9999);
                        staProtocol.setWorkNo((short)9992);
                        staProtocol.setStaNo(inSta.getBackSta().shortValue());
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -255,7 +256,7 @@
                            }
                        } else {
                            News.error(""+mark+" - 5"+" - 请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response);
                            staProtocol.setWorkNo((short)9999);
                            staProtocol.setWorkNo((short)9992);
                            staProtocol.setStaNo(inSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -1511,7 +1512,7 @@
//                                ledThread.errorReset();
                            }
                        } else {
                            staProtocol.setWorkNo((short)9999);
                            staProtocol.setWorkNo((short)9992);
                            staProtocol.setStaNo(emptyInSta.getBackSta().shortValue());
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -1886,7 +1887,8 @@
                    int res = wrkMastMapper.insert(wrkMast);
                    if (res == 0) {
                        News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 2"+" - 保存工作档失败");
                        throw new CoolException("保存工作档失败");
//                        throw new CoolException("保存工作档失败");
                        return true;
                    }
                    // 工作档明细保存
                    if (shallowLoc.getLocSts().equals("F")) {
@@ -1901,7 +1903,8 @@
                            wrkDetl.setModiTime(new Date());
                            if (!wrkDetlService.insert(wrkDetl)) {
                                News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 3"+" - 保存工作档明细失败");
                                throw new CoolException("保存工作档明细失败");
//                                throw new CoolException("保存工作档明细失败");
                                return true;
                            }
                        }
                    }
@@ -1911,11 +1914,13 @@
                        shallowLoc.setModiTime(new Date());
                        if (!locMastService.updateById(shallowLoc)) {
                            News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 4"+" - 更新源库位状态失败");
                            throw new CoolException("更新源库位状态失败");
//                            throw new CoolException("更新源库位状态失败");
                            return true;
                        }
                    } else {
                        News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 5"+" - 源库位出库失败");
                        throw new CoolException("源库位出库失败");
//                        throw new CoolException("源库位出库失败");
                        return true;
                    }
                    // 修改目标库位状态
                    if (loc.getLocSts().equals("O")) {
@@ -1923,11 +1928,13 @@
                        loc.setModiTime(new Date());
                        if (!locMastService.updateById(loc)) {
                            News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 6"+" - 更新目标库位状态失败");
                            throw new CoolException("更新目标库位状态失败");
//                            throw new CoolException("更新目标库位状态失败");
                            return true;
                        }
                    } else {
                        News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 7"+" - 移转失败");
                        throw new CoolException("移转失败");
//                        throw new CoolException("移转失败");
                        return true;
                    }
                } catch (Exception e){
                    News.error(""+mark+"moveLocForDeepLoc"+" - 8"+" - 双深库位阻塞,对浅库位进行移转失败", e);
@@ -2109,7 +2116,7 @@
                    }
                    WrkMast pakout = wrkMastMapper.selectWorkingPakout(inSta.getStaNo());
                    switch (inSta.getStaNo()) {
                        case 203://1F
                        case 101://1F
                            if (pakout != null) {
                                if (devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) {
                                    // 出库切换中
@@ -2125,24 +2132,6 @@
                            } else {
                                // 入库模式
                                devpThread.ioModeOf2F = IoModeType.PAKIN_MODE;
                            }
                            break;
                        case 401://1F
                            if (pakout != null) {
                                if (devpThread.ioModeOf4F != IoModeType.PAKOUT_MODE) {
                                    // 出库切换中
                                    devpThread.ioModeOf4F = IoModeType.PAKOUT_BOOTING;
                                    WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo());
                                    if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading()
                                            && !devpThread.getStation().get(inSta.getStaNo() + 1).isLoading()
                                            && devpThread.getStation().get(inSta.getStaNo() + 1).getWorkNo() == 0) {
                                        // 出库模式
                                        devpThread.ioModeOf4F = IoModeType.PAKOUT_MODE;
                                    }
                                }
                            } else {
                                // 入库模式
                                devpThread.ioModeOf4F = IoModeType.PAKIN_MODE;
                            }
                            break;
                    }