| | |
| | | } |
| | | page.setRecords(records); |
| | | |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | } |
| | | page.setRecords(records); |
| | | |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | } |
| | | page.setRecords(records); |
| | | |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyIsptItem:list')") |
| | | @PostMapping("/qlyIsptItem/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(qlyIsptItemService.list()); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(qlyIsptItemService.list())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyIsptItem:list')") |
| | | @PostMapping({"/qlyIsptItem/many/{ids}", "/qlyIsptItems/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(qlyIsptItemService.listByIds(Arrays.asList(ids))); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(qlyIsptItemService.listByIds(Arrays.asList(ids)))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyIsptItem:list')") |
| | | @GetMapping("/qlyIsptItem/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(qlyIsptItemService.getById(id)); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(qlyIsptItemService.getById(id))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyIsptItem:save')") |
| | |
| | | if (!qlyIsptItemService.save(qlyIsptItem)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(qlyIsptItem); |
| | | return R.ok("Save Success").add(buildPageRowsUtils.rowsMap(qlyIsptItem)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyIsptItem:update')") |
| | |
| | | if (!qlyIsptItemService.updateById(qlyIsptItem)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(qlyIsptItem); |
| | | return R.ok("Update Success").add(buildPageRowsUtils.rowsMap(qlyIsptItem)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyIsptItem:remove')") |
| | |
| | | if (!qlyIsptItemService.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:qlyIsptItem:list')") |
| | |
| | | qlyIsptItemService.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:qlyIsptItem:list')") |
| | | @PostMapping("/qlyIsptItem/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(qlyIsptItemService.list(), QlyIsptItem.class), response); |
| | | ExcelUtil.build(ExcelUtil.create(buildPageRowsUtils.rowsMap(qlyIsptItemService.list()), QlyIsptItem.class), response); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyIsptItem:update')") |