Browse Source

fit: 日常督察、所队自查任务到期自动结束

master
wxc 4 months ago
parent
commit
36a99f7ce0
  1. 16
      src/main/java/com/biutag/supervision/job/TaskJob.java

16
src/main/java/com/biutag/supervision/job/RiskJob.java → src/main/java/com/biutag/supervision/job/TaskJob.java

@ -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() {
Loading…
Cancel
Save