| | |
| | | @Autowired |
| | | private StockItemService stockItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:stock:list')") |
| | | @PostMapping("/stockItem/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | |
| | | return R.ok().add(stockItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:stock:list')") |
| | | @PostMapping("/stockItem/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(stockItemService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:stock:list')") |
| | | @PostMapping({"/stockItem/many/{ids}", "/stockItems/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(stockItemService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:stock:list')") |
| | | @GetMapping("/stockItem/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(stockItemService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockItem:save')") |
| | | @PreAuthorize("hasAuthority('manager:stock:save')") |
| | | @OperationLog("Create 库存明细表") |
| | | @PostMapping("/stockItem/save") |
| | | public R save(@RequestBody StockItem stockItem) { |
| | |
| | | return R.ok("Save Success").add(stockItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockItem:update')") |
| | | @PreAuthorize("hasAuthority('manager:stock:update')") |
| | | @OperationLog("Update 库存明细表") |
| | | @PostMapping("/stockItem/update") |
| | | public R update(@RequestBody StockItem stockItem) { |
| | |
| | | return R.ok("Update Success").add(stockItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockItem:remove')") |
| | | @PreAuthorize("hasAuthority('manager:stock:remove')") |
| | | @OperationLog("Delete 库存明细表") |
| | | @PostMapping("/stockItem/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:stock:list')") |
| | | @PostMapping("/stockItem/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:stockItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:stock:list')") |
| | | @PostMapping("/stockItem/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(stockItemService.list(), StockItem.class), response); |