SaticSchedulePgTask.java 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. package com.gyee.generation.task;
  2. import com.gyee.common.util.DateUtils;
  3. import com.gyee.generation.init.CacheContext;
  4. import com.gyee.generation.service.*;
  5. import com.xxl.job.core.context.XxlJobHelper;
  6. import com.xxl.job.core.handler.annotation.XxlJob;
  7. import org.slf4j.Logger;
  8. import org.slf4j.LoggerFactory;
  9. import org.springframework.stereotype.Component;
  10. import javax.annotation.Resource;
  11. import java.util.Date;
  12. /**
  13. * @ClassName : SaticScheduleTask
  14. * @Description : 调度
  15. */
  16. @Component
  17. public class SaticSchedulePgTask {
  18. private static Logger logger = LoggerFactory.getLogger(SaticSchedulePgTask.class);
  19. @Resource
  20. private InputOrOutPutService inputOrOutPutService;
  21. @Resource
  22. private LimitEventnewService limitEventnewService;
  23. @Resource
  24. private PowerCurveFittingService powerCurveFittingService;
  25. @Resource
  26. private ShutdownnewService shutdownnewService;
  27. @Resource
  28. private WindPowerInfo1Service windPowerInfo1Service;
  29. @Resource
  30. private WindPowerInfo2Service windPowerInfo2Service;
  31. @Resource
  32. private WindPowerInfo3Service windPowerInfo3Service;
  33. @Resource
  34. private WindPowerInfo4Service windPowerInfo4Service;
  35. @Resource
  36. private WindPowerInfo5Service windPowerInfo5Service;
  37. @Resource
  38. private WindPowerInfo6Service windPowerInfo6Service;
  39. @Resource
  40. private EquipmentInfo1Service equipmentInfo1Service;
  41. @Resource
  42. private EquipmentInfo2Service equipmentInfo2Service;
  43. @Resource
  44. private EquipmentInfo3Service equipmentInfo3Service;
  45. @Resource
  46. private EquipmentInfo4Service equipmentInfo4Service;
  47. @Resource
  48. private EquipmentInfo5Service equipmentInfo5Service;
  49. @Resource
  50. private EquipmentInfoDayTopService equipmentInfoDayTopService;
  51. //3.添加定时任务
  52. /**
  53. * 切入切出统计
  54. * 每天执行一次
  55. */
  56. @XxlJob("inputOrOutPut_PG")
  57. public void inputOrOutPut_PG() {
  58. XxlJobHelper.log("切入切出统计调度程序执行开始!........");
  59. try {
  60. inputOrOutPutService.inputOrOutput(new Date());
  61. } catch (Exception e) {
  62. e.printStackTrace();
  63. }
  64. XxlJobHelper.log("切入切出统计调度任务处理完成!........");
  65. }
  66. /**
  67. * 停机记录
  68. * 每15分钟执行一次
  69. */
  70. @XxlJob("shutdown_PG")
  71. public void shutdown_PG() {
  72. XxlJobHelper.log("停机记录调度程序执行开始!........");
  73. try {
  74. shutdownnewService.execShutdown(new Date());
  75. } catch (Exception e) {
  76. e.printStackTrace();
  77. }
  78. XxlJobHelper.log("停机记录调度任务处理完成!........");
  79. }
  80. /**
  81. * 限电停机记录
  82. * 每15分钟执行一次
  83. */
  84. @XxlJob("brownouts_PG")
  85. public void brownouts_PG() {
  86. XxlJobHelper.log("限电停机记录调度程序执行开始!........");
  87. try {
  88. limitEventnewService.execBrownouts(new Date());
  89. } catch (Exception e) {
  90. e.printStackTrace();
  91. }
  92. XxlJobHelper.log("限电停机记录调度任务处理完成!........");
  93. }
  94. /**
  95. * 日、月、年功率曲线拟合
  96. * 每天执行一次
  97. */
  98. @XxlJob("powerCurveFitting_PG")
  99. public void powerCurveFitting_PG() {
  100. XxlJobHelper.log("日、月、年功率曲线拟合调度程序执行开始!........");
  101. Date date=new Date();
  102. try {
  103. powerCurveFittingService.cureFitting(date,DateUtils.truncate(date),0, CacheContext.wtls);
  104. } catch (Exception e) {
  105. e.printStackTrace();
  106. }
  107. XxlJobHelper.log("日、月、年功率曲线拟合调度任务处理完成!........");
  108. }
  109. /**
  110. * 场站1表
  111. * 15分钟只执行一次
  112. *
  113. */
  114. @XxlJob("windPowerInfo1_PG")
  115. public void windPowerInfo1_PG() throws Exception {
  116. XxlJobHelper.log("场站指标1调度程序执行开始!........");
  117. Date date=new Date();
  118. windPowerInfo1Service.calLineInfoDay(date);
  119. windPowerInfo1Service.calProjectInfoDay(date);
  120. windPowerInfo1Service.calWindpowerInfoDay(date);
  121. windPowerInfo1Service.calCompanyInfoDay(date);
  122. windPowerInfo1Service.calRegionInfoDay(date);
  123. XxlJobHelper.log("场站指标1指标调度程序执行完成!........");
  124. }
  125. /**
  126. * 场站2表
  127. * 15分钟只执行一次
  128. *
  129. */
  130. @XxlJob("windPowerInfo2_PG")
  131. public void windPowerInfo2_PG() throws Exception {
  132. XxlJobHelper.log("场站指标2调度程序执行开始!........");
  133. Date date=new Date();
  134. windPowerInfo2Service.calLineInfoDay(date);
  135. windPowerInfo2Service.calProjectInfoDay(date);
  136. windPowerInfo2Service.calWindpowerInfoDay(date);
  137. windPowerInfo2Service.calCompanyInfoDay(date);
  138. windPowerInfo2Service.calRegionInfoDay(date);
  139. XxlJobHelper.log("场站指标2指标调度程序执行完成!........");
  140. }
  141. /**
  142. * 场站3表
  143. * 15分钟只执行一次
  144. *
  145. */
  146. @XxlJob("windPowerInfo3_PG")
  147. public void windPowerInfo3_PG() throws Exception {
  148. XxlJobHelper.log("场站指标3调度程序执行开始!........");
  149. Date date=new Date();
  150. windPowerInfo3Service.calLineInfoDay(date);
  151. windPowerInfo3Service.calProjectInfoDay(date);
  152. windPowerInfo3Service.calWindpowerInfoDay(date);
  153. windPowerInfo3Service.calCompanyInfoDay(date);
  154. windPowerInfo3Service.calRegionInfoDay(date);
  155. XxlJobHelper.log("场站指标3指标调度程序执行完成!........");
  156. }
  157. /**
  158. * 场站4表
  159. * 15分钟只执行一次
  160. *
  161. */
  162. @XxlJob("windPowerInfo4_PG")
  163. public void windPowerInfo4_PG() throws Exception {
  164. XxlJobHelper.log("场站指标4调度程序执行开始!........");
  165. Date date=new Date();
  166. windPowerInfo4Service.calLineInfoDay(date);
  167. windPowerInfo4Service.calProjectInfoDay(date);
  168. windPowerInfo4Service.calWindpowerInfoDay(date);
  169. windPowerInfo4Service.calCompanyInfoDay(date);
  170. windPowerInfo4Service.calRegionInfoDay(date);
  171. XxlJobHelper.log("场站指标4指标调度程序执行完成!........");
  172. }
  173. /**
  174. * 场站5表
  175. * 15分钟只执行一次
  176. *
  177. */
  178. @XxlJob("windPowerInfo5_PG")
  179. public void windPowerInfo5_PG() throws Exception {
  180. XxlJobHelper.log("场站指标5调度程序执行开始!........");
  181. Date date=new Date();
  182. windPowerInfo5Service.calLineInfoDay(date);
  183. windPowerInfo5Service.calProjectInfoDay(date);
  184. windPowerInfo5Service.calWindpowerInfoDay(date);
  185. windPowerInfo5Service.calCompanyInfoDay(date);
  186. windPowerInfo5Service.calRegionInfoDay(date);
  187. XxlJobHelper.log("场站指标5指标调度程序执行完成!........");
  188. }
  189. /**
  190. * 场站6表
  191. * 15分钟只执行一次
  192. *
  193. */
  194. @XxlJob("windPowerInfo6_PG")
  195. public void windPowerInfo6_PG() throws Exception {
  196. XxlJobHelper.log("场站指标6调度程序执行开始!........");
  197. Date date=new Date();
  198. windPowerInfo6Service.calLineInfoDay(date);
  199. windPowerInfo6Service.calProjectInfoDay(date);
  200. windPowerInfo6Service.calWindpowerInfoDay(date);
  201. windPowerInfo6Service.calCompanyInfoDay(date);
  202. windPowerInfo6Service.calRegionInfoDay(date);
  203. XxlJobHelper.log("场站指标6指标调度程序执行完成!........");
  204. }
  205. /**
  206. * 设备1-6表
  207. * 15分钟只执行一次
  208. *
  209. */
  210. @XxlJob("equipment_PowerInfo_PG")
  211. public void equipment_PowerInfo_PG() throws Exception {
  212. XxlJobHelper.log("设备指标调度程序执行开始!........");
  213. Date date=new Date();
  214. equipmentInfo1Service.calEquipmentInfoDay(date);
  215. equipmentInfo2Service.calEquipmentInfoDay(date);
  216. equipmentInfo3Service.calEquipmentInfoDay(date);
  217. equipmentInfo4Service.calEquipmentInfoDay(date);
  218. equipmentInfo5Service.calEquipmentInfoDay(date);
  219. XxlJobHelper.log("设备指标调度程序执行完成!........");
  220. }
  221. /**
  222. * 等级评估统计
  223. * 每天执行一次
  224. */
  225. @XxlJob("equipmentInfoDayTop_PG")
  226. public void equipmentInfoDayTop_PG() {
  227. XxlJobHelper.log("等级评估统计调度程序执行开始!........");
  228. try {
  229. equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
  230. } catch (Exception e) {
  231. e.printStackTrace();
  232. }
  233. XxlJobHelper.log("等级评估统计调度任务处理完成!........");
  234. }
  235. }