|
@@ -1,5 +1,6 @@
|
|
|
package com.poteviohealth.cgp.statistics.utils;
|
|
package com.poteviohealth.cgp.statistics.utils;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
import com.poteviohealth.cgp.common.integrated.order.model.PayAccount;
|
|
import com.poteviohealth.cgp.common.integrated.order.model.PayAccount;
|
|
@@ -7,6 +8,7 @@ import com.poteviohealth.cgp.statistics.constant.enums.OrderConstantEnum;
|
|
|
import com.poteviohealth.cgp.statistics.mapper.OrderMapper;
|
|
import com.poteviohealth.cgp.statistics.mapper.OrderMapper;
|
|
|
import com.poteviohealth.cgp.statistics.model.outdto.OrderExcelDTO;
|
|
import com.poteviohealth.cgp.statistics.model.outdto.OrderExcelDTO;
|
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
|
|
|
+import lombok.extern.log4j.Log4j2;
|
|
|
import org.apache.commons.lang3.EnumUtils;
|
|
import org.apache.commons.lang3.EnumUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
@@ -18,16 +20,17 @@ import java.util.concurrent.RecursiveTask;
|
|
|
* @author Qin
|
|
* @author Qin
|
|
|
*/
|
|
*/
|
|
|
@Data
|
|
@Data
|
|
|
|
|
+@Log4j2
|
|
|
public class OrderExcelTask extends RecursiveTask<List<OrderExcelDTO>> {
|
|
public class OrderExcelTask extends RecursiveTask<List<OrderExcelDTO>> {
|
|
|
|
|
|
|
|
private static final int MAX = 10000;
|
|
private static final int MAX = 10000;
|
|
|
private int start;
|
|
private int start;
|
|
|
private int end;
|
|
private int end;
|
|
|
- private QueryWrapper queryWrapper;
|
|
|
|
|
|
|
+ private String queryWrapper;
|
|
|
private Integer operatorId;
|
|
private Integer operatorId;
|
|
|
private String dbName;
|
|
private String dbName;
|
|
|
private OrderMapper orderMapper;
|
|
private OrderMapper orderMapper;
|
|
|
- public OrderExcelTask(int start, int end, QueryWrapper queryWrapper,Integer operatorId,String dbName,OrderMapper orderMapper){
|
|
|
|
|
|
|
+ public OrderExcelTask(int start, int end, String queryWrapper,Integer operatorId,String dbName,OrderMapper orderMapper){
|
|
|
super();
|
|
super();
|
|
|
this.end = end;
|
|
this.end = end;
|
|
|
this.start =start;
|
|
this.start =start;
|
|
@@ -45,9 +48,10 @@ public class OrderExcelTask extends RecursiveTask<List<OrderExcelDTO>> {
|
|
|
int page = (end - start);
|
|
int page = (end - start);
|
|
|
if (page < 2) {
|
|
if (page < 2) {
|
|
|
// 小于最大值 直接执行
|
|
// 小于最大值 直接执行
|
|
|
- list.addAll(orderMapper.orderExcel(queryWrapper,dbName,operatorId,(start-1)*MAX,MAX));
|
|
|
|
|
|
|
+ log.info("queryWrapper==="+ queryWrapper.length());
|
|
|
|
|
+ list.addAll(orderMapper.orderExcel(JSONObject.parseObject(queryWrapper, QueryWrapper.class),dbName,operatorId,(start-1)*MAX,MAX));
|
|
|
if(page == 1){
|
|
if(page == 1){
|
|
|
- list.addAll(orderMapper.orderExcel(queryWrapper,dbName,operatorId,(end-1)*MAX,MAX));
|
|
|
|
|
|
|
+ list.addAll(orderMapper.orderExcel(JSONObject.parseObject(queryWrapper, QueryWrapper.class),dbName,operatorId,(end-1)*MAX,MAX));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (OrderExcelDTO orderExcelDTO : list) {
|
|
for (OrderExcelDTO orderExcelDTO : list) {
|