| | |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.TaskItem; |
| | | import com.vincent.rsf.server.manager.entity.Wave; |
| | | import com.vincent.rsf.server.manager.entity.WaveItem; |
| | | import com.vincent.rsf.server.manager.service.TaskItemService; |
| | | import com.vincent.rsf.server.manager.service.WaveService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @Autowired |
| | | private WaveService waveService; |
| | | @Autowired |
| | | private TaskItemService taskItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:wave:list')") |
| | | @PostMapping("/wave/page") |
| | |
| | | @OperationLog("Delete 波次单据") |
| | | @PostMapping("/wave/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (Objects.isNull(ids)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().in(TaskItem::getSourceId, ids)); |
| | | if (taskItems.isEmpty()) { |
| | | throw new CoolException("有未完成任务,不可执行删除操作!!"); |
| | | } |
| | | if (!waveService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | |
| | | if (Cools.isEmpty(map) || Cools.isEmpty(map.get("wave"))) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return waveService.publicTask(map); |
| | | return waveService.publicTask(map, getLoginUserId()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:wave:list')") |
| | | @ApiOperation("波次出库任务预览") |
| | | @PostMapping("/wave/locs/preview/page") |
| | | public R mergeWavePreview(@RequestBody Map<String, Object> map) { |
| | | if (Cools.isEmpty(map.get("wave")) || StringUtils.isBlank(map.get("wave").toString())) { |
| | | if (Cools.isEmpty(map.get("waveId")) || StringUtils.isBlank(map.get("waveId").toString())) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | Long waveId = Long.parseLong(map.get("waveId").toString()); |