Browse Source

网格小组统计

dev_shibei_match
zxc 5 years ago
parent
commit
55c742edc6
  1. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java

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

Loading…
Cancel
Save