Browse Source

预警问题

main
kami 1 year ago
parent
commit
3c5e8c0005
  1. 1
      src/main/java/com/biutag/supervision/config/InterceptorConfig.java
  2. 95
      src/main/java/com/biutag/supervision/controller/datav/RiskDataController.java
  3. 2
      src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java
  4. 4
      src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java
  5. 9
      src/main/java/com/biutag/supervision/mapper/NegativeScoreDepartMapper.java
  6. 26
      src/main/java/com/biutag/supervision/mapper/NegativeScorePoliceMapper.java
  7. 24
      src/main/java/com/biutag/supervision/pojo/vo/RiskStatisticsVo.java
  8. 76
      src/main/java/com/biutag/supervision/service/ProblemSourceService.java
  9. 167
      src/main/java/com/biutag/supervision/service/RiskStatisticsService.java

1
src/main/java/com/biutag/supervision/config/InterceptorConfig.java

@ -34,6 +34,7 @@ public class InterceptorConfig implements WebMvcConfigurer {
.excludePathPatterns("/login") .excludePathPatterns("/login")
.excludePathPatterns("/auth/self") .excludePathPatterns("/auth/self")
.excludePathPatterns("/file/stream/**", "/templates/**") .excludePathPatterns("/file/stream/**", "/templates/**")
.excludePathPatterns("/datav/risk/**")
.excludePathPatterns("/score/**") .excludePathPatterns("/score/**")
.excludePathPatterns(List.of("/doc.html", "/webjars/**", "/favicon.ico", "/v3/api-docs/**")); .excludePathPatterns(List.of("/doc.html", "/webjars/**", "/favicon.ico", "/v3/api-docs/**"));

95
src/main/java/com/biutag/supervision/controller/datav/RiskDataController.java

@ -0,0 +1,95 @@
package com.biutag.supervision.controller.datav;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.vo.ProblemSourceStatisticsVo;
import com.biutag.supervision.pojo.vo.RiskStatisticsVo;
import com.biutag.supervision.service.ProblemSourceService;
import com.biutag.supervision.service.RiskStatisticsService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author kami on 2024-11-16 19:16:04
* @version 0.0.1
* @since 1.8
*/
@Slf4j
@RestController
@RequestMapping("/datav/risk")
@AllArgsConstructor
public class RiskDataController {
private final ProblemSourceService sourceService;
private final RiskStatisticsService statisticsService;
@GetMapping("/total/statistics")
public Result<ProblemSourceStatisticsVo> totalStatistics() {
return Result.success(sourceService.totalStatistics());
}
@GetMapping("/area/risk/statistics")
public Result<List<RiskStatisticsVo>> areaRiskStatistics() {
return Result.success(statisticsService.riskStatisticsBigOrg());
}
@GetMapping("/risk/org/statistics")
public Result<List<RiskStatisticsVo>> riskOrgStatistics() {
return Result.success(statisticsService.riskStatisticsOrg("派出所"));
}
@GetMapping("/risk/org/car/statistics")
public Result<List<RiskStatisticsVo>> riskOrgCarStatistics() {
return Result.success(statisticsService.riskStatisticsOrg("交警大队"));
}
@GetMapping("/risk/police/a/statistics")
public Result<List<RiskStatisticsVo>> riskPoliceAStatistics() {
return Result.success(statisticsService.personStatistics());
}
@GetMapping("/risk/police/b/statistics")
public Result<List<RiskStatisticsVo>> riskPoliceBStatistics() {
return Result.success(statisticsService.personStatistics2());
}
@GetMapping("/risk/leader/statistics")
public Result<List<RiskStatisticsVo>> riskLeaderStatistics() {
return Result.success(statisticsService.leaderStatistics());
}
// **********问题数*************
@GetMapping("/area/negative/statistics")
public Result<List<RiskStatisticsVo>> areaNegativeStatistics() {
return Result.success(sourceService.statisticsGroupRank3());
}
@GetMapping("/org/negative/statistics")
public Result<List<RiskStatisticsVo>> orgNegativeStatistics() {
return Result.success(sourceService.statisticsGroupRank2());
}
@GetMapping("/org/car/negative/statistics")
public Result<List<RiskStatisticsVo>> orgCarNegativeStatistics() {
return Result.success(sourceService.statisticsGroupRank());
}
@GetMapping("/police/a/negative/statistics")
public Result<List<RiskStatisticsVo>> policeANegativeStatistics() {
return Result.success(sourceService.personA());
}
@GetMapping("/police/b/negative/statistics")
public Result<List<RiskStatisticsVo>> policeBNegativeStatistics() {
return Result.success(sourceService.personB());
}
@GetMapping("/police/leader/negative/statistics")
public Result<List<RiskStatisticsVo>> policeLeaderNegativeStatistics() {
return Result.success(sourceService.personB());
}
}

2
src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java

@ -5,6 +5,8 @@ import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.AlarmNotification; import com.biutag.supervision.pojo.entity.AlarmNotification;
import com.biutag.supervision.pojo.param.AlarmParam; import com.biutag.supervision.pojo.param.AlarmParam;
import com.biutag.supervision.service.AlarmNotificationService; import com.biutag.supervision.service.AlarmNotificationService;
import com.biutag.supervision.service.ProblemSourceService;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;

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

@ -28,12 +28,12 @@ public interface NegativeBlameMapper extends BaseMapper<NegativeBlame> {
@Select(" SELECT blameIdCode, blameName, count(1) as number FROM `negative_blame` " + @Select(" SELECT blameIdCode, blameName, count(1) as number FROM `negative_blame` " +
" where blameIdCode is not null and LENGTH(blameIdCode) > 0 and ivPersonTypeCode = 1 " + " where blameIdCode is not null and LENGTH(blameIdCode) > 0 and ivPersonTypeCode = '1' " +
" GROUP BY blameIdCode order by number desc limit 10") " GROUP BY blameIdCode order by number desc limit 10")
List<BlamePerson> statisticsBlame(); List<BlamePerson> statisticsBlame();
@Select(" SELECT blameIdCode, blameName, count(1) as number FROM `negative_blame` " + @Select(" SELECT blameIdCode, blameName, count(1) as number FROM `negative_blame` " +
" where blameIdCode is not null and LENGTH(blameIdCode) > 0 and ivPersonTypeCode != 1 " + " where blameIdCode is not null and LENGTH(blameIdCode) > 0 and ivPersonTypeCode != '1' " +
" GROUP BY blameIdCode order by number desc limit 10") " GROUP BY blameIdCode order by number desc limit 10")
List<BlamePerson> statisticsBlame2(); List<BlamePerson> statisticsBlame2();

9
src/main/java/com/biutag/supervision/mapper/NegativeScoreDepartMapper.java

@ -2,7 +2,16 @@ package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.NegativeScoreDepart; import com.biutag.supervision.pojo.entity.NegativeScoreDepart;
import com.biutag.supervision.pojo.vo.RiskStatisticsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface NegativeScoreDepartMapper extends BaseMapper<NegativeScoreDepart> { public interface NegativeScoreDepartMapper extends BaseMapper<NegativeScoreDepart> {
@Select(" select depart_id as departId, sum(score) as score from negative_score_depart " +
" where discovery_time >= '2024-01-01 00:00:00' and depart_group_id = #{groupId} " +
" group by depart_id")
List<RiskStatisticsVo> statistics(@Param("groupId") String groupId);
} }

26
src/main/java/com/biutag/supervision/mapper/NegativeScorePoliceMapper.java

@ -2,7 +2,33 @@ package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.NegativeScorePolice; import com.biutag.supervision.pojo.entity.NegativeScorePolice;
import com.biutag.supervision.pojo.vo.RiskStatisticsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface NegativeScorePoliceMapper extends BaseMapper<NegativeScorePolice> { public interface NegativeScorePoliceMapper extends BaseMapper<NegativeScorePolice> {
@Select(" select id_code as idCode, sum(score) as score from negative_score_police " +
" where id_code in ( " +
" select blameIdCode from negative_blame where ivPersonTypeCode = '1' " +
") and discovery_time >= '2024-01-01 00:00:00' " +
" group by id_code order by score desc limit 10 ")
List<RiskStatisticsVo> statisticsPolice();
@Select(" select id_code as idCode, sum(score) as score from negative_score_police " +
" where id_code in ( " +
" select blameIdCode from negative_blame where ivPersonTypeCode != '1' " +
") and discovery_time >= '2024-01-01 00:00:00' " +
" group by id_code order by score desc limit 10 ")
List<RiskStatisticsVo> statisticsPolice2();
@Select(" select id_code as idCode, sum(score) as score from negative_score_police " +
" where id_code in ( " +
" select leadIdCode from negative_blame where ivPersonTypeCode != '1' " +
") and discovery_time >= '2024-01-01 00:00:00' " +
" group by id_code order by score desc limit 10 ")
List<RiskStatisticsVo> statisticsLeader();
} }

24
src/main/java/com/biutag/supervision/pojo/vo/RiskStatisticsVo.java

@ -0,0 +1,24 @@
package com.biutag.supervision.pojo.vo;
import lombok.Data;
/**
* @author kami on 2024-11-16 18:22:46
* @version 0.0.1
* @since 1.8
*/
@Data
public class RiskStatisticsVo {
String name;
String idCode;
String departId;
Double score;
Integer value;
String label;
}

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

@ -6,6 +6,7 @@ import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.vo.BlamePerson; import com.biutag.supervision.pojo.vo.BlamePerson;
import com.biutag.supervision.pojo.vo.ProblemSourceStatisticsVo; import com.biutag.supervision.pojo.vo.ProblemSourceStatisticsVo;
import com.biutag.supervision.pojo.vo.ProblemSourceVo; import com.biutag.supervision.pojo.vo.ProblemSourceVo;
import com.biutag.supervision.pojo.vo.RiskStatisticsVo;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil; import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -50,7 +51,9 @@ public class ProblemSourceService {
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))).intValue()))
).join(); ).join();
List<NegativeBlame> list = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>().select(NegativeBlame::getBlameIdCode)); List<NegativeBlame> list = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(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());
ProblemSourceStatisticsVo vo = build.build(); ProblemSourceStatisticsVo vo = build.build();
@ -98,8 +101,9 @@ public class ProblemSourceService {
private final StatisticsDepartMapper departMapper; private final StatisticsDepartMapper departMapper;
public void statisticsGroupRank() { public List<RiskStatisticsVo> statisticsGroupRank() {
StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper<StatisticsGroup>() StatisticsGroup group = statisticsGroupMapper
.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>()
@ -119,15 +123,24 @@ public class ProblemSourceService {
count++; count++;
mapLevel3.put(negative.getInvolveDepartId(), count); mapLevel3.put(negative.getInvolveDepartId(), count);
} }
List<RiskStatisticsVo> vo = new ArrayList<>();
for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) { for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) {
log.info("机构:{} | {}", departMap.get(entry.getKey()).getName(), entry.getValue()); RiskStatisticsVo v = new RiskStatisticsVo();
v.setLabel(departMap.get(entry.getKey()).getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", ""));
v.setValue(entry.getValue());
vo.add(v);
}
vo.sort(Comparator.comparing(RiskStatisticsVo::getValue, Comparator.reverseOrder()));
if(vo.size() > 10) {
return vo.subList(0,10);
} }
return vo;
} }
/** /**
* 派出所 * 派出所
*/ */
public void statisticsGroupRank2() { public List<RiskStatisticsVo> statisticsGroupRank2() {
StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper<StatisticsGroup>() StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper<StatisticsGroup>()
.eq(StatisticsGroup::getName, "派出所").last("limit 1")); .eq(StatisticsGroup::getName, "派出所").last("limit 1"));
@ -148,13 +161,22 @@ public class ProblemSourceService {
count++; count++;
mapLevel3.put(negative.getInvolveDepartId(), count); mapLevel3.put(negative.getInvolveDepartId(), count);
} }
List<RiskStatisticsVo> vo = new ArrayList<>();
for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) { for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) {
log.info("机构:{} | {}", departMap.get(entry.getKey()).getName(), entry.getValue()); RiskStatisticsVo v = new RiskStatisticsVo();
v.setLabel(departMap.get(entry.getKey()).getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", ""));
v.setValue(entry.getValue());
vo.add(v);
}
vo.sort(Comparator.comparing(RiskStatisticsVo::getValue, Comparator.reverseOrder()));
if(vo.size() > 10) {
return vo.subList(0,10);
} }
return vo;
} }
// 分县 // 分县
public void statisticsGroupRank3() { public List<RiskStatisticsVo> statisticsGroupRank3() {
StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper<StatisticsGroup>() StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper<StatisticsGroup>()
.eq(StatisticsGroup::getName, "派出所").last("limit 1")); .eq(StatisticsGroup::getName, "派出所").last("limit 1"));
@ -184,32 +206,38 @@ public class ProblemSourceService {
count++; count++;
mapLevel3.put(negative.getInvolveDepartId(), count); mapLevel3.put(negative.getInvolveDepartId(), count);
} }
List<RiskStatisticsVo> vo = new ArrayList<>();
for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) { for (Map.Entry<String, Integer> entry : mapLevel3.entrySet()) {
log.info("机构:{} | {}", areaMap.get(entry.getKey()).getName(), entry.getValue()); RiskStatisticsVo v = new RiskStatisticsVo();
v.setLabel(areaMap.get(entry.getKey()).getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", ""));
v.setValue(entry.getValue());
vo.add(v);
} }
vo.sort(Comparator.comparing(RiskStatisticsVo::getValue, Comparator.reverseOrder()));
return vo;
} }
public List<RiskStatisticsVo> personA() {
return trans(blameMapper.statisticsBlame());
}
/** public List<RiskStatisticsVo> personB() {
* 民警辅警 return trans(blameMapper.statisticsBlame2());
*/ }
public void personStatistics() {
List<BlamePerson> list = blameMapper.statisticsBlame();
List<BlamePerson> list2 = blameMapper.statisticsBlame2();
List<BlamePerson> list3 = blameMapper.statisticsBlame3();
public List<RiskStatisticsVo> leader() {
return trans(blameMapper.statisticsBlame3());
}
List<RiskStatisticsVo> trans(List<BlamePerson> list) {
List<RiskStatisticsVo> vo = new ArrayList<>();
for (BlamePerson blamePerson : list) { for (BlamePerson blamePerson : list) {
log.info("民警:{} | {}", blamePerson.getBlameName(), blamePerson.getNumber()); RiskStatisticsVo v = new RiskStatisticsVo();
} v.setLabel(blamePerson.getBlameName());
for (BlamePerson blamePerson : list2) { v.setValue(blamePerson.getNumber());
log.info("辅警:{} | {}", blamePerson.getBlameName(), blamePerson.getNumber()); vo.add(v);
}
for (BlamePerson blamePerson : list3) {
log.info("领导:{} | {}", blamePerson.getBlameName(), blamePerson.getNumber());
} }
return vo;
} }
} }

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

