| | |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<BasStationArea, BaseParam> pageParam = new PageParam<>(baseParam, BasStationArea.class); |
| | | PageParam<BasStationArea, BaseParam> page = basStationAreaService.page(pageParam, pageParam.buildWrapper(true)); |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok().add(page); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(page)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStationArea:list')") |
| | | @PostMapping("/basStationArea/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(basStationAreaService.list()); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(basStationAreaService.list())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStationArea:list')") |
| | | @PostMapping({"/basStationArea/many/{ids}", "/basStationAreas/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(basStationAreaService.listByIds(Arrays.asList(ids))); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(basStationAreaService.listByIds(Arrays.asList(ids)))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStationArea:list')") |
| | | @GetMapping("/basStationArea/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(basStationAreaService.getById(id)); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(basStationAreaService.getById(id))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStationArea:save')") |
| | |
| | | if (!basStationAreaService.save(basStationArea)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(basStationArea); |
| | | return R.ok("Save Success").add(buildPageRowsUtils.rowsMap(basStationArea)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStationArea:update')") |
| | |
| | | if (!basStationAreaService.updateById(basStationArea)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(basStationArea); |
| | | return R.ok("Update Success").add(buildPageRowsUtils.rowsMap(basStationArea)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStationArea:remove')") |
| | |
| | | if (!basStationAreaService.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:basStationArea:list')") |
| | |
| | | basStationAreaService.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:basStationArea:list')") |
| | | @PostMapping("/basStationArea/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(basStationAreaService.list(), BasStationArea.class), response); |
| | | ExcelUtil.build(ExcelUtil.create(buildPageRowsUtils.rowsMap(basStationAreaService.list()), BasStationArea.class), response); |
| | | } |
| | | |
| | | } |