#
TQS
2023-03-01 f30a3efc28ee4d3f67ddf76bc360b676595e4b80
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -521,6 +521,7 @@
                            // 更新工作档数据状态
                            wrkMast.setIoType(wrkMast.getIoType() - 50); // 入出库类型: 103->53,104->54,107->57
                            wrkMast.setWrkSts(2L); // 工作状态: 2.设备上走
                            wrkMast.setIoPri(13D);
                            wrkMast.setSourceStaNo(pickSta.getStaNo()); // 源站
                            wrkMast.setStaNo(dto.getStaNo()); // 目标站
                            wrkMast.setCrnNo(dto.getCrnNo());
@@ -744,6 +745,7 @@
                        // 更新工作档状态为 17.出库完成
                        wrkMast.setWrkSts(17L);
                        wrkMast.setSteNo(0);
                        wrkMast.setIoPri(15D);
                        wrkMast.setCrnEndTime(new Date());
                        if (wrkMastMapper.updateById(wrkMast) != 0) {
                            // 复位堆垛机
@@ -1186,7 +1188,7 @@
            // 获取源库位信息
            LocMast sourceSta = locMastService.selectById(wrkMast.getSourceLocNo());
            if (!sourceSta.getLocSts().equals("R") &&!sourceSta.getLocSts().equals("P")) {
                News.error("出库操作库位状态不符合--状态, 库位号={},库位状态={}", wrkMast.getLocNo(), sourceSta.getLocSts());
                News.error("出库操作库位状态不符合--状态, 库位号={},库位状态={}", wrkMast.getSourceLocNo(), sourceSta.getLocSts());
                continue;
            }
@@ -1620,7 +1622,7 @@
                            }
                        }
                        LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo());
                        if(sourceLoc.getLocSts().equals("F") || sourceLoc.getLocSts().equals("D")){
                        if(sourceLoc.getLocSts().equals("R") || sourceLoc.getLocSts().equals("D")){
                            sourceLoc.setLocSts("R"); // R.出库预约
                            sourceLoc.setModiTime(new Date());
                            if (!locMastService.updateById(sourceLoc)) {
@@ -2294,6 +2296,10 @@
        SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
        SteProtocol steProtocol = steThread.getSteProtocol();
        if (steProtocol == null) { return; }
        if(steProtocol.getLoad() == 1){
            News.error("小车上方有货,无法下发任务===>>{}", steNo);
            return;
        }
        if (steProtocol.isIdle() && steProtocol.getLoad() == 0) {
            // 堆垛机空闲
            if (crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() == 0) {
@@ -2713,7 +2719,7 @@
                            String locSts = "";
                            // 库位移转判断是否为空板移转
                            if (wrkMast.getEmptyMk().equals("N")) {
                                locSts = "F";
                                locSts = "R";
                                // 转移库存明细数据: 库存号 由工作档源库位变为目标库位
                                if (!locDetlService.updateLocNo(wrkMast.getLocNo(), wrkMast.getSourceLocNo())) {
                                    News.error("库位移转 ===>> 转移库存明细数据失败;[源库位={}],[目标库位={}]", wrkMast.getSourceLocNo(), wrkMast.getLocNo());
@@ -3404,6 +3410,7 @@
                }
                ledCommand.setSourceLocNo(wrkMast.getSourceLocNo());
                ledCommand.setStaNo(wrkMast.getStaNo());
                ledCommand.setBarcode(wrkMast.getBarcode());
                if (wrkMast.getIoType() != 110) {
                    List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo());
                    wrkDetls.forEach(wrkDetl -> {
@@ -3857,10 +3864,19 @@
                    boolean success = true;
                    List<String> insideLoc = Utils.getGroupInsideLoc(one.getLocNo());
                    for (String inside : insideLoc) {
                        if (!locMastService.selectById(inside).getLocSts().equals("O")) {
                        if (locMastService.selectById(inside).getLocSts().equals("P")
                                || locMastService.selectById(inside).getLocSts().equals("R")
                                || locMastService.selectById(inside).getLocSts().equals("S")
                                || locMastService.selectById(inside).getLocSts().equals("Q")) {
                            success = false; break;
                        }
                    }
                    Integer steNo = this.hasCar(one.getLocNo());
                    if (steNo != null) {
                        continue;
                    }
                    if (success) {
                        loc = one;
                        break;