|
|
|
|
@ -150,7 +150,6 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService {
|
|
|
|
|
List<RiskModelTaskClue> oldList = Optional.ofNullable(domain.getMap().get(task.getModelId())).orElse(new ArrayList<>()); |
|
|
|
|
// 按人分
|
|
|
|
|
Map<String, List<RiskModelTaskClue>> personOldMap = oldList.stream().collect(Collectors.groupingBy(RiskModelTaskClue::getIdCode)); |
|
|
|
|
|
|
|
|
|
Map<String, List<GBaseWFRXX>> wfrMap = xxList.stream().collect(Collectors.groupingBy(GBaseWFRXX::getZjhm)); |
|
|
|
|
|
|
|
|
|
List<RiskModelTaskClue> toInsert = new ArrayList<>(); |
|
|
|
|
@ -160,29 +159,53 @@ public class GBaseSHRWFRServiceImpl implements GBaseSHRWFRService {
|
|
|
|
|
if (wfxxList == null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
List<RiskModelTaskClue> olds = Optional.ofNullable(personOldMap.get(person.getIdCode())).orElse(new ArrayList<>()); |
|
|
|
|
Map<String, RiskModelTaskClue> oldMap = olds.stream().collect(Collectors.toMap(RiskModelTaskClue::getCaseIds, Function.identity(), (val, old) -> val)); |
|
|
|
|
List<RiskModelTaskClue> olds = personOldMap.get(person.getIdCode()); |
|
|
|
|
// 是否只有一个
|
|
|
|
|
if(olds!=null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
StringBuilder zm = new StringBuilder(); |
|
|
|
|
StringBuilder aj = new StringBuilder(); |
|
|
|
|
LocalDateTime eventTime = null; |
|
|
|
|
for (GBaseWFRXX xx : wfxxList) { |
|
|
|
|
if (oldMap.get(BhUtil.ajBh(xx.getAjbh())) != null) { |
|
|
|
|
if(zm.indexOf(xx.getSxzm()+",") == -1) { |
|
|
|
|
zm.append(xx.getSxzm()).append(","); |
|
|
|
|
} |
|
|
|
|
if(aj.indexOf(xx.getAjbh()+",") == -1) { |
|
|
|
|
aj.append(xx.getAjbh()).append(","); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
LocalDateTime tmp = xx.getLrsj().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
|
|
|
|
if(eventTime == null) { |
|
|
|
|
eventTime = tmp; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if(eventTime.isBefore(tmp)) { |
|
|
|
|
eventTime = tmp; |
|
|
|
|
} |
|
|
|
|
} catch (Exception ignored) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
StringBuilder tmp = new StringBuilder("该人员"); |
|
|
|
|
if(zm.length() > 0) { |
|
|
|
|
tmp.append("因:").append(zm.substring(0, zm.length()-1)); |
|
|
|
|
} |
|
|
|
|
tmp.append(" 已被打击处理过"); |
|
|
|
|
if(aj.length() > 0) { |
|
|
|
|
tmp.append("具体案件编号:").append(aj.substring(0, aj.length()-1)); |
|
|
|
|
} |
|
|
|
|
ClueData data = ClueData.builder() |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.id(BhUtil.ajBh(xx.getAjbh())) |
|
|
|
|
.id("isPoint") |
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.tag("已被打击处理") |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.sourceData("该人员因" + xx.getSxzm() + "被打击处理,案件编号:" + xx.getAjbh()) |
|
|
|
|
.sourceData(tmp.toString()) |
|
|
|
|
.eventTime(Optional.ofNullable(eventTime).orElse(LocalDateTime.now())) |
|
|
|
|
.build(); |
|
|
|
|
try { |
|
|
|
|
data.setEventTime(xx.getLrsj().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
} catch (Exception ignored) { |
|
|
|
|
data.setEventTime(LocalDateTime.now()); |
|
|
|
|
} |
|
|
|
|
toInsert.add(createClue(task.getModelId(), 5, task.getId(), data)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!toInsert.isEmpty()) { |
|
|
|
|
clueService.saveClues(toInsert, "B24被打击处理"); |
|
|
|
|
} |
|
|
|
|
|