Browse Source

修改104号模型

main
sjh 1 year ago
parent
commit
0c5f94f97c
  1. 6
      src/main/java/com/biutag/supervision/service/ModelClueService.java

6
src/main/java/com/biutag/supervision/service/ModelClueService.java

@ -1085,8 +1085,9 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
BigDecimal sumOfPercentages = departPercentageMap.values().stream() BigDecimal sumOfPercentages = departPercentageMap.values().stream()
.reduce(BigDecimal.ZERO, BigDecimal::add); .reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal avgPercentage = sumOfPercentages.divide(BigDecimal.valueOf(departPercentageMap.size()), 3, RoundingMode.HALF_UP); BigDecimal avgPercentage = sumOfPercentages.divide(BigDecimal.valueOf(departPercentageMap.size()), 3, RoundingMode.HALF_UP);
BigDecimal multiply = avgPercentage.multiply(new BigDecimal("0.5"));
List<String> highPercentageDepartments = departPercentageMap.entrySet().stream() List<String> 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) .map(Map.Entry::getKey)
.toList(); .toList();
for (String department : highPercentageDepartments) { for (String department : highPercentageDepartments) {
@ -1107,7 +1108,8 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
+ "在" + getDateString(params.get(0)) + "到" + getDateString(params.get(1)) + "在" + getDateString(params.get(0)) + "到" + getDateString(params.get(1))
+ "之间变更了" + departNumMap.get(department) + "个警情的结警性质,占全市的" + "之间变更了" + departNumMap.get(department) + "个警情的结警性质,占全市的"
+ convertToPercentString(departPercentageMap.get(department)) + ",超过了全市单位平均值(" + convertToPercentString(departPercentageMap.get(department)) + ",超过了全市单位平均值("
+ convertToPercentString(avgPercentage) + ")的50%以上,存在大量变更接警性质的异常情况。"); + convertToPercentString(avgPercentage) + ")的50%(即"
+ convertToPercentString(multiply) + ")以上,存在大量变更接警性质的异常情况。");
newModelClue.setData(newModelClue.getThingDesc()); newModelClue.setData(newModelClue.getThingDesc());
modelClues.add(newModelClue); modelClues.add(newModelClue);
} }

Loading…
Cancel
Save