package com.qmth.teachcloud.task.job;

import com.qmth.teachcloud.task.job.service.JobService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * @Description: 同步学校信息定时任务
 * @Author: CaoZixuan
 * @Date: 2021-04-19
 */
public class TimedSyncSchoolJob extends QuartzJobBean {

    @Resource
    JobService jobService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            jobService.updateSchoolInfo();
            jobService.updatePrintPlan();
            jobService.syncData();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
