| | |
| | | package org.springblade.modules.quartz.task; |
| | | |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.training.service.TrainingRegistrationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | @Autowired |
| | | private TrainingRegistrationService trainingRegistrationService; |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | public void testTask(){ |
| | | System.out.println("测试定时任务执行-----------------"); |
| | | } |
| | |
| | | /** |
| | | * 定时任务,处理考试中的人员 |
| | | */ |
| | | // @Scheduled(cron = "0 0 22 * * ?") |
| | | public void examLoading(){ |
| | | System.out.println("定时任务2:执行时间:"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); |
| | | System.out.println("定时任务,处理考试中的人员:执行时间:"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); |
| | | //自动处理之前报了名,考试忘记提交或者中断考试的 |
| | | trainingRegistrationService.examLoading(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务,6个月未登录人员,进行冻结 |
| | | */ |
| | | public void sixMonthNotLoginHandle(){ |
| | | System.out.println("定时任务,6个月未登录人员,进行冻结:执行时间:"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); |
| | | userService.sixMonthNotLoginHandle(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务,12个月未登录人员,进行注销 |
| | | */ |
| | | public void oneYearNotLoginHandle(){ |
| | | System.out.println("定时任务,12个月未登录人员,进行注销:执行时间:"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); |
| | | userService.oneYearNotLoginHandle(); |
| | | } |
| | | |
| | | } |