From aaca80a3282bf6b8a0fe2dc56810c78be0f4c1c4 Mon Sep 17 00:00:00 2001 From: xuyang <748613696@qq.com> Date: Wed, 13 Sep 2023 15:55:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/HarmonicServiceImpl.java | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/HarmonicServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/HarmonicServiceImpl.java index e1136600b..872eec463 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/HarmonicServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/HarmonicServiceImpl.java @@ -149,25 +149,24 @@ public class HarmonicServiceImpl implements IHarmonicService { List finalAllData = allData; deptList.forEach(item->{ List lineList = item.getLineIndexes(); - if (!CollectionUtils.isEmpty(lineList)){ + if (!CollectionUtils.isEmpty(lineList)){ - HarmonicDeptVO harmonicDeptVO = new HarmonicDeptVO(); - List collect = limitTargetNew.stream().filter(x -> lineList.contains(x.getLineId())).collect(Collectors.toList()); + HarmonicDeptVO harmonicDeptVO = new HarmonicDeptVO(); + List collect = limitTargetNew.stream().filter(x -> lineList.contains(x.getLineId())).collect(Collectors.toList()); - List sumList = finalAllData.stream().filter(x -> lineList.contains(x.getLineId())).collect(Collectors.toList()); + List 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); - harmonicDeptVO.setId(item.getIndex()); - harmonicDeptVO.setName(item.getName()); - list.add(harmonicDeptVO); - } - - }); + BeanUtil.copyProperties(areaDTO,harmonicDeptVO); + harmonicDeptVO.setId(item.getIndex()); + harmonicDeptVO.setName(item.getName()); + list.add(harmonicDeptVO); + } + }); 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; } @@ -440,7 +439,7 @@ public class HarmonicServiceImpl implements IHarmonicService { } else { 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(); areaDTO.setOnlineCount(onlineCount); areaDTO.setOverLineCount(overLineCount);