| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | |
| | | private CheckOrderItemService checkOrderItemService; |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:check:list')") |
| | | @PostMapping("/checkItem/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | |
| | | return R.ok().add(checkOrderItemService.page(pageParam, wrapper)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:check:list')") |
| | | @PostMapping("/checkItem/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(checkOrderItemService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:check:list')") |
| | | @PostMapping({"/checkItem/many/{ids}", "/checkItem/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(checkOrderItemService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:check:list')") |
| | | @GetMapping("/checkItem/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(checkOrderItemService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkItem:save')") |
| | | @PreAuthorize("hasAuthority('manager:check:save')") |
| | | @OperationLog("Create 字典数据集") |
| | | @PostMapping("/checkItem/save") |
| | | public R save(@RequestBody AsnOrderItem order) { |
| | |
| | | return R.ok("Save Success").add(order); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkItem:update')") |
| | | @PreAuthorize("hasAuthority('manager:check:update')") |
| | | @OperationLog("Update 字典数据集") |
| | | @PostMapping("/checkItem/update") |
| | | public R update(@RequestBody AsnOrderItem order) { |
| | |
| | | return R.ok("Update Success").add(order); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkItem:remove')") |
| | | @PreAuthorize("hasAuthority('manager:check:remove')") |
| | | @OperationLog("Delete 字典数据集") |
| | | @PostMapping("/checkItem/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:check:list')") |
| | | @PostMapping("/checkItem/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | |
| | | * @description: 盘点单导出 |
| | | * @version 1.0 |
| | | */ |
| | | @PreAuthorize("hasAuthority('manager:checkItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:check:list')") |
| | | @PostMapping("/checkItem/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | List<AsnOrderItem> orders = new ArrayList<>(); |
| | |
| | | */ |
| | | @PostMapping("/checkItem/template/download") |
| | | @ApiOperation("下载盘点单模板") |
| | | @PreAuthorize("hasAuthority('manager:checkItem:update')") |
| | | @PreAuthorize("hasAuthority('manager:check:update')") |
| | | public void downloadTemplate(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | CheckOrderTemplate template = ExcelUtil.mockData(CheckOrderTemplate.class); |
| | | List<CheckOrderTemplate> list = Arrays.asList(template); |