| | |
| | | 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; |
| | |
| | | @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); |
| | | } |
| | | |
| | | } |