#
zjj
12 小时以前 15b5002fd412a5d33be5d5c6deb63b3d02c77c41
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -302,12 +302,12 @@
            }
            if (liftSta.getHasCar()) {
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}站点存在小车,禁止派发", wrkMast.getWrkNo(), liftSta.getStaNo());
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}站点存在小车,禁止派发", wrkMast.getWrkNo(), liftSta.getSiteId());
                return false;
            }
            if (liftSta.getHasTray()) {
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}站点有托盘,禁止派发", wrkMast.getWrkNo(), liftSta.getStaNo());
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}站点有托盘,禁止派发", wrkMast.getWrkNo(), liftSta.getSiteId());
                return false;
            }
@@ -427,7 +427,7 @@
            assignCommand.setCommands(commands);
            wrkMast.setWrkSts(WrkStsType.OUTBOUND_SHUTTLE_RUN.sts);//小车搬运中  101.生成出库任务 ==> 102.小车搬运中
            wrkMast.setSourceStaNo(liftSta.getStaNo());
            wrkMast.setSourceStaNo(liftSta.getSiteId());
            wrkMast.setModiTime(new Date());
            wrkMast.setSystemMsg("");//清空消息
            if (wrkMastService.updateById(wrkMast)) {
@@ -504,6 +504,12 @@
            //判断小车是否到达货物库位
            if (!shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) {
                //任务被避障取消
                Object cancelLock = redisUtil.get(RedisKeyType.TRAFFIC_CONTROL_SHUTTLE_OBSTACLE_CANCEL_TASK_LOCK.key + wrkMast.getShuttleNo());
                if(cancelLock != null) {
                    return false;
                }
                //小车未到达取货位置
                shuttleDispatchUtils.dispatchShuttle(wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getShuttleNo());//调度小车到货物所在库位进行取货
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,小车未到达取货位置", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());
@@ -769,12 +775,12 @@
            }
            if (liftSta.getHasCar()) {
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}站点存在小车,禁止派发", wrkMast.getWrkNo(), liftSta.getStaNo());
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}站点存在小车,禁止派发", wrkMast.getWrkNo(), liftSta.getSiteId());
                return false;
            }
            if (!liftSta.getHasTray()) {
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}站点无托盘,禁止派发", wrkMast.getWrkNo(), liftSta.getStaNo());
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}站点无托盘,禁止派发", wrkMast.getWrkNo(), liftSta.getSiteId());
                return false;
            }
@@ -1540,8 +1546,8 @@
            //小车已在近点位置无需前往
            if (shuttleProtocol.getCurrentLocNo().equals(endLocation)) {
                wrkMast.setWrkSts(WrkStsType.MOVE_NEARBY_COMPLETE.sts);//小车移动到提升机中  301.生成小车移库任务 ==> 303.小车移动至近点完成
                wrkMast.setSourceStaNo(recentLiftStation.getStaNo());
                wrkMast.setStaNo(targetLiftSta.getStaNo());
                wrkMast.setSourceStaNo(recentLiftStation.getSiteId());
                wrkMast.setStaNo(targetLiftSta.getSiteId());
                wrkMast.setModiTime(now);
                wrkMast.setSystemMsg("");//清空消息
                wrkMastService.updateById(wrkMast);
@@ -1566,8 +1572,8 @@
            assignCommand.setCommands(commands);
            wrkMast.setWrkSts(WrkStsType.MOVE_NEARBY.sts);//小车移动到提升机中  301.生成小车移库任务 ==> 302.小车移动至近点中
            wrkMast.setSourceStaNo(recentLiftStation.getStaNo());
            wrkMast.setStaNo(targetLiftSta.getStaNo());
            wrkMast.setSourceStaNo(recentLiftStation.getSiteId());
            wrkMast.setStaNo(targetLiftSta.getSiteId());
            wrkMast.setModiTime(now);
            wrkMast.setSystemMsg("");//清空消息
            if (wrkMastService.updateById(wrkMast)) {
@@ -1660,7 +1666,13 @@
            int targetLev = Utils.getLev(shuttleProtocol.getCurrentLocNo());
            if (object == null || liftProtocol.getLev() != targetLev) {
                //获取提升机命令
                LiftCommand liftCommand = liftThread.getMoveCommand(wrkMast.getWrkNo(), liftProtocol.getLev(), targetLev);
                LiftStaProtocol startSta = LiftUtils.getLiftStaByLev(liftProtocol.getLiftNo(), liftProtocol.getLev());
                LiftStaProtocol targetSta = LiftUtils.getLiftStaByLev(liftProtocol.getLiftNo(), targetLev);
                if (startSta == null || targetSta == null) {
                    News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号提升机,站点数据不存在", wrkMast.getWrkNo(), wrkMast.getLiftNo());
                    return false;
                }
                LiftCommand liftCommand = liftThread.getMoveCommand(commonService.getWorkNo(WrkIoType.PREVIEW_LIFT_MOVE.id), startSta.getSiteId(), targetSta.getSiteId());
                ArrayList<LiftCommand> commands = new ArrayList<>();
                commands.add(liftCommand);
@@ -1674,6 +1686,12 @@
                liftAction.assignWork(wrkMast.getLiftNo(), assignCommand);
                News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号提升机在{}层,提升机不在小车层,调度移动中", wrkMast.getWrkNo(), liftProtocol.getLev(), wrkMast.getLiftNo());
                redisUtil.set(RedisKeyType.LIFT_MOVE_TO_SHUTTLE_LIMIT.key + wrkMast.getWrkNo(), "lift_moving", 60 * 3);
                redisUtil.set(RedisKeyType.TASK_RUN_LIMIT.key + wrkMast.getWrkNo(), "lock", 8);
                return false;
            }
            Object limitObj = redisUtil.get(RedisKeyType.TASK_RUN_LIMIT.key + wrkMast.getWrkNo());
            if (limitObj != null) {
                return false;
            }
@@ -1750,7 +1768,7 @@
            }
            //获取提升机命令
            LiftCommand liftCommand = liftThread.getShuttleSwitchCommand(wrkMast.getWrkNo(), sourceLiftSta.getLev(), liftSta.getLev());
            LiftCommand liftCommand = liftThread.getShuttleSwitchCommand(wrkMast.getWrkNo(), sourceLiftSta.getSiteId(), liftSta.getSiteId());
            ArrayList<LiftCommand> commands = new ArrayList<>();
            commands.add(liftCommand);