| | |
| | | import com.ruoyi.project.system.mapper.SysNoticeMapper; |
| | | import com.ruoyi.safe.mapper.SafeTrainingMapper; |
| | | import com.ruoyi.safe.pojo.SafeTraining; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | //定时任务汇总 |
| | | public class ScheduleTask { |
| | | |
| | | @Autowired |
| | | private SafeTrainingMapper safeTrainingMapper; |
| | | private final SafeTrainingMapper safeTrainingMapper; |
| | | |
| | | @Autowired |
| | | private SysNoticeMapper noticeMapper; |
| | | private final SysNoticeMapper noticeMapper; |
| | | |
| | | //定时任务(15分钟执行一次--判断培训计划数据,状态做变更) |
| | | @Scheduled(cron = "0 0/15 * * * ?") |
| | |
| | | .eq(SysNotice::getStatus,"1") |
| | | .lt(SysNotice::getCreateTime, LocalDateTime.now())); |
| | | } |
| | | |
| | | |
| | | } |