| | |
| | | list.add("col"); |
| | | list.add("lev"); |
| | | PageParam<Loc, BaseParam> page = locService.page(pageParam, pageParam.buildWrapper(true, list)); |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok().add(page); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(page)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:list')") |
| | | @PostMapping("/locPreview/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(locService.list()); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locService.list())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:list')") |
| | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:list')") |
| | | @PostMapping({"/locPreview/many/{ids}", "/locPreview/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(locService.listByIds(Arrays.asList(ids))); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locService.listByIds(Arrays.asList(ids)))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:list')") |
| | | @GetMapping("/locPreview/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(locService.getById(id)); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locService.getById(id))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:save')") |
| | |
| | | if (!locService.saveType(loc)) { |
| | | throw new CoolException("库位类型关联关系保存失败!!"); |
| | | } |
| | | return R.ok("Save Success").add(loc); |
| | | return R.ok("Save Success").add(buildPageRowsUtils.rowsMap(loc)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:update')") |
| | |
| | | if (!locService.updateLoc(loc)) { |
| | | throw new CoolException("库位类型关联关系修改失败!!"); |
| | | } |
| | | return R.ok("Update Success").add(loc); |
| | | return R.ok("Update Success").add(buildPageRowsUtils.rowsMap(loc)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:remove')") |
| | |
| | | if (!locService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | return R.ok("Delete Success").add(buildPageRowsUtils.rowsMap(ids)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:list')") |
| | |
| | | locService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getCode())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(vos)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:list')") |
| | |
| | | } else { |
| | | locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getStatus, 1)); |
| | | } |
| | | ExcelUtil.build(ExcelUtil.create(locs, Loc.class), response); |
| | | ExcelUtil.build(ExcelUtil.create(buildPageRowsUtils.rowsMap(locs), Loc.class), response); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locPreview:update')") |