From 687ba4451817bd2fc05911523d151e9d4a0f4d9c Mon Sep 17 00:00:00 2001 From: sjh Date: Sun, 17 Nov 2024 22:57:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=81=B5=E6=95=8F=E6=84=9F?= =?UTF-8?q?=E7=9F=A5=E5=A4=A7=E5=B1=8F2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biutag/supervision/service/RiskStatisticsService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java b/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java index bac8a07..ad08700 100644 --- a/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java +++ b/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java @@ -85,7 +85,12 @@ public class RiskStatisticsService { } result.add(tmp); } - result.sort(Comparator.comparing(RiskStatisticsVo::getValue, Comparator.reverseOrder())); + if (!result.isEmpty() && result.get(0).getValue() != null) { + result.sort(Comparator.comparing(RiskStatisticsVo::getValue, Comparator.reverseOrder())); + } + if (!result.isEmpty() && result.get(0).getScore() != null) { + result.sort(Comparator.comparing(RiskStatisticsVo::getScore, Comparator.reverseOrder())); + } return result; }