This commit is contained in:
2023-09-13 15:55:51 +08:00
parent 995b665ae4
commit aaca80a328

View File

@@ -149,25 +149,24 @@ public class HarmonicServiceImpl implements IHarmonicService {
List<RStatLimitTargetDPO> finalAllData = allData; List<RStatLimitTargetDPO> finalAllData = allData;
deptList.forEach(item->{ deptList.forEach(item->{
List<String> lineList = item.getLineIndexes(); List<String> lineList = item.getLineIndexes();
if (!CollectionUtils.isEmpty(lineList)){ if (!CollectionUtils.isEmpty(lineList)){
HarmonicDeptVO harmonicDeptVO = new HarmonicDeptVO(); HarmonicDeptVO harmonicDeptVO = new HarmonicDeptVO();
List<RStatLimitTargetDPO> collect = limitTargetNew.stream().filter(x -> lineList.contains(x.getLineId())).collect(Collectors.toList()); List<RStatLimitTargetDPO> collect = limitTargetNew.stream().filter(x -> lineList.contains(x.getLineId())).collect(Collectors.toList());
List<RStatLimitTargetDPO> sumList = finalAllData.stream().filter(x -> lineList.contains(x.getLineId())).collect(Collectors.toList()); List<RStatLimitTargetDPO> sumList = finalAllData.stream().filter(x -> lineList.contains(x.getLineId())).collect(Collectors.toList());
AreaDTO areaDTO = handleDataNew(collect, sumList, param.getStatisticalType().getCode()); AreaDTO areaDTO = handleDataNew(collect, sumList, param.getStatisticalType().getCode());
BeanUtil.copyProperties(areaDTO,harmonicDeptVO); BeanUtil.copyProperties(areaDTO,harmonicDeptVO);
harmonicDeptVO.setId(item.getIndex()); harmonicDeptVO.setId(item.getIndex());
harmonicDeptVO.setName(item.getName()); harmonicDeptVO.setName(item.getName());
list.add(harmonicDeptVO); list.add(harmonicDeptVO);
} }
});
});
if (!CollectionUtils.isEmpty(list)){ if (!CollectionUtils.isEmpty(list)){
return list.stream().sorted(Comparator.comparing(HarmonicDeptVO::getRatio).reversed().thenComparing(HarmonicDeptVO::getOnlineCount).thenComparing(HarmonicDeptVO::getOverLineCount)).collect(Collectors.toList()); return list.stream().sorted(Comparator.comparing(HarmonicDeptVO::getRatio).reversed().thenComparing(HarmonicDeptVO::getOnlineCount).thenComparing(HarmonicDeptVO::getOverLineCount)).collect(Collectors.toList());
} }
return list; return list;
} }
@@ -440,7 +439,7 @@ public class HarmonicServiceImpl implements IHarmonicService {
} else { } else {
avgOverDay = overLineCount == 0?0.0:BigDecimal.valueOf(overCountByDay*1.0/overLineCount).setScale(2, RoundingMode.HALF_UP).doubleValue(); avgOverDay = overLineCount == 0?0.0:BigDecimal.valueOf(overCountByDay*1.0/overLineCount).setScale(2, RoundingMode.HALF_UP).doubleValue();
} }
//月监测点超标占比 //月监测点符合性超标占比
ratio = map.size() == 0?0:BigDecimal.valueOf(ratio*100/map.size()).setScale(2, RoundingMode.HALF_UP).doubleValue(); ratio = map.size() == 0?0:BigDecimal.valueOf(ratio*100/map.size()).setScale(2, RoundingMode.HALF_UP).doubleValue();
areaDTO.setOnlineCount(onlineCount); areaDTO.setOnlineCount(onlineCount);
areaDTO.setOverLineCount(overLineCount); areaDTO.setOverLineCount(overLineCount);