| | |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | List<Integer> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id); |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs)); |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>() |
| | | .eq(Task::getId, id) |
| | | .in(Task::getTaskStatus, longs)); |
| | | |
| | | for (Task task : tasks) { |
| | | task.setTaskStatus(task.getTaskType() < (short) 100 ? TaskStsType.COMPLETE_IN.id : TaskStsType.COMPLETE_OUT.id); |
| | |
| | | |
| | | /** |
| | | * 拣料出库 |
| | | * |
| | | * @return |
| | | */ |
| | | @PreAuthorize("hasAuthority('manager:task:update')") |
| | |
| | | throw new CoolException("能数不能为空!!"); |
| | | } |
| | | try { |
| | | return R.ok(taskService.pickTask(id)); |
| | | return R.ok(taskService.pickOrCheckTask(id, "pick")); |
| | | } catch (Exception e) { |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 盘点出库 |
| | | * |
| | | * @return |
| | | */ |
| | | @PreAuthorize("hasAuthority('manager:task:update')") |
| | | @ApiOperation("拣料出库") |
| | | @PostMapping("/task/check/{id}") |
| | | public R checkTask(@PathVariable Long id) { |
| | | if (Objects.isNull(id)) { |
| | | throw new CoolException("能数不能为空!!"); |
| | | } |
| | | try { |
| | | return R.ok(taskService.pickOrCheckTask(id, "check")); |
| | | } catch (Exception e) { |
| | | throw new CoolException(e.getMessage()); |
| | | } |