Commit d861e6f5 authored by libin's avatar libin

会员与租车订单统计

parent 942b22a5
......@@ -3,6 +3,7 @@ package com.xxfc.platform.order.contant.enumerate;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import com.xxfc.platform.order.entity.OrderReceivedStatisticsBase;
import org.apache.commons.collections4.CollectionUtils;
import org.assertj.core.util.Lists;
import java.util.ArrayList;
......@@ -34,24 +35,34 @@ public enum StatisticsStatusEnum {
orderPayWays = Lists.newArrayList("1","2");
}
public static List<String> statisticsSateGroup(List<Integer> companyIdList){
public static List<String> statisticsSateGroupWithCompanys(List<Integer> companyIdList){
List<String> orderStatisticsStateGroups = new ArrayList<>();
for (Integer companyId : companyIdList) {
for (String orderOrigin : orderOrigins) {
for (String orderPayWay : orderPayWays) {
for (String orderState : orderStates) {
// 公司id-订单来源-支付方式-订单状态
orderStatisticsStateGroups.add(String.format("%d-%s-%s-%s",companyId,orderOrigin,orderPayWay,orderState));
}
List<String> stateGroup = statisticsStateGroup();
for (String stgp : stateGroup) {
for (Integer companyId : companyIdList) {
// 公司id-订单来源-支付方式-订单状态
orderStatisticsStateGroups.add(String.format("%d-%s",companyId,stgp));
}
}
return orderStatisticsStateGroups;
}
public static List<String> statisticsStateGroup(){
List<String> orderStatisticsStateGroups = new ArrayList<>();
for (String orderOrigin : orderOrigins) {
for (String orderPayWay : orderPayWays) {
for (String orderState : orderStates) {
//订单来源-支付方式-订单状态
orderStatisticsStateGroups.add(String.format("%s-%s-%s",orderOrigin,orderPayWay,orderState));
}
}
}
return orderStatisticsStateGroups;
}
public static List<String> getOtherStatisticsStateGroup(List<Integer> companyIdList,List<String> statisticsStates){
List<String> sateGroup = statisticsSateGroup(companyIdList);
sateGroup.retainAll(statisticsStates);
return sateGroup;
List<String> stateGroupList = CollectionUtils.isEmpty(companyIdList)?statisticsStateGroup():statisticsSateGroupWithCompanys(companyIdList);
stateGroupList.retainAll(statisticsStates);
return stateGroupList;
}
public static<T extends OrderReceivedStatisticsBase> T wrapStatisticsObject(Date date,String stateGroup,T targetObj){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment