|
@ -2861,7 +2861,14 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
ProjectDistributionAnalysisRightResultDTO result = new ProjectDistributionAnalysisRightResultDTO(); |
|
|
ProjectDistributionAnalysisRightResultDTO result = new ProjectDistributionAnalysisRightResultDTO(); |
|
|
List<ProjectDistributionAnalysisRightDTO> orgList = new ArrayList<>(); |
|
|
List<ProjectDistributionAnalysisRightDTO> orgList = new ArrayList<>(); |
|
|
if (!agencyInfo.getLevel().equals(ProjectConstant.ORG_LEVEL_COMMUNITY)){ |
|
|
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()); |
|
|
|
|
|
} |
|
|
}else { |
|
|
}else { |
|
|
Result<List<ProjectDistributionAnalysisRightDTO>> projectCountByGrid = govIssueOpenFeignClient.getProjectCountByGrid(formDTO); |
|
|
Result<List<ProjectDistributionAnalysisRightDTO>> projectCountByGrid = govIssueOpenFeignClient.getProjectCountByGrid(formDTO); |
|
|
if (!projectCountByGrid.success()){ |
|
|
if (!projectCountByGrid.success()){ |
|
@ -2871,6 +2878,21 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit |
|
|
orgList = projectCountByGrid.getData(); |
|
|
orgList = projectCountByGrid.getData(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(orgList)){ |
|
|
|
|
|
result.setList(orgList); |
|
|
|
|
|
} |
|
|
|
|
|
List<Integer> allCount = orgList.stream().map(m -> m.getCount()).collect(Collectors.toList()); |
|
|
|
|
|
Integer max = Collections.max(allCount); |
|
|
|
|
|
Integer min = Collections.min(allCount); |
|
|
|
|
|
if (orgList.size() == NumConstant.ONE || max.compareTo(min) == NumConstant.ZERO){ |
|
|
|
|
|
result.setUnder(orgList.get(NumConstant.ZERO).getCount().toString()); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
Integer minRange = min + ((max - min) / NumConstant.THREE); |
|
|
|
|
|
Integer maxRange = min + ((max - min) * NumConstant.TWO / NumConstant.THREE); |
|
|
|
|
|
result.setUnder(minRange.toString().concat("以下")); |
|
|
|
|
|
result.setMiddle(minRange.toString().concat("-").concat(maxRange.toString())); |
|
|
|
|
|
result.setAbove(maxRange.toString().concat("以上")); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|