package com.xhkjedu.sapi.task;

import com.xhkjedu.sapi.model.classreport.TReportClasstype;
import com.xhkjedu.sapi.service.classreport.ClassReportService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author ywx
 * @classname ClassReportTask
 * @description 班级报告定时任务
 * @date 2021/5/31 16:23
 **/
@Component
public class ClassReportTask {

    @Resource
    private ClassReportService classReportService;

    //生成上周班级报告
    @Scheduled(cron = "${cron.classReportWeek}")
    public void classReportWeek(){
        TReportClasstype type = new TReportClasstype();
        type.setReporttype(1);
        type.setBasenum(1);
        classReportService.generateClassReport(type);
    }

    //生成上月班级报告
    @Scheduled(cron = "${cron.classReportMonth}")
    public void classReportMonth(){
        TReportClasstype type = new TReportClasstype();
        type.setReporttype(2);
        type.setBasenum(1);
        classReportService.generateClassReport(type);
    }
}
