导出订单归集
This commit is contained in:
@@ -329,4 +329,23 @@ public class OmsOrderController {
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
|
||||
@GetMapping("/exportExcel2")
|
||||
@ApiOperation(value = "订单归集列表导出")
|
||||
public void exportExcel2(OmsOrderLocationQuery omsOrderLocationQuery) {
|
||||
//得到所有要导出的数据
|
||||
List<OrderExcelVo> excelVos = IOmsOrderService.listExcel2(omsOrderLocationQuery);
|
||||
//定义导出的excel名字
|
||||
String excelName = "订单归集列表";
|
||||
String fileNameURL = "";
|
||||
try {
|
||||
fileNameURL = URLEncoder.encode(excelName, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//导出订单列表
|
||||
ExportExcelUtils.export(fileNameURL, excelVos, OrderExcelVo.class, response);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -85,4 +85,5 @@ public interface IOmsOrderService extends IService<OmsOrder> {
|
||||
List<OmsOrderLocation> getPickupPoint(String id);
|
||||
|
||||
List<OrderExcelVo> listExcel(OmsOrderQuery omsOrderQuery);
|
||||
List<OrderExcelVo> listExcel2(OmsOrderLocationQuery omsOrderLocationQuery);
|
||||
}
|
||||
|
||||
@@ -375,4 +375,26 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
|
||||
}
|
||||
return orders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderExcelVo> listExcel2(OmsOrderLocationQuery omsOrderLocationQuery) {
|
||||
QueryWrapper<OmsOrder> qw = new QueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(omsOrderLocationQuery.getValueqhd())) {
|
||||
qw.eq("receiver_detail_address", omsOrderLocationQuery.getValueqhd());
|
||||
}
|
||||
if (StringUtils.isNotBlank(omsOrderLocationQuery.getValueszd())) {
|
||||
qw.eq("receiver_region", omsOrderLocationQuery.getValueszd());
|
||||
}
|
||||
if (StringUtils.isNotBlank(omsOrderLocationQuery.getReceiverPhone())) {
|
||||
qw.like("receiver_phone", omsOrderLocationQuery.getReceiverPhone());
|
||||
}
|
||||
List<OrderExcelVo> orders = new ArrayList<>();
|
||||
if (StringUtils.isBlank(omsOrderLocationQuery.getStatus())) {
|
||||
//查询全部订单
|
||||
orders = orderMapper.listExcel(qw);
|
||||
} else {
|
||||
orders = orderMapper.listExcel(qw.eq("status", omsOrderLocationQuery.getStatus()));
|
||||
}
|
||||
return orders;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user