|
|
@ -58,17 +58,19 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
|
public void groupGridDaily(Date date) { |
|
|
|
Integer pageNo = NumConstant.ONE; |
|
|
|
Integer pageSize = NumConstant.ONE_HUNDRED; |
|
|
|
List<String> customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); |
|
|
|
if (customerIds.size() == NumConstant.ZERO){ |
|
|
|
return; |
|
|
|
} |
|
|
|
customerIds.forEach(customerId -> { |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); |
|
|
|
List<DimGridEntity> gridsInfo = dimGridService.getGridListByCustomerId(customerId); |
|
|
|
List<GroupGridDailyResultDTO> resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); |
|
|
|
factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); |
|
|
|
}); |
|
|
|
List<String> customerIds; |
|
|
|
do { |
|
|
|
customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); |
|
|
|
if (customerIds.size() != NumConstant.ZERO){ |
|
|
|
customerIds.forEach(customerId -> { |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); |
|
|
|
List<DimGridEntity> gridsInfo = dimGridService.getGridListByCustomerId(customerId); |
|
|
|
List<GroupGridDailyResultDTO> resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); |
|
|
|
factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -79,17 +81,18 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
|
public void groupAgencyDaily(Date date) { |
|
|
|
Integer pageNo = NumConstant.ONE; |
|
|
|
Integer pageSize = NumConstant.ONE_HUNDRED; |
|
|
|
List<String> customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); |
|
|
|
if (customerIds.size() == NumConstant.ZERO){ |
|
|
|
return; |
|
|
|
} |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); |
|
|
|
customerIds.forEach(customerId -> { |
|
|
|
|
|
|
|
List<DimAgencyDTO> customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); |
|
|
|
List<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); |
|
|
|
factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); |
|
|
|
}); |
|
|
|
List<String> customerIds; |
|
|
|
do { |
|
|
|
customerIds = dimCustomerService.selectCustomerIdPage(pageNo++,pageSize); |
|
|
|
if (customerIds.size() != NumConstant.ZERO){ |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); |
|
|
|
customerIds.forEach(customerId -> { |
|
|
|
List<DimAgencyDTO> customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); |
|
|
|
List<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); |
|
|
|
factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); |
|
|
|
}); |
|
|
|
} |
|
|
|
}while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -258,6 +261,8 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 获取时间维度 dateId--weekId--monthId--quarterId--yearId |
|
|
|
* 如果有自定义时间,根据自定义时间获取时间维度 |
|
|
|
* 没有自定义时间,默认获取前一天的时间维度 |
|
|
|
* @param |
|
|
|
* @author zxc |
|
|
|
*/ |
|
|
|