Browse Source

特殊人群类型模型去掉精神疾病、犯罪前科

master
sjh 1 year ago
parent
commit
21cd20aca4
  1. 63
      src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java

63
src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java

@ -832,36 +832,15 @@ public class PointServiceImpl implements PointService {
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true);
Map<String, Integer> idCode = new HashMap<>();
log.info("模型130开始查询");
List<WdpcGrjdJsbry> list1 = jsbryRepository.getBaseMapper().selectByIdNos();
// List<WdpcGrjdJsbry> list1 = jsbryRepository.getBaseMapper().selectByIdNos();
List<WdpcJZJLB> list2 = jZJLBRepository.getBaseMapper().selectForModel129();
;
List<WdpcXdry> list3 = xdryRepository.getBaseMapper().selectXIDU();
List<WdpcSqjzry> list4 = sqjzryRepository.getBaseMapper().selectByIdNos();
List<WdpcXmsfry> list5 = xmsfryRepository.getBaseMapper().selectByIdNos();
log.info("模型130查询结果数:{},{},{},{},{}", list1.size(), list2.size(), list3.size(), list4.size(), list5.size());
// List<WdpcXmsfry> list5 = xmsfryRepository.getBaseMapper().selectByIdNos();
log.info("模型130查询结果数:{},{},{}", list2.size(), list3.size(), list4.size());
Map<String, RiskPersonal> personalMap = domain.getPersons().stream().collect(Collectors.toMap(RiskPersonal::getIdCode, Function.identity(), (old, newVal) -> newVal));
List<RiskModelTaskClue> toInsert = new ArrayList<>();
for (WdpcGrjdJsbry domicileType : list1) {
RiskPersonal personal = personalMap.get(domicileType.getIdCode());
if (personal == null) continue;
if (idCode.get(domicileType.getIdCode()) != null) continue;
if (oldMap.get(domicileType.getIdCode()) != null) continue;
idCode.put(domicileType.getIdCode(), 1);
ClueData data = ClueData.builder()
.name(personal.getName())
.id(personal.getId().toString())
.idCode(personal.getIdCode())
.tags(List.of("精神障碍患者"))
.score(1)
.eventTime(LocalDateTime.now())
.personId(personal.getId())
.sourceData("发现该人员于" + getDateString(domicileType.getActualTime())
+ "确诊为为“" + domicileType.getActualId() + "”精神障碍患者")
.build();
toInsert.add(DataUtil.createClueData(task, data));
}
for (WdpcJZJLB domicileType : list2) {
RiskPersonal personal = personalMap.get(domicileType.getIdCode());
if (personal == null) continue;
@ -938,42 +917,6 @@ public class PointServiceImpl implements PointService {
.build();
toInsert.add(DataUtil.createClueData(task, data));
}
for (WdpcXmsfry domicileType : list5) {
RiskPersonal personal = personalMap.get(domicileType.getIdCode());
if (personal == null) continue;
if (idCode.get(domicileType.getIdCode()) != null) continue;
if (oldMap.get(domicileType.getIdCode()) != null) continue;
idCode.put(domicileType.getIdCode(), 1);
String context = "";
if (domicileType.getCrimeName() != null) {
context = context + ",罪名为" + domicileType.getCrimeName();
}
if (domicileType.getSentenceTime() != null) {
context = context + ",判决日期为" + getDateString(domicileType.getSentenceTime());
}
if (domicileType.getPrisonBegin() != null) {
context = context + ",服刑开始日期为" + getDateString(domicileType.getPrisonBegin());
}
if (domicileType.getPrisonEnd() != null) {
context = context + ",服刑结束日期为" + getDateString(domicileType.getPrisonEnd());
}
if (domicileType.getPrisonOrganization() != null) {
context = context + ",服刑单位为" + domicileType.getPrisonOrganization();
}
ClueData data = ClueData.builder()
.name(personal.getName())
.id(personal.getId().toString())
.idCode(personal.getIdCode())
.tags(List.of("刑释解教人员"))
.score(5)
.eventTime(LocalDateTime.now())
.personId(personal.getId())
.sourceData("发现该人员为刑释解教人员" + context)
.build();
toInsert.add(DataUtil.createClueData(task, data));
}
if (!toInsert.isEmpty()) {
modelTaskClueService.saveClues(toInsert, Default.SPECIALPEOPLETYPE);
}

Loading…
Cancel
Save