|
|
|
|
@ -123,7 +123,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
syrkxx = idCodeMap.get(item.getBjrzjhm()); |
|
|
|
|
cache.put(item.getBjrzjhm(), new Byte[0]); |
|
|
|
|
if (syrkxx != null) { |
|
|
|
|
personals.add(createPerson(syrkxx, item.getBjsj(), now, end)); |
|
|
|
|
personals.add(createPerson(syrkxx, item.getBjsj(), now, end,Default.BIG_TAG_JJD)); |
|
|
|
|
} |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
@ -135,7 +135,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
syrkxx = idCodeMap.get(s); |
|
|
|
|
cache.put(s, new Byte[0]); |
|
|
|
|
if (syrkxx != null) { |
|
|
|
|
personals.add(createPerson(syrkxx, item.getBjsj(), now, end)); |
|
|
|
|
personals.add(createPerson(syrkxx, item.getBjsj(), now, end, Default.BIG_TAG_JJD)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -145,7 +145,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
syrkxx = compare(xxList, item.getBjrxm()); |
|
|
|
|
if (syrkxx != null) { |
|
|
|
|
cache.put(syrkxx.getGmsfhm(), new Byte[0]); |
|
|
|
|
personals.add(createPerson(syrkxx, item.getBjsj(), now, end)); |
|
|
|
|
personals.add(createPerson(syrkxx, item.getBjsj(), now, end, Default.BIG_TAG_JJD)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
riskPersonalService.saveDistinct(personals); |
|
|
|
|
@ -223,7 +223,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
exist.put(syrkxx.getGmsfhm(), new Byte[0]); |
|
|
|
|
Contradiction contradiction = map.get(syrkxx.getGmsfhm()); |
|
|
|
|
personals.add(createPerson(syrkxx, Optional.of(contradiction).map(Contradiction::getMaxTime) |
|
|
|
|
.orElse(null), now.toLocalDate(), now)); |
|
|
|
|
.orElse(null), now.toLocalDate(), now, Default.BIG_TAG_SHWFR)); |
|
|
|
|
} |
|
|
|
|
riskPersonalService.saveDistinct(personals); |
|
|
|
|
} |
|
|
|
|
@ -236,25 +236,52 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void pullPetition(LocalDateTime start) { |
|
|
|
|
List<DataPetition12337> pList1 = petition12337Repository.list(new LambdaQueryWrapper<DataPetition12337>() |
|
|
|
|
.select(DataPetition12337::getName, DataPetition12337::getIdCode, DataPetition12337::getPhone, DataPetition12337::getThirdDepartId, DataPetition12337::getThirdDepartName) |
|
|
|
|
.ge(DataPetition12337::getDiscoverTime, start)); |
|
|
|
|
|
|
|
|
|
List<DataPetitionComplaint> pList2 = complaintRepository.list(new LambdaQueryWrapper<DataPetitionComplaint>() |
|
|
|
|
.select(DataPetitionComplaint::getResponderName, DataPetitionComplaint::getResponderPhone, DataPetitionComplaint::getResponderName, DataPetitionComplaint::getThirdDepartId, DataPetitionComplaint::getThirdDepartName) |
|
|
|
|
.ge(DataPetitionComplaint::getDiscoveryTime, start)); |
|
|
|
|
|
|
|
|
|
List<DataCaseVerif> pList3 = dataCaseVerifRepository.list(new LambdaQueryWrapper<DataCaseVerif>() |
|
|
|
|
.select(DataCaseVerif::getResponderName, DataCaseVerif::getResponderPhone, DataCaseVerif::getThirdDepartId, DataCaseVerif::getThirdDepartName) |
|
|
|
|
.ge(DataCaseVerif::getDiscoveryTime, start)); |
|
|
|
|
List<DataCaseVerif> pList3 = new ArrayList<>(); |
|
|
|
|
List<DataPetition12337> pList1 = new ArrayList<>(); |
|
|
|
|
List<DataPetitionComplaint> pList2 = new ArrayList<>(); |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
// 捞数据
|
|
|
|
|
CompletableFuture.allOf( |
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> pList1.addAll(petition12337Repository.list(new LambdaQueryWrapper<DataPetition12337>() |
|
|
|
|
.select(DataPetition12337::getName, DataPetition12337::getIdCode, DataPetition12337::getPhone, DataPetition12337::getThirdDepartId, DataPetition12337::getThirdDepartName) |
|
|
|
|
.ge(DataPetition12337::getDiscoverTime, start)))), |
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> pList2.addAll(complaintRepository.list(new LambdaQueryWrapper<DataPetitionComplaint>() |
|
|
|
|
.select(DataPetitionComplaint::getResponderName, DataPetitionComplaint::getResponderPhone, DataPetitionComplaint::getResponderName, DataPetitionComplaint::getThirdDepartId, DataPetitionComplaint::getThirdDepartName) |
|
|
|
|
.ge(DataPetitionComplaint::getDiscoveryTime, start)))), |
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> pList3.addAll(dataCaseVerifRepository.list(new LambdaQueryWrapper<DataCaseVerif>() |
|
|
|
|
.select(DataCaseVerif::getResponderName, DataCaseVerif::getResponderPhone, DataCaseVerif::getThirdDepartId, DataCaseVerif::getThirdDepartName) |
|
|
|
|
.ge(DataCaseVerif::getDiscoveryTime, start)))) |
|
|
|
|
).join(); |
|
|
|
|
|
|
|
|
|
List<String> ids = new ArrayList<>(); |
|
|
|
|
List<String> idCards = new ArrayList<>(); |
|
|
|
|
List<String> mobiles = new ArrayList<>(); |
|
|
|
|
ids.addAll(pList1.stream().map(DataPetition12337::getIdCode).toList()); |
|
|
|
|
ids.addAll(pList2.stream().map(DataPetitionComplaint::getResponderIdCode).toList()); |
|
|
|
|
idCards.addAll(pList1.stream().map(DataPetition12337::getIdCode).toList()); |
|
|
|
|
idCards.addAll(pList2.stream().map(DataPetitionComplaint::getResponderIdCode).toList()); |
|
|
|
|
mobiles.addAll(pList3.stream().map(DataCaseVerif::getResponderPhone).toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> idCards2 = idCards.stream().distinct().toList(); |
|
|
|
|
List<String> mobiles2 = mobiles.stream().distinct().toList(); |
|
|
|
|
|
|
|
|
|
List<GBaseSYRKXX> xxList = new ArrayList<>(); |
|
|
|
|
// 实有人口数据整合
|
|
|
|
|
CompletableFuture.allOf(CompletableFutureUtil.runSyncObject(() -> xxList.addAll(getByIdCode(IntStream.range(0, (idCards2.size() + 9999) / 10000) |
|
|
|
|
.mapToObj(i -> idCards2.subList(i * 10000, Math.min((i + 1) * 10000, idCards2.size()))) |
|
|
|
|
.toList()))), |
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> xxList.addAll(getByMobiles(IntStream.range(0, (mobiles2.size() + 9999) / 10000) |
|
|
|
|
.mapToObj(i -> mobiles2.subList(i * 10000, Math.min((i + 1) * 10000, mobiles2.size()))) |
|
|
|
|
.toList())))).join(); |
|
|
|
|
// 去重
|
|
|
|
|
List<RiskPersonal> personals = new ArrayList<>(); |
|
|
|
|
Map<String, Byte[]> map = new WeakHashMap<>(); |
|
|
|
|
LocalDate today = now.toLocalDate(); |
|
|
|
|
Date nowDate = new Date(); |
|
|
|
|
for (GBaseSYRKXX xx : xxList) { |
|
|
|
|
if(map.get(xx.getGmsfhm()) == null) { |
|
|
|
|
personals.add(createPerson(xx, nowDate, today, now, Default.BIG_TAG_PETITION)); |
|
|
|
|
map.put(xx.getGmsfhm(), new Byte[0]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
riskPersonalService.saveDistinct(personals); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private final SupExternalDepartRepository supExternalDepartRepository; |
|
|
|
|
@ -324,7 +351,7 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RiskPersonal createPerson(GBaseSYRKXX item, Date bjsj, LocalDate now, LocalDateTime time) { |
|
|
|
|
RiskPersonal createPerson(GBaseSYRKXX item, Date date, LocalDate now, LocalDateTime time, String tag) { |
|
|
|
|
RiskPersonal person = new RiskPersonal(); |
|
|
|
|
person.setName(item.getXm()); |
|
|
|
|
person.setMobileNumber(item.getLxdh()); |
|
|
|
|
@ -335,9 +362,9 @@ public class PersonalServiceImpl implements PersonalService {
|
|
|
|
|
person.setCreateTime(time); |
|
|
|
|
person.setAge(IdCodeUtil.idCard2Age(person.getIdCode(), now)); |
|
|
|
|
person.setGender(IdCodeUtil.idCard2Gender(person.getIdCode())); |
|
|
|
|
person.setTags(Default.BIG_TAG_JJD); |
|
|
|
|
person.setTags(tag); |
|
|
|
|
try { |
|
|
|
|
LocalDateTime controlTime = bjsj.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
|
|
|
|
LocalDateTime controlTime = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
|
|
|
|
person.setControlTime(controlTime); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.info("报警时间处理异常"); |
|
|
|
|
|