diff --git a/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java b/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java index a906c20..44f7df1 100644 --- a/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java +++ b/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java @@ -111,7 +111,8 @@ public class ApplicationEvent { // gBaseJJDService.pullAndSave(LocalDateTime.of(2023, 12, 6, 0, 0, 0), end); // riskPersonalService.fixed(); // personalService.syncPerson(LocalDate.now()); - // 32,33,34,39,41,51 + // 32,33,34,39,41,51,53,43,63 + // 36 60 61 62 44 45 48 52 59 // petitionService.petitionModelTask(initDomain(List.of(40))); // riskTaskService.eduAndAreaModelTask(initDomain(List.of(34,41))); // riskTaskService.infoModelTask(initDomain(List.of(32,33))); @@ -120,14 +121,14 @@ public class ApplicationEvent { habitService.habitModelTask(LocalDateTime.of(2023, 12, 6, 0, 0, 0), initDomain(List.of(36,60,61,62))); // pointService.syncCarUser(initDomain(List.of(53))); // pointService.syncScore(initDomain(List.of(43))); -// pointService.syncViolence(initDomain(List.of(44))); -// noControlService.syncNoControlData(initDomain(List.of(45))); + pointService.syncViolence(initDomain(List.of(44))); + noControlService.syncNoControlData(initDomain(List.of(45))); // pointService.syncDrug(initDomain(List.of(37))); -// pointService.syncControlNoPower(initDomain(List.of(48))); -// pointService.syncOilBuy(initDomain(List.of(52))); + pointService.syncControlNoPower(initDomain(List.of(48))); + pointService.syncOilBuy(initDomain(List.of(52))); // gBaseJJDService.pullPoliceInstance(LocalDateTime.of(2023, 12, 6, 0, 0, 0), end, initDomain(List.of(55,56,57,58))); -// jsbryService.syncPys(initDomain(List.of(59))); - gBaseSHRWFRService.combatCrime(initDomain(List.of(63))); + jsbryService.syncPys(initDomain(List.of(59))); +// gBaseSHRWFRService.combatCrime(initDomain(List.of(63))); // gBaseJJDService.syncPoliceAttack(initDomain(List.of(64))); // gBaseJJDService.syncHomeViolence(initDomain(List.of(65,66))); // pointService.syncPointType(initDomain(List.of(67))); diff --git a/src/main/java/com/biutag/supervisiondata/mapper/dwd/GBaseZDRYMapper.java b/src/main/java/com/biutag/supervisiondata/mapper/dwd/GBaseZDRYMapper.java index 26cff87..925b236 100644 --- a/src/main/java/com/biutag/supervisiondata/mapper/dwd/GBaseZDRYMapper.java +++ b/src/main/java/com/biutag/supervisiondata/mapper/dwd/GBaseZDRYMapper.java @@ -24,7 +24,7 @@ public interface GBaseZDRYMapper extends BaseMapper { @Select(" select a.AJBH as ajbh, a.AJMC as ajmc, a.JYAQ as jyaq, a.BARQ as barq, b.XM as xm, b.XBmc as xbmc, b.ZJHM as zjhm, a.AJLBmc as ajlbmc, b.WFSS as wfss, a.BADWIDdm as badwiddm, a.BADWIDmc as badwidmc " + " from csga_dwd.dwd_asj_zfba_ajjbxx a, csga_dwd.dwd_ry_zfba_wfryxx b, csga_wdpcdb.wdpc_grjd_flxx c " + - " where a.ajbh = b.ajbh and a.AJLBdm = c.AJLBdm and c.LXDM = '3' AND a.BARQ > DATE_ADD(now(), INTERVAL -12 MONTH) ") + " where a.ajbh = b.ajbh and a.AJLBdm = c.AJLBdm and c.LXDM = '3' and b.ZJHM is not null AND a.BARQ > DATE_ADD(now(), INTERVAL -12 MONTH) ") List syncViolencePerson(); @Select("SELECT jjdbh, bjsj, bjrxm, IF(LENGTH(bjrlxdh) < 11, REGEXP_SUBSTR(bjnr, '[0-9]{11}'), bjrlxdh) AS bjrlxdh, IF(bjrzjhm IS NULL, REGEXP_SUBSTR(bjnr, '[0-9]{17}[0-9Xx]'), bjrzjhm) as bjrzjhm, bjnr, cjqk, gxdwdm, gxdwmc FROM `dwd_asj_zhtx_jjd` where (jqxzdm like '020107%' OR jqbz like '%个人极端%' ) AND bjsj > DATE_ADD(now(), INTERVAL -12 MONTH)") List syncKillSelf(); 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 a872bf3..00f2b42 100644 --- a/src/main/java/com/biutag/supervisiondata/service/impl/NoControlServiceImpl.java +++ b/src/main/java/com/biutag/supervisiondata/service/impl/NoControlServiceImpl.java @@ -1,5 +1,7 @@ package com.biutag.supervisiondata.service.impl; +import cn.hutool.core.date.DateUnit; +import cn.hutool.core.date.DateUtil; import com.biutag.supervisiondata.common.interfaces.CompletableFutureUtil; import com.biutag.supervisiondata.pojo.ClueData; import com.biutag.supervisiondata.pojo.constants.Default; @@ -14,6 +16,7 @@ import com.biutag.supervisiondata.repository.RiskTaskRepository; import com.biutag.supervisiondata.service.NoControlService; import com.biutag.supervisiondata.service.RiskModelTaskClueService; import com.biutag.supervisiondata.service.RiskPersonalTagService; +import com.biutag.supervisiondata.util.DataUtil; import com.biutag.supervisiondata.util.IdCodeUtil; import com.biutag.supervisiondata.util.BhUtil; import lombok.AllArgsConstructor; @@ -69,7 +72,7 @@ public class NoControlServiceImpl implements NoControlService { for (ClueData clueDatum : clueData) { RiskPersonal personal = idCodes.get(clueDatum.getIdCode()); - if(personal.getTags().indexOf(Default.NO_CONTROL) == -1) { + 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))); @@ -77,36 +80,19 @@ public class NoControlServiceImpl implements NoControlService { idCodes.put(clueDatum.getIdCode(), personal); toUpdate.add(newOne); } - clues.add(createClue(task.getModelId(), 5, task.getId(), clueDatum)); + clues.add(DataUtil.createClueData(task, clueDatum)); } - if(!toUpdate.isEmpty()) { + if (!toUpdate.isEmpty()) { log.info("修改人数:{}", toUpdate.size()); personalRepository.updateBatchById(toUpdate); } - if(!clues.isEmpty()) { + if (!clues.isEmpty()) { clueService.saveClues(clues, Default.CONTROLLER2_IG); } riskTaskRepository.updateTask(task.getId(), clues.size(), toUpdate.size()); } - RiskModelTaskClue createClue(Integer modelId, Integer score, Integer taskId, ClueData data) { - RiskModelTaskClue clue = new RiskModelTaskClue(); - clue.setModelId(modelId); - clue.setScore(score); - clue.setName(data.getName()); - clue.setIdCode(data.getIdCode()); - clue.setTaskId(taskId); - clue.setData(data.getSourceData()); - clue.setEventTime(data.getEventTime()); - clue.setCreateTime(LocalDateTime.now()); - clue.setUpdateTime(LocalDateTime.now()); - clue.setCaseIds(BhUtil.ajBh(data.getId())); - data.setPersonId(null); - clue.setRiskReason(data.getTag()); - return clue; - } - List crazyControl(Map idCodes, Map mobiles) { // 精神病人属于重点人员,发现多起警情 疑似存在管控不到位的现象 List extremeList = zdryRepository.getBaseMapper().syncPointNoControlCrazy(); @@ -116,21 +102,22 @@ public class NoControlServiceImpl implements NoControlService { if (extreme.getBjrzjhm() != null) { person = idCodes.get(extreme.getBjrzjhm()); } - if(person == null && extreme.getBjrlxdh() != null) { + if (person == null && extreme.getBjrlxdh() != null) { person = mobiles.get(extreme.getBjrlxdh()); } - if(person == null) { + if (person == null) { continue; } ClueData data = ClueData.builder() - .id(BhUtil.jjdBh(extreme.getJjdbh())) - .idCode(person.getIdCode()) - .name(person.getName()) - .personId(person.getId()) - .tag("精神病人管控不到位") - .sourceData("该人员属于精神病人,涉及到有关警情,"+Optional.ofNullable(extreme.getJjdbh()).map(it -> "接警单编号:"+it).orElse("")+"属于管控不到位"+Optional.ofNullable(extreme.getCjqk()).map(it -> ",具体情况:"+it).orElse("")) - .departName(extreme.getGxdwmc()) - .departId(extreme.getGxdwdm()) + .id(BhUtil.jjdBh(extreme.getJjdbh())) + .idCode(person.getIdCode()) + .name(person.getName()) + .personId(person.getId()) + .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()) .build(); try { data.setEventTime(extreme.getBjsj().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); @@ -151,7 +138,7 @@ public class NoControlServiceImpl implements NoControlService { if (violence.getZjhm() != null) { person = idCodes.get(violence.getZjhm()); } - if(person == null) { + if (person == null) { continue; } ClueData data = ClueData.builder() @@ -159,8 +146,9 @@ public class NoControlServiceImpl implements NoControlService { .idCode(person.getIdCode()) .name(person.getName()) .personId(person.getId()) - .tag("刑事、吸毒人员管控不到位") - .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("")) + .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()) .build(); @@ -183,7 +171,7 @@ public class NoControlServiceImpl implements NoControlService { if (noControl.getIdCardNo() != null) { person = idCodes.get(noControl.getIdCardNo()); } - if(person == null) { + if (person == null) { continue; } ClueData data = ClueData.builder() @@ -191,8 +179,9 @@ public class NoControlServiceImpl implements NoControlService { .idCode(person.getIdCode()) .name(person.getName()) .personId(person.getId()) - .tag("刑满释放人管控不到位") - .sourceData("该人员属于看守所故意犯罪刑满释放不满5年人员,发现在重点人员中 未纳入或未按要求落实双列管,"+Optional.ofNullable(noControl.getCrime()).map(it -> "涉及犯罪事实:"+it).orElse("")+""+Optional.ofNullable(noControl.getBriefCase()).map(it -> ",,具体事件表现为:"+it).orElse("")) + .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()) .build(); @@ -206,7 +195,7 @@ public class NoControlServiceImpl implements NoControlService { return clueData; } - List crazyLevelThreeControl(Map idCodes,Map mobiles) { + List crazyLevelThreeControl(Map idCodes, Map mobiles) { // 卫健委精神疾病三级以上人员,发现在重点人员中 未纳入或未按要求落实双列管 List crazyLevelThreeList = zdryRepository.getBaseMapper().syncCrazyLevelThree(); List clueData = new ArrayList<>(); @@ -215,10 +204,10 @@ public class NoControlServiceImpl implements NoControlService { if (crazyLevelThree.getSfzh() != null) { person = idCodes.get(crazyLevelThree.getSfzh()); } - if(person == null && crazyLevelThree.getLxdh() != null) { + if (person == null && crazyLevelThree.getLxdh() != null) { person = mobiles.get(crazyLevelThree.getLxdh()); } - if(person == null) { + if (person == null) { continue; } clueData.add(ClueData.builder() @@ -226,8 +215,9 @@ public class NoControlServiceImpl implements NoControlService { .idCode(person.getIdCode()) .name(person.getName()) .personId(person.getId()) - .tag("神疾病三级以上人员管控不到位") - .sourceData("卫健委精神疾病三级以上人员,发现在重点人员中 未纳入或未按要求落实双列管"+Optional.ofNullable(crazyLevelThree.getTsqksm()).map(it -> ",备注:"+it).orElse("")) + .tags(List.of("神疾病三级以上人员管控不到位")) + .score(5) + .sourceData("卫健委精神疾病三级以上人员,发现在重点人员中 未纳入或未按要求落实双列管" + Optional.ofNullable(crazyLevelThree.getTsqksm()).map(it -> ",备注:" + it).orElse("")) .build()); } return clueData; diff --git a/src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java b/src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java index d481f2d..713703e 100644 --- a/src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java +++ b/src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java @@ -231,54 +231,56 @@ public class PointServiceImpl implements PointService { @Override public void syncViolence(TaskParamDomain domain) { RiskTask task = taskRepository.create(domain.getPersons().size(), 44); - Map personalMap = domain.getPersons().stream().collect(Collectors.toMap(RiskPersonal::getIdCode, Function.identity(), (oldValue, newValue) -> newValue)); List list = zdryRepository.getBaseMapper().syncViolencePerson(); + Map> violenceMap = list.stream().collect(Collectors.groupingBy(Violence::getZjhm)); Map> map = new HashMap<>(); List olds = Optional.ofNullable(domain.getMap().get(task.getId())).orElse(new ArrayList<>()); Map> maps = olds.stream().collect(Collectors.groupingBy(RiskModelTaskClue::getIdCode)); List toInsert = new ArrayList<>(); - for (Violence violence : list) { - if (violence.getZjhm() == null || personalMap.get(violence.getZjhm()) == null) { - continue; - } - Map old = Optional.ofNullable(map.get(violence.getZjhm())).orElse(new HashMap<>()); - if (old.get(violence.getAjbh()) != null) { - continue; - } - List oldClues = Optional.ofNullable(maps.get(violence.getZjhm())).orElse(new ArrayList<>()); - Map oldMap = oldClues.stream().collect(Collectors.toMap(RiskModelTaskClue::getCaseIds, Function.identity(), (oldValue, newValue) -> newValue)); - if (oldMap.get(BhUtil.ajBh(violence.getAjbh())) != null) { - continue; + for (RiskPersonal person : domain.getPersons()) { + List tmp = violenceMap.get(person.getIdCode()); + if (tmp == null) continue; + List old = maps.get(person.getIdCode()); + if (old != null) continue; + tmp = tmp.stream().filter(StreamUtil.distinctByKey(Violence::getAjbh)).toList(); + StringBuilder sb = new StringBuilder("通过核查案件信息,发现该人员有暴力伤害行为,案件编号为:"); + List tags = new ArrayList<>(); + LocalDateTime date = null; + for (Violence violence : tmp) { + sb.append(violence.getAjbh()).append(","); + if(!tags.contains(violence.getAjlbmc())) { + tags.add(violence.getAjlbmc()); + } + try { + LocalDateTime ld = violence.getBarq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); + if(date == null) { + date = ld; + continue; + } + if(date.isAfter(ld)) { + date = ld; + } + } catch (Exception ignored) { + } } - old.put(violence.getAjbh(), 1); - map.put(violence.getZjhm(), old); - RiskPersonal person = personalMap.get(violence.getZjhm()); ClueData data = ClueData.builder() .name(person.getName()) - .id(violence.getAjbh()) + .id("") .personId(person.getId()) .idCode(person.getIdCode()) - .sourceData("通过核查案件信息,发现该人员有暴力伤害行为,案件编号为:" + violence.getAjbh() + Optional.ofNullable(violence.getWfss()).map(it -> ",具体情况为:" + it).orElse("")) - .tag(violence.getAjlbmc()) + .sourceData(sb.substring(0, sb.length()-1)) + .tags(tags) + .score(Math.min(tmp.size(), 5)) + .eventTime(date) .build(); - if (violence.getBadwiddm() != null) { - data.setDepartId(violence.getBadwiddm()); - data.setDepartId(violence.getBadwidmc()); - } - try { - data.setEventTime(violence.getBarq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); - } catch (Exception ignored) { - data.setEventTime(LocalDateTime.now()); - } - toInsert.add(createClue2(task.getModelId(), 5, task.getId(), data)); + toInsert.add(DataUtil.createClueData(task, data)); } - if (!toInsert.isEmpty()) { - modelTaskClueService.saveClues(toInsert, Default.VIOLENCE_IG); + modelTaskClueService.saveClues(toInsert, "B89暴力伤害行为"); } taskRepository.updateTask(task.getId(), toInsert.size(), 0); } @@ -1687,14 +1689,13 @@ public class PointServiceImpl implements PointService { .name(personal.getName()) .id(personal.getId().toString()) .idCode(personal.getIdCode()) - .tag("重点对象日常管控不到位") - .departId(gBaseZDRY.getXzdpcsdm()) - .departName(gBaseZDRY.getXzdpcs()) + .tags(List.of("重点对象日常管控不到位")) .personId(personal.getId()) + .score(5) .eventTime(LocalDateTime.of(2024, 10, 7, 12, 11, 23)) .sourceData("发现该人员属于重点人员,该人员的管控民警所管控的重点人员达到100人以上\n属于未落实日常管控要求") .build(); - toInsert.add(createClue(task.getModelId(), 5, task.getId(), data)); + toInsert.add(DataUtil.createClueData(task, data)); } if (!toInsert.isEmpty()) { log.info("增加特定对象日常管控不到位人员:{}", toInsert.size()); @@ -1823,8 +1824,7 @@ public class PointServiceImpl implements PointService { GBaseOilBuy::getName, GBaseOilBuy::getCompanyName, GBaseOilBuy::getType, GBaseOilBuy::getTime, GBaseOilBuy::getUseTo, GBaseOilBuy::getMobile, GBaseOilBuy::getIdCode) .ge(GBaseOilBuy::getTime, currentTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))); - RiskTask task = createTask(buys.size(), 52); - taskRepository.save(task); + RiskTask task = taskRepository.create(buys.size(), 52); // 旧数据 List oldList = Optional.ofNullable(domain.getMap().get(task.getModelId())).orElse(new ArrayList<>()); @@ -1851,6 +1851,8 @@ public class PointServiceImpl implements PointService { if (mineBuy == null) { continue; } + LocalDateTime time = null; + int count = 0; for (GBaseOilBuy item : mineBuy) { if (oldMap.get(BhUtil.oilBh(item.getXh())) != null) { continue; @@ -1858,68 +1860,38 @@ public class PointServiceImpl implements PointService { if (carMt.get(person.getIdCode()) != null) { continue; } - ClueData data = ClueData.builder() - .name(person.getName()) - .id(BhUtil.oilBh(item.getXh())) - .idCode(person.getIdCode()) - .departId(item.getOrgId()) - .departName(item.getOrgName()) - .personId(person.getId()) - .build(); + count++; try { - data.setEventTime(LocalDateTime.parse(item.getTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + LocalDateTime tmp = LocalDateTime.parse(item.getTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + if(time == null) { + time = tmp; + continue; + } + if(tmp.isAfter(time)) { + time = tmp; + } } catch (Exception e) { - data.setEventTime(LocalDateTime.now()); log.error("散装油时间转化异常"); } - - data.setTag(Default.NO_CAR_OIL_BUY); - data.setSourceData("发现该人员属于无车人员,于" + item.getTime() + "在" + item.getCompanyName() + "购买容量为" + item.getNumber() + "L的" + item.getType() + ",用作" + item.getUseTo()); - toInsert.add(createClue(task.getModelId(), 5, task.getId(), data)); } + ClueData data = ClueData.builder() + .name(person.getName()) + .id("") + .idCode(person.getIdCode()) + .score(Math.min(5, count)) + .tags(List.of(Default.NO_CAR_OIL_BUY)) + .personId(person.getId()) + .sourceData("发现该人员属于无车人员,买了" + count + "次散装油") + .eventTime(time) + .build(); + toInsert.add(DataUtil.createClueData(task, data)); } if (!toInsert.isEmpty()) { log.info("增加散装油人员:{}", toInsert.size()); modelTaskClueService.saveClues(toInsert, Default.GOODS_IG); } - - List toDelete = new ArrayList<>(); - Map deletePerson = new WeakHashMap<>(); - Map livePerson = new WeakHashMap<>(); - for (RiskModelTaskClue entry : oldList) { - // 删除记录 - if (entry.getEventTime().isBefore(currentTime)) { - RiskModelTaskClue delete = new RiskModelTaskClue(); - delete.setId(entry.getId()); - delete.setDel(1); - toDelete.add(delete); - deletePerson.put(entry.getIdCode(), new Byte[0]); - } else { - livePerson.put(entry.getIdCode(), new Byte[0]); - } - } - - List idCodes = new ArrayList<>(); - // 删除标签 从deletePerson遍历,存活中没有,新增没有,说明该标签就没了 - for (String s : deletePerson.keySet()) { - if (livePerson.get(s) == null && buyMap.get(s) == null) { - idCodes.add(s); - } - } - - if (!toDelete.isEmpty()) { - modelTaskClueService.deleteCluesAndDeleteTag(toDelete, idCodes, Default.NO_CAR_OIL_BUY); - } - - - RiskTask updateTask = new RiskTask(); - updateTask.setId(task.getId()); - updateTask.setInsertSize(toInsert.size()); - updateTask.setUpdateSize(toDelete.size()); - updateTask.setState(1); - updateTask.setEndTime(LocalDateTime.now()); - taskRepository.updateById(updateTask); + taskRepository.updateTask(task.getId(), toInsert.size(), 0); } @Override 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 de1612c..782a69d 100644 --- a/src/main/java/com/biutag/supervisiondata/service/impl/WdpcGrjdJsbryServiceService.java +++ b/src/main/java/com/biutag/supervisiondata/service/impl/WdpcGrjdJsbryServiceService.java @@ -11,6 +11,7 @@ import com.biutag.supervisiondata.repository.RiskTaskRepository; import com.biutag.supervisiondata.repository.WdpcGrjdJsbryRepository; import com.biutag.supervisiondata.service.RiskModelTaskClueService; import com.biutag.supervisiondata.service.WdpcGrjdJsbryService; +import com.biutag.supervisiondata.util.DataUtil; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -66,7 +67,8 @@ public class WdpcGrjdJsbryServiceService implements WdpcGrjdJsbryService { .name(wdpcGrjdJsbry.getName()) .id("psychosis") .idCode(wdpcGrjdJsbry.getIdCode()) - .tag(Default.PSYCHOSIS_TAG) + .tags(List.of(Default.PSYCHOSIS_TAG)) + .score(5) .sourceData(text.toString()) .build(); try { @@ -75,7 +77,7 @@ public class WdpcGrjdJsbryServiceService implements WdpcGrjdJsbryService { } catch (Exception e) { data.setEventTime(LocalDateTime.now()); } - toInsert.add(createClue(task.getModelId(), 5, task.getId(), data)); + toInsert.add(DataUtil.createClueData(task, data)); } if(!toInsert.isEmpty()) {