Commit d861e6f5 authored by libin's avatar libin

会员与租车订单统计

parent 942b22a5
...@@ -3,6 +3,7 @@ package com.xxfc.platform.order.contant.enumerate; ...@@ -3,6 +3,7 @@ package com.xxfc.platform.order.contant.enumerate;
import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import com.xxfc.platform.order.entity.OrderReceivedStatisticsBase; import com.xxfc.platform.order.entity.OrderReceivedStatisticsBase;
import org.apache.commons.collections4.CollectionUtils;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -34,24 +35,34 @@ public enum StatisticsStatusEnum { ...@@ -34,24 +35,34 @@ public enum StatisticsStatusEnum {
orderPayWays = Lists.newArrayList("1","2"); 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<>(); List<String> orderStatisticsStateGroups = new ArrayList<>();
for (Integer companyId : companyIdList) { List<String> stateGroup = statisticsStateGroup();
for (String orderOrigin : orderOrigins) { for (String stgp : stateGroup) {
for (String orderPayWay : orderPayWays) { for (Integer companyId : companyIdList) {
for (String orderState : orderStates) { // 公司id-订单来源-支付方式-订单状态
// 公司id-订单来源-支付方式-订单状态 orderStatisticsStateGroups.add(String.format("%d-%s",companyId,stgp));
orderStatisticsStateGroups.add(String.format("%d-%s-%s-%s",companyId,orderOrigin,orderPayWay,orderState)); }
} }
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; return orderStatisticsStateGroups;
} }
public static List<String> getOtherStatisticsStateGroup(List<Integer> companyIdList,List<String> statisticsStates){ public static List<String> getOtherStatisticsStateGroup(List<Integer> companyIdList,List<String> statisticsStates){
List<String> sateGroup = statisticsSateGroup(companyIdList); List<String> stateGroupList = CollectionUtils.isEmpty(companyIdList)?statisticsStateGroup():statisticsSateGroupWithCompanys(companyIdList);
sateGroup.retainAll(statisticsStates); stateGroupList.retainAll(statisticsStates);
return sateGroup; return stateGroupList;
} }
public static<T extends OrderReceivedStatisticsBase> T wrapStatisticsObject(Date date,String stateGroup,T targetObj){ 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