diff --git a/src/main/java/com/biutag/supervision/SupervisionApplication.java b/src/main/java/com/biutag/supervision/SupervisionApplication.java index e49e064..b4a1987 100644 --- a/src/main/java/com/biutag/supervision/SupervisionApplication.java +++ b/src/main/java/com/biutag/supervision/SupervisionApplication.java @@ -16,4 +16,4 @@ public class SupervisionApplication { SpringApplication.run(SupervisionApplication.class, args); } -} \ No newline at end of file +} diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java index 78c9a04..4fe9ca2 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java @@ -41,4 +41,16 @@ public interface NegativeBlameMapper extends BaseMapper { " where leadIdCode is not null and LENGTH(leadIdCode) > 0 and crtTime > '2024-01-01 00:00:00'" + " GROUP BY leadIdCode order by number desc limit 10") List statisticsBlame3(); + + @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 ") + List selectBlameList(); + + @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'") + 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'") + List selectBlameListNotIvPerson(); } diff --git a/src/main/java/com/biutag/supervision/service/ProblemSourceService.java b/src/main/java/com/biutag/supervision/service/ProblemSourceService.java index 14c72fb..df7f96e 100644 --- a/src/main/java/com/biutag/supervision/service/ProblemSourceService.java +++ b/src/main/java/com/biutag/supervision/service/ProblemSourceService.java @@ -52,10 +52,7 @@ public class ProblemSourceService { CompletableFutureUtil.runSyncObject(() -> build.negativeTotal(negativeMapper.selectCount(new LambdaQueryWrapper() .in(Negative::getCheckStatus, List.of(1, 2)).ge(Negative::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0))).intValue())) ).join(); - List list = blameMapper.selectList(new LambdaQueryWrapper() - .select(NegativeBlame::getBlameIdCode) - .ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) - .isNotNull(NegativeBlame::getBlameIdCode)); + List list = blameMapper.selectBlameList(); Long count = list.stream().map(NegativeBlame::getBlameIdCode).distinct().count(); build.peopleCount(count.intValue()); ProblemSourceStatisticsVo vo = build.build(); @@ -229,21 +226,17 @@ public class ProblemSourceService { Map mapPeopleCount = new HashMap<>(); Map mapPerson = new HashMap<>(); - List tmp = blameMapper.selectList(new LambdaQueryWrapper() - .select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart) - .ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) - .isNotNull(NegativeBlame::getBlameIdCode) - .isNotNull(NegativeBlame::getThreeLevelDapart)); + List tmp = blameMapper.selectBlameList(); for (NegativeBlame negativeBlame : tmp) { - if (departMap.get(negativeBlame.getThreeLevelDapart()) == null) { + if (departMap.get(negativeBlame.getBlameDepartId()) == null) { continue; } if (mapPerson.get(negativeBlame.getBlameIdCode()) != null) { continue; } - Integer count = Optional.ofNullable(mapPeopleCount.get(negativeBlame.getThreeLevelDapart())).orElse(0); + Integer count = Optional.ofNullable(mapPeopleCount.get(negativeBlame.getBlameDepartId())).orElse(0); count++; - mapPeopleCount.put(negativeBlame.getThreeLevelDapart(), count); + mapPeopleCount.put(negativeBlame.getBlameDepartId(), count); } mapPerson = null; // 统计 @@ -290,21 +283,17 @@ public class ProblemSourceService { Map mapPeopleCount = new HashMap<>(); Map mapPerson = new HashMap<>(); - List tmp = blameMapper.selectList(new LambdaQueryWrapper() - .select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart) - .ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) - .isNotNull(NegativeBlame::getBlameIdCode) - .isNotNull(NegativeBlame::getThreeLevelDapart)); + List tmp = blameMapper.selectBlameList(); for (NegativeBlame negativeBlame : tmp) { - if (departMap.get(negativeBlame.getThreeLevelDapart()) == null) { + if (departMap.get(negativeBlame.getBlameDepartId()) == null) { continue; } if (mapPerson.get(negativeBlame.getBlameIdCode()) != null) { continue; } - Integer count = Optional.ofNullable(mapPeopleCount.get(negativeBlame.getThreeLevelDapart())).orElse(0); + Integer count = Optional.ofNullable(mapPeopleCount.get(negativeBlame.getBlameDepartId())).orElse(0); count++; - mapPeopleCount.put(negativeBlame.getThreeLevelDapart(), count); + mapPeopleCount.put(negativeBlame.getBlameDepartId(), count); } mapPerson = null; // 统计 @@ -360,13 +349,9 @@ public class ProblemSourceService { Map mapPeopleCount = new HashMap<>(); Map mapPerson = new HashMap<>(); - List tmp = blameMapper.selectList(new LambdaQueryWrapper() - .select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart) - .ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) - .isNotNull(NegativeBlame::getBlameIdCode) - .isNotNull(NegativeBlame::getThreeLevelDapart)); + List tmp = blameMapper.selectBlameList(); for (NegativeBlame negativeBlame : tmp) { - StatisticsDepart depart = departMap.get(negativeBlame.getThreeLevelDapart()); + StatisticsDepart depart = departMap.get(negativeBlame.getBlameDepartId()); if (depart == null) { continue; } diff --git a/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java b/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java index 03f7cb3..fe2d138 100644 --- a/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java +++ b/src/main/java/com/biutag/supervision/service/RiskStatisticsService.java @@ -107,11 +107,7 @@ public class RiskStatisticsService { * @return */ public List personStatistics() { - List blames = blameMapper.selectList(new LambdaQueryWrapper() - .select(NegativeBlame::getBlameName, NegativeBlame::getBlameIdCode) - .ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) - .isNotNull(NegativeBlame::getBlameIdCode) - .eq(NegativeBlame::getIvPersonTypeCode, "1")); + List blames = blameMapper.selectBlameListIvPerson(); Map blameMap = blames.stream().collect(Collectors.toMap(NegativeBlame::getBlameIdCode, Function.identity(), (oldValue, newValue) -> newValue)); List list = policeMapper.statisticsPolice(); for (RiskStatisticsVo riskStatisticsVo : list) { @@ -130,11 +126,7 @@ public class RiskStatisticsService { * @return */ public List personStatistics2() { - List blames = blameMapper.selectList(new LambdaQueryWrapper() - .select(NegativeBlame::getBlameName, NegativeBlame::getBlameIdCode) - .ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) - .isNotNull(NegativeBlame::getBlameIdCode) - .ne(NegativeBlame::getIvPersonTypeCode, "1")); + List blames = blameMapper.selectBlameListNotIvPerson(); Map blameMap = blames.stream().collect(Collectors.toMap(NegativeBlame::getBlameIdCode, Function.identity(), (oldValue, newValue) -> newValue)); List list = policeMapper.statisticsPolice2(); for (RiskStatisticsVo riskStatisticsVo : list) { @@ -153,11 +145,7 @@ public class RiskStatisticsService { * @return */ public List leaderStatistics() { - List blames = blameMapper.selectList(new LambdaQueryWrapper() - .select(NegativeBlame::getLeadIdCode, NegativeBlame::getLeadName) - .ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) - .isNotNull(NegativeBlame::getLeadIdCode) - .ne(NegativeBlame::getIvPersonTypeCode, "1")); + List blames = blameMapper.selectBlameList(); Map blameMap = blames.stream().collect(Collectors.toMap(NegativeBlame::getLeadIdCode, Function.identity(), (oldValue, newValue) -> newValue)); List list = policeMapper.statisticsLeader(); for (RiskStatisticsVo riskStatisticsVo : list) { diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 7c967c0..8d5ffff 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -14,10 +14,10 @@ spring: password: ip12341234 data: redis: - host: 127.0.0.1 + host: 172.31.217.20 # 端口,默认为6379 - port: 6379 - password: 123456 + port: 30079 + password: ip1234!@#$ #mybatis-plus: # configuration: @@ -33,4 +33,4 @@ springdoc: - group: 'plugin' paths-to-match: - '/api/plugin/**' - - '/login' \ No newline at end of file + - '/login'