| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.controller.params.ReviseLogParams; |
| | | import com.vincent.rsf.server.manager.entity.ReviseLog; |
| | | import com.vincent.rsf.server.manager.service.ReviseLogService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | |
| | | @Autowired |
| | | private ReviseLogService reviseLogService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:reviseLog:list')") |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping("/reviseLog/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | |
| | | return R.ok().add(reviseLogService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:reviseLog:list')") |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping("/reviseLog/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(reviseLogService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:reviseLog:list')") |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping({"/reviseLog/many/{ids}", "/reviseLogs/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(reviseLogService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:reviseLog:list')") |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @GetMapping("/reviseLog/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(reviseLogService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:reviseLog:save')") |
| | | @PreAuthorize("hasAuthority('manager:locRevise:save')") |
| | | @OperationLog("Create 库位调整历史") |
| | | @PostMapping("/reviseLog/save") |
| | | public R save(@RequestBody ReviseLog reviseLog) { |
| | |
| | | return R.ok("Save Success").add(reviseLog); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:reviseLog:update')") |
| | | @PreAuthorize("hasAuthority('manager:locRevise:update')") |
| | | @OperationLog("Update 库位调整历史") |
| | | @PostMapping("/reviseLog/update") |
| | | public R update(@RequestBody ReviseLog reviseLog) { |
| | |
| | | return R.ok("Update Success").add(reviseLog); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:reviseLog:remove')") |
| | | @PreAuthorize("hasAuthority('manager:locRevise:update')") |
| | | @OperationLog("save 库存调整明细") |
| | | @PostMapping("/reviseLog/items/save") |
| | | public R update(@RequestBody ReviseLogParams reviseLog) { |
| | | if (Objects.isNull(reviseLog)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return R.ok().add(reviseLogService.reviseLoc(reviseLog, getLoginUserId())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:remove')") |
| | | @OperationLog("Delete 库位调整历史") |
| | | @PostMapping("/reviseLog/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:reviseLog:list')") |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping("/reviseLog/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:reviseLog:list')") |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping("/reviseLog/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(reviseLogService.list(), ReviseLog.class), response); |