|
|
|
|
@ -14,13 +14,16 @@ import com.biutag.supervisiondata.service.NoControlService;
|
|
|
|
|
import com.biutag.supervisiondata.service.RiskModelTaskClueService; |
|
|
|
|
import com.biutag.supervisiondata.util.DataUtil; |
|
|
|
|
import com.biutag.supervisiondata.util.BhUtil; |
|
|
|
|
import com.biutag.supervisiondata.util.DateTimeUtil; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.ZoneId; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author kami on 2024-11-18 14:06:17 |
|
|
|
|
@ -60,30 +63,33 @@ public class NoControlServiceImpl implements NoControlService {
|
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> clueData.addAll(zyControl(idCodes))), |
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> clueData.addAll(crazyLevelThreeControl(idCodes, mobiles))) |
|
|
|
|
).join(); |
|
|
|
|
List<RiskPersonal> toUpdate = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
List<RiskModelTaskClue> clues = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
for (ClueData clueDatum : clueData) { |
|
|
|
|
RiskPersonal personal = idCodes.get(clueDatum.getIdCode()); |
|
|
|
|
if (personal.getTags().indexOf(Default.NO_CONTROL) == -1) { |
|
|
|
|
RiskPersonal newOne = new RiskPersonal(); |
|
|
|
|
newOne.setId(personal.getId()); |
|
|
|
|
newOne.setTags(personal.getTags().concat(",".concat(Default.NO_CONTROL))); |
|
|
|
|
personal.setTags(personal.getTags().concat(",".concat(Default.NO_CONTROL))); |
|
|
|
|
idCodes.put(clueDatum.getIdCode(), personal); |
|
|
|
|
toUpdate.add(newOne); |
|
|
|
|
} |
|
|
|
|
clues.add(DataUtil.createClueData(task, clueDatum)); |
|
|
|
|
Map<String, List<ClueData>> clueDataMap = clueData.stream().collect(Collectors.groupingBy(ClueData::getIdCode)); |
|
|
|
|
for (Map.Entry<String, List<ClueData>> entry : clueDataMap.entrySet()) { |
|
|
|
|
RiskPersonal personal = idCodes.get(entry.getKey()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (!toUpdate.isEmpty()) { |
|
|
|
|
log.info("修改人数:{}", toUpdate.size()); |
|
|
|
|
personalRepository.updateBatchById(toUpdate); |
|
|
|
|
List<String> tags = new ArrayList<>(); |
|
|
|
|
for (ClueData data : entry.getValue()) { |
|
|
|
|
tags.addAll(data.getTags()); |
|
|
|
|
} |
|
|
|
|
String tag = tags.stream().distinct().collect(Collectors.joining(",")); |
|
|
|
|
clues.add(DataUtil.createClueData(task, ClueData.builder() |
|
|
|
|
.id("") |
|
|
|
|
.idCode(personal.getIdCode()) |
|
|
|
|
.name(personal.getName()) |
|
|
|
|
.personId(personal.getId()) |
|
|
|
|
.tags(tags) |
|
|
|
|
.score(5) |
|
|
|
|
.sourceData("该人员存在:"+tag) |
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
|
.build())); |
|
|
|
|
} |
|
|
|
|
if (!clues.isEmpty()) { |
|
|
|
|
clueService.saveClues(clues, Default.CONTROLLER2_IG); |
|
|
|
|
clueService.saveClues(clues, "B92风险人员排查不到位"); |
|
|
|
|
} |
|
|
|
|
riskTaskRepository.updateTask(task.getId(), clues.size(), toUpdate.size()); |
|
|
|
|
riskTaskRepository.updateTask(task.getId(), clues.size(), 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<ClueData> crazyControl(Map<String, RiskPersonal> idCodes, Map<String, RiskPersonal> mobiles) { |
|
|
|
|
@ -106,17 +112,11 @@ public class NoControlServiceImpl implements NoControlService {
|
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.tags(List.of("精神病人管控不到位")) |
|
|
|
|
.tags(List.of("精神病人排查不到位")) |
|
|
|
|
.score(5) |
|
|
|
|
.sourceData("该人员属于精神病人,涉及到有关警情," + Optional.ofNullable(extreme.getJjdbh()).map(it -> "接警单编号:" + it).orElse("") + "属于管控不到位" + Optional.ofNullable(extreme.getCjqk()).map(it -> ",具体情况:" + it).orElse("")) |
|
|
|
|
.departName(extreme.getGxdwmc()) |
|
|
|
|
.departId(extreme.getGxdwdm()) |
|
|
|
|
.eventTime(DateTimeUtil.date2LocalDateTime(extreme.getBjsj())) |
|
|
|
|
.build(); |
|
|
|
|
try { |
|
|
|
|
data.setEventTime(extreme.getBjsj().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("报案时间异常"); |
|
|
|
|
} |
|
|
|
|
clueData.add(data); |
|
|
|
|
} |
|
|
|
|
return clueData; |
|
|
|
|
@ -139,17 +139,11 @@ public class NoControlServiceImpl implements NoControlService {
|
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.tags(List.of("刑事、吸毒人员管控不到位")) |
|
|
|
|
.tags(List.of("刑事、吸毒人员排查不到位")) |
|
|
|
|
.score(5) |
|
|
|
|
.sourceData("该人员属于故意犯罪并作出刑事判决人员(排除仍在羁押状态的)、公安机关查处吸毒人员(排除仍在羁押状态的),涉及到案件," + Optional.ofNullable(violence.getAjbh()).map(it -> "案件编号:" + it).orElse("") + "属于管控不到位" + Optional.ofNullable(violence.getAjmc()).map(it -> ",案件名称:" + it).orElse("") + Optional.ofNullable(violence.getWfss()).map(it -> ",违法事实:" + it).orElse("")) |
|
|
|
|
.departName(violence.getBadwidmc()) |
|
|
|
|
.departId(violence.getBadwiddm()) |
|
|
|
|
.eventTime(DateTimeUtil.date2LocalDateTime(violence.getBarq())) |
|
|
|
|
.build(); |
|
|
|
|
try { |
|
|
|
|
data.setEventTime(violence.getBarq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("报案时间异常"); |
|
|
|
|
} |
|
|
|
|
clueData.add(data); |
|
|
|
|
} |
|
|
|
|
return clueData; |
|
|
|
|
@ -172,17 +166,11 @@ public class NoControlServiceImpl implements NoControlService {
|
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.tags(List.of("刑满释放人管控不到位")) |
|
|
|
|
.tags(List.of("刑满释放人排查不到位")) |
|
|
|
|
.score(5) |
|
|
|
|
.sourceData("该人员属于看守所故意犯罪刑满释放不满5年人员,发现在重点人员中 未纳入或未按要求落实双列管," + Optional.ofNullable(noControl.getCrime()).map(it -> "涉及犯罪事实:" + it).orElse("") + "" + Optional.ofNullable(noControl.getBriefCase()).map(it -> ",,具体事件表现为:" + it).orElse("")) |
|
|
|
|
.departName(noControl.getCaseUnit()) |
|
|
|
|
.departId(noControl.getCaseUnitId()) |
|
|
|
|
.eventTime(DateTimeUtil.date2LocalDateTime(noControl.getOutDate())) |
|
|
|
|
.build(); |
|
|
|
|
try { |
|
|
|
|
data.setEventTime(noControl.getOutDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("出监狱时间异常"); |
|
|
|
|
} |
|
|
|
|
clueData.add(data); |
|
|
|
|
} |
|
|
|
|
return clueData; |
|
|
|
|
@ -208,9 +196,10 @@ public class NoControlServiceImpl implements NoControlService {
|
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
.name(person.getName()) |
|
|
|
|
.personId(person.getId()) |
|
|
|
|
.tags(List.of("神疾病三级以上人员管控不到位")) |
|
|
|
|
.tags(List.of("精神疾病三级以上人员排查不到位")) |
|
|
|
|
.score(5) |
|
|
|
|
.sourceData("卫健委精神疾病三级以上人员,发现在重点人员中 未纳入或未按要求落实双列管" + Optional.ofNullable(crazyLevelThree.getTsqksm()).map(it -> ",备注:" + it).orElse("")) |
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
|
.build()); |
|
|
|
|
} |
|
|
|
|
return clueData; |
|
|
|
|
|