From 3b425b0adc79b4d2901913219e4a87d6c1b50255 Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Thu, 9 Jan 2025 11:36:56 +0800 Subject: [PATCH] 250108 --- .../ProfileDepartController.java | 24 +++++++++++++------ .../pojo/domain/ProfileDepart.java | 12 ++++++---- .../pojo/entity/DataCaseVerif.java | 1 + .../service/NegativeWorkService.java | 2 +- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/sensitiveperception/ProfileDepartController.java b/src/main/java/com/biutag/supervision/controller/sensitiveperception/ProfileDepartController.java index 7444793..e54d8bf 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitiveperception/ProfileDepartController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitiveperception/ProfileDepartController.java @@ -50,6 +50,7 @@ public class ProfileDepartController { private final NegativeScoreService negativeScoreService; private final NegativeScoreDepartService negativeScoreDepartService; + private final NegativeProblemRelationService negativeProblemRelationService; @GetMapping public Result> list(DepartNegativeQueryParam param) { @@ -87,9 +88,12 @@ public class ProfileDepartController { .between(NegativeScoreDepart::getDiscoveryTime, beginTime, endTime)); List negativeIds = list.stream().map(NegativeScoreDepart::getNegativeId).toList(); - int negativePoliceSize = negativeIds.isEmpty() ? 0 : profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.police.getValue())); + if (negativeIds.isEmpty()) { + return Result.success(profileDepart); + } + int negativePoliceSize = profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.police.getValue())); profileDepart.getDepartInfo().setNegativePoliceSize(negativePoliceSize); - int negativeAuxSize = negativeIds.isEmpty() ? 0 : profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.aux.getValue(), PersonTypeEnum.xj.getValue())); + int negativeAuxSize = profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.aux.getValue(), PersonTypeEnum.xj.getValue())); profileDepart.getDepartInfo().setNegativeAuxSize(negativeAuxSize); profileDepart.getNegativeInfo().setSize(list.size()); @@ -132,18 +136,24 @@ public class ProfileDepartController { List policeBarList = profileDepartMapper.selectPoliceNegativeCount(departId, beginTime, endTime); profileDepart.setPoliceBarList(policeBarList); - // 风险问题构成 雷达图 - List problemTypeBarList = profileDepartMapper.selectProblemType(departId, beginTime, endTime); - int max = problemTypeBarList.stream().mapToInt(BarItem::getValue).max().getAsInt(); - List problemTypeRadarIndicator = problemTypeBarList.stream().map(item -> { + List problemTypeList = profileDepartMapper.selectProblemType(departId, beginTime, endTime); + int max = problemTypeList.stream().mapToInt(BarItem::getValue).max().getAsInt(); + List problemTypeRadarIndicator = problemTypeList.stream().map(item -> { ProfileDepart.RadarIndicatorItem radarIndicatorItem = new ProfileDepart.RadarIndicatorItem(); radarIndicatorItem.setMax(max); radarIndicatorItem.setName(item.getLabel()); return radarIndicatorItem; }).toList(); - profileDepart.setProblemTypeRadarIndicator(problemTypeRadarIndicator); + // 突出问题排名 + List negativeProblemRelations = negativeProblemRelationService.list(new LambdaQueryWrapper().in(NegativeProblemRelation::getNegativeId, negativeIds)); + Map> collect = negativeProblemRelations.stream().collect(Collectors.groupingBy(item -> item.getOneLevelContent() + " / " + item.getTwoLevelContent() + " / " + item.getThreeLevelContent())); + List problemTypeBarList = collect.keySet().stream().map(key -> { + return new BarItem(key, collect.get(key).size()); + }).toList(); + profileDepart.setProblemTypeBarList(problemTypeBarList); + List result = negativeScoreService.calculateDepartScore(beginTime, endTime, departId); profileDepart.setScore((BigDecimal) result.get(0)); profileDepart.setExpression(result.get(1).toString()); diff --git a/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java b/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java index 43ea4b1..20bf687 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java @@ -18,7 +18,7 @@ import java.util.List; @Getter public class ProfileDepart { - private BigDecimal score; + private BigDecimal score = new BigDecimal(0); private String expression; @@ -26,14 +26,18 @@ public class ProfileDepart { private DepartInfo departInfo = new DepartInfo(); private NegativeInfo negativeInfo = new NegativeInfo(); + // 问题来源占比 private List problemSourcesList = new ArrayList<>(); + // 业务类型占比 private List businessTypeList = new ArrayList<>(); - private List policeBarList = new ArrayList<>(); + // 雷达图 private List problemTypeRadarIndicator = new ArrayList<>(); private List scoreRadarData = new ArrayList<>(); - private List scoreTypeBarList = new ArrayList<>(); - private List weightTypeBarList = new ArrayList<>(); + // 个人问题排名 + private List policeBarList = new ArrayList<>(); + // 个人问题排名 + private List problemTypeBarList = new ArrayList<>(); @Setter @Getter diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java b/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java index dcb994b..ce64a43 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java @@ -66,6 +66,7 @@ public class DataCaseVerif { // @TableField("create_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") private LocalDateTime createTime; // 分发状态 diff --git a/src/main/java/com/biutag/supervision/service/NegativeWorkService.java b/src/main/java/com/biutag/supervision/service/NegativeWorkService.java index ce24baf..bb32983 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeWorkService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeWorkService.java @@ -71,7 +71,7 @@ public class NegativeWorkService extends ServiceImpl