package com.gyee.wisdom.alarm.sharding.schedule;

import com.gyee.wisdom.alarm.sharding.entity.AlarmCountInfo;
import com.gyee.wisdom.alarm.sharding.entity.EarlyWarnScore;
import com.gyee.wisdom.alarm.sharding.entity.EarlyWarnScoreOne;
import com.gyee.wisdom.alarm.sharding.entity.Windturbine;
import com.gyee.wisdom.alarm.sharding.mapper.AlarmCountMapper;
import com.gyee.wisdom.alarm.sharding.mapper.EarlyWarnScoreMapper;
import com.gyee.wisdom.alarm.sharding.service.AlarmReportService;
import com.gyee.wisdom.alarm.sharding.service.WindturbineService;
import com.gyee.wisdom.alarm.sharding.util.SnowflakeGenerator;
import com.gyee.wisdom.common.utils.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @description:
 * @auther: Wanghs
 * @date: 2022-03-31
 */

@Component
@Slf4j
@EnableScheduling
public class EarlyScoreScheduled {


    @Value("${count.custom}")
    public boolean custom;
    @Autowired
    private AlarmReportService alarmReportService;

    @Scheduled(cron = "0 30 1 ? * *")
    public boolean doTask() {

        if (!custom) {
            return false;
        }
        boolean b = alarmReportService.startCount();
        return b;

    }

}
