| | |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.controller.params.LocToTaskParams; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | import com.vincent.rsf.server.manager.enums.TaskResouceType; |
| | | import com.vincent.rsf.server.manager.service.LocItemService; |
| | | import com.vincent.rsf.server.manager.service.LocService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<LocItem, BaseParam> pageParam = new PageParam<>(baseParam, LocItem.class); |
| | | |
| | | QueryWrapper<LocItem> wrapper = pageParam.buildWrapper(true); |
| | | FieldsUtils.setFieldsFilters(wrapper, pageParam, LocItem.class); |
| | | |
| | | /**拼接扩展字段*/ |
| | | PageParam<LocItem, BaseParam> page = locItemService.page(pageParam, pageParam.buildWrapper(true)); |
| | | PageParam<LocItem, BaseParam> page = locItemService.page(pageParam, wrapper); |
| | | List<LocItem> records = page.getRecords(); |
| | | for (LocItem record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | |
| | | } |
| | | param.setType(Constants.TASK_TYPE_OUT_STOCK); |
| | | |
| | | return locItemService.generateTask(param); |
| | | try { |
| | | locItemService.generateTask(TaskResouceType.TASK_RESOUCE_STOCK_TYPE.val, param, getLoginUserId()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (Objects.isNull(map)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return R.ok("任务生成成功").add(locItemService.genMoveTask(map)); |
| | | return R.ok("任务生成成功").add(locItemService.genMoveTask(map, getLoginUserId())); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | map.setType(Constants.TASK_TYPE_OUT_CHECK); |
| | | return R.ok("任务生成成功").add(locItemService.generateTask(map)); |
| | | |
| | | try { |
| | | locItemService.generateTask(TaskResouceType.TASK_RESOUCE_CHECK_TYPE.val, map, getLoginUserId()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | return R.ok("任务生成成功"); |
| | | } |
| | | |
| | | |
| | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | | @GetMapping("/locItem/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(locService.getById(id)); |
| | | return R.ok().add(locItemService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:save')") |