|
@ -135,15 +135,10 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
if (customerIds.size() != NumConstant.ZERO) { |
|
|
if (customerIds.size() != NumConstant.ZERO) { |
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); |
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); |
|
|
customerIds.forEach(customerId -> { |
|
|
customerIds.forEach(customerId -> { |
|
|
Boolean status = true; |
|
|
|
|
|
try { |
|
|
try { |
|
|
List<DimAgencyDTO> customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); |
|
|
List<DimAgencyDTO> customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); |
|
|
List<List<DimAgencyDTO>> partition = ListUtils.partition(customerAgencyInfos, NumConstant.ONE_HUNDRED); |
|
|
List<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); |
|
|
for (List<DimAgencyDTO> p : partition) { |
|
|
factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily, customerId); |
|
|
List<AgencyGroupDailyResultDTO> agencyGroupDaily = this.getAgencyGroupDaily(p, dimIdBean, customerId); |
|
|
|
|
|
factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily, customerId,status); |
|
|
|
|
|
status = false; |
|
|
|
|
|
} |
|
|
|
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
log.error(String.format(GroupConstant.STATS_FAILED_AGENCY_DAILY, customerId, LocalDate.now(), e)); |
|
|
log.error(String.format(GroupConstant.STATS_FAILED_AGENCY_DAILY, customerId, LocalDate.now(), e)); |
|
|
} |
|
|
} |
|
@ -186,13 +181,13 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
* @Description 网格小组 【机关-日】 数据统计处理 |
|
|
* @Description 网格小组 【机关-日】 数据统计处理 |
|
|
* @author zxc |
|
|
* @author zxc |
|
|
*/ |
|
|
*/ |
|
|
public List<AgencyGroupDailyResultDTO> getAgencyGroupDaily(List<DimAgencyDTO> agencyList, DimIdGenerator.DimIdBean timeDim, String customerId) { |
|
|
public List<AgencyGroupDailyResultDTO> getAgencyGroupDaily(List<DimAgencyDTO> customerAgencyInfos, DimIdGenerator.DimIdBean timeDim, String customerId) { |
|
|
if (CollectionUtils.isEmpty(agencyList)) { |
|
|
if (customerAgencyInfos.size() == NumConstant.ZERO) { |
|
|
return new ArrayList<>(); |
|
|
return new ArrayList<>(); |
|
|
} |
|
|
} |
|
|
List<AgencyGroupDailyResultDTO> result = new ArrayList<>(); |
|
|
List<AgencyGroupDailyResultDTO> result = new ArrayList<>(); |
|
|
String dateId = timeDim.getDateId(); |
|
|
String dateId = timeDim.getDateId(); |
|
|
// List<DimAgencyEntity> agencyList = dimAgencyService.getAgencyListByCustomerId(customerId);
|
|
|
List<DimAgencyEntity> agencyList = dimAgencyService.getAgencyListByCustomerId(customerId); |
|
|
agencyList.forEach(agency -> { |
|
|
agencyList.forEach(agency -> { |
|
|
AgencyGroupDailyResultDTO agencyResult = new AgencyGroupDailyResultDTO(); |
|
|
AgencyGroupDailyResultDTO agencyResult = new AgencyGroupDailyResultDTO(); |
|
|
String agencyId = agency.getId(); |
|
|
String agencyId = agency.getId(); |
|
|