|
|
@@ -17,10 +17,12 @@ import com.poteviohealth.cgp.common.integrated.customer.model.SubsidyCustomerJso
|
|
|
import com.poteviohealth.cgp.common.integrated.finance.model.MemberListData;
|
|
|
import com.poteviohealth.cgp.common.integrated.finance.model.MonthData;
|
|
|
import com.poteviohealth.cgp.common.integrated.order.model.OrderStatisticsData;
|
|
|
+import com.poteviohealth.cgp.common.integrated.order.model.PayAccount;
|
|
|
import com.poteviohealth.cgp.common.integrated.partner.model.AreaDTO;
|
|
|
import com.poteviohealth.cgp.common.integrated.partner.model.EmployeeStationFace;
|
|
|
import com.poteviohealth.cgp.common.integrated.partner.model.EmployeeStationJsonFace;
|
|
|
import com.poteviohealth.cgp.common.service.impl.BaseServiceImpl;
|
|
|
+import com.poteviohealth.cgp.statistics.constant.enums.OrderConstantEnum;
|
|
|
import com.poteviohealth.cgp.statistics.mapper.OrderMapper;
|
|
|
import com.poteviohealth.cgp.statistics.model.Order;
|
|
|
import com.poteviohealth.cgp.statistics.model.indto.DishesOrderWebInDTO;
|
|
|
@@ -30,9 +32,9 @@ 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 com.poteviohealth.cgp.statistics.utils.OrderExcelTask;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.EnumUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
import org.apache.ibatis.builder.BuilderException;
|
|
|
@@ -191,18 +193,57 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
|
|
|
QueryWrapper<Order> queryWrapper2 = orderServiceQuery(dto, "o.");
|
|
|
count = baseMapper.orderPageListSize(queryWrapper2,dbName,operatorId);
|
|
|
}
|
|
|
- //每页1000条,计算总页数
|
|
|
+ //每页10000条,计算总页数
|
|
|
int maxPage = (int) Math.ceil(count/10000.0);
|
|
|
- List<OrderExcelDTO> list = Lists.newArrayList();
|
|
|
- ForkJoinPool pool = new ForkJoinPool();
|
|
|
+ int start = 0;
|
|
|
+ LinkedList<OrderExcelDTO> list = Lists.newLinkedList();
|
|
|
+ for (int i = 0; i < maxPage; i++) {
|
|
|
+ list = baseMapper.orderExcel(queryWrapper,dbName,operatorId,start);
|
|
|
+ start = list.getLast().getId();
|
|
|
+ list.addAll(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ for (OrderExcelDTO orderExcelDTO : list) {
|
|
|
+ for (OrderConstantEnum.OrderStatus status : EnumUtils.getEnumList(OrderConstantEnum.OrderStatus.class)) {
|
|
|
+ if (status.getCode().toString().equals(orderExcelDTO.getOrderStatus())) {
|
|
|
+ orderExcelDTO.setOrderStatus(status.getDisplay());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (OrderConstantEnum.PayStyle status : EnumUtils.getEnumList(OrderConstantEnum.PayStyle.class)) {
|
|
|
+ if (status.getCode().toString().equals(orderExcelDTO.getPayStyle())) {
|
|
|
+ orderExcelDTO.setPayStyle(status.getDisplay());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (OrderConstantEnum.PayStatus status : EnumUtils.getEnumList(OrderConstantEnum.PayStatus.class)) {
|
|
|
+ if (status.getCode().toString().equals(orderExcelDTO.getPayStatus())) {
|
|
|
+ orderExcelDTO.setPayStatus(status.getDisplay());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (OrderConstantEnum.OrderStyle status : EnumUtils.getEnumList(OrderConstantEnum.OrderStyle.class)) {
|
|
|
+ if (status.getCode().toString().equals(orderExcelDTO.getOrderStyle())) {
|
|
|
+ orderExcelDTO.setOrderStyle(status.getDisplay());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ orderExcelDTO.setPayAccount(getPayAccountString(orderExcelDTO.getPayAccount()));
|
|
|
+ orderExcelDTO.setStationOrGroupName(StringUtils.isNotBlank(orderExcelDTO.getGroupLeaderName())?orderExcelDTO.getGroupLeaderName():orderExcelDTO.getServiceStationName());
|
|
|
+ }
|
|
|
+ //ForkJoinPool pool = new ForkJoinPool();
|
|
|
try {
|
|
|
- OrderExcelTask task = new OrderExcelTask(1,maxPage,queryWrapper, operatorId, dbName,baseMapper);
|
|
|
+ /* OrderExcelTask task = new OrderExcelTask(1,maxPage,queryWrapper, operatorId, dbName,baseMapper);
|
|
|
Future<List<OrderExcelDTO>> future = pool.submit(task);
|
|
|
do {
|
|
|
pool.awaitTermination(1, TimeUnit.SECONDS);
|
|
|
} while (!future.isDone());
|
|
|
pool.shutdown();
|
|
|
- list = future.get();
|
|
|
+ list = future.get();*/
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
throw new BuilderException("工单导出失败,请重新操作");
|
|
|
@@ -211,6 +252,24 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ private String getPayAccountString(String payAccount){
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ for (String s : payAccount.split(",")) {
|
|
|
+ if(StringUtils.isNotBlank(s)){
|
|
|
+ for (PayAccount account : EnumUtils.getEnumList(PayAccount.class)) {
|
|
|
+ if(account.getCode().equals(Integer.parseInt(s))){
|
|
|
+ sb.append(account.getDisplay()+",");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(sb.length()>0){
|
|
|
+ return sb.substring(0,sb.length()-1);
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<DishesOrderWebOutDTO> orderDishes(DishesOrderWebInDTO dto) {
|
|
|
Integer operatorId = TokenContext.cureOperatorId();
|