| | |
| | | if (param == null) { |
| | | return R.error("参数不能为空"); |
| | | } |
| | | |
| | | List<CreateOutTaskParam> taskList = param.getTaskList(); |
| | | if (taskList == null || taskList.size() == 0) { |
| | | return R.error("任务列表不能为空"); |
| | | boolean result = commonService.createOutTaskBatch(param); |
| | | if (result) { |
| | | return R.ok(); |
| | | } |
| | | |
| | | for (CreateOutTaskParam createOutTaskParam : taskList) { |
| | | if (createOutTaskParam == null) { |
| | | throw new CoolException("任务参数不能为空"); |
| | | } |
| | | commonService.createOutTask(createOutTaskParam); |
| | | } |
| | | return R.ok(); |
| | | return R.error("生成批量出库任务失败"); |
| | | } |
| | | |
| | | @PostMapping("/completeTask") |
| | |
| | | return R.error("任务取消失败"); |
| | | } |
| | | |
| | | @PostMapping("/manualRollbackTask") |
| | | @OpenApiLog(memo = "任务人工回滚") |
| | | public R manualRollbackTask(@RequestBody ManualRollbackTaskParam param) { |
| | | if (param == null) { |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean rollback = commonService.manualRollbackTask(param); |
| | | if (rollback) { |
| | | return R.ok(); |
| | | } |
| | | return R.error("任务人工回滚失败"); |
| | | } |
| | | |
| | | @PostMapping("/cancelTaskBatch") |
| | | @OpenApiLog(memo = "任务批量取消") |
| | | public R cancelTaskBatch(@RequestBody CancelTaskBatchParam param) { |
| | |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | @PostMapping("/updateTaskPriorityAndBatchSeq") |
| | | @OpenApiLog(memo = "修改任务优先级和批次序号") |
| | | public R updateTaskPriorityAndBatchSeq(@RequestBody UpdateTaskPriorityAndBatchSeqParam param) { |
| | | if (param == null) { |
| | | return R.error("参数不能为空"); |
| | | } |
| | | boolean result = commonService.updateTaskPriorityAndBatchSeq(param); |
| | | if (result) { |
| | | return R.ok(); |
| | | } |
| | | return R.error("修改任务优先级和批次序号失败"); |
| | | } |
| | | |
| | | @PostMapping("/deviceStatus") |
| | | // @OpenApiLog(memo = "获取设备状态") |
| | | public R getDeviceStatus() { |