SendDataToDcJob.java 1.0 KB

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