|
|
|
|
@ -6,6 +6,8 @@ import com.biutag.supervisiondata.common.utils.StreamUtil;
|
|
|
|
|
import com.biutag.supervisiondata.pojo.ClueData; |
|
|
|
|
import com.biutag.supervisiondata.pojo.constants.Default; |
|
|
|
|
import com.biutag.supervisiondata.pojo.database.PointOrg; |
|
|
|
|
import com.biutag.supervisiondata.pojo.database.SecurityMan; |
|
|
|
|
import com.biutag.supervisiondata.pojo.domain.Drug; |
|
|
|
|
import com.biutag.supervisiondata.pojo.domain.TaskParamDomain; |
|
|
|
|
import com.biutag.supervisiondata.pojo.domain.WFSHPerson; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.ads.GBaseSYRKXX; |
|
|
|
|
@ -268,6 +270,9 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService {
|
|
|
|
|
} catch (Exception ignored) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(zblxList.isEmpty()) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
zblxList = zblxList.stream().filter(StreamUtil.distinctByKey(WdpcGrjdZblx::getDmmc)).toList(); |
|
|
|
|
List<String> tags = new ArrayList<>(); |
|
|
|
|
int score = 0; |
|
|
|
|
@ -323,12 +328,49 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService {
|
|
|
|
|
List<RiskModelTaskClue> toInsert = new ArrayList<>(); |
|
|
|
|
// 有无职业
|
|
|
|
|
List<RiskModelTaskClue> toInsert2 = new ArrayList<>(); |
|
|
|
|
// 涉药
|
|
|
|
|
Map<String, List<Drug>> drugMap = drug(); |
|
|
|
|
Map<String, List<SecurityMan>> securityMenMap = security(); |
|
|
|
|
|
|
|
|
|
// 实有人口要查的
|
|
|
|
|
List<RiskPersonal> personalList = new ArrayList<>(); |
|
|
|
|
Map<String, RiskPersonal> noJob = new WeakHashMap<>(); |
|
|
|
|
for (RiskPersonal person : domain.getPersons()) { |
|
|
|
|
if (oldMap.get(person.getIdCode()) != null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// 先看是不是涉药或保安
|
|
|
|
|
List<Drug> drugMan = drugMap.get(person.getIdCode()); |
|
|
|
|
if(drugMan != null) { |
|
|
|
|
ClueData data = ClueData.builder() |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.id("zy") |
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.score(5) |
|
|
|
|
.sourceData("该人员从事涉药工作") |
|
|
|
|
.tags(List.of("涉药工作")) |
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.build(); |
|
|
|
|
toInsert.add(DataUtil.createClueData(task, data)); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
List<SecurityMan> securityMen = securityMenMap.get(person.getIdCode()); |
|
|
|
|
if(securityMen != null) { |
|
|
|
|
ClueData data = ClueData.builder() |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.id("zy") |
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.score(5) |
|
|
|
|
.sourceData("该人员从事保安工作") |
|
|
|
|
.tags(List.of("保安工作")) |
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.build(); |
|
|
|
|
toInsert.add(DataUtil.createClueData(task, data)); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String zydm = wfrMap.get(person.getIdCode()); |
|
|
|
|
if (zydm == null) { |
|
|
|
|
personalList.add(person); |
|
|
|
|
@ -339,32 +381,22 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService {
|
|
|
|
|
personalList.add(person); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if(zblx.getScore() < 5.0) { |
|
|
|
|
ClueData data = ClueData.builder() |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.id("zy") |
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.tag(zblx.getDmmc()) |
|
|
|
|
.score(zblx.getScore().intValue()) |
|
|
|
|
.sourceData("该人员从事"+zblx.getDmmc()+"工作") |
|
|
|
|
.tags(List.of(zblx.getDmmc())) |
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.build(); |
|
|
|
|
if (zblx.getScore() < 5.0) { |
|
|
|
|
data.setSourceData("该人员从事" + zblx.getDmmc()); |
|
|
|
|
toInsert.add(DataUtil.createClueData(task, data)); |
|
|
|
|
} else { |
|
|
|
|
data.setSourceData("该人员" + zblx.getDmmc()); |
|
|
|
|
ClueData data2 = ClueData.builder() |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.id("zy") |
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.tag(zblx.getDmmc()) |
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.sourceData("该人员无固定职业") |
|
|
|
|
.build(); |
|
|
|
|
toInsert2.add(createClue(task2.getModelId(), zblx.getScore().intValue(), task2.getId(), data2)); |
|
|
|
|
noJob.put(person.getIdCode(), person); |
|
|
|
|
} |
|
|
|
|
toInsert.add(createClue(task.getModelId(), zblx.getScore().intValue(), task.getId(), data)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<GBaseSYRKXX> xxList = gBaseSYRKXXRepository.getBaseMapper().selectWork(); |
|
|
|
|
Map<String, String> syMap = xxList.stream().collect(Collectors.toMap(GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getZydm, (val, old) -> val)); |
|
|
|
|
|
|
|
|
|
@ -373,45 +405,63 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService {
|
|
|
|
|
if (zydm == null) continue; |
|
|
|
|
WdpcGrjdZblx zblx = wfzyMap.get(zydm); |
|
|
|
|
if (zblx == null) continue; |
|
|
|
|
if (zblx.getScore() < 5.0) { |
|
|
|
|
ClueData data = ClueData.builder() |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.id("zy") |
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.tag(zblx.getDmmc()) |
|
|
|
|
.score(zblx.getScore().intValue()) |
|
|
|
|
.sourceData("该人员从事"+zblx.getDmmc()+"工作") |
|
|
|
|
.tags(List.of(zblx.getDmmc())) |
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.build(); |
|
|
|
|
if (zblx.getScore() < 5.0) { |
|
|
|
|
data.setSourceData("该人员从事" + zblx.getDmmc() + "的职业"); |
|
|
|
|
toInsert.add(DataUtil.createClueData(task, data)); |
|
|
|
|
} else { |
|
|
|
|
data.setSourceData("该人员" + zblx.getDmmc()); |
|
|
|
|
ClueData data2 = ClueData.builder() |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.id("zy") |
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.tag(zblx.getDmmc()) |
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.sourceData("该人员无固定职业") |
|
|
|
|
.build(); |
|
|
|
|
toInsert2.add(createClue(task2.getModelId(), zblx.getScore().intValue(), task2.getId(), data2)); |
|
|
|
|
noJob.put(person.getIdCode(), person); |
|
|
|
|
} |
|
|
|
|
toInsert.add(createClue(task.getModelId(), zblx.getScore().intValue(), task.getId(), data)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!toInsert.isEmpty()) { |
|
|
|
|
log.info("保存职业类型: {}", toInsert.size()); |
|
|
|
|
clueService.saveClues(toInsert, Default.IMPORT_IG); |
|
|
|
|
} |
|
|
|
|
for (Map.Entry<String, RiskPersonal> entry : noJob.entrySet()) { |
|
|
|
|
ClueData data = ClueData.builder() |
|
|
|
|
.name(entry.getValue().getName()) |
|
|
|
|
.id("zy") |
|
|
|
|
.idCode(entry.getValue().getIdCode()) |
|
|
|
|
.score(5) |
|
|
|
|
.sourceData("该人员无固定职业") |
|
|
|
|
.tags(List.of("无固定职业")) |
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
|
.personId(entry.getValue().getId()) |
|
|
|
|
.build(); |
|
|
|
|
toInsert2.add(DataUtil.createClueData(task2, data)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!toInsert2.isEmpty()) { |
|
|
|
|
log.info("保存无职业: {}", toInsert2.size()); |
|
|
|
|
clueService.saveClues(toInsert2, Default.IMPORT_IG); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
taskRepository.updateTask(task.getId(), toInsert.size(), 0); |
|
|
|
|
taskRepository.updateTask(task2.getId(), toInsert2.size(), 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, List<SecurityMan>> security() { |
|
|
|
|
List<SecurityMan> securityList = new ArrayList<>(); |
|
|
|
|
CompletableFuture.allOf( |
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> securityList.addAll(zdryRepository.getBaseMapper().syncSecurityMan1())), |
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> securityList.addAll(zdryRepository.getBaseMapper().syncSecurityMan2())) |
|
|
|
|
).join(); |
|
|
|
|
return securityList.stream().collect(Collectors.groupingBy(SecurityMan::getIdCode)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, List<Drug>> drug() { |
|
|
|
|
List<Drug> list = zdryRepository.getBaseMapper().selectDrugMan(); |
|
|
|
|
return list.stream().collect(Collectors.groupingBy(Drug::getSfzh)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RiskPersonal createPerson(WFSHPerson person, GBaseSYRKXX xx, String tag) { |
|
|
|
|
RiskPersonal personal = new RiskPersonal(); |
|
|
|
|
personal.setIdCode(person.getIdCode()); |
|
|
|
|
|