package com.qmth.sop.task.job;

import com.qmth.sop.common.enums.ExceptionResultEnum;
import com.qmth.sop.task.job.service.JobService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import javax.annotation.Resource;

/**
 * @Description: 自动新增打卡记录
 * @Author: CaoZixuan
 * @Date: 2023-11-18
 */
public class AutoAddDingRecordJob extends QuartzJobBean {
    @Resource
    JobService jobService;

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        try {
            jobService.autoAddDingRecord();
        } catch (Exception e) {
            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
        }
    }
}
