package org.springblade.modules.crontab;
|
|
import org.springblade.modules.training.entity.TrainingRegistration;
|
import org.springblade.modules.training.service.TrainingRegistrationService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
/**
|
* 定时任务
|
* @author zhongrj
|
* @since 2021-11-18
|
*/
|
@Component
|
public class Crontab {
|
|
@Autowired
|
private TrainingRegistrationService trainingRegistrationService;
|
|
/**
|
* 定时任务,每天凌晨1点执行一次,
|
* 自动处理之前报了名,申请了考试又没有去考试的,做缺考标记,并将报名状态修改为已取消报名
|
*/
|
@Scheduled(cron = "* * 1 * * ?")
|
// @Scheduled(cron = "*/30 * * * * ?")
|
@GetMapping("/examApplyStatus")
|
public void examApplyStatus(){
|
//自动处理之前报了名,申请了考试又没有去考试的,做缺考标记,并将报名状态修改为已取消报名
|
trainingRegistrationService.examApplyStatus();
|
}
|
}
|