| | |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:orderType:list')") |
| | | @PostMapping("/orderType/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | public R query(@RequestParam(required = false) String condition, @RequestParam(required = false) Integer type) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<OrderType> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(OrderType::getName, condition); |
| | | } |
| | | if (!Cools.isEmpty(type)) { |
| | | wrapper.eq(OrderType::getType, type); |
| | | } |
| | | orderTypeService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getName())) |
| | | ); |