From 2c9779241ce1951eed48b6507b62de7a26b1cf1e Mon Sep 17 00:00:00 2001 From: kami <605128600@qq.com> Date: Fri, 20 Dec 2024 10:40:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E6=9F=A5=E4=B8=8D=E5=88=B0=E4=BD=8D?= =?UTF-8?q?=E5=A4=9A=E5=90=88=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/ApplicationEvent.java | 8 +- .../service/impl/NoControlServiceImpl.java | 75 ++++++++----------- .../impl/WdpcGrjdJsbryServiceService.java | 4 +- 3 files changed, 37 insertions(+), 50 deletions(-) diff --git a/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java b/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java index 9a18705..0a95499 100644 --- a/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java +++ b/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java @@ -102,9 +102,9 @@ public class ApplicationEvent { public void serviceReady() { RedisDao.getInstance().init(redisTemplate); DepartUtil.init(ryRepository, departRepository); - LocalDateTime end = LocalDate.now().minusDays(1).atTime(23,59,59); + LocalDateTime end = LocalDate.now().minusDays(1).atTime(23, 59, 59); CompletableFutureUtil.runSync(() -> { - personalService.init(List.of(115,116)); + personalService.init(List.of(45, 59, 15, 116)); // personalService.pullInvestigate(); // personalService.pullPsychosis(); // gBaseSHRWFRService.pullAndSave(LocalDateTime.of(2019,12,6,0,0,0), end); @@ -124,7 +124,7 @@ public class ApplicationEvent { // pointService.syncCarUser(initDomain(List.of(53))); // pointService.syncScore(initDomain(List.of(43))); // pointService.syncViolence(initDomain(List.of(44))); -// noControlService.syncNoControlData(initDomain(List.of(45))); + noControlService.syncNoControlData(initDomain(List.of(45))); // // pointService.syncControlNoPower(initDomain(List.of(48))); // pointService.syncOilBuy(initDomain(List.of(52))); @@ -170,7 +170,7 @@ public class ApplicationEvent { // riskTaskService.heightFight(initDomain(List.of(42))); // pointService.syncKillSelf(initDomain(List.of(46))); // policeService.contradictModelTask(initDomain(List.of(38))); -//// 整合到68模型 +// 整合到68模型 // pointService.syncSecurity(initDomain(List.of(37))); // pointService.syncDrug(initDomain(List.of(37))); }); diff --git a/src/main/java/com/biutag/supervisiondata/service/impl/NoControlServiceImpl.java b/src/main/java/com/biutag/supervisiondata/service/impl/NoControlServiceImpl.java index 6b5ae19..d72a63d 100644 --- a/src/main/java/com/biutag/supervisiondata/service/impl/NoControlServiceImpl.java +++ b/src/main/java/com/biutag/supervisiondata/service/impl/NoControlServiceImpl.java @@ -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 toUpdate = new ArrayList<>(); + List 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> clueDataMap = clueData.stream().collect(Collectors.groupingBy(ClueData::getIdCode)); + for (Map.Entry> entry : clueDataMap.entrySet()) { + RiskPersonal personal = idCodes.get(entry.getKey()); - } - if (!toUpdate.isEmpty()) { - log.info("修改人数:{}", toUpdate.size()); - personalRepository.updateBatchById(toUpdate); + List 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 crazyControl(Map idCodes, Map 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; diff --git a/src/main/java/com/biutag/supervisiondata/service/impl/WdpcGrjdJsbryServiceService.java b/src/main/java/com/biutag/supervisiondata/service/impl/WdpcGrjdJsbryServiceService.java index 028ecf6..c9d0c47 100644 --- a/src/main/java/com/biutag/supervisiondata/service/impl/WdpcGrjdJsbryServiceService.java +++ b/src/main/java/com/biutag/supervisiondata/service/impl/WdpcGrjdJsbryServiceService.java @@ -78,9 +78,7 @@ public class WdpcGrjdJsbryServiceService implements WdpcGrjdJsbryService { if (time.isBefore(tmp)) { time = tmp; } - } catch (Exception ignored) { - - } + } catch (Exception ignored) {} } ClueData data = ClueData.builder() .name(personal.getName())