package com.jiayue.client.job; import com.jiayue.client.service.SendDataService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; /** * 青海集中功率预测向数据中心回传数据: * 1.实际功率 短期 超短期 气象站 测风塔 风机 等数据 * 2.每天凌晨2点执行,回传前一天数据,定时任务失败需要手动触发回传 */ @Service @Slf4j public class SendDataToDcJob { @Autowired public SendDataService sendDataService; /** * 每天凌晨2点执行 */ @Scheduled(cron = "0 0/5 * * * ?") public void sendJob() { log.info("时间 【" + System.currentTimeMillis() + "】 向数据中心发送青海集中功率预测前一天的实际功率等数据。"); String startTime = "2021-09-25 00:00:00"; String endTime = "2021-09-26 00:00:00"; sendDataService.send(startTime, endTime, "all"); } }