|
|
|
|
@ -2,6 +2,7 @@ package com.biutag.supervision.job;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.biutag.supervision.constants.enums.TaskTypeEnum; |
|
|
|
|
import com.biutag.supervision.constants.enums.WorkStatusEnum; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupRiskPersonal; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupRiskPersonalSupRecord; |
|
|
|
|
@ -33,10 +34,17 @@ public class RiskJob {
|
|
|
|
|
private final SupTaskService taskService; |
|
|
|
|
|
|
|
|
|
// 每10分钟执行一次
|
|
|
|
|
@Scheduled(fixedRate = 600000) |
|
|
|
|
public void updateHandleTimeout() { |
|
|
|
|
@Scheduled(fixedRate = 60000) |
|
|
|
|
public void updateRiskPersonalWork() { |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
List<SupRiskPersonal> list = riskPersonalService.list(new LambdaQueryWrapper<SupRiskPersonal>().eq(SupRiskPersonal::getWorkStatus, WorkStatusEnum.done.name())); |
|
|
|
|
// 重点人员
|
|
|
|
|
List<SupTask> tasks = taskService.list(new LambdaQueryWrapper<SupTask>().le(SupTask::getBeginTime, now).ge(SupTask::getEndTime, now) |
|
|
|
|
.eq(SupTask::getTaskType, TaskTypeEnum.risk_personal.name())); |
|
|
|
|
if (tasks.isEmpty()) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
List<SupRiskPersonal> list = riskPersonalService.list(new LambdaQueryWrapper<SupRiskPersonal>().eq(SupRiskPersonal::getWorkStatus, WorkStatusEnum.done.name()) |
|
|
|
|
.in(SupRiskPersonal::getTaskId, tasks.stream().map(SupTask::getId).toList())); |
|
|
|
|
for (SupRiskPersonal riskPersonal : list) { |
|
|
|
|
SupTask task = taskService.getById(riskPersonal.getTaskId()); |
|
|
|
|
|
|
|
|
|
|