| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.wms.asrs.entity.Order; |
| | | import com.zy.asrs.wms.asrs.entity.OrderType; |
| | | import com.zy.asrs.wms.asrs.service.OrderTypeService; |
| | | import com.zy.asrs.wms.common.annotation.CacheData; |
| | | import com.zy.asrs.wms.common.annotation.OperationLog; |
| | | import com.zy.asrs.wms.common.domain.BaseParam; |
| | | import com.zy.asrs.wms.common.domain.KeyValVo; |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:orderLog:list')") |
| | | @PostMapping("/orderLog/page") |
| | | @CacheData(tableName = {"man_order_log"}) |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<OrderLog, BaseParam> pageParam = new PageParam<>(baseParam, OrderLog.class); |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:orderLog:list')") |
| | | @PostMapping("/orderLog/in/page") |
| | | @CacheData(tableName = {"man_order_log", "man_order_type"}) |
| | | public R pageIn(@RequestBody Map<String, Object> map) { |
| | | String condition = map.getOrDefault("condition", "").toString(); |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | |
| | | } |
| | | |
| | | Object paramObj = map.get("_param"); |
| | | if(paramObj != null) { |
| | | if (paramObj != null) { |
| | | Map param = (Map) paramObj; |
| | | for (Object value : param.entrySet()) { |
| | | Map.Entry entry = (Map.Entry) value; |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:orderLog:list')") |
| | | @PostMapping("/orderLog/out/page") |
| | | @CacheData(tableName = {"man_order_log", "man_order_type"}) |
| | | public R pageOut(@RequestBody Map<String, Object> map) { |
| | | String condition = map.getOrDefault("condition", "").toString(); |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:orderLog:list')") |
| | | @PostMapping("/orderLog/list") |
| | | @CacheData(tableName = {"man_order_log"}) |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(orderLogService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:orderLog:list')") |
| | | @GetMapping("/orderLog/{id}") |
| | | @CacheData(tableName = {"man_order_log"}) |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(orderLogService.getById(id)); |
| | | } |
| | |
| | | @PreAuthorize("hasAuthority('asrs:orderLog:list')") |
| | | @PostMapping("/orderLog/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(orderLogService.list(), OrderLog.class), response); |
| | | String ioModel = map.getOrDefault("ioModel", "").toString(); |
| | | map.remove("ioModel"); |
| | | |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<OrderLog, BaseParam> pageParam = new PageParam<>(baseParam, OrderLog.class); |
| | | QueryWrapper<OrderLog> queryWrapper = pageParam.buildWrapper(true); |
| | | |
| | | List<OrderLog> list = orderLogService.list(queryWrapper); |
| | | if (!Cools.isEmpty(ioModel)) { |
| | | ArrayList<Long> types = new ArrayList<>(); |
| | | for (OrderType orderType : orderTypeService.list(new LambdaQueryWrapper<OrderType>().eq(OrderType::getType, ioModel.equals("in") ? 1 : 2))) { |
| | | types.add(orderType.getId()); |
| | | } |
| | | queryWrapper.in("order_type", types); |
| | | list = orderLogService.list(queryWrapper); |
| | | } |
| | | ExcelUtil.build(ExcelUtil.create(list, OrderLog.class), response); |
| | | } |
| | | |
| | | } |