package com.xjrsoft.module.job;

import cn.hutool.extra.spring.SpringUtil;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.DatasourceUtil;
import com.xjrsoft.module.attendance.entity.AttendanceRuleDetails;
import com.xjrsoft.module.attendance.service.IAttendanceMessageSetService;
import com.xjrsoft.module.attendance.service.IAttendanceRuleCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
import java.util.List;

/**
 * 考勤消息通知
 * @author dzx
 * @date 2024年5月21日
 */
@Component
@Slf4j
public class AttendanceMessageTask {
    @Autowired
    private IAttendanceMessageSetService messageSetService;

    @Autowired
    private IAttendanceRuleCategoryService ruleCategoryService;
    @Scheduled(cron = "0 */15 * * * ?")
    public void RefreshConnectionPool() {
        String active = SpringUtil.getActiveProfile();
        if(!"prod".equals(active)){
            log.info("非正式环境，无法执行数据推送");
            return;
        }

        List<AttendanceRuleDetails> ruleDetails = ruleCategoryService.getTodayRules();

        try {
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
    }
}
