| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean completeTask(Long taskId) { |
| | | Task task = taskService.getById(taskId); |
| | | if(task == null){ |
| | | throw new CoolException("任务不存在"); |
| | | } |
| | | |
| | | List<TaskDetl> taskDetls = taskDetlService.getTaskDetlByTaskId(taskId); |
| | | if (taskDetls.isEmpty()) { |
| | | throw new CoolException("任务明细不存在"); |
| | | } |
| | | |
| | | if (task.getTaskType() < 100) { |
| | | //入库 |
| | | task.setTaskSts(99L);//99.入库完成 |
| | | }else { |
| | | //出库 |
| | | task.setTaskSts(199L);//199.出库完成 |
| | | } |
| | | |
| | | task.setUpdateTime(new Date()); |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务更新失败"); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public boolean cancelTask(Long taskId) { |
| | | Task task = taskService.getById(taskId); |