package com.ssj.task;

import com.ssj.framework.core.util.SystemResourceLocator;
import com.ssj.service.weixin.library.service.ILibBorrowHisService;
import com.ssj.service.weixin.library.service.ILibSubscribeService;
import com.ssj.service.weixin.zuoyb.service.ZuoybStudentBgService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@DisallowConcurrentExecution
@Component
public class ReadMonthReportTask implements Job {

    private static Logger logger = LoggerFactory.getLogger(ReadMonthReportTask.class);

    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
        try {
            logger.info("每月第一天发送上个月阅读排名结果给家长");
            ILibBorrowHisService hisService = SystemResourceLocator.getBean(ILibBorrowHisService.class);
            hisService.pushReadMonthToUser();
        } catch (Exception e) {
            logger.error("每月第一天发送上个月阅读排名结果给家长异常-->"+e.getMessage());
        }finally{
            logger.info("每月第一天发送上个月阅读排名结果给家长结束");
        }

    }
}
