| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | |
| | | private DeliveryItemService deliveryItemService; |
| | | @Autowired |
| | | private CompanysService companysService; |
| | | @Autowired |
| | | private DeliveryServiceImpl deliveryService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:deliveryItem:list')") |
| | | @PostMapping("/deliveryItem/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<DeliveryItem, BaseParam> pageParam = new PageParam<>(baseParam, DeliveryItem.class); |
| | | return R.ok().add(deliveryItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | QueryWrapper<DeliveryItem> wrapper = pageParam.buildWrapper(true); |
| | | return R.ok().add(deliveryItemService.page(pageParam, wrapper)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:deliveryItem:list')") |
| | | @PostMapping("/deliveryItem/filters/page") |
| | | public R filter(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<DeliveryItem, BaseParam> pageParam = new PageParam<>(baseParam, DeliveryItem.class); |
| | | QueryWrapper<DeliveryItem> wrapper = pageParam.buildWrapper(true); |
| | | wrapper.apply("anfme > work_qty + qty "); |
| | | return R.ok().add(deliveryItemService.page(pageParam, wrapper)); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:deliveryItem:list')") |
| | | @ApiOperation("分页获取列表") |
| | | @PostMapping("/deliveryItem/edit/page") |
| | | public R byPoIdspage(@RequestBody Map<String, Object> map) { |
| | | List<Long> poDetlIds = new ArrayList<>(); |
| | | if (!Objects.isNull(map.get("ids"))) { |
| | | poDetlIds = JSONArray.parseArray(JSONArray.toJSONString(map.get("ids")), Long.class); |
| | | map.remove("ids"); |
| | | } |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<DeliveryItem, BaseParam> pageParam = new PageParam<>(baseParam, DeliveryItem.class); |
| | | QueryWrapper<DeliveryItem> queryWrapper = pageParam.buildWrapper(true); |
| | | if (!poDetlIds.isEmpty()) { |
| | | queryWrapper.in("id", poDetlIds); |
| | | } else { |
| | | return R.ok(); |
| | | } |
| | | return R.ok().add(deliveryItemService.page(pageParam, queryWrapper)); |
| | | } |
| | | |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:deliveryItem:list')") |
| | | @PostMapping("/deliveryItem/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(deliveryItemService.list()); |