|
|
|
@ -27,7 +27,6 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.ZoneId; |
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
@ -77,8 +76,8 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
String idCards = PatternUtil.takeIdCard(item.getCjqk()); |
|
|
|
String idCards = PatternUtil.takeIdCard(item.getCjqk()); |
|
|
|
if (!idCards.isEmpty()) { |
|
|
|
if (!idCards.isEmpty()) { |
|
|
|
person.setIdCode(idCards); |
|
|
|
person.setIdCode(idCards); |
|
|
|
String[] strs = idCards.split(","); |
|
|
|
String[] array = idCards.split(","); |
|
|
|
for (String s : strs) { |
|
|
|
for (String s : array) { |
|
|
|
idCodes1.add(s); |
|
|
|
idCodes1.add(s); |
|
|
|
jjdMap.computeIfAbsent(item.getBjrzjhm(), k -> new ArrayList<>()).add(item); |
|
|
|
jjdMap.computeIfAbsent(item.getBjrzjhm(), k -> new ArrayList<>()).add(item); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -120,11 +119,11 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
List<RiskPersonal> toInsert = new ArrayList<>(); |
|
|
|
List<RiskPersonal> toInsert = new ArrayList<>(); |
|
|
|
for (RiskPersonal personal : personals) { |
|
|
|
for (RiskPersonal personal : personals) { |
|
|
|
if (personal.getIdCode() != null) { |
|
|
|
if (personal.getIdCode() != null) { |
|
|
|
String[] strs = personal.getIdCode().split(","); |
|
|
|
String[] array = personal.getIdCode().split(","); |
|
|
|
// 多张身份证存入异常信息
|
|
|
|
// 多张身份证存入异常信息
|
|
|
|
personal.setIdCode(null); |
|
|
|
personal.setIdCode(null); |
|
|
|
xxxInfo = new ArrayList<>(); |
|
|
|
xxxInfo = new ArrayList<>(); |
|
|
|
for (String s : strs) { |
|
|
|
for (String s : array) { |
|
|
|
GBaseSYRKXX xx = idCodeMap.get(s); |
|
|
|
GBaseSYRKXX xx = idCodeMap.get(s); |
|
|
|
if (xx != null) { |
|
|
|
if (xx != null) { |
|
|
|
xxxInfo.add(xx); |
|
|
|
xxxInfo.add(xx); |
|
|
|
@ -205,11 +204,9 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
personal.setControlDepartName(depart.getInternalShortName()); |
|
|
|
personal.setControlDepartName(depart.getInternalShortName()); |
|
|
|
personal.setControlDepartType(DepartType.OTHER.getType()); |
|
|
|
personal.setControlDepartType(DepartType.OTHER.getType()); |
|
|
|
// 如果有报警时间,暂时填报警时间 处理标签回正
|
|
|
|
// 如果有报警时间,暂时填报警时间 处理标签回正
|
|
|
|
try { |
|
|
|
personal.setCreateTime(DateTimeUtil.date2LocalDateTime(tmp.getBjsj())); |
|
|
|
LocalDateTime time = tmp.getBjsj().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
|
|
|
personal.setControlTime(personal.getCreateTime()); |
|
|
|
personal.setCreateTime(time); |
|
|
|
if(personal.getCreateTime() == null) { |
|
|
|
personal.setControlTime(time); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
personal.setCreateTime(LocalDateTime.now()); |
|
|
|
personal.setCreateTime(LocalDateTime.now()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -263,34 +260,13 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
Map<String, List<GBaseJJD>> mobileMap = new WeakHashMap<>(); |
|
|
|
Map<String, List<GBaseJJD>> mobileMap = new WeakHashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
String idCard = PatternUtil.takeIdCard(gBaseJJD.getCjqk()); |
|
|
|
List<String> idCards = processIdCards(gBaseJJD); |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
idCards.forEach(idCard -> idCodeMap.computeIfAbsent(idCard, k -> new ArrayList<>()).add(gBaseJJD)); |
|
|
|
idCard = PatternUtil.takeIdCard(gBaseJJD.getBjnr()); |
|
|
|
List<String> mobiles = processMobile(gBaseJJD); |
|
|
|
} |
|
|
|
mobiles.forEach(mobile -> mobileMap.computeIfAbsent(mobile, k -> new ArrayList<>()).add(gBaseJJD)); |
|
|
|
if (!idCard.isEmpty()) { |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
// 如果有多个号码,防止警察证件被录入
|
|
|
|
|
|
|
|
for (String s : tmp) { |
|
|
|
|
|
|
|
idCodeMap.computeIfAbsent(s, k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String mobile = PatternUtil.takeMobile(gBaseJJD.getCjqk()); |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!mobile.isEmpty()) { |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
// 如果有多个号码,防止警察证件被录入
|
|
|
|
|
|
|
|
for (String s : tmp) { |
|
|
|
|
|
|
|
mobileMap.computeIfAbsent(s, k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<RiskModelTaskClue> oldList = Optional.ofNullable(domain.getMap().get(task.getModelId())).orElse(new ArrayList<>()); |
|
|
|
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true); |
|
|
|
// 按人分
|
|
|
|
|
|
|
|
Map<String, List<RiskModelTaskClue>> personOldMap = oldList.stream().collect(Collectors.groupingBy(RiskModelTaskClue::getIdCode)); |
|
|
|
|
|
|
|
List<GBaseJJD> jjdList; |
|
|
|
List<GBaseJJD> jjdList; |
|
|
|
List<RiskModelTaskClue> toInsert = new ArrayList<>(); |
|
|
|
List<RiskModelTaskClue> toInsert = new ArrayList<>(); |
|
|
|
for (RiskPersonal person : domain.getPersons()) { |
|
|
|
for (RiskPersonal person : domain.getPersons()) { |
|
|
|
@ -299,40 +275,21 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
if (jjdList.isEmpty()) { |
|
|
|
if (jjdList.isEmpty()) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
jjdList = jjdList.stream().filter(StreamUtil.distinctByKey(GBaseJJD::getJjdbh)).toList(); |
|
|
|
jjdList = jjdList.stream().filter(StreamUtil.distinctByKey(GBaseJJD::getJjdbh)).sorted().toList(); |
|
|
|
List<RiskModelTaskClue> olds = personOldMap.get(person.getIdCode()); |
|
|
|
RiskModelTaskClue old = oldMap.get(person.getIdCode()); |
|
|
|
if (olds != null) { |
|
|
|
if (old != null) continue; |
|
|
|
// 是否类型只有一个
|
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
LocalDateTime eventTime = null; |
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder("该人员存在" + jjdList.size() + "起平台涉警事件警情,相关警情接警单编号为:"); |
|
|
|
StringBuilder sb = new StringBuilder("该人员存在" + jjdList.size() + "起平台涉警事件警情,相关警情接警单编号为:"); |
|
|
|
for (GBaseJJD gBaseJJD : jjdList) { |
|
|
|
LocalDateTime eventTime = findRecentTime(jjdList, sb); |
|
|
|
sb.append(gBaseJJD.getJjdbh()).append(","); |
|
|
|
toInsert.add(DataUtil.createClueData(task, ClueData.builder() |
|
|
|
try { |
|
|
|
|
|
|
|
LocalDateTime tmp = gBaseJJD.getBjsj().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
|
|
|
|
|
|
|
if (eventTime == null) { |
|
|
|
|
|
|
|
eventTime = tmp; |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (eventTime.isBefore(tmp)) { |
|
|
|
|
|
|
|
eventTime = tmp; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception ignored) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ClueData data = ClueData.builder() |
|
|
|
|
|
|
|
.name(person.getName()) |
|
|
|
.name(person.getName()) |
|
|
|
.id("ptsjsj") |
|
|
|
.id("") |
|
|
|
.idCode(person.getIdCode()) |
|
|
|
.idCode(person.getIdCode()) |
|
|
|
.tags(List.of("平台涉警事件")) |
|
|
|
.tags(List.of("平台涉警事件")) |
|
|
|
.sourceData(sb.substring(0, sb.length() - 1)) |
|
|
|
.sourceData(sb.substring(0, sb.length() - 1)) |
|
|
|
.eventTime(Optional.ofNullable(eventTime).orElse(LocalDateTime.now())) |
|
|
|
.eventTime(eventTime) |
|
|
|
.personId(person.getId()) |
|
|
|
.personId(person.getId()) |
|
|
|
.score(Math.min(5, jjdList.size())) |
|
|
|
.score(Math.min(5, jjdList.size())) |
|
|
|
.build(); |
|
|
|
.build())); |
|
|
|
toInsert.add(DataUtil.createClueData(task, data)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
log.info("保存袭警数据:{}", toInsert.size()); |
|
|
|
log.info("保存袭警数据:{}", toInsert.size()); |
|
|
|
if (!toInsert.isEmpty()) { |
|
|
|
if (!toInsert.isEmpty()) { |
|
|
|
@ -371,32 +328,12 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
if (riskPerson != null) { |
|
|
|
if (riskPerson != null) { |
|
|
|
personJqList.computeIfAbsent(riskPerson.getIdCode(), k -> new ArrayList<>()).add(jjd); |
|
|
|
personJqList.computeIfAbsent(riskPerson.getIdCode(), k -> new ArrayList<>()).add(jjd); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<String> idCards = processIdCards(jjd); |
|
|
|
|
|
|
|
idCards.stream().filter(s -> idCodelMap.get(s) != null).forEach(s -> personJqList.computeIfAbsent(s, k -> new ArrayList<>()).add(jjd)); |
|
|
|
|
|
|
|
|
|
|
|
// 一个都不放过
|
|
|
|
List<String> mobiles = processIdCards(jjd); |
|
|
|
String idCard = PatternUtil.takeIdCard(jjd.getCjqk()); |
|
|
|
mobiles.stream().map(mobileMap::get).filter(Objects::nonNull).map(RiskPersonal::getIdCode) |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
.forEach(s -> personJqList.computeIfAbsent(s, k -> new ArrayList<>()).add(jjd)); |
|
|
|
idCard = PatternUtil.takeIdCard(jjd.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!idCard.isEmpty()) { |
|
|
|
|
|
|
|
String[] str = idCard.split(","); |
|
|
|
|
|
|
|
for (String s : str) { |
|
|
|
|
|
|
|
riskPerson = idCodelMap.get(s); |
|
|
|
|
|
|
|
if (riskPerson == null) continue; |
|
|
|
|
|
|
|
personJqList.computeIfAbsent(riskPerson.getIdCode(), k -> new ArrayList<>()).add(jjd); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String mobile = PatternUtil.takeMobile(jjd.getCjqk()); |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(jjd.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mobile.isEmpty()) continue; |
|
|
|
|
|
|
|
String[] str = mobile.split(","); |
|
|
|
|
|
|
|
for (String s : str) { |
|
|
|
|
|
|
|
riskPerson = mobileMap.get(s); |
|
|
|
|
|
|
|
if (riskPerson == null) continue; |
|
|
|
|
|
|
|
personJqList.computeIfAbsent(riskPerson.getIdCode(), k -> new ArrayList<>()).add(jjd); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
log.info("开始统计每个人的警情"); |
|
|
|
log.info("开始统计每个人的警情"); |
|
|
|
@ -406,20 +343,7 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
List<GBaseJJD> list; |
|
|
|
List<GBaseJJD> list; |
|
|
|
for (Map.Entry<String, List<GBaseJJD>> entry : personJqList.entrySet()) { |
|
|
|
for (Map.Entry<String, List<GBaseJJD>> entry : personJqList.entrySet()) { |
|
|
|
list = entry.getValue().stream().distinct().sorted().toList(); |
|
|
|
list = entry.getValue().stream().distinct().sorted().toList(); |
|
|
|
LocalDateTime maxTime = null; |
|
|
|
LocalDateTime maxTime = Optional.ofNullable(findRecentTime(list, null)).orElse(LocalDateTime.now()); |
|
|
|
for (GBaseJJD gBaseJJD : list) { |
|
|
|
|
|
|
|
LocalDateTime tmp = DateTimeUtil.date2LocalDateTime(gBaseJJD.getBjsj()); |
|
|
|
|
|
|
|
if (maxTime == null) { |
|
|
|
|
|
|
|
maxTime = tmp; |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (tmp.isAfter(maxTime)) { |
|
|
|
|
|
|
|
maxTime = tmp; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (maxTime == null) { |
|
|
|
|
|
|
|
maxTime = LocalDateTime.now(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RiskPersonal person = idCodelMap.get(entry.getKey()); |
|
|
|
RiskPersonal person = idCodelMap.get(entry.getKey()); |
|
|
|
StringBuilder sb = new StringBuilder("该人员近一年来有" + list.size() + "起平台涉警事件,接警单编号为:"); |
|
|
|
StringBuilder sb = new StringBuilder("该人员近一年来有" + list.size() + "起平台涉警事件,接警单编号为:"); |
|
|
|
@ -460,7 +384,6 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void syncHomeViolence(TaskParamDomain domain) { |
|
|
|
public void syncHomeViolence(TaskParamDomain domain) { |
|
|
|
LocalDateTime limit = LocalDateTime.now().minusYears(1); |
|
|
|
LocalDateTime limit = LocalDateTime.now().minusYears(1); |
|
|
|
|
|
|
|
|
|
|
|
List<GBaseJJD> result = gBaseJJDRepository.getBaseMapper().selectHomeViolence(limit.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
List<GBaseJJD> result = gBaseJJDRepository.getBaseMapper().selectHomeViolence(limit.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
// 被家暴
|
|
|
|
// 被家暴
|
|
|
|
RiskTask task = taskRepository.create(result.size(), 65); |
|
|
|
RiskTask task = taskRepository.create(result.size(), 65); |
|
|
|
@ -479,12 +402,8 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
Map<String, List<GBaseJJD>> wfMobileMap = new WeakHashMap<>(); |
|
|
|
Map<String, List<GBaseJJD>> wfMobileMap = new WeakHashMap<>(); |
|
|
|
// 没有号码算报警人被家暴,一个号码算该人被家暴,两个号码算第一人被家暴,第二人家暴,3个号码从第二个开始算(第一个号码有可能是民警或报警人)
|
|
|
|
// 没有号码算报警人被家暴,一个号码算该人被家暴,两个号码算第一人被家暴,第二人家暴,3个号码从第二个开始算(第一个号码有可能是民警或报警人)
|
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
String idCard = PatternUtil.takeIdCard(gBaseJJD.getCjqk()); |
|
|
|
List<String> tmp = processIdCards(gBaseJJD); |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
if (!tmp.isEmpty()) { |
|
|
|
idCard = PatternUtil.takeIdCard(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!idCard.isEmpty()) { |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
switch (tmp.size()) { |
|
|
|
switch (tmp.size()) { |
|
|
|
case 1 -> shIdCodeMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
case 1 -> shIdCodeMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
case 2 -> { |
|
|
|
case 2 -> { |
|
|
|
@ -498,12 +417,8 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
} |
|
|
|
} |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
String mobile = PatternUtil.takeMobile(gBaseJJD.getCjqk()); |
|
|
|
tmp = processMobile(gBaseJJD); |
|
|
|
if (mobile.isEmpty()) { |
|
|
|
if (!tmp.isEmpty()) { |
|
|
|
mobile = PatternUtil.takeMobile(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!mobile.isEmpty()) { |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
switch (tmp.size()) { |
|
|
|
switch (tmp.size()) { |
|
|
|
case 1 -> shMobileMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
case 1 -> shMobileMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
case 2 -> { |
|
|
|
case 2 -> { |
|
|
|
@ -596,7 +511,7 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
RiskModelTaskClue motherClue = collectionClue(motherIdCodeMap, new WeakHashMap<>(0), person, task2, "与母亲关系不合"); |
|
|
|
RiskModelTaskClue motherClue = collectionClue(motherIdCodeMap, new WeakHashMap<>(0), person, task2, "与母亲关系不合"); |
|
|
|
if (fatherClue != null) { |
|
|
|
if (fatherClue != null) { |
|
|
|
RiskModelTaskClue fatherOld = fatherOldMap.get(person.getIdCode()); |
|
|
|
RiskModelTaskClue fatherOld = fatherOldMap.get(person.getIdCode()); |
|
|
|
if(fatherOld == null) { |
|
|
|
if (fatherOld == null) { |
|
|
|
fatherDBData.getToInsert().add(fatherClue); |
|
|
|
fatherDBData.getToInsert().add(fatherClue); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
fatherOldMap.remove(person.getIdCode()); |
|
|
|
fatherOldMap.remove(person.getIdCode()); |
|
|
|
@ -606,9 +521,9 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(motherClue == null) continue; |
|
|
|
if (motherClue == null) continue; |
|
|
|
RiskModelTaskClue motherOld = motherOldMap.get(person.getIdCode()); |
|
|
|
RiskModelTaskClue motherOld = motherOldMap.get(person.getIdCode()); |
|
|
|
if(motherOld == null) { |
|
|
|
if (motherOld == null) { |
|
|
|
motherDBData.getToInsert().add(motherClue); |
|
|
|
motherDBData.getToInsert().add(motherClue); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -636,52 +551,14 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
Map<String, List<GBaseJJD>> mobilesMap = new WeakHashMap<>(); |
|
|
|
Map<String, List<GBaseJJD>> mobilesMap = new WeakHashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
String idCard = PatternUtil.takeIdCard(gBaseJJD.getCjqk()); |
|
|
|
List<String> tmp = processIdCards(gBaseJJD); |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
if (!tmp.isEmpty()) { |
|
|
|
idCard = PatternUtil.takeIdCard(gBaseJJD.getBjnr()); |
|
|
|
collectSingleMap(tmp, 3, idCodesMap, gBaseJJD); |
|
|
|
} |
|
|
|
|
|
|
|
boolean mobileContinue = false; |
|
|
|
|
|
|
|
if (!idCard.isEmpty()) { |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
switch (tmp.size()) { |
|
|
|
|
|
|
|
case 0 -> mobileContinue = true; |
|
|
|
|
|
|
|
case 1 -> idCodesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
case 2 -> { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(0), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(1), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default -> { |
|
|
|
|
|
|
|
for (int i = 1; i < 3; i++) { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!mobileContinue) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String mobile = PatternUtil.takeMobile(gBaseJJD.getCjqk()); |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> tmp = Arrays.stream(mobile.split(",")).toList(); |
|
|
|
tmp = processMobile(gBaseJJD); |
|
|
|
switch (tmp.size()) { |
|
|
|
if (tmp.isEmpty()) continue; |
|
|
|
case 0 -> { |
|
|
|
collectSingleMap(tmp, tmp.size(), mobilesMap, gBaseJJD); |
|
|
|
} |
|
|
|
|
|
|
|
case 1 -> mobilesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
case 2 -> { |
|
|
|
|
|
|
|
mobilesMap.computeIfAbsent(tmp.get(0), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
mobilesMap.computeIfAbsent(tmp.get(1), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default -> { |
|
|
|
|
|
|
|
for (int i = 1; i < tmp.size(); i++) { |
|
|
|
|
|
|
|
mobilesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true); |
|
|
|
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true); |
|
|
|
|
|
|
|
|
|
|
|
@ -716,52 +593,14 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
Map<String, List<GBaseJJD>> mobilesMap = new WeakHashMap<>(); |
|
|
|
Map<String, List<GBaseJJD>> mobilesMap = new WeakHashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
String idCard = PatternUtil.takeIdCard(gBaseJJD.getCjqk()); |
|
|
|
List<String> tmp = processIdCards(gBaseJJD); |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
if (!tmp.isEmpty()) { |
|
|
|
idCard = PatternUtil.takeIdCard(gBaseJJD.getBjnr()); |
|
|
|
collectSingleMap(tmp, tmp.size(), idCodesMap, gBaseJJD); |
|
|
|
} |
|
|
|
|
|
|
|
boolean mobileContinue = false; |
|
|
|
|
|
|
|
if (!idCard.isEmpty()) { |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
switch (tmp.size()) { |
|
|
|
|
|
|
|
case 0 -> mobileContinue = true; |
|
|
|
|
|
|
|
case 1 -> idCodesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
case 2 -> { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(0), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(1), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default -> { |
|
|
|
|
|
|
|
for (int i = 1; i < 3; i++) { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!mobileContinue) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String mobile = PatternUtil.takeMobile(gBaseJJD.getCjqk()); |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> tmp = Arrays.stream(mobile.split(",")).toList(); |
|
|
|
tmp = processMobile(gBaseJJD); |
|
|
|
switch (tmp.size()) { |
|
|
|
if (tmp.isEmpty()) continue; |
|
|
|
case 0 -> { |
|
|
|
collectSingleMap(tmp, tmp.size(), mobilesMap, gBaseJJD); |
|
|
|
} |
|
|
|
|
|
|
|
case 1 -> mobilesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
case 2 -> { |
|
|
|
|
|
|
|
mobilesMap.computeIfAbsent(tmp.get(0), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
mobilesMap.computeIfAbsent(tmp.get(1), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default -> { |
|
|
|
|
|
|
|
for (int i = 1; i < tmp.size(); i++) { |
|
|
|
|
|
|
|
mobilesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true); |
|
|
|
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true); |
|
|
|
|
|
|
|
|
|
|
|
@ -795,52 +634,14 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
Map<String, List<GBaseJJD>> mobilesMap = new WeakHashMap<>(); |
|
|
|
Map<String, List<GBaseJJD>> mobilesMap = new WeakHashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
String idCard = PatternUtil.takeIdCard(gBaseJJD.getCjqk()); |
|
|
|
List<String> tmp = processIdCards(gBaseJJD); |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
if (!tmp.isEmpty()) { |
|
|
|
idCard = PatternUtil.takeIdCard(gBaseJJD.getBjnr()); |
|
|
|
collectSingleMap(tmp, tmp.size(), idCodesMap, gBaseJJD); |
|
|
|
} |
|
|
|
|
|
|
|
boolean mobileContinue = false; |
|
|
|
|
|
|
|
if (!idCard.isEmpty()) { |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
switch (tmp.size()) { |
|
|
|
|
|
|
|
case 0 -> mobileContinue = true; |
|
|
|
|
|
|
|
case 1 -> idCodesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
case 2 -> { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(0), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(1), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default -> { |
|
|
|
|
|
|
|
for (int i = 1; i < tmp.size(); i++) { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!mobileContinue) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String mobile = PatternUtil.takeMobile(gBaseJJD.getCjqk()); |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> tmp = Arrays.stream(mobile.split(",")).toList(); |
|
|
|
tmp = processMobile(gBaseJJD); |
|
|
|
switch (tmp.size()) { |
|
|
|
if (tmp.isEmpty()) continue; |
|
|
|
case 0 -> { |
|
|
|
collectSingleMap(tmp, tmp.size(), mobilesMap, gBaseJJD); |
|
|
|
} |
|
|
|
|
|
|
|
case 1 -> mobilesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
case 2 -> { |
|
|
|
|
|
|
|
mobilesMap.computeIfAbsent(tmp.get(0), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
mobilesMap.computeIfAbsent(tmp.get(1), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default -> { |
|
|
|
|
|
|
|
for (int i = 1; i < tmp.size(); i++) { |
|
|
|
|
|
|
|
mobilesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true); |
|
|
|
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true); |
|
|
|
|
|
|
|
|
|
|
|
@ -876,12 +677,8 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
|
|
|
|
|
|
|
|
List<GBaseJJD> others = new ArrayList<>(); |
|
|
|
List<GBaseJJD> others = new ArrayList<>(); |
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
String idCard = PatternUtil.takeIdCard(gBaseJJD.getCjqk()); |
|
|
|
List<String> tmp = processIdCards(gBaseJJD); |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
if (!tmp.isEmpty()) { |
|
|
|
idCard = PatternUtil.takeIdCard(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!idCard.isEmpty()) { |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
// 年龄22岁以下才算
|
|
|
|
// 年龄22岁以下才算
|
|
|
|
for (String s : tmp) { |
|
|
|
for (String s : tmp) { |
|
|
|
Integer age = IdCodeUtil.idCard2Age(s, today); |
|
|
|
Integer age = IdCodeUtil.idCard2Age(s, today); |
|
|
|
@ -891,14 +688,9 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
} |
|
|
|
} |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
String mobile = PatternUtil.takeMobile(gBaseJJD.getCjqk()); |
|
|
|
tmp = processMobile(gBaseJJD); |
|
|
|
if (mobile.isEmpty()) { |
|
|
|
if (tmp.isEmpty()) continue; |
|
|
|
mobile = PatternUtil.takeMobile(gBaseJJD.getBjnr()); |
|
|
|
mobiles.addAll(tmp); |
|
|
|
} |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mobiles.addAll(Arrays.stream(mobile.split(",")).toList()); |
|
|
|
|
|
|
|
others.add(gBaseJJD); |
|
|
|
others.add(gBaseJJD); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -908,11 +700,7 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
Map<String, List<GBaseSYRKXX>> mobileRkMap = xxList.stream().collect(Collectors.groupingBy(GBaseSYRKXX::getLxdh)); |
|
|
|
Map<String, List<GBaseSYRKXX>> mobileRkMap = xxList.stream().collect(Collectors.groupingBy(GBaseSYRKXX::getLxdh)); |
|
|
|
// 第二轮通过手机号找身份证
|
|
|
|
// 第二轮通过手机号找身份证
|
|
|
|
for (GBaseJJD other : others) { |
|
|
|
for (GBaseJJD other : others) { |
|
|
|
String mobile = PatternUtil.takeMobile(other.getCjqk()); |
|
|
|
List<String> tmp = processMobile(other); |
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(other.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(mobile.split(",")).toList(); |
|
|
|
|
|
|
|
List<String> idCard = new ArrayList<>(); |
|
|
|
List<String> idCard = new ArrayList<>(); |
|
|
|
for (String s : tmp) { |
|
|
|
for (String s : tmp) { |
|
|
|
List<GBaseSYRKXX> arr = Optional.ofNullable(mobileRkMap.get(s)).orElse(new ArrayList<>()); |
|
|
|
List<GBaseSYRKXX> arr = Optional.ofNullable(mobileRkMap.get(s)).orElse(new ArrayList<>()); |
|
|
|
@ -921,12 +709,8 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
return age != null && age <= 22; |
|
|
|
return age != null && age <= 22; |
|
|
|
}).toList()); |
|
|
|
}).toList()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
if (idCard.isEmpty()) continue; |
|
|
|
continue; |
|
|
|
idCard.forEach(s -> idCodesMap.computeIfAbsent(s, k -> new ArrayList<>()).add(other)); |
|
|
|
} |
|
|
|
|
|
|
|
for (String s : idCard) { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(s, k -> new ArrayList<>()).add(other); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true); |
|
|
|
Map<String, RiskModelTaskClue> oldMap = domain.getOldMap(task.getModelId(), true); |
|
|
|
@ -939,14 +723,7 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
StringBuilder sb = new StringBuilder("该人员存在" + jjdList.size() + "起被欺凌警情,接警单编号:"); |
|
|
|
StringBuilder sb = new StringBuilder("该人员存在" + jjdList.size() + "起被欺凌警情,接警单编号:"); |
|
|
|
LocalDateTime time = null; |
|
|
|
LocalDateTime time = findRecentTime(jjdList, sb); |
|
|
|
for (GBaseJJD jjd : jjdList) { |
|
|
|
|
|
|
|
sb.append(jjd.getJjdbh()).append(","); |
|
|
|
|
|
|
|
LocalDateTime tmp = DateTimeUtil.date2LocalDateTime(jjd.getBjsj()); |
|
|
|
|
|
|
|
if (time == null || (tmp != null && time.isBefore(tmp))) { |
|
|
|
|
|
|
|
time = tmp; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String desc = sb.substring(0, sb.length() - 1); |
|
|
|
String desc = sb.substring(0, sb.length() - 1); |
|
|
|
RiskModelTaskClue old = oldMap.get(person.getIdCode()); |
|
|
|
RiskModelTaskClue old = oldMap.get(person.getIdCode()); |
|
|
|
if (old == null) { |
|
|
|
if (old == null) { |
|
|
|
@ -1048,42 +825,24 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
Map<String, List<GBaseJJD>> mobilesMap = new WeakHashMap<>(); |
|
|
|
Map<String, List<GBaseJJD>> mobilesMap = new WeakHashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
String idCard = PatternUtil.takeIdCard(gBaseJJD.getCjqk()); |
|
|
|
List<String> tmp = processIdCards(gBaseJJD); |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
if (!tmp.isEmpty()) { |
|
|
|
idCard = PatternUtil.takeIdCard(gBaseJJD.getBjnr()); |
|
|
|
if (tmp.size() == 1) { |
|
|
|
} |
|
|
|
idCodesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
boolean mobileContinue = false; |
|
|
|
} else { |
|
|
|
if (!idCard.isEmpty()) { |
|
|
|
for (int i = 1; i < tmp.size(); i++) { |
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
idCodesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
switch (tmp.size()) { |
|
|
|
|
|
|
|
case 0 -> mobileContinue = true; |
|
|
|
|
|
|
|
case 1 -> idCodesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
default -> { |
|
|
|
|
|
|
|
for (int i = 1; i < tmp.size(); i++) { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!mobileContinue) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String mobile = PatternUtil.takeMobile(gBaseJJD.getCjqk()); |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> tmp = Arrays.stream(mobile.split(",")).toList(); |
|
|
|
tmp = processMobile(gBaseJJD); |
|
|
|
switch (tmp.size()) { |
|
|
|
if (tmp.isEmpty()) continue; |
|
|
|
case 0 -> { |
|
|
|
if (tmp.size() == 1) { |
|
|
|
} |
|
|
|
mobilesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
case 1 -> mobilesMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
} else { |
|
|
|
default -> { |
|
|
|
for (int i = 1; i < tmp.size(); i++) { |
|
|
|
for (int i = 1; i < tmp.size(); i++) { |
|
|
|
mobilesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
mobilesMap.computeIfAbsent(tmp.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1114,49 +873,31 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
List<String> mobiles = new ArrayList<>(); |
|
|
|
List<String> mobiles = new ArrayList<>(); |
|
|
|
// 第一轮排除掉有身份证的
|
|
|
|
// 第一轮排除掉有身份证的
|
|
|
|
for (GBaseJJD gBaseJJD : jjdList) { |
|
|
|
for (GBaseJJD gBaseJJD : jjdList) { |
|
|
|
boolean continueMobile = false; |
|
|
|
List<String> tmp = processIdCards(gBaseJJD); |
|
|
|
String idCard = PatternUtil.takeIdCard(gBaseJJD.getCjqk()); |
|
|
|
if (!tmp.isEmpty()) { |
|
|
|
if (idCard.isEmpty()) { |
|
|
|
|
|
|
|
idCard = PatternUtil.takeIdCard(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!idCard.isEmpty()) { |
|
|
|
|
|
|
|
// 找到身份证年龄小的
|
|
|
|
// 找到身份证年龄小的
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
if (tmp.size() == 1) { |
|
|
|
switch (tmp.size()) { |
|
|
|
fatherIdCodeMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
case 0 -> continueMobile = true; |
|
|
|
} else { |
|
|
|
case 1 -> fatherIdCodeMap.computeIfAbsent(tmp.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
fatherIdCodeMap.computeIfAbsent(findSmallOne(tmp), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
default -> fatherIdCodeMap.computeIfAbsent(findSmallOne(tmp), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!continueMobile) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
String mobile = PatternUtil.takeMobile(gBaseJJD.getCjqk()); |
|
|
|
|
|
|
|
if (!mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobiles.addAll(Arrays.stream(mobile.split(",")).toList()); |
|
|
|
|
|
|
|
others.add(gBaseJJD); |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
mobile = PatternUtil.takeMobile(gBaseJJD.getBjnr()); |
|
|
|
tmp = processMobile(gBaseJJD); |
|
|
|
if (!mobile.isEmpty()) { |
|
|
|
if (tmp.isEmpty()) { |
|
|
|
mobiles.addAll(Arrays.stream(mobile.split(",")).toList()); |
|
|
|
mobiles.addAll(tmp); |
|
|
|
others.add(gBaseJJD); |
|
|
|
others.add(gBaseJJD); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (mobiles.isEmpty()) { |
|
|
|
if (mobiles.isEmpty()) { |
|
|
|
return fatherIdCodeMap; |
|
|
|
return fatherIdCodeMap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<GBaseSYRKXX> xxList = gBaseSYRKXXRepository.list(new LambdaQueryWrapper<GBaseSYRKXX>() |
|
|
|
List<GBaseSYRKXX> xxList = gBaseSYRKXXRepository.list(new LambdaQueryWrapper<GBaseSYRKXX>() |
|
|
|
.select(GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getLxdh).in(GBaseSYRKXX::getLxdh, mobiles)); |
|
|
|
.select(GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getLxdh).in(GBaseSYRKXX::getLxdh, mobiles)); |
|
|
|
Map<String, List<GBaseSYRKXX>> mobileRkMap = xxList.stream().collect(Collectors.groupingBy(GBaseSYRKXX::getLxdh)); |
|
|
|
Map<String, List<GBaseSYRKXX>> mobileRkMap = xxList.stream().collect(Collectors.groupingBy(GBaseSYRKXX::getLxdh)); |
|
|
|
// 第二轮通过手机号找身份证
|
|
|
|
// 第二轮通过手机号找身份证
|
|
|
|
for (GBaseJJD other : others) { |
|
|
|
for (GBaseJJD other : others) { |
|
|
|
String mobile = PatternUtil.takeMobile(other.getCjqk()); |
|
|
|
List<String> tmp = processMobile(other); |
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(other.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(mobile.split(",")).toList(); |
|
|
|
|
|
|
|
List<String> idCard = new ArrayList<>(); |
|
|
|
List<String> idCard = new ArrayList<>(); |
|
|
|
for (String s : tmp) { |
|
|
|
for (String s : tmp) { |
|
|
|
List<GBaseSYRKXX> arr = Optional.ofNullable(mobileRkMap.get(s)).orElse(new ArrayList<>()); |
|
|
|
List<GBaseSYRKXX> arr = Optional.ofNullable(mobileRkMap.get(s)).orElse(new ArrayList<>()); |
|
|
|
@ -1205,6 +946,28 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
.orElse(null); |
|
|
|
.orElse(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> processIdCards(GBaseJJD jjd) { |
|
|
|
|
|
|
|
String idCard = PatternUtil.takeIdCard(jjd.getCjqk()); |
|
|
|
|
|
|
|
if (idCard.isEmpty()) { |
|
|
|
|
|
|
|
idCard = PatternUtil.takeIdCard(jjd.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (idCard.isEmpty()) { |
|
|
|
|
|
|
|
return new ArrayList<>(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> processMobile(GBaseJJD jjd) { |
|
|
|
|
|
|
|
String mobiles = PatternUtil.takeMobile(jjd.getCjqk()); |
|
|
|
|
|
|
|
if (mobiles.isEmpty()) { |
|
|
|
|
|
|
|
mobiles = PatternUtil.takeMobile(jjd.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mobiles.isEmpty()) { |
|
|
|
|
|
|
|
return new ArrayList<>(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Arrays.stream(mobiles.split(",")).toList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 手机要搜索的clue数据 |
|
|
|
* 手机要搜索的clue数据 |
|
|
|
* |
|
|
|
* |
|
|
|
@ -1221,20 +984,12 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
if (jjdList.isEmpty()) return null; |
|
|
|
if (jjdList.isEmpty()) return null; |
|
|
|
jjdList = jjdList.stream().filter(StreamUtil.distinctByKey(GBaseJJD::getJjdbh)).sorted().toList(); |
|
|
|
jjdList = jjdList.stream().filter(StreamUtil.distinctByKey(GBaseJJD::getJjdbh)).sorted().toList(); |
|
|
|
StringBuilder sb = new StringBuilder("该人员存在" + jjdList.size() + "起" + tag + "警情,接警单编号:"); |
|
|
|
StringBuilder sb = new StringBuilder("该人员存在" + jjdList.size() + "起" + tag + "警情,接警单编号:"); |
|
|
|
LocalDateTime time = null; |
|
|
|
|
|
|
|
for (GBaseJJD gBaseJJD : jjdList) { |
|
|
|
|
|
|
|
sb.append(gBaseJJD.getJjdbh()).append(","); |
|
|
|
|
|
|
|
LocalDateTime tmp = DateTimeUtil.date2LocalDateTime(gBaseJJD.getBjsj()); |
|
|
|
|
|
|
|
if (time == null || (tmp != null && time.isBefore(tmp))) { |
|
|
|
|
|
|
|
time = tmp; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return DataUtil.createClueData(task, ClueData.builder() |
|
|
|
return DataUtil.createClueData(task, ClueData.builder() |
|
|
|
.name(personal.getName()) |
|
|
|
.name(personal.getName()) |
|
|
|
.idCode(personal.getIdCode()) |
|
|
|
.idCode(personal.getIdCode()) |
|
|
|
.tags(List.of(tag)) |
|
|
|
.tags(List.of(tag)) |
|
|
|
.personId(personal.getId()) |
|
|
|
.personId(personal.getId()) |
|
|
|
.eventTime(time) |
|
|
|
.eventTime(findRecentTime(jjdList, sb)) |
|
|
|
.sourceData(sb.substring(0, sb.length() - 1)) |
|
|
|
.sourceData(sb.substring(0, sb.length() - 1)) |
|
|
|
.score(Math.min(jjdList.size(), 5)) |
|
|
|
.score(Math.min(jjdList.size(), 5)) |
|
|
|
.build()); |
|
|
|
.build()); |
|
|
|
@ -1242,6 +997,7 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 多身份证对比名称 |
|
|
|
* 多身份证对比名称 |
|
|
|
|
|
|
|
* |
|
|
|
* @param infos 信息 |
|
|
|
* @param infos 信息 |
|
|
|
* @param name 名称 |
|
|
|
* @param name 名称 |
|
|
|
* @return 正确信息 |
|
|
|
* @return 正确信息 |
|
|
|
@ -1275,9 +1031,7 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
personal.setGender(IdCodeUtil.idCard2Gender(personal.getIdCode())); |
|
|
|
personal.setGender(IdCodeUtil.idCard2Gender(personal.getIdCode())); |
|
|
|
personal.setAge(Optional.ofNullable(IdCodeUtil.idCard2Age(personal.getIdCode(), today)).orElse(-1)); |
|
|
|
personal.setAge(Optional.ofNullable(IdCodeUtil.idCard2Age(personal.getIdCode(), today)).orElse(-1)); |
|
|
|
if (personal.getAge() == null) { |
|
|
|
if (personal.getAge() == null) { |
|
|
|
LocalDate localDate = DateTimeUtil.date2LocalDate(info.getCsrq()); |
|
|
|
personal.setAge(Optional.ofNullable(DateTimeUtil.date2LocalDate(info.getCsrq())).map(date -> date.until(today).getYears()).orElse(null)); |
|
|
|
int age = localDate.until(today).getYears(); |
|
|
|
|
|
|
|
personal.setAge(age); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (personal.getGender() == null) { |
|
|
|
if (personal.getGender() == null) { |
|
|
|
personal.setGender(info.getXbdm()); |
|
|
|
personal.setGender(info.getXbdm()); |
|
|
|
@ -1318,4 +1072,31 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
} |
|
|
|
} |
|
|
|
return tmp; |
|
|
|
return tmp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void collectSingleMap(List<String> strList, int defaultEnd, Map<String, List<GBaseJJD>> idCodesMap, GBaseJJD gBaseJJD) { |
|
|
|
|
|
|
|
switch (strList.size()) { |
|
|
|
|
|
|
|
case 1 -> idCodesMap.computeIfAbsent(strList.getFirst(), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
case 2 -> { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(strList.get(0), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(strList.get(1), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default -> { |
|
|
|
|
|
|
|
for (int i = 1; i < defaultEnd; i++) { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(strList.get(i), k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LocalDateTime findRecentTime(List<GBaseJJD> jjdList, StringBuilder sb) { |
|
|
|
|
|
|
|
LocalDateTime time = null; |
|
|
|
|
|
|
|
for (GBaseJJD gBaseJJD : jjdList) { |
|
|
|
|
|
|
|
if(sb != null) sb.append(gBaseJJD.getJjdbh()).append(","); |
|
|
|
|
|
|
|
LocalDateTime tmp = DateTimeUtil.date2LocalDateTime(gBaseJJD.getBjsj()); |
|
|
|
|
|
|
|
if (time == null || (tmp != null && time.isBefore(tmp))) { |
|
|
|
|
|
|
|
time = tmp; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return time; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |