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