RealTest.java 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. package com.gyee.generation;
  2. import com.gyee.common.util.DateUtils;
  3. import com.gyee.generation.service.realtimelibrary.*;
  4. import com.gyee.generation.util.SpringUtils;
  5. import org.springframework.boot.SpringApplication;
  6. import java.util.Calendar;
  7. import java.util.Date;
  8. public class RealTest {
  9. public static void main(String[] args) throws Exception {
  10. SpringApplication.run(GenerationMain.class, args);
  11. StatusService statusService= SpringUtils.getBean("statusService");
  12. CycleCalculationService cycleCalculationService= SpringUtils.getBean("cycleCalculationService");
  13. CalculationService calculationService= SpringUtils.getBean("calculationService");
  14. CycleCalculationRebuildService cycleCalculationRebuildService= SpringUtils.getBean("cycleCalculationRebuildService");
  15. RealtimeService realtimeService= SpringUtils.getBean("realtimeService");
  16. RegionCalreService regionCalreService= SpringUtils.getBean("regionCalreService");
  17. // inputOrOutPutService.initialInputOrOutputSpeed();
  18. Calendar c = Calendar.getInstance();
  19. Date begin=null;
  20. Date end=null;
  21. // CacheService cacheService= SpringUtils.getBean("cacheService");
  22. // cacheService.initRedisCache();
  23. //
  24. // c.set(Calendar.DAY_OF_MONTH,1);
  25. //
  26. // c.set(Calendar.HOUR_OF_DAY, 23);
  27. // c.set(Calendar.MINUTE, 59);
  28. // c.set(Calendar.SECOND, 59);
  29. //
  30. //
  31. ////
  32. // c.setTime(DateUtils.truncate(c.getTime()));
  33. begin=new Date();
  34. System.out.println("设备指标记录调度程序执行开始!。。。。。。");
  35. // cycleCalculationRebuildService.saveCyle(c.getTime());
  36. // for(int i=0;i<19;i++)
  37. // {
  38. // realtimeService.savaRealtimeTargetWp();
  39. statusService.middleStatusReal();
  40. // statusService.startStatusReal();
  41. // calculationService.calWp();
  42. // cycleCalculationService.saveCyle();
  43. c.add(Calendar.DAY_OF_MONTH,1);
  44. System.out.println("完成一次!。。。。。。");
  45. // }
  46. end=new Date();
  47. System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  48. System.out.println("设备指标记录调度程序执行结束!。。。。。。");
  49. //
  50. // realtimeService.savaRealtimeTarget();
  51. // regionCalreService.aqts();
  52. //
  53. // end=new Date();
  54. // System.out.println("执行用时"+ DateUtils.millisecondDiff(begin,end) +"秒");
  55. // System.out.println("状态判定调度程序执行结束!。。。。。。");
  56. // System.out.println("完成!。。。。。。");
  57. //
  58. //
  59. //
  60. // //
  61. // System.out.println("故障转换率记录调度程序执行开始!。。。。。。");
  62. // TimelinessRateService timelinessRateService = SpringUtils.getBean("timelinessRateService");
  63. // timelinessRateService.failRate(c.getTime());
  64. // System.out.println("故障转换率记录调度程序执行结束!。。。。。。");
  65. //
  66. // begin=new Date();
  67. // System.out.println("切15分钟数据统计记录调度程序执行开始!。。。。。。");
  68. // EquipmentInfo15minuteService equipmentInfo15minuteService = SpringUtils.getBean("equipmentInfo15minuteService");
  69. // equipmentInfo15minuteService.calEquipmentInfo15minute(c.getTime());
  70. // end=new Date();
  71. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  72. // System.out.println("切15分钟数据统计记录记录调度程序执行结束!。。。。。。");
  73. //
  74. //
  75. // List<ProBasicEquipment> wtls= CacheContext.wpwtmap.get("SXJ_KGDL_GJY_FDC_STA");
  76. // List<ProBasicEquipment> wtls= new ArrayList<>();
  77. // for(ProBasicPowerstation wp: CacheContext.wpls)
  78. // {
  79. // if(wp.getId().contains("FDC"))
  80. // {
  81. // wtls.addAll(CacheContext.wpwtmap.get(wp.getId()));
  82. // }
  83. // }
  84. // List<ProBasicEquipment> wtls= CacheContext.wpwtmap.get("SXJ_KGDL_GJY_FDC_STA");
  85. //
  86. // while (true)
  87. // {
  88. // begin=new Date();
  89. // System.out.println("切入切出状态切换记录调度程序执行开始!。。。。。。");
  90. // inputOrOutPutService.inputOrOutputSpeed(c.getTime());
  91. // end=new Date();
  92. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  93. // System.out.println("切入切出状态切换记录调度程序执行结束!。。。。。。");
  94. // }
  95. //
  96. //
  97. // begin=new Date();
  98. // System.out.println("初始化散点图调度程序执行开始!。。。。。。");
  99. //
  100. //
  101. // initialRedisService.intialWtScatter();
  102. // end=new Date();
  103. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  104. // System.out.println("初始化散点图度程序执行结束!。。。。。。");
  105. // begin=new Date();
  106. // System.out.println("切入切出统计调度程序执行开始!。。。。。。");
  107. //
  108. //
  109. // inputOrOutPutService.inputOrOutput(c.getTime());
  110. // end=new Date();
  111. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  112. // System.out.println("切入切出统计调度程序执行结束!。。。。。。");
  113. //
  114. //
  115. //
  116. // begin=new Date();
  117. // System.out.println("停机记录调度程序执行开始!。。。。。。");
  118. // ShutdownnewService shutdownnewService= SpringUtils.getBean("shutdownnewService");
  119. //
  120. // shutdownnewService.execShutdown(c.getTime());
  121. // end=new Date();
  122. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  123. // System.out.println("停机记录调度程序执行结束!。。。。。。");
  124. //
  125. //
  126. // begin=new Date();
  127. // System.out.println("限电停机记录调度程序执行开始!。。。。。。");
  128. // LimitEventnewService limitEventnewService= SpringUtils.getBean("limitEventnewService");
  129. ////
  130. //
  131. // List<ProBasicPowerstation> wpls=new ArrayList<>();
  132. //
  133. //// ProBasicPowerstation wp= CacheContext.wpmap.get("SXJ_KGDL_GJY_FDC_STA");
  134. //// wpls.add(wp);
  135. //// List<ProBasicEquipment> wtls=CacheContext.wpwtmap.get("SXJ_KGDL_GJY_FDC_STA");
  136. // limitEventnewService.execBrownouts(c.getTime());
  137. // end=new Date();
  138. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  139. // System.out.println("限电停机记录调度程序执行结束!。。。。。。");
  140. //
  141. //
  142. // begin=new Date();
  143. // System.out.println("曲线拟合调度程序执行开始!。。。。。。");
  144. // PowerCurveFittingByTimeService powerCurveFittingByTimeService= SpringUtils.getBean("powerCurveFittingByTimeService");
  145. //
  146. //// XxlJobHelper.log("日序执行开始!........");
  147. //// powerCurveFittingByTimeService.cureFittingDay(c.getTime());
  148. //// XxlJobHelper.log("日处理完成!........");
  149. ////
  150. // XxlJobHelper.log("月序执行开始!........");
  151. // powerCurveFittingByTimeService.cureFittingMonth(c.getTime(),"1");
  152. // XxlJobHelper.log("月处理完成!........");
  153. ////
  154. //// XxlJobHelper.log("年序执行开始!........");
  155. //// powerCurveFittingByTimeService.cureFittingYear(c.getTime());
  156. //// XxlJobHelper.log("年处理完成!........");
  157. ////
  158. // end=new Date();
  159. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  160. // System.out.println("曲线拟合调度程序执行结束!。。。。。。");
  161. //
  162. //
  163. // begin=new Date();
  164. // System.out.println("场站指标记录调度程序执行开始!。。。。。。");
  165. // WindPowerInfo1Service windPowerInfo1Service= SpringUtils.getBean("windPowerInfo1Service");
  166. // WindPowerInfo2Service windPowerInfo2Service= SpringUtils.getBean("windPowerInfo2Service");
  167. // WindPowerInfo3Service windPowerInfo3Service= SpringUtils.getBean("windPowerInfo3Service");
  168. // WindPowerInfo4Service windPowerInfo4Service= SpringUtils.getBean("windPowerInfo4Service");
  169. // WindPowerInfo5Service windPowerInfo5Service= SpringUtils.getBean("windPowerInfo5Service");
  170. // WindPowerInfo6Service windPowerInfo6Service= SpringUtils.getBean("windPowerInfo6Service");
  171. //
  172. // windPowerInfo1Service.calLineInfoDay(c.getTime());
  173. // windPowerInfo1Service.calProjectInfoDay(c.getTime());
  174. // windPowerInfo1Service.calWindpowerInfoDay(c.getTime());
  175. // windPowerInfo1Service.calCompanyInfoDay(c.getTime());
  176. // windPowerInfo1Service.calRegionInfoDay(c.getTime());
  177. //
  178. // windPowerInfo2Service.calLineInfoDay(c.getTime());
  179. // windPowerInfo2Service.calProjectInfoDay(c.getTime());
  180. // windPowerInfo2Service.calWindpowerInfoDay(c.getTime());
  181. // windPowerInfo2Service.calCompanyInfoDay(c.getTime());
  182. // windPowerInfo2Service.calRegionInfoDay(c.getTime());
  183. //
  184. // windPowerInfo3Service.calLineInfoDay(c.getTime());
  185. // windPowerInfo3Service.calProjectInfoDay(c.getTime());
  186. // windPowerInfo3Service.calWindpowerInfoDay(c.getTime());
  187. // windPowerInfo3Service.calCompanyInfoDay(c.getTime());
  188. // windPowerInfo3Service.calRegionInfoDay(c.getTime());
  189. //
  190. // windPowerInfo4Service.calLineInfoDay(c.getTime());
  191. // windPowerInfo4Service.calProjectInfoDay(c.getTime());
  192. // windPowerInfo4Service.calWindpowerInfoDay(c.getTime());
  193. // windPowerInfo4Service.calCompanyInfoDay(c.getTime());
  194. // windPowerInfo4Service.calRegionInfoDay(c.getTime());
  195. //
  196. // windPowerInfo5Service.calLineInfoDay(c.getTime());
  197. // windPowerInfo5Service.calProjectInfoDay(c.getTime());
  198. // windPowerInfo5Service.calWindpowerInfoDay(c.getTime());
  199. // windPowerInfo5Service.calCompanyInfoDay(c.getTime());
  200. // windPowerInfo5Service.calRegionInfoDay(c.getTime());
  201. //
  202. // windPowerInfo6Service.calLineInfoDay(c.getTime());
  203. // windPowerInfo6Service.calProjectInfoDay(c.getTime());
  204. // windPowerInfo6Service.calWindpowerInfoDay(c.getTime());
  205. // windPowerInfo6Service.calCompanyInfoDay(c.getTime());
  206. // windPowerInfo6Service.calRegionInfoDay(c.getTime());
  207. //
  208. // end=new Date();
  209. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  210. // System.out.println("场站指标记录调度程序执行结束!。。。。。。");
  211. //
  212. //
  213. //
  214. // c.set(Calendar.DAY_OF_MONTH,9);
  215. // for(int i=0;i<6;i++)
  216. // {
  217. // begin=new Date();
  218. // System.out.println("设备指标记录调度程序执行开始!。。。。。。");
  219. // EquipmentInfo1Service equipmentInfo1Service= SpringUtils.getBean("equipmentInfo1Service");
  220. // EquipmentInfo2Service equipmentInfo2Service= SpringUtils.getBean("equipmentInfo2Service");
  221. // EquipmentInfo3Service equipmentInfo3Service= SpringUtils.getBean("equipmentInfo3Service");
  222. // EquipmentInfo4Service equipmentInfo4Service= SpringUtils.getBean("equipmentInfo4Service");
  223. // EquipmentInfo5Service equipmentInfo5Service= SpringUtils.getBean("equipmentInfo5Service");
  224. // EquipmentInfoDayTopService equipmentInfoDayTopService= SpringUtils.getBean("equipmentInfoDayTopService");
  225. // WtAlysisDayService wtAlysisDayService= SpringUtils.getBean("wtAlysisDayService");
  226. //
  227. // equipmentInfo1Service.calEquipmentInfoDay(c.getTime());
  228. // equipmentInfo2Service.calEquipmentInfoDay(c.getTime());
  229. //
  230. // equipmentInfo3Service.calEquipmentInfoDay(c.getTime());
  231. //
  232. // equipmentInfo4Service.calEquipmentInfoDay(c.getTime());
  233. //
  234. // equipmentInfo5Service.calEquipmentInfoDay(c.getTime());
  235. //
  236. // equipmentInfoDayTopService.calEquipmentInfoDayTop(c.getTime());
  237. // equipmentInfoDayTopService.calEquipmentInfoMonthTop(c.getTime());
  238. // equipmentInfoDayTopService.calEquipmentInfoYearTop(c.getTime());
  239. //
  240. // wtAlysisDayService.calEquipmentInfoDay(c.getTime());
  241. // c.add(Calendar.DAY_OF_MONTH,1);
  242. // }
  243. //
  244. //
  245. //
  246. // end=new Date();
  247. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  248. // System.out.println("设备指标记录调度程序执行结束!。。。。。。");
  249. //
  250. //
  251. //
  252. //
  253. // begin=new Date();
  254. // System.out.println("功率一致性系数和拟合优度调度程序执行开始!。。。。。。");
  255. // WindturbineGoodnessService windturbineGoodnessService= SpringUtils.getBean("windturbineGoodnessService");
  256. //
  257. // windturbineGoodnessService.calWindturbineGoodness(c.getTime());
  258. // end=new Date();
  259. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  260. // System.out.println("功率一致性系数和拟合优度调度程序执行结束!。。。。。。");
  261. //
  262. // c.add(Calendar.DAY_OF_MONTH,-1);
  263. // begin=new Date();
  264. // System.out.println("设备数据和场站数据风资源调度程序执行开始!。。。。。。");
  265. // WpwindDayInfoService wpwindDayInfoService= SpringUtils.getBean("wpwindDayInfoService");
  266. // WtwindDayInfoService wtwindDayInfoService= SpringUtils.getBean("wtwindDayInfoService");
  267. // wpwindDayInfoService.calWpwindDayInfo(c.getTime());
  268. // wtwindDayInfoService.calWtwindDayInfo(c.getTime());
  269. // end=new Date();
  270. // System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
  271. // System.out.println("设备数据和场站数据风资源调度程序执行结束!。。。。。。");
  272. }
  273. }