|
|
|
@ -6,10 +6,8 @@ import com.biutag.supervisiondata.pojo.ClueData; |
|
|
|
import com.biutag.supervisiondata.pojo.constants.Default; |
|
|
|
import com.biutag.supervisiondata.pojo.constants.Default; |
|
|
|
import com.biutag.supervisiondata.pojo.database.PointOrg; |
|
|
|
import com.biutag.supervisiondata.pojo.database.PointOrg; |
|
|
|
import com.biutag.supervisiondata.pojo.domain.TaskParamDomain; |
|
|
|
import com.biutag.supervisiondata.pojo.domain.TaskParamDomain; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.pojo.domain.WFSHPerson; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.ads.GBaseSYRKXX; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.ads.GBaseSYRKXX; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseAJJBXX; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseJJD; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseSHRXX; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseWFRXX; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseWFRXX; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskModelTaskClue; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskModelTaskClue; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskPersonal; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskPersonal; |
|
|
|
@ -53,8 +51,6 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService { |
|
|
|
|
|
|
|
|
|
|
|
private final GBaseSYRKXXRepository gBaseSYRKXXRepository; |
|
|
|
private final GBaseSYRKXXRepository gBaseSYRKXXRepository; |
|
|
|
|
|
|
|
|
|
|
|
private final GBaseAJJBXXRepository ajjbxxRepository; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final RiskPersonalService riskPersonalService; |
|
|
|
private final RiskPersonalService riskPersonalService; |
|
|
|
|
|
|
|
|
|
|
|
private final GBaseZDRYRepository zdryRepository; |
|
|
|
private final GBaseZDRYRepository zdryRepository; |
|
|
|
@ -66,10 +62,8 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService { |
|
|
|
List<PointOrg> orgs = zdryRepository.getBaseMapper().selectOrg(); |
|
|
|
List<PointOrg> orgs = zdryRepository.getBaseMapper().selectOrg(); |
|
|
|
List<SupExternalDepart> supDeparts = externalDepartRepository.list(new LambdaQueryWrapper<SupExternalDepart>() |
|
|
|
List<SupExternalDepart> supDeparts = externalDepartRepository.list(new LambdaQueryWrapper<SupExternalDepart>() |
|
|
|
.select(SupExternalDepart::getExternalId, SupExternalDepart::getInternalId, SupExternalDepart::getInternalName, SupExternalDepart::getSource) |
|
|
|
.select(SupExternalDepart::getExternalId, SupExternalDepart::getInternalId, SupExternalDepart::getInternalName, SupExternalDepart::getSource) |
|
|
|
.in(SupExternalDepart::getSource, List.of("重点人员", "情指行"))); |
|
|
|
.in(SupExternalDepart::getSource, List.of("情指行"))); |
|
|
|
Map<String, List<SupExternalDepart>> amp = supDeparts.stream().collect(Collectors.groupingBy(SupExternalDepart::getSource)); |
|
|
|
Map<String, SupExternalDepart> externalDepart = supDeparts.stream().collect(Collectors.toMap(SupExternalDepart::getExternalId, Function.identity(), (val, old) -> val)); |
|
|
|
Map<String, SupExternalDepart> pointExternalDepart = amp.get("重点人员").stream().collect(Collectors.toMap(SupExternalDepart::getExternalId, Function.identity(), (val, old) -> val)); |
|
|
|
|
|
|
|
Map<String, SupExternalDepart> jqExternalDepart = amp.get("情指行").stream().collect(Collectors.toMap(SupExternalDepart::getExternalId, Function.identity(), (val, old) -> val)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, PointOrg> orgIdMap = new WeakHashMap<>(); |
|
|
|
Map<String, PointOrg> orgIdMap = new WeakHashMap<>(); |
|
|
|
Map<String, PointOrg> orgCodeMap = new WeakHashMap<>(); |
|
|
|
Map<String, PointOrg> orgCodeMap = new WeakHashMap<>(); |
|
|
|
@ -78,233 +72,66 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService { |
|
|
|
orgCodeMap.put(org.getDm(), org); |
|
|
|
orgCodeMap.put(org.getDm(), org); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<WFSHPerson> shrTmp = new ArrayList<>(); |
|
|
|
List<GBaseSHRXX> shrList = new ArrayList<>(); |
|
|
|
List<WFSHPerson> wfrTmp = new ArrayList<>(); |
|
|
|
List<GBaseWFRXX> wxrList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 统计出所有的案件编号批量查询
|
|
|
|
|
|
|
|
List<String> ajNos = new ArrayList<>(); |
|
|
|
|
|
|
|
// 手机号
|
|
|
|
|
|
|
|
List<String> mobiles = new ArrayList<>(); |
|
|
|
|
|
|
|
// 身份证
|
|
|
|
|
|
|
|
List<String> idCards = new ArrayList<>(); |
|
|
|
|
|
|
|
// 分别拉取受害人和违法人信息
|
|
|
|
// 分别拉取受害人和违法人信息
|
|
|
|
CompletableFuture.allOf( |
|
|
|
CompletableFuture.allOf( |
|
|
|
CompletableFutureUtil.runSyncObject(() -> { |
|
|
|
CompletableFutureUtil.runSyncObject(() -> shrTmp.addAll(shrxxRepository.getBaseMapper().selectSHData(start.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), |
|
|
|
List<GBaseSHRXX> shrTmp = shrxxRepository.getBaseMapper().selectDataToRisk(start.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), |
|
|
|
end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))))), |
|
|
|
end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
CompletableFutureUtil.runSyncObject(() -> wfrTmp.addAll(wfrxxRepository.getBaseMapper().selectWFData("2019-12-06 00:00:00", |
|
|
|
for (GBaseSHRXX gBaseSHRXX : shrTmp) { |
|
|
|
end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))))) |
|
|
|
if (gBaseSHRXX.getGmsfhm() != null) { |
|
|
|
).join(); |
|
|
|
idCards.add(gBaseSHRXX.getGmsfhm()); |
|
|
|
// 信息全的数据
|
|
|
|
} else if (gBaseSHRXX.getLxdh() != null) { |
|
|
|
Map<String, WFSHPerson> tmpMap = new WeakHashMap<>(); |
|
|
|
mobiles.add(gBaseSHRXX.getLxdh()); |
|
|
|
// 要补全的数据
|
|
|
|
} else { |
|
|
|
List<String> idCodes = new ArrayList<>(); |
|
|
|
|
|
|
|
for (WFSHPerson wfshPerson : shrTmp) { |
|
|
|
|
|
|
|
if (tmpMap.get(wfshPerson.getIdCode()) != null) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
shrList.add(gBaseSHRXX); |
|
|
|
if (wfshPerson.getName() == null || wfshPerson.getName().isEmpty() || wfshPerson.getMobile() == null |
|
|
|
ajNos.add(gBaseSHRXX.getAjbh()); |
|
|
|
|| wfshPerson.getMobile().isEmpty() || wfshPerson.getMobile().equals("无")) { |
|
|
|
} |
|
|
|
idCodes.add(wfshPerson.getIdCode()); |
|
|
|
}), |
|
|
|
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> { |
|
|
|
|
|
|
|
List<GBaseWFRXX> wfrTmp = wfrxxRepository.getBaseMapper().selectDataToRisk("2019-12-06 00:00:00", |
|
|
|
|
|
|
|
end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
|
|
|
|
for (GBaseWFRXX gBaseWFRXX : wfrTmp) { |
|
|
|
|
|
|
|
if (gBaseWFRXX.getZjhm() != null) { |
|
|
|
|
|
|
|
idCards.add(gBaseWFRXX.getZjhm()); |
|
|
|
|
|
|
|
} else if (gBaseWFRXX.getLxdh() != null) { |
|
|
|
|
|
|
|
mobiles.add(gBaseWFRXX.getLxdh()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
wxrList.add(gBaseWFRXX); |
|
|
|
tmpMap.put(wfshPerson.getIdCode(), wfshPerson); |
|
|
|
ajNos.add(gBaseWFRXX.getAjbh()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
for (WFSHPerson wfshPerson : wfrTmp) { |
|
|
|
).join(); |
|
|
|
if (tmpMap.get(wfshPerson.getIdCode()) != null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
List<String> distinctAJ = ajNos.stream().distinct().toList(); |
|
|
|
} |
|
|
|
// 切割 每次查10000条
|
|
|
|
if (wfshPerson.getName() == null || wfshPerson.getName().isEmpty() || wfshPerson.getMobile() == null |
|
|
|
List<List<String>> ajs = IntStream.range(0, (distinctAJ.size() + 9999) / 10000) |
|
|
|
|| wfshPerson.getMobile().isEmpty() || wfshPerson.getMobile().equals("无")) { |
|
|
|
.mapToObj(i -> distinctAJ.subList(i * 10000, Math.min((i + 1) * 10000, distinctAJ.size()))) |
|
|
|
idCodes.add(wfshPerson.getIdCode()); |
|
|
|
.toList(); |
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
List<String> idCards2 = idCards.stream().distinct().toList(); |
|
|
|
tmpMap.put(wfshPerson.getIdCode(), wfshPerson); |
|
|
|
List<String> mobiles2 = mobiles.stream().distinct().toList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<GBaseAJJBXX> xxList = new ArrayList<>(); |
|
|
|
|
|
|
|
for (List<String> aj : ajs) { |
|
|
|
|
|
|
|
xxList.addAll(ajjbxxRepository.list(new LambdaQueryWrapper<GBaseAJJBXX>() |
|
|
|
|
|
|
|
.select(GBaseAJJBXX::getAjbh, GBaseAJJBXX::getBadwidmc, GBaseAJJBXX::getBadwiddm, GBaseAJJBXX::getBarq) |
|
|
|
|
|
|
|
.in(GBaseAJJBXX::getAjbh, aj))); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// 案件转map方便提取
|
|
|
|
|
|
|
|
Map<String, GBaseAJJBXX> xxMap = xxList.stream().collect(Collectors.toMap(GBaseAJJBXX::getAjbh, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 人员信息查询
|
|
|
|
List<String> idCards = idCodes.stream().distinct().toList(); |
|
|
|
// 身份证查到的人
|
|
|
|
List<List<String>> idCode = IntStream.range(0, (idCards.size() + 9999) / 10000) |
|
|
|
List<GBaseSYRKXX> sFms = new ArrayList<>(); |
|
|
|
.mapToObj(i -> idCards.subList(i * 10000, Math.min((i + 1) * 10000, idCards.size()))) |
|
|
|
// 手机号查到的人
|
|
|
|
|
|
|
|
List<GBaseSYRKXX> lXfs = new ArrayList<>(); |
|
|
|
|
|
|
|
CompletableFuture.allOf( |
|
|
|
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> { |
|
|
|
|
|
|
|
List<List<String>> idCode = IntStream.range(0, (idCards2.size() + 9999) / 10000) |
|
|
|
|
|
|
|
.mapToObj(i -> idCards2.subList(i * 10000, Math.min((i + 1) * 10000, idCards2.size()))) |
|
|
|
|
|
|
|
.toList(); |
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info("获取补全违法人和受害人:{}", idCode.size()); |
|
|
|
|
|
|
|
List<GBaseSYRKXX> xxList = new ArrayList<>(); |
|
|
|
int count = idCode.size(); |
|
|
|
int count = idCode.size(); |
|
|
|
for (List<String> arr : idCode) { |
|
|
|
for (List<String> arr : idCode) { |
|
|
|
List<GBaseSYRKXX> list = gBaseSYRKXXRepository.list(new LambdaQueryWrapper<GBaseSYRKXX>() |
|
|
|
xxList.addAll(gBaseSYRKXXRepository.list(new LambdaQueryWrapper<GBaseSYRKXX>() |
|
|
|
.select(GBaseSYRKXX::getLxdh, GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getXm, GBaseSYRKXX::getXbdm, GBaseSYRKXX::getSspcsdm) |
|
|
|
.select(GBaseSYRKXX::getLxdh, GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getXm, GBaseSYRKXX::getXbdm, GBaseSYRKXX::getSspcsdm) |
|
|
|
.in(GBaseSYRKXX::getGmsfhm, arr)); |
|
|
|
.in(GBaseSYRKXX::getGmsfhm, arr))); |
|
|
|
sFms.addAll(list); |
|
|
|
|
|
|
|
log.info("身份证进度 | {}", --count); |
|
|
|
log.info("身份证进度 | {}", --count); |
|
|
|
} |
|
|
|
} |
|
|
|
}), |
|
|
|
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> { |
|
|
|
|
|
|
|
List<List<String>> mobile = IntStream.range(0, (mobiles2.size() + 9999) / 10000) |
|
|
|
|
|
|
|
.mapToObj(i -> mobiles2.subList(i * 10000, Math.min((i + 1) * 10000, mobiles2.size()))) |
|
|
|
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
int count = mobile.size(); |
|
|
|
|
|
|
|
for (List<String> arr : mobile) { |
|
|
|
|
|
|
|
List<GBaseSYRKXX> list = gBaseSYRKXXRepository.list(new LambdaQueryWrapper<GBaseSYRKXX>() |
|
|
|
|
|
|
|
.select(GBaseSYRKXX::getLxdh, GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getXm, GBaseSYRKXX::getXbdm, GBaseSYRKXX::getSspcsdm) |
|
|
|
|
|
|
|
.in(GBaseSYRKXX::getLxdh, arr)); |
|
|
|
|
|
|
|
lXfs.addAll(list); |
|
|
|
|
|
|
|
log.info("手机号进度 | {}", --count); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
).join(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, GBaseSYRKXX> idCodeMap = sFms.stream().collect(Collectors.toMap(GBaseSYRKXX::getGmsfhm, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
Map<String, GBaseSYRKXX> idCodeMap = xxList.stream().collect(Collectors.toMap(GBaseSYRKXX::getGmsfhm, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
Map<String, List<GBaseSYRKXX>> mobileMap = lXfs.stream().collect(Collectors.groupingBy(GBaseSYRKXX::getLxdh)); |
|
|
|
|
|
|
|
List<RiskPersonal> personals = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, List<GBaseAJJBXX>> shrMap = new HashMap<>(); |
|
|
|
List<RiskPersonal> toInsert1 = createInsertData(Default.WFR_TAG, wfrTmp, tmpMap, idCodeMap, orgCodeMap, orgIdMap, externalDepart); |
|
|
|
for (GBaseSHRXX gBaseSHRXX : shrList) { |
|
|
|
List<RiskPersonal> toInsert2 = createInsertData(Default.SHR_TAG, shrTmp, tmpMap, idCodeMap, orgCodeMap, orgIdMap, externalDepart); |
|
|
|
GBaseAJJBXX ajjbxx = xxMap.get(gBaseSHRXX.getAjbh()); |
|
|
|
|
|
|
|
if (ajjbxx == null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
GBaseSYRKXX rkxx = Optional.ofNullable(gBaseSHRXX.getGmsfhm()).map(idCodeMap::get) |
|
|
|
|
|
|
|
.orElse(null); |
|
|
|
|
|
|
|
if (gBaseSHRXX.getLxdh() != null && rkxx == null) { |
|
|
|
|
|
|
|
List<GBaseSYRKXX> rkxxList = mobileMap.get(gBaseSHRXX.getLxdh()); |
|
|
|
|
|
|
|
if (rkxxList != null) { |
|
|
|
|
|
|
|
rkxx = compare(rkxxList, gBaseSHRXX.getXm()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (rkxx != null) { |
|
|
|
|
|
|
|
RiskPersonal person = createPerson(Default.SHR_TAG, ajjbxx, rkxx); |
|
|
|
|
|
|
|
if (rkxx.getSspcsdm() != null) { |
|
|
|
|
|
|
|
PointOrg org = orgCodeMap.get(rkxx.getSspcsdm()); |
|
|
|
|
|
|
|
org = findOrg(org, orgIdMap); |
|
|
|
|
|
|
|
if (org != null) { |
|
|
|
|
|
|
|
SupExternalDepart depart = pointExternalDepart.get(org.getDm()); |
|
|
|
|
|
|
|
if (depart != null) { |
|
|
|
|
|
|
|
person.setControlDepartId(depart.getInternalId()); |
|
|
|
|
|
|
|
person.setControlDepartName(depart.getInternalName()); |
|
|
|
|
|
|
|
person.setControlDepartType(DepartType.HUMAN.getType()); |
|
|
|
|
|
|
|
person.setControlTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
person.setCreateTime(person.getControlTime()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (person.getIdCode() != null) { |
|
|
|
log.info("违法人数: {}", toInsert1.size()); |
|
|
|
shrMap.computeIfAbsent(person.getIdCode(), k -> new ArrayList<>()).add(ajjbxx); |
|
|
|
riskPersonalService.formatAndSave(toInsert1, Default.WFR_TAG); |
|
|
|
} |
|
|
|
log.info("受害人数: {}", toInsert2.size()); |
|
|
|
personals.add(person); |
|
|
|
riskPersonalService.formatAndSave(toInsert2, Default.SHR_TAG); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (GBaseWFRXX gBaseWFRXX : wxrList) { |
|
|
|
|
|
|
|
GBaseAJJBXX ajjbxx = xxMap.get(gBaseWFRXX.getAjbh()); |
|
|
|
|
|
|
|
if (ajjbxx == null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
GBaseSYRKXX rkxx = null; |
|
|
|
|
|
|
|
if (gBaseWFRXX.getZjhm() != null) { |
|
|
|
|
|
|
|
rkxx = idCodeMap.get(gBaseWFRXX.getZjhm()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (gBaseWFRXX.getLxdh() != null && rkxx == null) { |
|
|
|
|
|
|
|
List<GBaseSYRKXX> rkxxList = mobileMap.get(gBaseWFRXX.getLxdh()); |
|
|
|
|
|
|
|
if (rkxxList != null) { |
|
|
|
|
|
|
|
rkxx = compare(rkxxList, gBaseWFRXX.getXm()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (rkxx != null) { |
|
|
|
|
|
|
|
RiskPersonal person = createPerson(Default.WFR_TAG, ajjbxx, rkxx); |
|
|
|
|
|
|
|
if (rkxx.getSspcsdm() != null) { |
|
|
|
|
|
|
|
PointOrg org = orgCodeMap.get(rkxx.getSspcsdm()); |
|
|
|
|
|
|
|
org = findOrg(org, orgIdMap); |
|
|
|
|
|
|
|
if (org != null) { |
|
|
|
|
|
|
|
SupExternalDepart depart = pointExternalDepart.get(org.getDm()); |
|
|
|
|
|
|
|
if (depart != null) { |
|
|
|
|
|
|
|
person.setControlDepartId(depart.getInternalId()); |
|
|
|
|
|
|
|
person.setControlDepartName(depart.getInternalName()); |
|
|
|
|
|
|
|
person.setControlDepartType(DepartType.HUMAN.getType()); |
|
|
|
|
|
|
|
person.setControlTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
person.setCreateTime(person.getControlTime()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
shrMap.computeIfAbsent(person.getIdCode(), k -> new ArrayList<>()).add(ajjbxx); |
|
|
|
|
|
|
|
personals.add(person); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (RiskPersonal personal : personals) { |
|
|
|
|
|
|
|
if (personal.getControlDepartType() != null && personal.getControlDepartType() >= DepartType.HUMAN.getType()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<GBaseAJJBXX> tmp = shrMap.get(personal.getIdCode()); |
|
|
|
|
|
|
|
if (tmp == null || tmp.isEmpty()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
GBaseAJJBXX jjx = null; |
|
|
|
|
|
|
|
for (GBaseAJJBXX gBaseAJJBXX : tmp) { |
|
|
|
|
|
|
|
if (jjx == null) { |
|
|
|
|
|
|
|
jjx = gBaseAJJBXX; |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
LocalDateTime time = gBaseAJJBXX.getBarq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
|
|
|
|
|
|
|
if (time.isAfter(jjx.getBarq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime())) { |
|
|
|
|
|
|
|
jjx = gBaseAJJBXX; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.info("报警时间处理异常"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (jjx == null || jjx.getBadwiddm() == null) { |
|
|
|
|
|
|
|
personal.setControlDepartId(null); |
|
|
|
|
|
|
|
personal.setControlDepartName(null); |
|
|
|
|
|
|
|
personal.setControlTime(null); |
|
|
|
|
|
|
|
personal.setControlDepartType(null); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
PointOrg org = orgCodeMap.get(jjx.getBadwiddm()); |
|
|
|
|
|
|
|
org = findOrg(org, orgIdMap); |
|
|
|
|
|
|
|
SupExternalDepart depart = Optional.ofNullable(org).map(PointOrg::getDm).map(jqExternalDepart::get).orElse(null); |
|
|
|
|
|
|
|
if (depart == null) { |
|
|
|
|
|
|
|
personal.setControlDepartId(null); |
|
|
|
|
|
|
|
personal.setControlDepartName(null); |
|
|
|
|
|
|
|
personal.setControlTime(null); |
|
|
|
|
|
|
|
personal.setControlDepartType(null); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
personal.setControlDepartId(depart.getInternalId()); |
|
|
|
|
|
|
|
personal.setControlDepartName(depart.getInternalName()); |
|
|
|
|
|
|
|
personal.setControlDepartType(DepartType.OTHER.getType()); |
|
|
|
|
|
|
|
// 如果有报警时间,暂时填报警时间 处理标签回正
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
LocalDateTime time = jjx.getBarq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
|
|
|
|
|
|
|
personal.setCreateTime(time); |
|
|
|
|
|
|
|
personal.setControlTime(time); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
personal.setCreateTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
log.info("报警时间处理异常"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
log.info("人数: {}", personals.size()); |
|
|
|
|
|
|
|
riskPersonalService.formatAndSave(personals, Default.BIG_TAG_SHWFR); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private final RiskTaskRepository taskRepository; |
|
|
|
private final RiskTaskRepository taskRepository; |
|
|
|
@ -585,33 +412,75 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService { |
|
|
|
return info; |
|
|
|
return info; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RiskPersonal createPerson(String tag, GBaseAJJBXX ajjbxx, GBaseSYRKXX rkxx) { |
|
|
|
RiskPersonal createPerson(WFSHPerson person, GBaseSYRKXX xx, String tag) { |
|
|
|
RiskPersonal personal = new RiskPersonal(); |
|
|
|
RiskPersonal personal = new RiskPersonal(); |
|
|
|
personal.setIdCode(rkxx.getGmsfhm()); |
|
|
|
personal.setIdCode(person.getIdCode()); |
|
|
|
personal.setName(rkxx.getXm()); |
|
|
|
if (xx != null) { |
|
|
|
personal.setMobileNumber(rkxx.getLxdh()); |
|
|
|
personal.setName(xx.getXm()); |
|
|
|
personal.setControlDepartId(ajjbxx.getBadwiddm()); |
|
|
|
personal.setMobileNumber(xx.getLxdh()); |
|
|
|
personal.setControlDepartName(ajjbxx.getBadwidmc()); |
|
|
|
personal.setControlTime(LocalDateTime.now()); |
|
|
|
personal.setGender(IdCodeUtil.idCard2Gender(rkxx.getGmsfhm())); |
|
|
|
} else { |
|
|
|
if (personal.getGender() == null) { |
|
|
|
personal.setName(person.getName()); |
|
|
|
personal.setGender(rkxx.getXbdm()); |
|
|
|
personal.setName(person.getMobile()); |
|
|
|
} |
|
|
|
|
|
|
|
personal.setControlDepartType(DepartType.OTHER.getType()); |
|
|
|
|
|
|
|
// 如果有报警时间,暂时填报警时间 处理标签回正
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
LocalDateTime time = ajjbxx.getBarq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
|
|
|
personal.setControlTime(person.getBarq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
personal.setCreateTime(time); |
|
|
|
|
|
|
|
personal.setControlTime(time); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
personal.setCreateTime(LocalDateTime.now()); |
|
|
|
log.error("案件日期转换异常"); |
|
|
|
log.info("报警时间处理异常"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
personal.setGender(IdCodeUtil.idCard2Gender(person.getIdCode())); |
|
|
|
personal.setAge(Optional.ofNullable(IdCodeUtil.idCard2Age(personal.getIdCode(), LocalDate.now())).orElse(-1)); |
|
|
|
personal.setAge(Optional.ofNullable(IdCodeUtil.idCard2Age(personal.getIdCode(), LocalDate.now())).orElse(-1)); |
|
|
|
// 这里暂时将小标签放到预览属性 处理标签回正
|
|
|
|
personal.setCreateTime(LocalDateTime.now()); |
|
|
|
personal.setTags(tag); |
|
|
|
personal.setTags(tag); |
|
|
|
return personal; |
|
|
|
return personal; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<RiskPersonal> createInsertData(String tag, List<WFSHPerson> list, Map<String, WFSHPerson> tmpMap, Map<String, GBaseSYRKXX> idCodeMap, |
|
|
|
|
|
|
|
Map<String, PointOrg> orgCodeMap, Map<String, PointOrg> orgIdMap, Map<String, SupExternalDepart> externalDepart) { |
|
|
|
|
|
|
|
Map<String, SupExternalDepart> departMap = new WeakHashMap<>(); |
|
|
|
|
|
|
|
Map<String, Byte[]> exist = new WeakHashMap<>(); |
|
|
|
|
|
|
|
List<RiskPersonal> toInsert = new ArrayList<>(); |
|
|
|
|
|
|
|
for (WFSHPerson person : list) { |
|
|
|
|
|
|
|
if (exist.get(person.getIdCode()) != null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
WFSHPerson result = tmpMap.get(person.getIdCode()); |
|
|
|
|
|
|
|
RiskPersonal personal; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String departId; |
|
|
|
|
|
|
|
if (result != null) { |
|
|
|
|
|
|
|
personal = createPerson(result, null, tag); |
|
|
|
|
|
|
|
personal.setControlDepartType(DepartType.OTHER.getType()); |
|
|
|
|
|
|
|
departId = result.getDepartId(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
GBaseSYRKXX xx = idCodeMap.get(person.getIdCode()); |
|
|
|
|
|
|
|
personal = createPerson(person, xx, tag); |
|
|
|
|
|
|
|
personal.setControlDepartType(DepartType.HUMAN.getType()); |
|
|
|
|
|
|
|
departId = xx.getSspcsdm(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (departId == null) { |
|
|
|
|
|
|
|
toInsert.add(personal); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
SupExternalDepart depart = departMap.get(departId); |
|
|
|
|
|
|
|
if (depart == null) { |
|
|
|
|
|
|
|
PointOrg org = orgCodeMap.get(departId); |
|
|
|
|
|
|
|
org = findOrg(org, orgIdMap); |
|
|
|
|
|
|
|
if (org != null) { |
|
|
|
|
|
|
|
depart = externalDepart.get(org.getDm()); |
|
|
|
|
|
|
|
departMap.put(departId, depart); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (depart != null) { |
|
|
|
|
|
|
|
personal.setControlDepartId(depart.getInternalId()); |
|
|
|
|
|
|
|
personal.setControlDepartName(depart.getInternalName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
toInsert.add(personal); |
|
|
|
|
|
|
|
exist.put(person.getIdCode(), new Byte[0]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return toInsert; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PointOrg findOrg(PointOrg org, Map<String, PointOrg> orgIdMap) { |
|
|
|
PointOrg findOrg(PointOrg org, Map<String, PointOrg> orgIdMap) { |
|
|
|
if (org == null) { |
|
|
|
if (org == null) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
|