From 45922fe81452034a9842607de25d2ef41fc51247 Mon Sep 17 00:00:00 2001 From: duwenyuan <15600000461@163.com> Date: Fri, 19 Dec 2025 19:03:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=93=81=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=88=86=E6=9E=90=E6=A8=A1=E5=9D=97=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SampleStatAnalysisService.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/jeecg-module-data-analyze/src/main/java/org/jeecg/service/impl/SampleStatAnalysisService.java b/jeecg-module-data-analyze/src/main/java/org/jeecg/service/impl/SampleStatAnalysisService.java index a0ca737..32fc7e1 100644 --- a/jeecg-module-data-analyze/src/main/java/org/jeecg/service/impl/SampleStatAnalysisService.java +++ b/jeecg-module-data-analyze/src/main/java/org/jeecg/service/impl/SampleStatAnalysisService.java @@ -220,13 +220,28 @@ public class SampleStatAnalysisService extends ServiceImpl> groupedByNuclideName = nuclideActConcIntvlList.stream() .filter(p -> p.getNuclideName() != null) .collect(Collectors.groupingBy(NuclideActConcIntvl::getNuclideName)); + + Map> sortedByCount = groupedByNuclideName.entrySet().stream() + .sorted(Map.Entry.>comparingByValue( + Comparator.comparingInt(List::size) + ).reversed()) // .reversed() 表示从多到少 + .collect(Collectors.toMap( + Map.Entry::getKey, + Map.Entry::getValue, + (e1, e2) -> e1, + LinkedHashMap::new // 使用 LinkedHashMap + )); + + + //查询级别 getSample List nuclideNames = new ArrayList<>(groupedByNuclideName.keySet()); if (CollectionUtils.isNotEmpty(nuclideNames)) { //通过台站ID、核素名称查找阈值 thresholdResultHisDataList = this.baseMapper.selectByStationAndNuclides(schemaName, Integer.valueOf(stationCode), nuclideNames, startTime, endTime); } - resultMap.put("nuclideActConcIntvlList", groupedByNuclideName); + // resultMap.put("nuclideActConcIntvlList", groupedByNuclideName); + resultMap.put("nuclideActConcIntvlList", sortedByCount); resultMap.put("sampleLevelDataList", sampleLevelDataList); resultMap.put("thresholdResultHisDataList", thresholdResultHisDataList); result.setSuccess(true); @@ -239,6 +254,7 @@ public class SampleStatAnalysisService extends ServiceImpl> entry : groupByStation.entrySet()) { String displayCode = entry.getKey(); @@ -606,6 +626,8 @@ public class SampleStatAnalysisService extends ServiceImpl