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 9723363..7ea30ec 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java @@ -114,6 +114,21 @@ public class ProfileDepartController { // 个人问题排名 List policeBarList = profileDepartMapper.selectPoliceTop10(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 -> { + ProfileDepart.RadarIndicatorItem radarIndicatorItem = new ProfileDepart.RadarIndicatorItem(); + radarIndicatorItem.setMax(max); + radarIndicatorItem.setName(item.getLabel()); + return radarIndicatorItem; + }).toList(); + List problemTypeRadarData = problemTypeBarList.stream().map(BarItem::getValue).toList(); + profileDepart.setProblemTypeRadarIndicator(problemTypeRadarIndicator); + profileDepart.setProblemTypeRadarData(problemTypeRadarData); + // 突出问题排名 + profileDepart.setProblemTypeBarList(problemTypeBarList); return Result.success(profileDepart); } diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java index 3567937..30e48f6 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java @@ -11,6 +11,7 @@ import com.biutag.supervision.mapper.ProfilePoliceMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.domain.ProfileDepart; import com.biutag.supervision.pojo.domain.ProfilePolice; +import com.biutag.supervision.pojo.dto.common.BarItem; import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.entity.BusinessDepart; import com.biutag.supervision.pojo.entity.BusinessPolice; @@ -110,6 +111,18 @@ public class ProfilePoliceController { Map> businessTypeGroup = list.stream().collect(Collectors.groupingBy(Negative::getBusinessTypeCode)); List businessTypeList = businessTypeGroup.keySet().stream().map(key -> new PieItem(BusinessTypeEnum.get(key).getLabel(), businessTypeGroup.get(key).size())).toList(); profilePolice.setBusinessTypeList(businessTypeList); + // 风险问题构成 雷达图 + List problemTypeBarList = profilePoliceMapper.selectProblemType(idCode, beginTime, endTime); + int max = problemTypeBarList.stream().mapToInt(BarItem::getValue).max().getAsInt(); + List problemTypeRadarIndicator = problemTypeBarList.stream().map(item -> { + ProfileDepart.RadarIndicatorItem radarIndicatorItem = new ProfileDepart.RadarIndicatorItem(); + radarIndicatorItem.setMax(max); + radarIndicatorItem.setName(item.getLabel()); + return radarIndicatorItem; + }).toList(); + List problemTypeRadarData = problemTypeBarList.stream().map(BarItem::getValue).toList(); + profilePolice.setProblemTypeRadarIndicator(problemTypeRadarIndicator); + profilePolice.setProblemTypeRadarData(problemTypeRadarData); return Result.success(profilePolice); } diff --git a/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java index 498511f..afd1aa7 100644 --- a/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java @@ -2,6 +2,7 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.dto.common.BarItem; +import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.model.DepartNegativeModel; import java.util.Date; @@ -15,7 +16,8 @@ public interface ProfileDepartMapper { Page queryDepartNegative(Page page, Date beginTime, Date endTime, String departName, String departId); - int getNegativePoliceSize(List idCodes); List selectPoliceTop10(String departId, Date beginTime, Date endTime); + + List selectProblemType(String departId, Date beginTime, Date endTime); } diff --git a/src/main/java/com/biutag/supervision/mapper/ProfilePoliceMapper.java b/src/main/java/com/biutag/supervision/mapper/ProfilePoliceMapper.java index 21f1e3d..c843269 100644 --- a/src/main/java/com/biutag/supervision/mapper/ProfilePoliceMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/ProfilePoliceMapper.java @@ -1,6 +1,7 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.dto.common.BarItem; import com.biutag.supervision.pojo.model.DepartNegativeModel; import com.biutag.supervision.pojo.model.PoliceNegativeModel; @@ -15,5 +16,6 @@ public interface ProfilePoliceMapper { Page queryPoliceNegative(Page page, Date beginTime, Date endTime, String name, String empNo, String departId); + List selectProblemType(String idCode, Date beginTime, Date endTime); } 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 5140cc1..ba8d6aa 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java @@ -22,6 +22,18 @@ public class ProfileDepart { private List problemSourcesList = new ArrayList<>(); private List businessTypeList = new ArrayList<>(); private List policeBarList = new ArrayList<>(); + // 雷达图 + private List problemTypeRadarIndicator = new ArrayList<>(); + private List problemTypeRadarData = new ArrayList<>(); + private List problemTypeBarList = new ArrayList<>(); + + @Setter + @Getter + @Accessors(chain = true) + public static class RadarIndicatorItem { + private Integer max; + private String name; + } @Setter @Getter diff --git a/src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java b/src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java index a4901ab..a69eb60 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java @@ -20,4 +20,8 @@ public class ProfilePolice { private NegativeInfo negativeInfo = new NegativeInfo(); private List problemSourcesList = new ArrayList<>(); private List businessTypeList = new ArrayList<>(); + + // 雷达图 + private List problemTypeRadarIndicator = new ArrayList<>(); + private List problemTypeRadarData = new ArrayList<>(); } diff --git a/src/main/resources/mapper/ProfileDepartMapper.xml b/src/main/resources/mapper/ProfileDepartMapper.xml index cf77e97..c405103 100644 --- a/src/main/resources/mapper/ProfileDepartMapper.xml +++ b/src/main/resources/mapper/ProfileDepartMapper.xml @@ -6,23 +6,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - + + \ No newline at end of file diff --git a/src/main/resources/mapper/ProfilePoliceMapper.xml b/src/main/resources/mapper/ProfilePoliceMapper.xml index c326958..e7b3fc0 100644 --- a/src/main/resources/mapper/ProfilePoliceMapper.xml +++ b/src/main/resources/mapper/ProfilePoliceMapper.xml @@ -47,5 +47,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" verify_size DESC + \ No newline at end of file