@ -0,0 +1,167 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.biutag.supervision.mapper.*;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.StatisticsGroup;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.vo.RiskStatisticsVo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author kami on 2024-11-16 18:22:13
* @version 0.0.1
* @since 1.8
*/
@Slf4j
@Service
@AllArgsConstructor
public class RiskStatisticsService {
private final StatisticsGroupMapper statisticsGroupMapper;
private final NegativeScoreDepartMapper negativeScoreDepartMapper;
private final SupDepartMapper supDepartMapper;
/**
* 分机构统计风险分
*
* @param name 机构类型名称
* @return 列表
*/
public List<RiskStatisticsVo> riskStatisticsOrg(String name) {
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));
StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper<StatisticsGroup>()
.eq(StatisticsGroup::getName, name).last("limit 1"));
List<RiskStatisticsVo> vo = negativeScoreDepartMapper.statistics(group.getGroupId());
vo.sort(Comparator.comparing(RiskStatisticsVo::getScore, Comparator.reverseOrder()));
if (vo.size() > 10) {
vo = vo.subList(0, 10);
}
// 补名字
for (RiskStatisticsVo r : vo) {
SupDepart depart = departMap.get(r.getDepartId());
r.setName(depart.getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", ""));
}
return vo;
}
/**
* 分县统计风险分
*
* @return 列表
*/
public List<RiskStatisticsVo> riskStatisticsBigOrg() {
StatisticsGroup group = statisticsGroupMapper.selectOne(new LambdaQueryWrapper<StatisticsGroup>()
.eq(StatisticsGroup::getName, "派出所").last("limit 1"));
List<RiskStatisticsVo> vo = negativeScoreDepartMapper.statistics(group.getGroupId());
List<SupDepart> departs = supDepartMapper.selectList(new LambdaQueryWrapper<SupDepart>()
.select(SupDepart::getId, SupDepart::getPid, SupDepart::getName, SupDepart::getLevel));
Map<String, SupDepart> areaMap = departs.stream().collect(Collectors.toMap(SupDepart::getId, Function.identity(), (oldValue, newValue) -> newValue));
Map<String, Double> map = new HashMap<>();
for (RiskStatisticsVo depart : vo) {
SupDepart department = areaMap.get(depart.getDepartId());
if(department == null) {
log.info("统计未找到该id的机构:{}", depart.getDepartId());
continue;
}
SupDepart area = areaMap.get(department.getPid());
Double score = Optional.ofNullable(map.get(area.getId())).orElse(0.0);
score += depart.getScore();
map.put(area.getId(), score);
}
List<RiskStatisticsVo> result = new ArrayList<>();
for (Map.Entry<String, Double> entry : map.entrySet()) {
RiskStatisticsVo tmp = new RiskStatisticsVo();
tmp.setDepartId(entry.getKey());
tmp.setScore(entry.getValue());
SupDepart depart = areaMap.get(entry.getKey());
tmp.setName(depart.getName().replaceFirst("湖南省长沙市公安局", "").replaceFirst("湖南省长沙市", "").replaceFirst("湖南省", ""));
result.add(tmp);
}
return result;
}
private final NegativeBlameMapper blameMapper;
private final NegativeScorePoliceMapper policeMapper;
/**
* 民警
*
* @return
*/
public List<RiskStatisticsVo> personStatistics() {
List<NegativeBlame> blames = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getBlameName, NegativeBlame::getBlameIdCode)
.isNotNull(NegativeBlame::getBlameIdCode)
.eq(NegativeBlame::getIvPersonTypeCode, "1"));
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) {
NegativeBlame map = blameMap.get(riskStatisticsVo.getIdCode());
if (map == null) {
continue;
}
riskStatisticsVo.setName(map.getBlameName());
}
return list;
}
/**
* 辅警/协警
*
* @return
*/
public List<RiskStatisticsVo> personStatistics2() {
List<NegativeBlame> blames = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getBlameName, NegativeBlame::getBlameIdCode)
.isNotNull(NegativeBlame::getBlameIdCode)
.ne(NegativeBlame::getIvPersonTypeCode, "1"));
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) {
NegativeBlame map = blameMap.get(riskStatisticsVo.getIdCode());
if (map == null) {
continue;
}
riskStatisticsVo.setName(map.getBlameName());
}
return list;
}
/**
* 领导
*
* @return
*/
public List<RiskStatisticsVo> leaderStatistics() {
List<NegativeBlame> blames = blameMapper.selectList(new LambdaQueryWrapper<NegativeBlame>()
.select(NegativeBlame::getLeadIdCode, NegativeBlame::getLeadName)
.isNotNull(NegativeBlame::getLeadIdCode)
.ne(NegativeBlame::getIvPersonTypeCode, "1"));
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) {
NegativeBlame map = blameMap.get(riskStatisticsVo.getIdCode());
if (map == null) {
continue;
}
riskStatisticsVo.setName(map.getLeadName());
}
return list;
}
}
Loading…
Cancel
Save