| | |
| | | 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:loc:list')") |
| | | @PostMapping("/loc/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:loc:list')") |
| | | @ApiOperation(("获取库位使用率")) |
| | | @PostMapping("/loc/pie/list") |
| | | public R locPie() { |
| | | return R.ok().add(locService.getLocPies()); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locService.getLocPies())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:list')") |
| | |
| | | Page<String> emptyPage = new Page<>(current, pageSize); |
| | | emptyPage.setRecords(Collections.emptyList()); |
| | | emptyPage.setTotal(0L); |
| | | return R.ok().add(emptyPage); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(emptyPage)); |
| | | } |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, locCode).last("LIMIT 1")); |
| | | if (loc == null) { |
| | | Page<String> emptyPage = new Page<>(current, pageSize); |
| | | emptyPage.setRecords(Collections.emptyList()); |
| | | emptyPage.setTotal(0L); |
| | | return R.ok().add(emptyPage); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(emptyPage)); |
| | | } |
| | | String q = map.get("q") != null ? String.valueOf(map.get("q")).trim() : null; |
| | | if (StringUtils.isBlank(q) && map.get("condition") != null) { |
| | |
| | | Page<String> pageOut = new Page<>(current, pageSize); |
| | | pageOut.setRecords(records); |
| | | pageOut.setTotal(result.getTotal()); |
| | | return R.ok().add(pageOut); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(pageOut)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:list')") |
| | | @PostMapping({"/loc/many/{ids}", "/locs/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:loc:list')") |
| | | @GetMapping("/loc/{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:loc: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:loc: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:loc: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:loc: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:loc: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:loc:update')") |