| | |
| | | public synchronized void autoCompleteTask() { |
| | | List<TaskWrk> taskWrks = taskWrkMapper.selectWorkingTask(); |
| | | for (TaskWrk taskWrk : taskWrks) { |
| | | //获取命令集合 |
| | | List<CommandInfo> commandInfos = commandInfoService.selectByTaskNo(taskWrk.getTaskNo()); |
| | | if (taskWrk.getCommandStep() < commandInfos.size()) { |
| | | continue;//当前步序没有到达最后一条命令 |
| | | } |
| | | |
| | | //判断末端命令是否执行完成 |
| | | if (!commandInfos.isEmpty()){ |
| | | CommandInfo commandInfo = commandInfos.get(commandInfos.size() - 1); |
| | | if (commandInfo.getCommandStatus() != CommandStatusType.COMPLETE.id) { |
| | | continue;//指令未完成 |
| | | } |
| | | } |
| | | // //获取命令集合 |
| | | // List<CommandInfo> commandInfos = commandInfoService.selectByTaskNo(taskWrk.getTaskNo()); |
| | | // if (taskWrk.getCommandStep() < commandInfos.size()) { |
| | | // continue;//当前步序没有到达最后一条命令 |
| | | // } |
| | | // |
| | | // //判断末端命令是否执行完成 |
| | | // if (!commandInfos.isEmpty()){ |
| | | // CommandInfo commandInfo = commandInfos.get(commandInfos.size() - 1); |
| | | // if (commandInfo.getCommandStatus() != CommandStatusType.COMPLETE.id) { |
| | | // continue;//指令未完成 |
| | | // } |
| | | // } |
| | | |
| | | |
| | | Date now = new Date(); |
| | | //指令已完成,更新任务 |
| | | if (taskWrk.getIoType() == 1) { |
| | | if (taskWrk.getIoType() == 1 && taskWrk.getWrkSts() == 5) { |
| | | //入库任务 |
| | | // taskWrk.setWrkSts(4);//3.吊车入库中 => 4.入库完成 |
| | | taskWrk.setStatus(TaskStatusType.OVER.id); |
| | |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(9999L); |
| | | locMastService.updateById(locMast); |
| | | } else if (taskWrk.getIoType() == 2) { |
| | | } else if (taskWrk.getIoType() == 2 && taskWrk.getWrkSts() == 15) { |
| | | //出库任务 |
| | | // taskWrk.setWrkSts(14);//12.吊车出库中 => 14.出库完成 |
| | | taskWrk.setStatus(TaskStatusType.OVER.id); |
| | |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(9999L); |
| | | locMastService.updateById(locMast); |
| | | } else if (taskWrk.getIoType() == 3) { |
| | | } else if (taskWrk.getIoType() == 3 && taskWrk.getWrkSts() == 5) { |
| | | |
| | | //更新起始库位状态 |
| | | LocMast locMastStart = locMastService.selectByLocNo(taskWrk.getStartPoint()); |