From 0c5f94f97cce45bcb4168119517a7f376f270405 Mon Sep 17 00:00:00 2001 From: sjh Date: Fri, 15 Nov 2024 20:01:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9104=E5=8F=B7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/biutag/supervision/service/ModelClueService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index 31b20f6..0492dde 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -1085,8 +1085,9 @@ public class ModelClueService extends ServiceImpl { BigDecimal sumOfPercentages = departPercentageMap.values().stream() .reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal avgPercentage = sumOfPercentages.divide(BigDecimal.valueOf(departPercentageMap.size()), 3, RoundingMode.HALF_UP); + BigDecimal multiply = avgPercentage.multiply(new BigDecimal("0.5")); List highPercentageDepartments = departPercentageMap.entrySet().stream() - .filter(entry -> entry.getValue().compareTo(avgPercentage.multiply(new BigDecimal("1.5"))) < 0) + .filter(entry -> entry.getValue().compareTo(multiply) > 0) .map(Map.Entry::getKey) .toList(); for (String department : highPercentageDepartments) { @@ -1107,7 +1108,8 @@ public class ModelClueService extends ServiceImpl { + "在" + getDateString(params.get(0)) + "到" + getDateString(params.get(1)) + "之间变更了" + departNumMap.get(department) + "个警情的结警性质,占全市的" + convertToPercentString(departPercentageMap.get(department)) + ",超过了全市单位平均值(" - + convertToPercentString(avgPercentage) + ")的50%以上,存在大量变更接警性质的异常情况。"); + + convertToPercentString(avgPercentage) + ")的50%(即" + + convertToPercentString(multiply) + ")以上,存在大量变更接警性质的异常情况。"); newModelClue.setData(newModelClue.getThingDesc()); modelClues.add(newModelClue); }