|
|
|
@ -1,13 +1,9 @@ |
|
|
|
package com.biutag.supervisiondata.service.impl; |
|
|
|
package com.biutag.supervisiondata.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.common.interfaces.CompletableFutureUtil; |
|
|
|
import com.biutag.supervisiondata.common.interfaces.CompletableFutureUtil; |
|
|
|
import com.biutag.supervisiondata.common.utils.StreamUtil; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.pojo.ClueData; |
|
|
|
import com.biutag.supervisiondata.pojo.ClueData; |
|
|
|
import com.biutag.supervisiondata.pojo.constants.Default; |
|
|
|
import com.biutag.supervisiondata.pojo.domain.BadHabit; |
|
|
|
import com.biutag.supervisiondata.pojo.domain.TaskParamDomain; |
|
|
|
import com.biutag.supervisiondata.pojo.domain.TaskParamDomain; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseAJJBXX; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.dwd.GBaseWFRXX; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskModelTaskClue; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskModelTaskClue; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskPersonal; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskPersonal; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskTask; |
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskTask; |
|
|
|
@ -15,18 +11,15 @@ import com.biutag.supervisiondata.repository.*; |
|
|
|
import com.biutag.supervisiondata.service.HabitService; |
|
|
|
import com.biutag.supervisiondata.service.HabitService; |
|
|
|
import com.biutag.supervisiondata.service.RiskModelTaskClueService; |
|
|
|
import com.biutag.supervisiondata.service.RiskModelTaskClueService; |
|
|
|
import com.biutag.supervisiondata.util.DataUtil; |
|
|
|
import com.biutag.supervisiondata.util.DataUtil; |
|
|
|
|
|
|
|
import com.biutag.supervisiondata.util.DateTimeUtil; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.ZoneId; |
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.function.Function; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import java.util.stream.IntStream; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author kami on 2024-11-13 11:11:56 |
|
|
|
* @author kami on 2024-11-13 11:11:56 |
|
|
|
@ -40,203 +33,107 @@ public class HabitServiceImpl implements HabitService { |
|
|
|
|
|
|
|
|
|
|
|
private final GBaseAJJBXXRepository gBaseAJJBXXRepository; |
|
|
|
private final GBaseAJJBXXRepository gBaseAJJBXXRepository; |
|
|
|
|
|
|
|
|
|
|
|
private final GBaseWFRXXRepository gBaseWFRXXRepository; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final RiskTaskRepository riskTaskRepository; |
|
|
|
private final RiskTaskRepository riskTaskRepository; |
|
|
|
|
|
|
|
|
|
|
|
private final RiskModelTaskClueService riskModelTaskClueService; |
|
|
|
private final RiskModelTaskClueService riskModelTaskClueService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void habitModelTask(LocalDateTime targetTime, TaskParamDomain domain) { |
|
|
|
public void syncBadHabit(LocalDateTime targetTime, TaskParamDomain domain) { |
|
|
|
List<GBaseAJJBXX> ajjbxxList = gBaseAJJBXXRepository.getBaseMapper().selectHabit(targetTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
List<BadHabit> habitList = gBaseAJJBXXRepository.getBaseMapper().selectBadHabit(targetTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
|
|
|
|
|
|
|
|
LocalDateTime limit = LocalDateTime.now().minusYears(1); |
|
|
|
|
|
|
|
log.info("总案件数:{}", ajjbxxList.size()); |
|
|
|
|
|
|
|
// 酒
|
|
|
|
|
|
|
|
List<GBaseAJJBXX> targetAjList = new ArrayList<>(); |
|
|
|
|
|
|
|
List<String> ajNos = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 赌博
|
|
|
|
|
|
|
|
List<GBaseAJJBXX> targetAjList2 = new ArrayList<>(); |
|
|
|
|
|
|
|
List<String> ajNos2 = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 其他行为
|
|
|
|
Map<String, List<String>> alcoholics = new WeakHashMap<>(); |
|
|
|
List<GBaseAJJBXX> targetAjList3 = new ArrayList<>(); |
|
|
|
Map<String, List<String>> gambler = new WeakHashMap<>(); |
|
|
|
List<String> ajNos3 = new ArrayList<>(); |
|
|
|
Map<String, List<String>> AIDS = new WeakHashMap<>(); |
|
|
|
|
|
|
|
Map<String, List<String>> alcoholics2 = new WeakHashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
for (GBaseAJJBXX gBaseAJJBXX : ajjbxxList) { |
|
|
|
LocalDateTime limit = LocalDateTime.now().minusYears(1); |
|
|
|
if (gBaseAJJBXX.getAjlbmc() == null) { |
|
|
|
for (BadHabit badHabit : habitList) { |
|
|
|
continue; |
|
|
|
if (badHabit.getAjlbmc().contains("酒")) { |
|
|
|
} |
|
|
|
alcoholics.computeIfAbsent(badHabit.getIdCode(), k -> new ArrayList<>()).add(badHabit.getAjbh()); |
|
|
|
if (gBaseAJJBXX.getAjlbmc().contains("酒")){ |
|
|
|
LocalDateTime tmp = DateTimeUtil.date2LocalDateTime(badHabit.getBarq()); |
|
|
|
targetAjList.add(gBaseAJJBXX); |
|
|
|
if (tmp != null && tmp.isAfter(limit)) |
|
|
|
ajNos.add(gBaseAJJBXX.getAjbh()); |
|
|
|
alcoholics2.computeIfAbsent(badHabit.getIdCode(), k -> new ArrayList<>()).add(badHabit.getAjbh()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (gBaseAJJBXX.getAjlbmc().contains("赌博")) { |
|
|
|
if (badHabit.getAjlbmc().contains("赌博")) { |
|
|
|
targetAjList2.add(gBaseAJJBXX); |
|
|
|
gambler.computeIfAbsent(badHabit.getIdCode(), k -> new ArrayList<>()).add(badHabit.getAjbh()); |
|
|
|
ajNos2.add(gBaseAJJBXX.getAjbh()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (badHabit.getAjlbmc().contains("嫖娼") || badHabit.getAjlbmc().contains("招嫖") |
|
|
|
|
|
|
|
|| badHabit.getAjlbmc().contains("嫖宿")) { |
|
|
|
if (gBaseAJJBXX.getAjlbmc().contains("嫖娼") || gBaseAJJBXX.getAjlbmc().contains("招嫖") |
|
|
|
if (badHabit.getAjlbmc().contains("幼女")) { |
|
|
|
|| gBaseAJJBXX.getAjlbmc().contains("嫖宿")) { |
|
|
|
|
|
|
|
if (gBaseAJJBXX.getAjlbmc().contains("幼女")) { |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
targetAjList3.add(gBaseAJJBXX); |
|
|
|
AIDS.computeIfAbsent(badHabit.getIdCode(), k -> new ArrayList<>()).add(badHabit.getAjbh()); |
|
|
|
ajNos3.add(gBaseAJJBXX.getAjbh()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
RiskTask task = riskTaskRepository.create(ajNos.size(), 36); |
|
|
|
|
|
|
|
RiskTask task2 = riskTaskRepository.create(ajNos2.size(), 60); |
|
|
|
|
|
|
|
RiskTask task3 = riskTaskRepository.create(ajNos3.size(), 61); |
|
|
|
|
|
|
|
log.info("共计案件:{} | {} | {}", ajNos.size(), ajNos2.size(), ajNos3.size()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<RiskModelTaskClue> toInsert1 = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CompletableFuture.allOf( |
|
|
|
CompletableFuture.allOf( |
|
|
|
CompletableFutureUtil.runSyncObject(() -> toInsert1.addAll(findBadHabit(ajNos, targetAjList, task, domain, "酗酒行为", "B35酗酒"))), |
|
|
|
CompletableFutureUtil.runSyncObject(() -> createBadHabit(alcoholics, domain, 36, "酗酒行为", "B35酗酒")), |
|
|
|
CompletableFutureUtil.runSyncObject(() -> findBadHabit(ajNos2, targetAjList2, task2, domain, "赌博行为", "B37赌博")), |
|
|
|
CompletableFutureUtil.runSyncObject(() -> createBadHabit(gambler, domain, 60, "赌博行为", "B37赌博")), |
|
|
|
CompletableFutureUtil.runSyncObject(() -> findBadHabit(ajNos3, targetAjList3, task3, domain, "其它成瘾行为", "B40其它成瘾行为")) |
|
|
|
CompletableFutureUtil.runSyncObject(() -> createBadHabit(AIDS, domain, 61, "其它成瘾行为", "B40其它成瘾行为")), |
|
|
|
|
|
|
|
CompletableFutureUtil.runSyncObject(() -> createBadHabit(alcoholics2, domain, 62, "一年内酗酒行为", "B78酗酒")) |
|
|
|
).join(); |
|
|
|
).join(); |
|
|
|
|
|
|
|
|
|
|
|
log.info("开始进行数据库操作"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(toInsert1.isEmpty()) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// 近一年酗酒
|
|
|
|
|
|
|
|
RiskTask task4 = riskTaskRepository.create(toInsert1.size(), 62); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, RiskModelTaskClue> old = domain.getOldMap(task4.getModelId(), true); |
|
|
|
void createBadHabit(Map<String, List<String>> badHabits, TaskParamDomain domain, Integer modelId, String tag, String bigTag) { |
|
|
|
|
|
|
|
RiskTask task = riskTaskRepository.create(badHabits.size(), modelId); |
|
|
|
List<RiskModelTaskClue> toInsertYears = new ArrayList<>(); |
|
|
|
Map<String, RiskModelTaskClue> olds = domain.getOldMap(modelId, true); |
|
|
|
for (RiskModelTaskClue clue : toInsert1) { |
|
|
|
|
|
|
|
if(old.get(clue.getIdCode()) == null) { |
|
|
|
|
|
|
|
clue.setModelId(task4.getModelId()); |
|
|
|
|
|
|
|
clue.setTaskId(task4.getId()); |
|
|
|
|
|
|
|
toInsertYears.add(clue); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!toInsertYears.isEmpty()) { |
|
|
|
|
|
|
|
riskModelTaskClueService.saveClues(toInsertYears, "B78酗酒"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<RiskModelTaskClue> toUpdate = new ArrayList<>(); |
|
|
|
List<RiskModelTaskClue> toUpdate = new ArrayList<>(); |
|
|
|
List<String> idCodes = new ArrayList<>(); |
|
|
|
|
|
|
|
// 酗酒 看看有没有过期
|
|
|
|
|
|
|
|
for (Map.Entry<String, RiskModelTaskClue> entry : old.entrySet()) { |
|
|
|
|
|
|
|
if(entry.getValue().getEventTime() == null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(entry.getValue().getEventTime().isBefore(limit)) { |
|
|
|
|
|
|
|
RiskModelTaskClue update = new RiskModelTaskClue(); |
|
|
|
|
|
|
|
update.setId(entry.getValue().getId()); |
|
|
|
|
|
|
|
update.setDel(1); |
|
|
|
|
|
|
|
toUpdate.add(update); |
|
|
|
|
|
|
|
idCodes.add(entry.getValue().getIdCode()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(!toUpdate.isEmpty()) { |
|
|
|
|
|
|
|
riskModelTaskClueService.deleteCluesAndDeleteTag(toUpdate, idCodes, task4.getModelId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
riskTaskRepository.updateTask(task4.getId(), toInsertYears.size(), toUpdate.size()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<RiskModelTaskClue> findBadHabit(List<String> ajNos, List<GBaseAJJBXX> targetAjList, RiskTask task, TaskParamDomain domain, String tag, String bigTag) { |
|
|
|
|
|
|
|
List<List<String>> ajNo = IntStream.range(0, (ajNos.size() + 9999) / 10000) |
|
|
|
|
|
|
|
.mapToObj(i -> ajNos.subList(i * 10000, Math.min((i + 1) * 10000, ajNos.size()))) |
|
|
|
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
List<GBaseWFRXX> wfrList = new ArrayList<>(); |
|
|
|
|
|
|
|
ajNo.forEach(aj -> wfrList.addAll(gBaseWFRXXRepository.list(new LambdaQueryWrapper<GBaseWFRXX>() |
|
|
|
|
|
|
|
.select(GBaseWFRXX::getAjbh, GBaseWFRXX::getZjhm) |
|
|
|
|
|
|
|
.in(GBaseWFRXX::getAjbh, aj)))); |
|
|
|
|
|
|
|
// 违法信息
|
|
|
|
|
|
|
|
Map<String, List<GBaseWFRXX>> wfrMap = wfrList.stream().filter(it -> it.getZjhm() != null).collect(Collectors.groupingBy(GBaseWFRXX::getZjhm)); |
|
|
|
|
|
|
|
// 案件信息
|
|
|
|
|
|
|
|
Map<String, GBaseAJJBXX> ajMap = targetAjList.stream().collect(Collectors.toMap(GBaseAJJBXX::getAjbh, Function.identity(), (oldValue, newValue) -> newValue)); |
|
|
|
|
|
|
|
List<RiskModelTaskClue> oldList = Optional.ofNullable(domain.getMap().get(task.getModelId())).orElse(new ArrayList<>()); |
|
|
|
|
|
|
|
// 人员的旧线索
|
|
|
|
|
|
|
|
Map<String, List<RiskModelTaskClue>> clueMap = oldList.stream().collect(Collectors.groupingBy(RiskModelTaskClue::getIdCode)); |
|
|
|
|
|
|
|
List<RiskModelTaskClue> clues; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LocalDateTime limit = LocalDateTime.now().minusYears(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 创建新数据
|
|
|
|
|
|
|
|
List<RiskModelTaskClue> toInsert = new ArrayList<>(); |
|
|
|
List<RiskModelTaskClue> toInsert = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
List<RiskModelTaskClue> toInsert2 = new ArrayList<>(); |
|
|
|
|
|
|
|
log.info("开始遍历人员:{}", wfrMap.size()); |
|
|
|
|
|
|
|
for (RiskPersonal person : domain.getPersons()) { |
|
|
|
for (RiskPersonal person : domain.getPersons()) { |
|
|
|
List<GBaseWFRXX> wfTmp = Optional.ofNullable(wfrMap.get(person.getIdCode())).orElse(new ArrayList<>()); |
|
|
|
List<String> tmp = badHabits.get(person.getIdCode()); |
|
|
|
wfTmp = wfTmp.stream().filter(StreamUtil.distinctByKey(GBaseWFRXX::getAjbh)).toList(); |
|
|
|
if (tmp == null) continue; |
|
|
|
if(wfTmp.isEmpty()){ |
|
|
|
tmp = tmp.stream().distinct().sorted().toList(); |
|
|
|
continue; |
|
|
|
String desc = "结合案件信息和违法人信息相关数据,发现该人员有" + tmp.size() + "起" + tag + "相关案件,相关案件编号为:" + String.join(",", tmp); |
|
|
|
} |
|
|
|
|
|
|
|
// 该人员旧的线索
|
|
|
|
|
|
|
|
clues = clueMap.get(person.getIdCode()); |
|
|
|
|
|
|
|
if(clues != null) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder("结合案件信息和违法人信息相关数据,发现该人员有"+wfTmp.size()+"起"+tag+"相关案件,相关案件编号为:"); |
|
|
|
RiskModelTaskClue old = olds.get(person.getIdCode()); |
|
|
|
StringBuilder ajs = new StringBuilder(); |
|
|
|
if (old != null && !old.getData().equals(desc)) { |
|
|
|
LocalDateTime eventTime = null; |
|
|
|
RiskModelTaskClue update = new RiskModelTaskClue(); |
|
|
|
int count = 0; |
|
|
|
update.setId(old.getId()); |
|
|
|
int size = 0; |
|
|
|
update.setData(desc); |
|
|
|
for (GBaseWFRXX gBaseWFRXX : wfTmp) { |
|
|
|
update.setEventTime(LocalDateTime.now()); |
|
|
|
GBaseAJJBXX aj = ajMap.get(gBaseWFRXX.getAjbh()); |
|
|
|
update.setScore(Math.min(5, tmp.size())); |
|
|
|
if (aj == null) { |
|
|
|
update.setModelId(modelId); |
|
|
|
|
|
|
|
toUpdate.add(update); |
|
|
|
|
|
|
|
olds.remove(person.getIdCode()); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
sb.append(gBaseWFRXX.getAjbh()).append(","); |
|
|
|
if(old != null) { |
|
|
|
size++; |
|
|
|
olds.remove(person.getIdCode()); |
|
|
|
try { |
|
|
|
|
|
|
|
LocalDateTime tmp = aj.getBarq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
|
|
|
|
|
|
|
if(tmp.isAfter(limit)) { |
|
|
|
|
|
|
|
count++; |
|
|
|
|
|
|
|
ajs.append(aj.getAjbh()).append(","); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(eventTime == null) { |
|
|
|
|
|
|
|
eventTime = tmp; |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if(eventTime.isBefore(tmp)) { |
|
|
|
toInsert.add(DataUtil.createClueData(task, ClueData.builder() |
|
|
|
eventTime = tmp; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception ignored) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ClueData data = ClueData.builder() |
|
|
|
|
|
|
|
.id("habit") |
|
|
|
.id("habit") |
|
|
|
.name(person.getName()) |
|
|
|
.name(person.getName()) |
|
|
|
.idCode(person.getIdCode()) |
|
|
|
.idCode(person.getIdCode()) |
|
|
|
.tags(List.of(tag)) |
|
|
|
.tags(List.of(tag)) |
|
|
|
.personId(person.getId()) |
|
|
|
.personId(person.getId()) |
|
|
|
.sourceData(sb.substring(0, sb.length()-1)) |
|
|
|
.sourceData(desc) |
|
|
|
.score(Math.min(size, 5)) |
|
|
|
.score(Math.min(tmp.size(), 5)) |
|
|
|
.eventTime(Optional.ofNullable(eventTime).orElse(LocalDateTime.now())) |
|
|
|
|
|
|
|
.build(); |
|
|
|
|
|
|
|
toInsert.add(DataUtil.createClueData(task, data)); |
|
|
|
|
|
|
|
if(count > 0) { |
|
|
|
|
|
|
|
toInsert2.add(DataUtil.createClueData(new RiskTask(), ClueData.builder() |
|
|
|
|
|
|
|
.id("habit2") |
|
|
|
|
|
|
|
.name(person.getName()) |
|
|
|
|
|
|
|
.idCode(person.getIdCode()) |
|
|
|
|
|
|
|
.tags(List.of(Default.YEAR_DRINK)) |
|
|
|
|
|
|
|
.score(5) |
|
|
|
|
|
|
|
.personId(person.getId()) |
|
|
|
|
|
|
|
.sourceData("发现该人员近一年内有酗酒行为,具体案件为:"+ajs.substring(0, ajs.length()-1)) |
|
|
|
|
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
.eventTime(LocalDateTime.now()) |
|
|
|
.build())); |
|
|
|
.build())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<RiskModelTaskClue> toDelete = new ArrayList<>(); |
|
|
|
|
|
|
|
List<String> deleteIdCodes = new ArrayList<>(); |
|
|
|
|
|
|
|
for (Map.Entry<String, RiskModelTaskClue> entry : olds.entrySet()) { |
|
|
|
|
|
|
|
RiskModelTaskClue delete = new RiskModelTaskClue(); |
|
|
|
|
|
|
|
delete.setId(entry.getValue().getId()); |
|
|
|
|
|
|
|
delete.setDel(1); |
|
|
|
|
|
|
|
toDelete.add(delete); |
|
|
|
|
|
|
|
deleteIdCodes.add(entry.getValue().getIdCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!toInsert.isEmpty()) { |
|
|
|
if (!toInsert.isEmpty()) { |
|
|
|
|
|
|
|
log.info("新增{}数据{}条", tag, toInsert.size()); |
|
|
|
riskModelTaskClueService.saveClues(toInsert, bigTag); |
|
|
|
riskModelTaskClueService.saveClues(toInsert, bigTag); |
|
|
|
} |
|
|
|
} |
|
|
|
riskTaskRepository.updateTask(task.getId(), toInsert.size(), 0); |
|
|
|
if (!toUpdate.isEmpty()) { |
|
|
|
return toInsert2; |
|
|
|
log.info("修改{}数据{}条", tag, toUpdate.size()); |
|
|
|
|
|
|
|
riskModelTaskClueService.updateClues(toInsert, modelId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!toDelete.isEmpty()) { |
|
|
|
|
|
|
|
log.info("删除{}数据{}条", tag, toDelete.size()); |
|
|
|
|
|
|
|
riskModelTaskClueService.deleteCluesAndDeleteTag(toDelete, deleteIdCodes, modelId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
riskTaskRepository.updateTask(task.getId(), toInsert.size(), toDelete.size() + toUpdate.size()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|