|
|
@ -1231,35 +1231,28 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
|
} |
|
|
|
|
|
|
|
//1.查询当前组织的直属下级组织信息【机关维度】
|
|
|
|
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|
|
|
List<ScreenCustomerAgencyDTO> subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), null); |
|
|
|
if (subAgencyList.size() < NumConstant.ONE) { |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); |
|
|
|
List<String> agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); |
|
|
|
ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId()); |
|
|
|
if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { |
|
|
|
List<ScreenCustomerAgencyDTO> subAgencies = indexService.getSubAgencyList(formDTO.getAgencyId(), agencyDTO.getAreaCode()); |
|
|
|
agencyIds = subAgencies.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); |
|
|
|
subAgencyList = subAgencies.stream().map(item -> { |
|
|
|
DimAgencyEntity entity = new DimAgencyEntity(); |
|
|
|
entity.setId(item.getAgencyId()); |
|
|
|
entity.setAgencyName(item.getAgencyName()); |
|
|
|
entity.setLevel(item.getLevel()); |
|
|
|
return entity; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
//2.按日期查询所有下级组织的事件治理指数
|
|
|
|
List<AgencyGovrnResultDTO> list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId()); |
|
|
|
|
|
|
|
//3.封装数据
|
|
|
|
for (DimAgencyEntity sub : subAgencyList) { |
|
|
|
for (ScreenCustomerAgencyDTO sub : subAgencyList) { |
|
|
|
AgencyGovrnResultDTO dto = new AgencyGovrnResultDTO(); |
|
|
|
dto.setAgencyId(sub.getId()); |
|
|
|
dto.setAgencyId(sub.getAgencyId()); |
|
|
|
dto.setAgencyName(sub.getAgencyName()); |
|
|
|
dto.setLevel(sub.getLevel()); |
|
|
|
for (AgencyGovrnResultDTO re : list) { |
|
|
|
if (sub.getId().equals(re.getAgencyId())) { |
|
|
|
if (sub.getAgencyId().equals(re.getAgencyId())) { |
|
|
|
dto.setProblemResolvedCount(re.getProblemResolvedCount()); |
|
|
|
dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio()); |
|
|
|
dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio()); |
|
|
|