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