|
|
|
@ -49,10 +49,12 @@ public class ProblemSourceService { |
|
|
|
CompletableFuture.allOf( |
|
|
|
CompletableFuture.allOf( |
|
|
|
CompletableFutureUtil.runSyncObject(() -> build.aTotal(businessDepartMapper.problemSum(List.of(1, 2), "2024-01-01 00:00:00"))), |
|
|
|
CompletableFutureUtil.runSyncObject(() -> build.aTotal(businessDepartMapper.problemSum(List.of(1, 2), "2024-01-01 00:00:00"))), |
|
|
|
CompletableFutureUtil.runSyncObject(() -> build.caseTotal(businessDepartMapper.problemSum(List.of(4, 5, 6), "2024-01-01 00:00:00"))), |
|
|
|
CompletableFutureUtil.runSyncObject(() -> build.caseTotal(businessDepartMapper.problemSum(List.of(4, 5, 6), "2024-01-01 00:00:00"))), |
|
|
|
CompletableFutureUtil.runSyncObject(() -> build.negativeTotal(negativeMapper.selectCount(new LambdaQueryWrapper<Negative>().in(Negative::getCheckStatus, List.of(1, 2))).intValue())) |
|
|
|
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(); |
|
|
|
).join(); |
|
|
|
List<NegativeBlame> list = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>() |
|
|
|
List<NegativeBlame> list = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>() |
|
|
|
.select(NegativeBlame::getBlameIdCode) |
|
|
|
.select(NegativeBlame::getBlameIdCode) |
|
|
|
|
|
|
|
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.isNotNull(NegativeBlame::getBlameIdCode)); |
|
|
|
.isNotNull(NegativeBlame::getBlameIdCode)); |
|
|
|
Long count = list.stream().map(NegativeBlame::getBlameIdCode).distinct().count(); |
|
|
|
Long count = list.stream().map(NegativeBlame::getBlameIdCode).distinct().count(); |
|
|
|
build.peopleCount(count.intValue()); |
|
|
|
build.peopleCount(count.intValue()); |
|
|
|
@ -63,40 +65,6 @@ public class ProblemSourceService { |
|
|
|
|
|
|
|
|
|
|
|
private final SupDepartMapper supDepartMapper; |
|
|
|
private final SupDepartMapper supDepartMapper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @param type 类型 1- 风险值 2- 问题数 3-问题发生率 |
|
|
|
|
|
|
|
* @param businessType |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void rankStatistics(Integer type, Integer businessType) { |
|
|
|
|
|
|
|
List<SupDepart> departs = supDepartMapper.selectList(new LambdaQueryWrapper<SupDepart>() |
|
|
|
|
|
|
|
.select(SupDepart::getId, SupDepart::getPid, SupDepart::getName, SupDepart::getLevel)); |
|
|
|
|
|
|
|
Map<String, SupDepart> departMap = departs.stream().collect(Collectors.toMap(SupDepart::getId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
|
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
|
|
|
|
Map<String, Integer> mapLevel2 = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Negative negative : negatives) { |
|
|
|
|
|
|
|
SupDepart depart = departMap.get(negative.getInvolveDepartId()); |
|
|
|
|
|
|
|
if (depart == null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (depart.getLevel() == 3) { |
|
|
|
|
|
|
|
Integer count = Optional.ofNullable(mapLevel3.get(negative.getInvolveDepartId())).orElse(0); |
|
|
|
|
|
|
|
count++; |
|
|
|
|
|
|
|
mapLevel3.put(negative.getInvolveDepartId(), count); |
|
|
|
|
|
|
|
depart = departMap.get(depart.getPid()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (depart.getLevel() == 2) { |
|
|
|
|
|
|
|
Integer count = Optional.ofNullable(mapLevel2.get(negative.getInvolveDepartId())).orElse(0); |
|
|
|
|
|
|
|
count++; |
|
|
|
|
|
|
|
mapLevel2.put(negative.getInvolveDepartId(), count); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final StatisticsGroupMapper statisticsGroupMapper; |
|
|
|
private final StatisticsGroupMapper statisticsGroupMapper; |
|
|
|
|
|
|
|
|
|
|
|
private final StatisticsDepartMapper departMapper; |
|
|
|
private final StatisticsDepartMapper departMapper; |
|
|
|
@ -104,7 +72,7 @@ public class ProblemSourceService { |
|
|
|
public List<RiskStatisticsVo> statisticsGroupRank() { |
|
|
|
public List<RiskStatisticsVo> statisticsGroupRank() { |
|
|
|
StatisticsGroup group = statisticsGroupMapper |
|
|
|
StatisticsGroup group = statisticsGroupMapper |
|
|
|
.selectOne(new LambdaQueryWrapper<StatisticsGroup>() |
|
|
|
.selectOne(new LambdaQueryWrapper<StatisticsGroup>() |
|
|
|
.eq(StatisticsGroup::getName, "交警大队").last("limit 1")); |
|
|
|
.eq(StatisticsGroup::getName, "交警大队").last("limit 1")); |
|
|
|
|
|
|
|
|
|
|
|
List<StatisticsDepart> list = departMapper.selectList(new LambdaQueryWrapper<StatisticsDepart>() |
|
|
|
List<StatisticsDepart> list = departMapper.selectList(new LambdaQueryWrapper<StatisticsDepart>() |
|
|
|
.eq(StatisticsDepart::getLevel, 3) |
|
|
|
.eq(StatisticsDepart::getLevel, 3) |
|
|
|
@ -113,6 +81,7 @@ public class ProblemSourceService { |
|
|
|
Map<String, StatisticsDepart> departMap = list.stream().collect(Collectors.toMap(StatisticsDepart::getDepartId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
Map<String, StatisticsDepart> departMap = list.stream().collect(Collectors.toMap(StatisticsDepart::getDepartId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
|
|
|
|
|
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
|
|
|
|
.ge(Negative::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
for (Negative negative : negatives) { |
|
|
|
for (Negative negative : negatives) { |
|
|
|
@ -131,8 +100,8 @@ public class ProblemSourceService { |
|
|
|
vo.add(v); |
|
|
|
vo.add(v); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.sort(Comparator.comparing(RiskStatisticsVo::getValue, Comparator.reverseOrder())); |
|
|
|
vo.sort(Comparator.comparing(RiskStatisticsVo::getValue, Comparator.reverseOrder())); |
|
|
|
if(vo.size() > 10) { |
|
|
|
if (vo.size() > 10) { |
|
|
|
return vo.subList(0,10); |
|
|
|
return vo.subList(0, 10); |
|
|
|
} |
|
|
|
} |
|
|
|
return vo; |
|
|
|
return vo; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -151,6 +120,7 @@ public class ProblemSourceService { |
|
|
|
Map<String, StatisticsDepart> departMap = list.stream().collect(Collectors.toMap(StatisticsDepart::getDepartId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
Map<String, StatisticsDepart> departMap = list.stream().collect(Collectors.toMap(StatisticsDepart::getDepartId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
|
|
|
|
|
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
|
|
|
|
.ge(Negative::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
for (Negative negative : negatives) { |
|
|
|
for (Negative negative : negatives) { |
|
|
|
@ -169,8 +139,8 @@ public class ProblemSourceService { |
|
|
|
vo.add(v); |
|
|
|
vo.add(v); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.sort(Comparator.comparing(RiskStatisticsVo::getValue, Comparator.reverseOrder())); |
|
|
|
vo.sort(Comparator.comparing(RiskStatisticsVo::getValue, Comparator.reverseOrder())); |
|
|
|
if(vo.size() > 10) { |
|
|
|
if (vo.size() > 10) { |
|
|
|
return vo.subList(0,10); |
|
|
|
return vo.subList(0, 10); |
|
|
|
} |
|
|
|
} |
|
|
|
return vo; |
|
|
|
return vo; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -191,6 +161,7 @@ public class ProblemSourceService { |
|
|
|
Map<String, SupDepart> areaMap = departs.stream().collect(Collectors.toMap(SupDepart::getId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
Map<String, SupDepart> areaMap = departs.stream().collect(Collectors.toMap(SupDepart::getId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
|
|
|
|
|
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
|
|
|
|
.ge(Negative::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
for (Negative negative : negatives) { |
|
|
|
for (Negative negative : negatives) { |
|
|
|
@ -242,6 +213,7 @@ public class ProblemSourceService { |
|
|
|
Map<String, StatisticsDepart> departMap = list.stream().collect(Collectors.toMap(StatisticsDepart::getDepartId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
Map<String, StatisticsDepart> departMap = list.stream().collect(Collectors.toMap(StatisticsDepart::getDepartId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
|
|
|
|
|
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
|
|
|
|
.ge(Negative::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
// *********问题数**********
|
|
|
|
// *********问题数**********
|
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
@ -259,13 +231,14 @@ public class ProblemSourceService { |
|
|
|
|
|
|
|
|
|
|
|
List<NegativeBlame> tmp = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>() |
|
|
|
List<NegativeBlame> tmp = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>() |
|
|
|
.select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart) |
|
|
|
.select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart) |
|
|
|
|
|
|
|
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.isNotNull(NegativeBlame::getBlameIdCode) |
|
|
|
.isNotNull(NegativeBlame::getBlameIdCode) |
|
|
|
.isNotNull(NegativeBlame::getThreeLevelDapart)); |
|
|
|
.isNotNull(NegativeBlame::getThreeLevelDapart)); |
|
|
|
for (NegativeBlame negativeBlame : tmp) { |
|
|
|
for (NegativeBlame negativeBlame : tmp) { |
|
|
|
if (departMap.get(negativeBlame.getThreeLevelDapart()) == null) { |
|
|
|
if (departMap.get(negativeBlame.getThreeLevelDapart()) == null) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if(mapPerson.get(negativeBlame.getBlameIdCode()) != null) { |
|
|
|
if (mapPerson.get(negativeBlame.getBlameIdCode()) != null) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
Integer count = Optional.ofNullable(mapPeopleCount.get(negativeBlame.getThreeLevelDapart())).orElse(0); |
|
|
|
Integer count = Optional.ofNullable(mapPeopleCount.get(negativeBlame.getThreeLevelDapart())).orElse(0); |
|
|
|
@ -277,18 +250,19 @@ public class ProblemSourceService { |
|
|
|
List<RiskStatisticsVo> vo = new ArrayList<>(); |
|
|
|
List<RiskStatisticsVo> vo = new ArrayList<>(); |
|
|
|
for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) { |
|
|
|
for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) { |
|
|
|
Integer humanCount = mapPeopleCount.get(entry.getKey()); |
|
|
|
Integer humanCount = mapPeopleCount.get(entry.getKey()); |
|
|
|
if(humanCount == null) continue; |
|
|
|
if (humanCount == null) continue; |
|
|
|
RiskStatisticsVo v = new RiskStatisticsVo(); |
|
|
|
RiskStatisticsVo v = new RiskStatisticsVo(); |
|
|
|
v.setName(departMap.get(entry.getKey()).getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", "")); |
|
|
|
v.setName(departMap.get(entry.getKey()).getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", "")); |
|
|
|
v.setScore(new BigDecimal(entry.getValue().toString()).divide(new BigDecimal(humanCount.toString()), 2, RoundingMode.UP).doubleValue()); |
|
|
|
v.setScore(new BigDecimal(entry.getValue().toString()).divide(new BigDecimal(humanCount.toString()), 2, RoundingMode.UP).doubleValue()); |
|
|
|
vo.add(v); |
|
|
|
vo.add(v); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.sort(Comparator.comparing(RiskStatisticsVo::getScore, Comparator.reverseOrder())); |
|
|
|
vo.sort(Comparator.comparing(RiskStatisticsVo::getScore, Comparator.reverseOrder())); |
|
|
|
if(vo.size() > 10) { |
|
|
|
if (vo.size() > 10) { |
|
|
|
return vo.subList(0,10); |
|
|
|
return vo.subList(0, 10); |
|
|
|
} |
|
|
|
} |
|
|
|
return vo; |
|
|
|
return vo; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 派出所
|
|
|
|
// 派出所
|
|
|
|
public List<RiskStatisticsVo> statisticsGroupRate2() { |
|
|
|
public List<RiskStatisticsVo> statisticsGroupRate2() { |
|
|
|
StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper<StatisticsGroup>() |
|
|
|
StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper<StatisticsGroup>() |
|
|
|
@ -301,6 +275,7 @@ public class ProblemSourceService { |
|
|
|
Map<String, StatisticsDepart> departMap = list.stream().collect(Collectors.toMap(StatisticsDepart::getDepartId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
Map<String, StatisticsDepart> departMap = list.stream().collect(Collectors.toMap(StatisticsDepart::getDepartId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
|
|
|
|
|
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
|
|
|
|
.ge(Negative::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
for (Negative negative : negatives) { |
|
|
|
for (Negative negative : negatives) { |
|
|
|
@ -317,13 +292,14 @@ public class ProblemSourceService { |
|
|
|
|
|
|
|
|
|
|
|
List<NegativeBlame> tmp = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>() |
|
|
|
List<NegativeBlame> tmp = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>() |
|
|
|
.select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart) |
|
|
|
.select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart) |
|
|
|
|
|
|
|
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.isNotNull(NegativeBlame::getBlameIdCode) |
|
|
|
.isNotNull(NegativeBlame::getBlameIdCode) |
|
|
|
.isNotNull(NegativeBlame::getThreeLevelDapart)); |
|
|
|
.isNotNull(NegativeBlame::getThreeLevelDapart)); |
|
|
|
for (NegativeBlame negativeBlame : tmp) { |
|
|
|
for (NegativeBlame negativeBlame : tmp) { |
|
|
|
if (departMap.get(negativeBlame.getThreeLevelDapart()) == null) { |
|
|
|
if (departMap.get(negativeBlame.getThreeLevelDapart()) == null) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if(mapPerson.get(negativeBlame.getBlameIdCode()) != null) { |
|
|
|
if (mapPerson.get(negativeBlame.getBlameIdCode()) != null) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
Integer count = Optional.ofNullable(mapPeopleCount.get(negativeBlame.getThreeLevelDapart())).orElse(0); |
|
|
|
Integer count = Optional.ofNullable(mapPeopleCount.get(negativeBlame.getThreeLevelDapart())).orElse(0); |
|
|
|
@ -335,15 +311,15 @@ public class ProblemSourceService { |
|
|
|
List<RiskStatisticsVo> vo = new ArrayList<>(); |
|
|
|
List<RiskStatisticsVo> vo = new ArrayList<>(); |
|
|
|
for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) { |
|
|
|
for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) { |
|
|
|
Integer humanCount = mapPeopleCount.get(entry.getKey()); |
|
|
|
Integer humanCount = mapPeopleCount.get(entry.getKey()); |
|
|
|
if(humanCount == null) continue; |
|
|
|
if (humanCount == null) continue; |
|
|
|
RiskStatisticsVo v = new RiskStatisticsVo(); |
|
|
|
RiskStatisticsVo v = new RiskStatisticsVo(); |
|
|
|
v.setName(departMap.get(entry.getKey()).getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", "")); |
|
|
|
v.setName(departMap.get(entry.getKey()).getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", "")); |
|
|
|
v.setScore(new BigDecimal(entry.getValue().toString()).divide(new BigDecimal(humanCount.toString()), 2, RoundingMode.UP).doubleValue()); |
|
|
|
v.setScore(new BigDecimal(entry.getValue().toString()).divide(new BigDecimal(humanCount.toString()), 2, RoundingMode.UP).doubleValue()); |
|
|
|
vo.add(v); |
|
|
|
vo.add(v); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.sort(Comparator.comparing(RiskStatisticsVo::getScore, Comparator.reverseOrder())); |
|
|
|
vo.sort(Comparator.comparing(RiskStatisticsVo::getScore, Comparator.reverseOrder())); |
|
|
|
if(vo.size() > 10) { |
|
|
|
if (vo.size() > 10) { |
|
|
|
return vo.subList(0,10); |
|
|
|
return vo.subList(0, 10); |
|
|
|
} |
|
|
|
} |
|
|
|
return vo; |
|
|
|
return vo; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -364,6 +340,7 @@ public class ProblemSourceService { |
|
|
|
Map<String, SupDepart> areaMap = departs.stream().collect(Collectors.toMap(SupDepart::getId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
Map<String, SupDepart> areaMap = departs.stream().collect(Collectors.toMap(SupDepart::getId, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
|
|
|
|
|
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
List<Negative> negatives = negativeMapper.selectList(new LambdaQueryWrapper<Negative>() |
|
|
|
|
|
|
|
.ge(Negative::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
.in(Negative::getCheckStatus, List.of(1, 2))); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
Map<String, Integer> mapLevel3 = new HashMap<>(); |
|
|
|
for (Negative negative : negatives) { |
|
|
|
for (Negative negative : negatives) { |
|
|
|
@ -385,6 +362,7 @@ public class ProblemSourceService { |
|
|
|
|
|
|
|
|
|
|
|
List<NegativeBlame> tmp = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>() |
|
|
|
List<NegativeBlame> tmp = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>() |
|
|
|
.select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart) |
|
|
|
.select(NegativeBlame::getBlameIdCode, NegativeBlame::getThreeLevelDapart) |
|
|
|
|
|
|
|
.ge(NegativeBlame::getCrtTime, LocalDateTime.of(2024, 1, 1, 0, 0, 0)) |
|
|
|
.isNotNull(NegativeBlame::getBlameIdCode) |
|
|
|
.isNotNull(NegativeBlame::getBlameIdCode) |
|
|
|
.isNotNull(NegativeBlame::getThreeLevelDapart)); |
|
|
|
.isNotNull(NegativeBlame::getThreeLevelDapart)); |
|
|
|
for (NegativeBlame negativeBlame : tmp) { |
|
|
|
for (NegativeBlame negativeBlame : tmp) { |
|
|
|
@ -396,7 +374,7 @@ public class ProblemSourceService { |
|
|
|
if (area == null) { |
|
|
|
if (area == null) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if(mapPerson.get(negativeBlame.getBlameIdCode()) != null) { |
|
|
|
if (mapPerson.get(negativeBlame.getBlameIdCode()) != null) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
Integer count = Optional.ofNullable(mapPeopleCount.get(depart.getPid())).orElse(0); |
|
|
|
Integer count = Optional.ofNullable(mapPeopleCount.get(depart.getPid())).orElse(0); |
|
|
|
@ -410,7 +388,7 @@ public class ProblemSourceService { |
|
|
|
List<RiskStatisticsVo> vo = new ArrayList<>(); |
|
|
|
List<RiskStatisticsVo> vo = new ArrayList<>(); |
|
|
|
for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) { |
|
|
|
for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) { |
|
|
|
Integer humanCount = mapPeopleCount.get(entry.getKey()); |
|
|
|
Integer humanCount = mapPeopleCount.get(entry.getKey()); |
|
|
|
if(humanCount == null) continue; |
|
|
|
if (humanCount == null) continue; |
|
|
|
RiskStatisticsVo v = new RiskStatisticsVo(); |
|
|
|
RiskStatisticsVo v = new RiskStatisticsVo(); |
|
|
|
v.setName(areaMap.get(entry.getKey()).getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", "")); |
|
|
|
v.setName(areaMap.get(entry.getKey()).getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", "")); |
|
|
|
v.setScore(new BigDecimal(entry.getValue().toString()).divide(new BigDecimal(humanCount.toString()), 2, RoundingMode.UP).doubleValue()); |
|
|
|
v.setScore(new BigDecimal(entry.getValue().toString()).divide(new BigDecimal(humanCount.toString()), 2, RoundingMode.UP).doubleValue()); |
|
|
|
@ -421,7 +399,6 @@ public class ProblemSourceService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<RiskStatisticsVo> trans(List<BlamePerson> list) { |
|
|
|
List<RiskStatisticsVo> trans(List<BlamePerson> list) { |
|
|
|
List<RiskStatisticsVo> vo = new ArrayList<>(); |
|
|
|
List<RiskStatisticsVo> vo = new ArrayList<>(); |
|
|
|
for (BlamePerson blamePerson : list) { |
|
|
|
for (BlamePerson blamePerson : list) { |
|
|
|
|