Browse Source

灵敏感知相关接口

main
kami 1 year ago
parent
commit
109af30aef
  1. 2
      src/main/java/com/biutag/supervision/SupervisionApplication.java
  2. 12
      src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java
  3. 37
      src/main/java/com/biutag/supervision/service/ProblemSourceService.java
  4. 18
      src/main/java/com/biutag/supervision/service/RiskStatisticsService.java
  5. 8
      src/main/resources/application-local.yml

2
src/main/java/com/biutag/supervision/SupervisionApplication.java

@ -16,4 +16,4 @@ public class SupervisionApplication {
SpringApplication.run(SupervisionApplication.class, args);
}
}
}

12
src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java

@ -41,4 +41,16 @@ public interface NegativeBlameMapper extends BaseMapper<NegativeBlame> {
" 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<BlamePerson> 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<NegativeBlame> 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<NegativeBlame> 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<NegativeBlame> selectBlameListNotIvPerson();
}

37
src/main/java/com/biutag/supervision/service/ProblemSourceService.java

@ -52,10 +52,7 @@ public class ProblemSourceService {
CompletableFutureUtil.runSyncObject(() -> build.negativeTotal(negativeMapper.selectCount(new LambdaQueryWrapper<Negative>()
.in(Negative::getCheckStatus, List.of(1, 2)).ge(Negative::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0))).intValue()))
).join();
List<NegativeBlame> list = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getBlameIdCode)
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0))
.isNotNull(NegativeBlame::getBlameIdCode));
List<NegativeBlame> 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<String, Integer> mapPeopleCount = new HashMap<>();
Map<String, String> mapPerson = new HashMap<>();
List<NegativeBlame> tmp = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart)
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0))
.isNotNull(NegativeBlame::getBlameIdCode)
.isNotNull(NegativeBlame::getThreeLevelDapart));
List<NegativeBlame> 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<String, Integer> mapPeopleCount = new HashMap<>();
Map<String, String> mapPerson = new HashMap<>();
List<NegativeBlame> tmp = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart)
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0))
.isNotNull(NegativeBlame::getBlameIdCode)
.isNotNull(NegativeBlame::getThreeLevelDapart));
List<NegativeBlame> 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<String, Integer> mapPeopleCount = new HashMap<>();
Map<String, String> mapPerson = new HashMap<>();
List<NegativeBlame> tmp = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart)
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0))
.isNotNull(NegativeBlame::getBlameIdCode)
.isNotNull(NegativeBlame::getThreeLevelDapart));
List<NegativeBlame> tmp = blameMapper.selectBlameList();
for (NegativeBlame negativeBlame : tmp) {
StatisticsDepart depart = departMap.get(negativeBlame.getThreeLevelDapart());
StatisticsDepart depart = departMap.get(negativeBlame.getBlameDepartId());
if (depart == null) {
continue;
}

18
src/main/java/com/biutag/supervision/service/RiskStatisticsService.java

@ -107,11 +107,7 @@ public class RiskStatisticsService {
* @return
*/
public List<RiskStatisticsVo> personStatistics() {
List<NegativeBlame> blames = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getBlameName, NegativeBlame::getBlameIdCode)
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0))
.isNotNull(NegativeBlame::getBlameIdCode)
.eq(NegativeBlame::getIvPersonTypeCode, "1"));
List<NegativeBlame> blames = blameMapper.selectBlameListIvPerson();
Map<String, NegativeBlame> blameMap = blames.stream().collect(Collectors.toMap(NegativeBlame::getBlameIdCode, Function.identity(), (oldValue, newValue) -> newValue));
List<RiskStatisticsVo> list = policeMapper.statisticsPolice();
for (RiskStatisticsVo riskStatisticsVo : list) {
@ -130,11 +126,7 @@ public class RiskStatisticsService {
* @return
*/
public List<RiskStatisticsVo> personStatistics2() {
List<NegativeBlame> blames = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getBlameName, NegativeBlame::getBlameIdCode)
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0))
.isNotNull(NegativeBlame::getBlameIdCode)
.ne(NegativeBlame::getIvPersonTypeCode, "1"));
List<NegativeBlame> blames = blameMapper.selectBlameListNotIvPerson();
Map<String, NegativeBlame> blameMap = blames.stream().collect(Collectors.toMap(NegativeBlame::getBlameIdCode, Function.identity(), (oldValue, newValue) -> newValue));
List<RiskStatisticsVo> list = policeMapper.statisticsPolice2();
for (RiskStatisticsVo riskStatisticsVo : list) {
@ -153,11 +145,7 @@ public class RiskStatisticsService {
* @return
*/
public List<RiskStatisticsVo> leaderStatistics() {
List<NegativeBlame> blames = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getLeadIdCode, NegativeBlame::getLeadName)
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0))
.isNotNull(NegativeBlame::getLeadIdCode)
.ne(NegativeBlame::getIvPersonTypeCode, "1"));
List<NegativeBlame> blames = blameMapper.selectBlameList();
Map<String, NegativeBlame> blameMap = blames.stream().collect(Collectors.toMap(NegativeBlame::getLeadIdCode, Function.identity(), (oldValue, newValue) -> newValue));
List<RiskStatisticsVo> list = policeMapper.statisticsLeader();
for (RiskStatisticsVo riskStatisticsVo : list) {

8
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'
- '/login'

Loading…
Cancel
Save