|
|
@@ -30,8 +30,6 @@ import com.poteviohealth.cgp.statistics.model.indto.OrderCostWebInDTO;
|
|
|
import com.poteviohealth.cgp.statistics.model.indto.OrderServiceWebInDTO;
|
|
|
import com.poteviohealth.cgp.statistics.model.outdto.*;
|
|
|
import com.poteviohealth.cgp.statistics.service.IOrderService;
|
|
|
-import com.poteviohealth.cgp.statistics.utils.CostOrderExcelTask;
|
|
|
-import com.poteviohealth.cgp.statistics.utils.DishesOrderExcelTask;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.EnumUtils;
|
|
|
@@ -45,9 +43,6 @@ import java.math.BigDecimal;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.text.ParseException;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.ForkJoinPool;
|
|
|
-import java.util.concurrent.Future;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -270,12 +265,42 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<DishesOrderWebOutDTO> orderDishes(DishesOrderWebInDTO dto) {
|
|
|
+ public List<DishesOrderWebOutDTO> orderDishes(DishesOrderWebInDTO inDTO) {
|
|
|
Integer operatorId = TokenContext.cureOperatorId();
|
|
|
- QueryWrapper queryWrapper = webQuery(dto);
|
|
|
+ QueryWrapper queryWrapper = webQuery(inDTO);
|
|
|
int count = baseMapper.dishesOrderPageListAllSize(queryWrapper,dbName,operatorId);
|
|
|
//每页1000条,计算总页数
|
|
|
int maxPage = (int) Math.ceil(count/10000.0);
|
|
|
+
|
|
|
+ int start = 0;
|
|
|
+ LinkedList<DishesOrderWebOutDTO> list = Lists.newLinkedList();
|
|
|
+ for (int i = 0; i < maxPage; i++) {
|
|
|
+ LinkedList<DishesOrderWebOutDTO> findList = baseMapper.dishesOrderExcel(queryWrapper,dbName,operatorId,start);
|
|
|
+ start = findList.getLast().getId();
|
|
|
+ list.addAll(findList);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (DishesOrderWebOutDTO dto : list) {
|
|
|
+ String val = "";
|
|
|
+ for (String s : dto.getPayAccountStr().split(",")) {
|
|
|
+ if("1".equals(s)){
|
|
|
+ val+="助餐账户,";
|
|
|
+ }else if("2".equals(s)){
|
|
|
+ val+="积分账户,";
|
|
|
+ }else if("3".equals(s)){
|
|
|
+ val+="储值账户,";
|
|
|
+ }else if("4".equals(s)){
|
|
|
+ val+="现金支付,";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(val != ""){
|
|
|
+ val = val.substring(0, val.length()-1);
|
|
|
+ }
|
|
|
+ dto.setPayAccountStr(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ /*
|
|
|
List<DishesOrderWebOutDTO> list = Lists.newArrayList();
|
|
|
ForkJoinPool pool = new ForkJoinPool();
|
|
|
try {
|
|
|
@@ -290,7 +315,7 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
|
|
|
e.printStackTrace();
|
|
|
throw new BuilderException("餐单导出失败,请重新操作");
|
|
|
}
|
|
|
- return list;
|
|
|
+ return list;*/
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -301,7 +326,13 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
|
|
|
//每页1000条,计算总页数
|
|
|
int maxPage = (int) Math.ceil(count/10000.0);
|
|
|
List<OrderCostWebOutDTO> list = Lists.newArrayList();
|
|
|
- ForkJoinPool pool = new ForkJoinPool();
|
|
|
+ int start = 0;
|
|
|
+ for (int i = 0; i < maxPage; i++) {
|
|
|
+ LinkedList<OrderCostWebOutDTO> findList = baseMapper.costOrderExcel(queryWrapper,dbName,operatorId,start);
|
|
|
+ start = findList.getLast().getId();
|
|
|
+ list.addAll(findList);
|
|
|
+ }
|
|
|
+ /* ForkJoinPool pool = new ForkJoinPool();
|
|
|
try {
|
|
|
CostOrderExcelTask task = new CostOrderExcelTask(1,maxPage, queryWrapper, operatorId, dbName,baseMapper);
|
|
|
Future<List<OrderCostWebOutDTO>> future = pool.submit(task);
|
|
|
@@ -313,7 +344,7 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
throw new BuilderException("成本核算导出失败,请重新操作");
|
|
|
- }
|
|
|
+ }*/
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@@ -352,7 +383,7 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
|
|
|
if(orderWebInDTO.getCostStatus() != null){
|
|
|
orderQueryWrapper.eq( "o.cost_status",orderWebInDTO.getCostStatus());
|
|
|
}
|
|
|
- orderQueryWrapper.orderByDesc("o.order_cost_id");
|
|
|
+ // orderQueryWrapper.orderByDesc("o.order_cost_id");
|
|
|
|
|
|
return orderQueryWrapper;
|
|
|
}
|
|
|
@@ -385,7 +416,7 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
|
|
|
orderQueryWrapper.in("o.service_station_id", orderWebInDTO.getStationIds());
|
|
|
}
|
|
|
orderQueryWrapper.eq("o.pay_status",3);
|
|
|
- orderQueryWrapper.orderByDesc("o.order_id");
|
|
|
+ //orderQueryWrapper.orderByDesc("o.id");
|
|
|
return orderQueryWrapper;
|
|
|
}
|
|
|
|