diff --git a/src/main/java/com/biutag/supervision/controller/datav/RiskDataController.java b/src/main/java/com/biutag/supervision/controller/datav/RiskDataController.java index 30f8062..0802146 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/RiskDataController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/RiskDataController.java @@ -34,8 +34,8 @@ public class RiskDataController { } @GetMapping("/area/risk/statistics") - public Result> areaRiskStatistics() { - return Result.success(statisticsService.riskStatisticsBigOrg()); + public Result> areaRiskStatistics(Integer bisType) { + return Result.success(statisticsService.riskStatisticsBigOrg(17)); } @GetMapping("/risk/org/statistics") diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java index 4fe9ca2..5699164 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java @@ -51,6 +51,6 @@ public interface NegativeBlameMapper extends BaseMapper { List selectBlameListIvPerson(); @Select(" select blameName, blameIdCode, blameDepartId from `negative_blame` where crtTime > '2024-01-01 00:00:00' " + - " and blameIdCode is not null and blameDepartId is not null and length(blameIdCode) > 0 and length(blameDepartId) > 0 and ivPersonTypeCode != '1'") + " and blameIdCode is not null and blameDepartId is not null and length(blameIdCode) > 0 and length(blameDepartId) > 0 and length(blameName) > 0 and ivPersonTypeCode != '1'") List selectBlameListNotIvPerson(); } diff --git a/src/main/java/com/biutag/supervision/mapper/StatisticsGroupMapper.java b/src/main/java/com/biutag/supervision/mapper/StatisticsGroupMapper.java index f21f7f4..c9bb201 100644 --- a/src/main/java/com/biutag/supervision/mapper/StatisticsGroupMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/StatisticsGroupMapper.java @@ -1,6 +1,7 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.domain.GroupMembers; import com.biutag.supervision.pojo.entity.StatisticsGroup; import org.apache.ibatis.annotations.Select; @@ -15,4 +16,12 @@ public interface StatisticsGroupMapper extends BaseMapper { + "" + "") List> getNameByGroupIds(List groupIds); -} \ No newline at end of file + + /** + * 没时间写negative_group了 + */ + @Select(" select b.groupId,a.groupName,b.membersName,b.membersCode from negative_group a inner JOIN negative_group_members b " + + " on a.groupId = b.groupId " + + " where a.type = '1' order by b.membersCode") + List selectGroupMembers(); +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/GroupMembers.java b/src/main/java/com/biutag/supervision/pojo/domain/GroupMembers.java new file mode 100644 index 0000000..370d58d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/GroupMembers.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.domain; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author kami on 2024-11-17 10:53:37 + * @version 0.0.1 + * @since 1.8 + */ + +@Data +public class GroupMembers implements Serializable { + + String groupId; + + String groupName; + + String membersName; + + String membersCode; +} diff --git a/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java b/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java index fe2d138..d485499 100644 --- a/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java +++ b/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java @@ -2,6 +2,7 @@ package com.biutag.supervision.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.biutag.supervision.mapper.*; +import com.biutag.supervision.pojo.domain.GroupMembers; import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.entity.StatisticsGroup; import com.biutag.supervision.pojo.entity.SupDepart; @@ -59,11 +60,16 @@ public class RiskStatisticsService { } /** - * 分县统计风险分 - * + * 派出所 + * @param bisType 高业务 17 中业务18低业务19 * @return 列表 */ - public List riskStatisticsBigOrg() { + public List riskStatisticsBigOrg(Integer bisType) { + List members = statisticsGroupMapper.selectGroupMembers(); + Map> memberMap = members.stream().collect(Collectors.groupingBy(GroupMembers::getGroupId)); + List membersList = memberMap.get(bisType); + Map groupMembersMap = membersList.stream().collect(Collectors.toMap(GroupMembers::getMembersCode, Function.identity(), (oldValue, newValue) -> newValue)); + StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper() .eq(StatisticsGroup::getName, "派出所").last("limit 1")); List vo = negativeScoreDepartMapper.statistics(group.getGroupId());