|
|
@ -2915,22 +2915,26 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
|
} |
|
|
|
ProjectDistributionAnalysisRightResultDTO result = new ProjectDistributionAnalysisRightResultDTO(); |
|
|
|
List<ProjectDistributionAnalysisRightDTO> orgList = new ArrayList<>(); |
|
|
|
Result<List<SonOrgResultDTO>> sonOrgList = govOrgOpenFeignClient.getSonAgencyId(formDTO.getOrgId(), agencyInfo.getLevel()); |
|
|
|
if (!sonOrgList.success() || CollectionUtils.isEmpty(sonOrgList.getData())){ |
|
|
|
throw new EpmetException(String.format("查询组织{%s}的下级组织失败或为空...",formDTO.getOrgId())); |
|
|
|
} |
|
|
|
List<SonOrgResultDTO> orgIds = sonOrgList.getData(); |
|
|
|
if (!agencyInfo.getLevel().equals(ProjectConstant.ORG_LEVEL_COMMUNITY)){ |
|
|
|
Result<List<String>> sonAgencyIdResult = govOrgOpenFeignClient.getSonAgencyId(formDTO.getOrgId()); |
|
|
|
if (!sonAgencyIdResult.success()){ |
|
|
|
throw new EpmetException(String.format("查询组织{%s}的下级组织失败...",formDTO.getOrgId())); |
|
|
|
} |
|
|
|
List<String> agencyIds = sonAgencyIdResult.getData(); |
|
|
|
if (CollectionUtils.isNotEmpty(agencyIds)){ |
|
|
|
orgList = baseDao.selectProjectCountByOrg(agencyIds,formDTO.getStartDate(),formDTO.getEndDate()); |
|
|
|
} |
|
|
|
orgList = baseDao.selectProjectCountByOrg(orgIds.stream().map(m -> m.getPids()).collect(Collectors.toList()), formDTO.getStartDate(),formDTO.getEndDate()); |
|
|
|
}else { |
|
|
|
for (SonOrgResultDTO o : orgIds) { |
|
|
|
ProjectDistributionAnalysisRightDTO dto = new ProjectDistributionAnalysisRightDTO(); |
|
|
|
dto.setOrgId(o.getOrgId()); |
|
|
|
orgList.add(dto); |
|
|
|
} |
|
|
|
Result<List<ProjectDistributionAnalysisRightDTO>> projectCountByGrid = govIssueOpenFeignClient.getProjectCountByGrid(formDTO); |
|
|
|
if (!projectCountByGrid.success()){ |
|
|
|
throw new EpmetException("查询网格项目数失败..."); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(projectCountByGrid.getData())){ |
|
|
|
orgList = projectCountByGrid.getData(); |
|
|
|
orgList.stream().forEach(o -> projectCountByGrid.getData().stream().filter(p -> p.getOrgId().equals(o.getOrgId())).forEach(p -> o.setCount(p.getCount()))); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (CollectionUtils.isEmpty(orgList)){ |
|
|
|