|
|
|
|
@ -1,10 +1,7 @@
|
|
|
|
|
package com.biutag.supervisiondata.task; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.biutag.supervisiondata.common.interfaces.CompletableFutureUtil; |
|
|
|
|
import com.biutag.supervisiondata.pojo.domain.TaskParamDomain; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.Model; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskModelTaskClue; |
|
|
|
|
import com.biutag.supervisiondata.pojo.entity.mine.RiskPersonal; |
|
|
|
|
import com.biutag.supervisiondata.repository.ModelRepository; |
|
|
|
|
@ -19,7 +16,6 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.LocalTime; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
@ -68,8 +64,8 @@ public class TaskService {
|
|
|
|
|
*/ |
|
|
|
|
@Scheduled(cron = "0 30 01 * * ?") |
|
|
|
|
public void personRefresh() { |
|
|
|
|
LocalDateTime start = LocalDate.now().minusDays(1).atTime(0,0,0); |
|
|
|
|
LocalDateTime end = LocalDate.now().minusDays(1).atTime(23,59,59); |
|
|
|
|
LocalDateTime start = LocalDate.now().minusDays(1).atTime(0, 0, 0); |
|
|
|
|
LocalDateTime end = LocalDate.now().minusDays(1).atTime(23, 59, 59); |
|
|
|
|
|
|
|
|
|
personalService.pullInvestigate(); |
|
|
|
|
personalService.pullPsychosis(); |
|
|
|
|
@ -109,40 +105,70 @@ public class TaskService {
|
|
|
|
|
* 2点更新模型 |
|
|
|
|
*/ |
|
|
|
|
@Scheduled(cron = "0 0 02 * * ?") |
|
|
|
|
public void modelRefresh() { |
|
|
|
|
public void refreshEduAndAreaModel() { |
|
|
|
|
log.info("risk model refresh start, group=eduAndArea, modelIds={}", List.of(34, 41)); |
|
|
|
|
// 文化程度和出生地区
|
|
|
|
|
riskTaskService.eduAndAreaModelTask(initDomain(List.of(34, 41))); |
|
|
|
|
log.info("risk model refresh end, group=eduAndArea, modelIds={}", List.of(34, 41)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 20 02 * * ?") |
|
|
|
|
public void refreshInfoModel() { |
|
|
|
|
log.info("risk model refresh start, group=info, modelIds={}", List.of(32, 33)); |
|
|
|
|
// 性别和年龄
|
|
|
|
|
riskTaskService.infoModelTask(initDomain(List.of(32, 33))); |
|
|
|
|
log.info("risk model refresh end, group=info, modelIds={}", List.of(32, 33)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 40 02 * * ?") |
|
|
|
|
public void refreshMarriageAndHabitModels() { |
|
|
|
|
LocalDateTime fiveYearsAgo = LocalDateTime.now().minusYears(5); |
|
|
|
|
CompletableFutureUtil.runSync(() -> { |
|
|
|
|
// 文化程度和出生地区
|
|
|
|
|
riskTaskService.eduAndAreaModelTask(initDomain(List.of(34,41))); |
|
|
|
|
// 性别和年龄
|
|
|
|
|
riskTaskService.infoModelTask(initDomain(List.of(32,33))); |
|
|
|
|
// 婚姻创伤和婚姻状态
|
|
|
|
|
marriageService.marriageModelTask(initDomain(List.of(39,51))); |
|
|
|
|
// 五年内酒、赌博、嫖娼案件,一年内酒案件
|
|
|
|
|
habitService.syncBadHabit(fiveYearsAgo, initDomain(List.of(36,60,61,62))); |
|
|
|
|
petitionService.petitionModelTask(initDomain(List.of(40))); |
|
|
|
|
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.syncControlNoPower(initDomain(List.of(48))); |
|
|
|
|
pointService.syncControlNoPower(initDomain(List.of(50))); |
|
|
|
|
pointService.syncOilBuy(initDomain(List.of(52))); |
|
|
|
|
gBaseJJDService.pullPoliceInstance(initDomain(List.of(55,56,57,58))); |
|
|
|
|
jsbryService.syncPys(initDomain(List.of(59))); |
|
|
|
|
gBaseSHRWFRService.combatCrime(initDomain(List.of(63))); |
|
|
|
|
gBaseJJDService.warningInstance(initDomain(List.of(64))); |
|
|
|
|
gBaseJJDService.syncHomeViolence(initDomain(List.of(65,66))); |
|
|
|
|
pointService.syncPointType(initDomain(List.of(67))); |
|
|
|
|
gBaseSHRWFRService.hadWork(initDomain(List.of(37, 68))); |
|
|
|
|
gBaseJJDService.syncParentRelation(initDomain(List.of(69,70))); |
|
|
|
|
gBaseJJDService.syncLove(initDomain(List.of(71))); |
|
|
|
|
gBaseJJDService.syncMarryDispute(initDomain(List.of(72))); |
|
|
|
|
gBaseJJDService.syncNeighborAndColleagueDispute(initDomain(List.of(73))); |
|
|
|
|
gBaseJJDService.syncBullying(initDomain(List.of(74))); |
|
|
|
|
gBaseJJDService.syncOtherContradict(initDomain(List.of(75))); |
|
|
|
|
gBaseSHRWFRService.crimeName(initDomain(List.of(76))); |
|
|
|
|
}); |
|
|
|
|
log.info("risk model refresh start, group=marriageAndHabit, modelIds={}", List.of(39, 51, 36, 60, 61, 62, 40)); |
|
|
|
|
// 婚姻创伤和婚姻状态
|
|
|
|
|
marriageService.marriageModelTask(initDomain(List.of(39, 51))); |
|
|
|
|
// 五年内酒、赌博、嫖娼案件,一年内酒案件
|
|
|
|
|
habitService.syncBadHabit(fiveYearsAgo, initDomain(List.of(36, 60, 61, 62))); |
|
|
|
|
petitionService.petitionModelTask(initDomain(List.of(40))); |
|
|
|
|
log.info("risk model refresh end, group=marriageAndHabit, modelIds={}", List.of(39, 51, 36, 60, 61, 62, 40)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 03 * * ?") |
|
|
|
|
public void refreshPointModels() { |
|
|
|
|
log.info("risk model refresh start, group=point, modelIds={}", List.of(53, 43, 44, 45, 48, 50, 52)); |
|
|
|
|
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.syncControlNoPower(initDomain(List.of(48))); |
|
|
|
|
pointService.syncControlNoPower(initDomain(List.of(50))); |
|
|
|
|
pointService.syncOilBuy(initDomain(List.of(52))); |
|
|
|
|
log.info("risk model refresh end, group=point, modelIds={}", List.of(53, 43, 44, 45, 48, 50, 52)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 20 04 * * ?") |
|
|
|
|
public void refreshPoliceModels() { |
|
|
|
|
log.info("risk model refresh start, group=police, modelIds={}", List.of(55, 56, 57, 58, 59, 63, 64, 65, 66, 67)); |
|
|
|
|
gBaseJJDService.pullPoliceInstance(initDomain(List.of(55, 56, 57, 58))); |
|
|
|
|
jsbryService.syncPys(initDomain(List.of(59))); |
|
|
|
|
gBaseSHRWFRService.combatCrime(initDomain(List.of(63))); |
|
|
|
|
gBaseJJDService.warningInstance(initDomain(List.of(64))); |
|
|
|
|
gBaseJJDService.syncHomeViolence(initDomain(List.of(65, 66))); |
|
|
|
|
pointService.syncPointType(initDomain(List.of(67))); |
|
|
|
|
log.info("risk model refresh end, group=police, modelIds={}", List.of(55, 56, 57, 58, 59, 63, 64, 65, 66, 67)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 50 04 * * ?") |
|
|
|
|
public void refreshRelationModels() { |
|
|
|
|
log.info("risk model refresh start, group=relation, modelIds={}", List.of(37, 68, 69, 70, 71, 72, 73, 74, 75, 76)); |
|
|
|
|
gBaseSHRWFRService.hadWork(initDomain(List.of(37, 68))); |
|
|
|
|
gBaseJJDService.syncParentRelation(initDomain(List.of(69, 70))); |
|
|
|
|
gBaseJJDService.syncLove(initDomain(List.of(71))); |
|
|
|
|
gBaseJJDService.syncMarryDispute(initDomain(List.of(72))); |
|
|
|
|
gBaseJJDService.syncNeighborAndColleagueDispute(initDomain(List.of(73))); |
|
|
|
|
gBaseJJDService.syncBullying(initDomain(List.of(74))); |
|
|
|
|
gBaseJJDService.syncOtherContradict(initDomain(List.of(75))); |
|
|
|
|
gBaseSHRWFRService.crimeName(initDomain(List.of(76))); |
|
|
|
|
log.info("risk model refresh end, group=relation, modelIds={}", List.of(37, 68, 69, 70, 71, 72, 73, 74, 75, 76)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TaskParamDomain initDomain(List<Integer> modelIds) { |
|
|
|
|
@ -150,6 +176,7 @@ public class TaskService {
|
|
|
|
|
List<RiskModelTaskClue> clues = riskModelTaskClueRepository.list(new LambdaQueryWrapper<RiskModelTaskClue>() |
|
|
|
|
.in(RiskModelTaskClue::getModelId, modelIds) |
|
|
|
|
.eq(RiskModelTaskClue::getDel, 0)); |
|
|
|
|
log.info("risk model initDomain loaded, modelIds={}, persons={}, clues={}", modelIds, persons.size(), clues.size()); |
|
|
|
|
Map<Integer, List<RiskModelTaskClue>> map = clues.stream().collect(Collectors.groupingBy(RiskModelTaskClue::getModelId)); |
|
|
|
|
return new TaskParamDomain(persons, map); |
|
|
|
|
} |
|
|
|
|
|