#
TQS
2022-11-22 13c2b426704d4ec12e4c263d054cec2f1416be39
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -920,6 +920,7 @@
                        || Utils.getLev(wrkMast.getSourceLocNo()) != Utils.getLev(one.getLocNo()))){
                    continue;
                }
                log.info("");
            }
            //出库库位不是最外层库位,判断浅库位组是否都为空,或存在库位移转任务
@@ -1069,6 +1070,12 @@
                            if (steProtocol == null) { continue; }
                            if (steProtocol.isIdle()) {
                                //小车只能绑定一笔作业中任务
                                WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
                                if(wrkMast1 != null){
                                    continue;
                                }
                                // 命令下发区 --------------------------------------------------------------------------
                                SteCommand steCommand = new SteCommand();
                                steCommand.setSteNo(steNo); // 穿梭车编号
@@ -1078,10 +1085,12 @@
                                steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue());
                                steCommand.setBay(steProtocol.getBay());
                                steCommand.setLev(steProtocol.getLev());
                                steCommand.setMemo("11==>14小车搬出库任务,任务号"+wrkMast.getWrkNo()+"");
                                if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) {
                                    log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
                                } else {
                                    log.info("穿梭车命令下发成功(11==>14小车搬出库任务),穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
                                    // 修改工作档状态 11.生成出库ID => 14.小车搬出库
                                    Date now = new Date();
                                    wrkMast.setWrkSts(14L);
@@ -1258,6 +1267,12 @@
                    SteProtocol steProtocol = steThread.getSteProtocol();
                    if (steProtocol == null) { return; }
                    if (steProtocol.isIdle()) {
                        //小车只能绑定一笔作业中任务
                        WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
                        if(wrkMast1 != null){
                            return;
                        }
                        // 命令下发区 --------------------------------------------------------------------------
                        SteCommand steCommand = new SteCommand();
@@ -1686,6 +1701,12 @@
                    if (steProtocol == null) { return; }
                    if (steProtocol.isIdle()) {
                        //小车只能绑定一笔作业中任务
                        WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
                        if(wrkMast1 != null){
                            return;
                        }
                        // 命令下发区 --------------------------------------------------------------------------
                        SteCommand steCommand = new SteCommand();
                        steCommand.setSteNo(steNo); // 穿梭车编号
@@ -1881,6 +1902,12 @@
        if (steProtocol == null) { return; }
        if (steProtocol.isIdle()) {
            //小车只能绑定一笔作业中任务
            WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
            if(wrkMast1 != null){
                return;
            }
            // 命令下发区 --------------------------------------------------------------------------
            SteCommand steCommand = new SteCommand();
            steCommand.setSteNo(steNo); // 穿梭车编号
@@ -1894,6 +1921,7 @@
            if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) {
                log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
            } else {
                log.error("穿梭车命令下发成功让小车从 远点 ====>> 待机位,绑定穿梭车,IoType={}, 穿梭车号={},任务数据={}", wrkMast.getIoType(), steNo, JSON.toJSON(steCommand));
                // 修改工作档状态 绑定穿梭车
                wrkMast.setSteNo(steNo);
                wrkMast.setModiTime(new Date());
@@ -1912,6 +1940,12 @@
        if (!basSteService.updatePakMk(steNo, "Y")) {
            log.error("修改穿梭车作业状态 失败!!,穿梭车={}", steNo);
            return;
        }
        //小车只能绑定一笔作业中任务
        WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
        if(wrkMast1 != null){
            return;
        }
@@ -1948,6 +1982,12 @@
        if (steProtocol == null) { return; }
        if (steProtocol.isIdle()) {
            //小车只能绑定一笔作业中任务
            WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
            if(wrkMast1 != null){
                return;
            }
            // 命令下发区 --------------------------------------------------------------------------
            SteCommand steCommand = new SteCommand();
            steCommand.setSteNo(steNo); // 穿梭车编号
@@ -1957,10 +1997,12 @@
            steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue());
            steCommand.setBay(steProtocol.getBay());
            steCommand.setLev(steProtocol.getLev());
            steCommand.setMemo("绑定小车号,让小车从 远点 ====>> 移动到近点");
            if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) {
                log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
            } else {
                log.info("穿梭车命令下发成功(让小车从远点==>>移动到近点),IoType={}, 穿梭车号={},任务数据={}", wrkMast.getIoType(), steNo, JSON.toJSON(steCommand));
                // 修改工作档状态 绑定穿梭车
                wrkMast.setSteNo(steNo);
                wrkMast.setModiTime(new Date());
@@ -1981,6 +2023,12 @@
        SteProtocol steProtocol = steThread.getSteProtocol();
        if (steProtocol == null) { return; }
        if (steProtocol.isIdle()) {
            //小车只能绑定一笔作业中任务
            WrkMast wrkMast1 = wrkMastMapper.selectSteNoData(steNo);
            if(wrkMast1 != null){
                return;
            }
            // 命令下发区 --------------------------------------------------------------------------
            SteCommand steCommand = new SteCommand();
@@ -2316,9 +2364,11 @@
                        steCommand.setSteNo(steNo); // 穿梭车编号
                        steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号
                        steCommand.setTaskMode(SteTaskModeType.findOutByLoc(wrkMast.getSourceLocNo())); // 任务模式:  搬出库
                        steCommand.setMemo("出库 ===>> 迁入小车 完成");
                        if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) {
                            log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
                        } else {
                            log.info("穿梭车命令下发成功,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
                            // 13.迁入小车 ==> 14.小车搬出库
                            wrkMast.setWrkSts(14L);
                            Date now = new Date();