|
@@ -79,20 +79,30 @@ public class AreaEnvBuilder extends AreaIndicatorsParagraphBuilder {
|
|
|
projectCount = itemMapList.get(0).get(AreaEnvContentCodes.projectsCount.name());
|
|
|
|
|
|
// 项目达标率最差的指标
|
|
|
- Map<String, Integer> worstSortMap = new HashMap<>();
|
|
|
- worstSortMap.put(AreaEnvContentCodes.unqualifiedCount.name(), -1);
|
|
|
- DataUtils.sort(itemMapList, worstSortMap);
|
|
|
- worstIndicator = itemMapList.get(0).get(ItemAttrConstants.NAME);
|
|
|
- worstIndicatorNoncomplianceProjectCount = itemMapList.get(0).get(
|
|
|
- AreaEnvContentCodes.unqualifiedCount.name());
|
|
|
+ List<Map<String, String>> worstMap = itemMapList.stream().filter(
|
|
|
+ map -> map.get(AreaEnvContentCodes.unqualifiedCount.name()) != null).
|
|
|
+ collect(Collectors.toList());
|
|
|
+ if (!CollectionUtils.isEmpty(worstMap)) {
|
|
|
+ Map<String, Integer> worstSortMap = new HashMap<>();
|
|
|
+ worstSortMap.put(AreaEnvContentCodes.unqualifiedCount.name(), -1);
|
|
|
+ DataUtils.sort(worstMap, worstSortMap);
|
|
|
+ worstIndicator = worstMap.get(0).get(ItemAttrConstants.NAME);
|
|
|
+ worstIndicatorNoncomplianceProjectCount = worstMap.get(0).get(
|
|
|
+ AreaEnvContentCodes.unqualifiedCount.name());
|
|
|
+ }
|
|
|
|
|
|
// 项目达标率最好的指标
|
|
|
- Map<String, Integer> bestSortMap = new HashMap<>();
|
|
|
- bestSortMap.put(AreaEnvContentCodes.qualifiedCount.name(), -1);
|
|
|
- DataUtils.sort(itemMapList, bestSortMap);
|
|
|
- bestIndicator = itemMapList.get(0).get(ItemAttrConstants.NAME);
|
|
|
- bestIndicatorComplianceProjectCount = itemMapList.get(0).get(
|
|
|
- AreaEnvContentCodes.qualifiedCount.name());
|
|
|
+ List<Map<String, String>> bestMap = itemMapList.stream().filter(
|
|
|
+ map -> map.get(AreaEnvContentCodes.qualifiedCount.name()) != null).
|
|
|
+ collect(Collectors.toList());
|
|
|
+ if (!CollectionUtils.isEmpty(bestMap)) {
|
|
|
+ Map<String, Integer> bestSortMap = new HashMap<>();
|
|
|
+ bestSortMap.put(AreaEnvContentCodes.qualifiedCount.name(), -1);
|
|
|
+ DataUtils.sort(bestMap, bestSortMap);
|
|
|
+ bestIndicator = bestMap.get(0).get(ItemAttrConstants.NAME);
|
|
|
+ bestIndicatorComplianceProjectCount = bestMap.get(0).get(
|
|
|
+ AreaEnvContentCodes.qualifiedCount.name());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 总项目数
|
|
@@ -161,7 +171,7 @@ public class AreaEnvBuilder extends AreaIndicatorsParagraphBuilder {
|
|
|
Map<String, AttrValueVO> attrValueMap = attrValueList2Map(statisticCodeSet, projectItemValue.getAttrs());
|
|
|
|
|
|
// 统计各项目达标率
|
|
|
- GraphItemVO graphItemVO = new GraphItemVO(simpleProjectInfo.getProjectName(),
|
|
|
+ GraphItemVO graphItemVO = new GraphItemVO(simpleProjectInfo.getProjectLocalName(),
|
|
|
DataUtils.parseDouble(attrValueMap.get(ProjectEnvContentCodes.complianceRate.name()).getValue()),
|
|
|
AttrValueTypeEnum.number_2, DataConstants.PERCENT);
|
|
|
projectsComplianceRate.add(graphItemVO);
|