| | |
| | | return R.ok().add(taskService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:list')") |
| | | @GetMapping("/task/orderDetlId/{orderDetlId}") |
| | | public R getByOrderDetlId(@PathVariable("orderDetlId") Long orderDetlId) { |
| | | return R.ok().add(taskService.getByOrderDetlId(orderDetlId)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:save')") |
| | | @OperationLog("添加任务") |
| | | @PostMapping("/task/save") |
| | |
| | | @PreAuthorize("hasAuthority('asrs:task:list')") |
| | | @PostMapping("/task/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(taskService.list(), Task.class), response); |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<Task, BaseParam> pageParam = new PageParam<>(baseParam, Task.class); |
| | | List<Task> data = taskService.list(pageParam.buildWrapper(true)); |
| | | |
| | | ExcelUtil.build(ExcelUtil.create(data, Task.class), response); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:update')") |
| | | @OperationLog("完成任务") |
| | | @PostMapping("/task/complete") |
| | | public R complete(@RequestBody Task task) { |
| | | try { |
| | | boolean result = workService.completeTask(task.getId()); |
| | | return R.ok("完成成功"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:update')") |
| | |
| | | public R cancel(@RequestBody Task task) { |
| | | try { |
| | | boolean result = workService.cancelTask(task.getId()); |
| | | return R.ok("修改成功"); |
| | | return R.ok("取消成功"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:update')") |
| | | @OperationLog("拣料任务") |
| | | @PostMapping("/task/pick") |
| | | public R pick(@RequestBody Task task) { |
| | | try { |
| | | boolean result = workService.pickTask(task.getId()); |
| | | return R.ok("拣料成功"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |