| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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)) { |
| | |
| | | |
| | | //判断小车是否到达货物库位 |
| | | 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()); |
| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | //小车已在近点位置无需前往 |
| | | 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); |
| | |
| | | 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)) { |
| | |
| | | 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); |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //获取提升机命令 |
| | | 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); |
| | | |