|
|
|
@ -842,6 +842,118 @@ public class GBaseJJDServiceImpl implements GBaseJJDService { |
|
|
|
taskRepository.updateTask(task.getId(), toInsert.size(), toUpdate.size()); |
|
|
|
taskRepository.updateTask(task.getId(), toInsert.size(), toUpdate.size()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void syncBullying(TaskParamDomain domain) { |
|
|
|
|
|
|
|
String startTime = LocalDateTime.of(2023, 12, 6, 0, 0, 0).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
|
|
|
LocalDateTime limit = LocalDateTime.now().minusYears(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<GBaseJJD> result = gBaseJJDRepository.getBaseMapper().selectBullying(startTime); |
|
|
|
|
|
|
|
// 恋爱创伤
|
|
|
|
|
|
|
|
RiskTask task = taskRepository.create(result.size(), 74); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, List<GBaseJJD>> idCodesMap = new WeakHashMap<>(); |
|
|
|
|
|
|
|
List<String> mobiles = new ArrayList<>(); |
|
|
|
|
|
|
|
LocalDate today = LocalDate.now(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<GBaseJJD> others = new ArrayList<>(); |
|
|
|
|
|
|
|
for (GBaseJJD gBaseJJD : result) { |
|
|
|
|
|
|
|
String idCard = PatternUtil.takeIdCard(gBaseJJD.getCjqk()); |
|
|
|
|
|
|
|
if (idCard.isEmpty()) { |
|
|
|
|
|
|
|
idCard = PatternUtil.takeIdCard(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(!idCard.isEmpty()) { |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(idCard.split(",")).toList(); |
|
|
|
|
|
|
|
// 年龄22岁以下才算
|
|
|
|
|
|
|
|
for (String s : tmp) { |
|
|
|
|
|
|
|
Integer age = IdCodeUtil.idCard2Age(s, today); |
|
|
|
|
|
|
|
if(age != null && age <= 22) { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(s, k -> new ArrayList<>()).add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String mobile = PatternUtil.takeMobile(gBaseJJD.getCjqk()); |
|
|
|
|
|
|
|
if (idCard.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(gBaseJJD.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(idCard.isEmpty()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mobiles.addAll(Arrays.stream(mobile.split(",")).toList()); |
|
|
|
|
|
|
|
others.add(gBaseJJD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<GBaseSYRKXX> xxList = gBaseSYRKXXRepository.list(new LambdaQueryWrapper<GBaseSYRKXX>() |
|
|
|
|
|
|
|
.select(GBaseSYRKXX::getGmsfhm, GBaseSYRKXX::getLxdh).in(GBaseSYRKXX::getLxdh, mobiles)); |
|
|
|
|
|
|
|
Map<String, List<GBaseSYRKXX>> mobileRkMap = xxList.stream().collect(Collectors.groupingBy(GBaseSYRKXX::getLxdh)); |
|
|
|
|
|
|
|
// 第二轮通过手机号找身份证
|
|
|
|
|
|
|
|
for (GBaseJJD other : others) { |
|
|
|
|
|
|
|
String mobile = PatternUtil.takeMobile(other.getCjqk()); |
|
|
|
|
|
|
|
if (mobile.isEmpty()) { |
|
|
|
|
|
|
|
mobile = PatternUtil.takeMobile(other.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<String> tmp = Arrays.stream(mobile.split(",")).toList(); |
|
|
|
|
|
|
|
List<String> idCard = new ArrayList<>(); |
|
|
|
|
|
|
|
for (String s : tmp) { |
|
|
|
|
|
|
|
List<GBaseSYRKXX> arr = Optional.ofNullable(mobileRkMap.get(s)).orElse(new ArrayList<>()); |
|
|
|
|
|
|
|
idCard.addAll(arr.stream().map(GBaseSYRKXX::getGmsfhm).filter(Objects::nonNull).filter(item -> { |
|
|
|
|
|
|
|
Integer age = IdCodeUtil.idCard2Age(item, today); |
|
|
|
|
|
|
|
return age != null && age <= 22; |
|
|
|
|
|
|
|
}).toList()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(idCard.isEmpty()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (String s : idCard) { |
|
|
|
|
|
|
|
idCodesMap.computeIfAbsent(s, k -> new ArrayList<>()).add(other); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<RiskModelTaskClue> oldList = domain.getMap().get(task.getModelId()); |
|
|
|
|
|
|
|
Map<String, List<RiskModelTaskClue>> personMap = oldList.stream().collect(Collectors.groupingBy(RiskModelTaskClue::getIdCode)); |
|
|
|
|
|
|
|
List<RiskModelTaskClue> toInsert = new ArrayList<>(); |
|
|
|
|
|
|
|
for (RiskPersonal person : domain.getPersons()) { |
|
|
|
|
|
|
|
List<GBaseJJD> jjdList = idCodesMap.get(person.getIdCode()); |
|
|
|
|
|
|
|
jjdList = jjdList.stream().filter(StreamUtil.distinctByKey(GBaseJJD::getJjdbh)).toList(); |
|
|
|
|
|
|
|
if(jjdList == null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<RiskModelTaskClue> olds = Optional.ofNullable(personMap.get(person.getIdCode())).orElse(new ArrayList<>()); |
|
|
|
|
|
|
|
Map<String, RiskModelTaskClue> oldMap = olds.stream().collect(Collectors.toMap(RiskModelTaskClue::getCaseIds, Function.identity(), (val, old) -> val)); |
|
|
|
|
|
|
|
for (GBaseJJD jjd : jjdList) { |
|
|
|
|
|
|
|
if(oldMap.get(BhUtil.jjdBh(jjd.getJjdbh())) != null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ClueData data = ClueData.builder() |
|
|
|
|
|
|
|
.name(person.getName()) |
|
|
|
|
|
|
|
.id(BhUtil.jjdBh(jjd.getJjdbh())) |
|
|
|
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
|
|
|
.tag("存在被欺凌警情") |
|
|
|
|
|
|
|
.personId(person.getId()) |
|
|
|
|
|
|
|
.build(); |
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder("存在被欺凌警情,接警单编号:" + jjd.getJjdbh()); |
|
|
|
|
|
|
|
if (jjd.getBjnr() != null && !jjd.getBjnr().isEmpty()) { |
|
|
|
|
|
|
|
sb.append(",报警内容;" + jjd.getBjnr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (jjd.getCjqk() != null && !jjd.getCjqk().isEmpty()) { |
|
|
|
|
|
|
|
sb.append(",处警情况;" + jjd.getCjqk()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
sb.append(",增加风险分5分"); |
|
|
|
|
|
|
|
data.setSourceData(sb.toString()); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
data.setEventTime(jjd.getBjsj().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
|
|
|
} catch (Exception ignored) { |
|
|
|
|
|
|
|
data.setEventTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
toInsert.add(createClue(task.getModelId(), 5, task.getId(), data)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
log.info("欺凌:{}", toInsert.size()); |
|
|
|
|
|
|
|
if (!toInsert.isEmpty()) { |
|
|
|
|
|
|
|
clueService.saveClues(toInsert, Default.HOME_VIOLENCE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
taskRepository.updateTask(task.getId(), toInsert.size(), 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Map<String, List<GBaseJJD>> findTargetJJD(List<GBaseJJD> jjdList) { |
|
|
|
Map<String, List<GBaseJJD>> findTargetJJD(List<GBaseJJD> jjdList) { |
|
|
|
|
|
|
|
|
|
|
|
Map<String, List<GBaseJJD>> fatherIdCodeMap = new WeakHashMap<>(); |
|
|
|
Map<String, List<GBaseJJD>> fatherIdCodeMap = new WeakHashMap<>(); |
|
|
|
|