| | |
| | | } |
| | | |
| | | } |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok().add(page); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(page)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreas:list')") |
| | |
| | | pageResult |
| | | .setTotal(page.getTotal()) |
| | | .setRecords(page.getRecords().stream().map(this::buildOptionVo).collect(Collectors.toList())); |
| | | return R.ok().add(pageResult); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(pageResult)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStation:list')") |
| | | @PostMapping("/basStation/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(basStationService.list()); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(basStationService.list())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStation:list')") |
| | | @PostMapping({"/basStation/many/{ids}", "/basStations/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(basStationService.listByIds(Arrays.asList(ids))); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(basStationService.listByIds(Arrays.asList(ids)))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStation:list')") |
| | |
| | | station.setContainerTypes(longs1); |
| | | } |
| | | |
| | | return R.ok().add(station); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(station)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStation:save')") |
| | |
| | | if (!basStationService.save(basStation)) { |
| | | return R.error("保存失败"); |
| | | } |
| | | return R.ok("保存成功").add(basStation); |
| | | return R.ok("保存成功").add(buildPageRowsUtils.rowsMap(basStation)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStation:update')") |
| | |
| | | if (!basStationService.updateById(basStation)) { |
| | | return R.error("更新失败"); |
| | | } |
| | | return R.ok("更新成功").add(basStation); |
| | | return R.ok("更新成功").add(buildPageRowsUtils.rowsMap(basStation)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStation:remove')") |
| | |
| | | if (!basStationService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("删除失败"); |
| | | } |
| | | return R.ok("删除成功").add(ids); |
| | | return R.ok("删除成功").add(buildPageRowsUtils.rowsMap(ids)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStation:list')") |
| | |
| | | basStationService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getId())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(vos)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStation:list')") |
| | | @PostMapping("/basStation/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(basStationService.list(), BasStation.class), response); |
| | | ExcelUtil.build(ExcelUtil.create(buildPageRowsUtils.rowsMap(basStationService.list()), BasStation.class), response); |
| | | } |
| | | |
| | | private BasStationOptionVo buildOptionVo(BasStation station) { |