|
|
|
|
@ -26,13 +26,27 @@ import java.util.List;
|
|
|
|
|
@Slf4j |
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
@Component |
|
|
|
|
public class RiskJob { |
|
|
|
|
public class TaskJob { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final SupRiskPersonalService riskPersonalService; |
|
|
|
|
private final SupRiskPersonalSupRecordService riskPersonalSupRecordService; |
|
|
|
|
private final SupTaskService taskService; |
|
|
|
|
|
|
|
|
|
@Scheduled(fixedRate = 60000) |
|
|
|
|
public void updateTask() { |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
// 重点人员
|
|
|
|
|
List<SupTask> tasks = taskService.list(new LambdaQueryWrapper<SupTask>().lt(SupTask::getEndTime, now) |
|
|
|
|
.in(SupTask::getTaskType, List.of(TaskTypeEnum.inspection.name(), TaskTypeEnum.selfexamination.name(), TaskTypeEnum.risk_personal.name())) |
|
|
|
|
.eq(SupTask::getTaskStatus, WorkStatusEnum.todo.name())); |
|
|
|
|
for (SupTask task : tasks) { |
|
|
|
|
taskService.update(new LambdaUpdateWrapper<SupTask>() |
|
|
|
|
.eq(SupTask::getId, task.getId()) |
|
|
|
|
.set(SupTask::getTaskStatus, WorkStatusEnum.done.name())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 每10分钟执行一次
|
|
|
|
|
@Scheduled(fixedRate = 60000) |
|
|
|
|
public void updateRiskPersonalWork() { |