WindpowerInfoMonthService.java 120 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468
  1. //package com.gyee.generation.service;
  2. //
  3. //import com.gyee.common.contant.ContantXk;
  4. //import com.gyee.common.model.PointData;
  5. //import com.gyee.common.model.StringUtils;
  6. //import com.gyee.generation.init.CacheContext;
  7. //import com.gyee.generation.model.auto.*;
  8. //import com.gyee.generation.model.vo.Location;
  9. //import com.gyee.generation.service.auto.*;
  10. //import com.gyee.generation.util.DateUtils;
  11. //import com.gyee.generation.util.realtimesource.IEdosUtil;
  12. //import com.gyee.generation.util.statisticcs.Initial;
  13. //import org.slf4j.Logger;
  14. //import org.slf4j.LoggerFactory;
  15. //import org.springframework.stereotype.Service;
  16. //
  17. //import javax.annotation.Resource;
  18. //import java.math.BigDecimal;
  19. //import java.math.RoundingMode;
  20. //import java.util.*;
  21. //import java.util.stream.Collectors;
  22. //
  23. //@Service
  24. //public class WindpowerInfoMonthService {
  25. //
  26. // private static final Logger logger = LoggerFactory.getLogger(WindpowerInfoMonthService.class);
  27. // @Resource
  28. // private IEdosUtil edosUtil;
  29. //
  30. // @Resource
  31. // private IProEconWindpowerInfoDayService proEconWindpowerInfoDayService;
  32. // @Resource
  33. // private IProEconWindpowerInfoMonthService proEconWindpowerInfoMonthService;
  34. // @Resource
  35. // private IProEconWindpowerInfoYearService proEconWindpowerInfoYearService;
  36. // @Resource
  37. // private IProEconWindturbineInfoDayService proEconWindturbineInfoDayService;
  38. // @Resource
  39. // private IProEconWindturbineInfoMonthService proEconWindturbineInfoMonthService;
  40. // @Resource
  41. // private IProEconWindturbineInfoYearService proEconWindturbineInfoYearService;
  42. //
  43. //
  44. // /**
  45. // * 计算区域日信息
  46. // * @param recordDate
  47. // * @throws Exception
  48. // */
  49. // public void calRegionInfoDay(Date recordDate) throws Exception {
  50. //
  51. // List<ProEconWindpowerInfoMonth> wpinfodayls = proEconWindpowerInfoMonthService.list().stream()
  52. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  53. //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  54. // && i.getLocation().equals(Location.cp.getValue()))
  55. // .collect(Collectors.toList());
  56. // if(!wpinfodayls.isEmpty())
  57. // {
  58. //
  59. // Map<String, Map<String, List<ProEconWindpowerInfoMonth>>>rgmap=new HashMap<>();
  60. //
  61. //
  62. //
  63. //
  64. // for(ProEconWindpowerInfoMonth wpinfo:wpinfodayls)
  65. // {
  66. //
  67. // if(rgmap.containsKey(wpinfo.getCompanyId()))
  68. // {
  69. // Map<String, List<ProEconWindpowerInfoMonth>> map=rgmap.get(wpinfo.getCompanyId());
  70. // List<ProEconWindpowerInfoMonth> qbls=map.get("qb");
  71. // List<ProEconWindpowerInfoMonth> gfls=map.get("fd");
  72. // List<ProEconWindpowerInfoMonth> fdls=map.get("gf");
  73. //
  74. // if(wpinfo.getForeignKeyId().equals("-1"))
  75. // {
  76. // fdls.add(wpinfo);
  77. // }else if(wpinfo.getForeignKeyId().equals("-2")){
  78. // gfls.add(wpinfo);
  79. // }
  80. // qbls.add(wpinfo);
  81. // }else
  82. // {
  83. // Map<String, List<ProEconWindpowerInfoMonth>> map=new HashMap<>();
  84. //
  85. // List<ProEconWindpowerInfoMonth> qbls=new ArrayList<>();
  86. // List<ProEconWindpowerInfoMonth> gfls=new ArrayList<>();
  87. // List<ProEconWindpowerInfoMonth> fdls=new ArrayList<>();
  88. //
  89. // if(wpinfo.getForeignKeyId().equals("-1"))
  90. // {
  91. // fdls.add(wpinfo);
  92. // }else if(wpinfo.getForeignKeyId().equals("-2")){
  93. // gfls.add(wpinfo);
  94. // }
  95. // qbls.add(wpinfo);
  96. // map.put("qb",qbls);
  97. // map.put("fd",fdls);
  98. // map.put("gf",gfls);
  99. // }
  100. // }
  101. //
  102. //
  103. // //判断是否有重复记录,先删除重复记录
  104. // List<String> idls = proEconWindpowerInfoMonthService.list().stream()
  105. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  106. //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  107. // && i.getLocation().equals(Location.rg.getValue())).map(ProEconWindpowerInfoMonth::getId)
  108. // .collect(Collectors.toList());
  109. //
  110. // if (idls != null && idls.size() > 0) {
  111. //
  112. // proEconWindpowerInfoMonthService.removeByIds(idls);
  113. //
  114. // }
  115. // for(Map.Entry<String, Map<String, List<ProEconWindpowerInfoMonth>>> entry:rgmap.entrySet()){
  116. // Map<String, List<ProEconWindpowerInfoMonth>> map=entry.getValue();
  117. // List<ProEconWindpowerInfoMonth> qbls=map.get("qb");
  118. // List<ProEconWindpowerInfoMonth> gfls=map.get("fd");
  119. // List<ProEconWindpowerInfoMonth> fdls=map.get("gf");
  120. //// if(CacheContext.cpwpmap.size()==qbls.size())
  121. //// {
  122. //
  123. // ProEconWindpowerInfoMonth qb=new ProEconWindpowerInfoMonth();
  124. // ProEconWindpowerInfoMonth fd=new ProEconWindpowerInfoMonth();
  125. // ProEconWindpowerInfoMonth gf=new ProEconWindpowerInfoMonth();
  126. //
  127. // if(CacheContext.rgmap.containsKey(entry.getKey()))
  128. // {
  129. // ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
  130. // gf.setRegionId(cp.getId());
  131. //
  132. // gf.setRecordDate(DateUtils.truncDay(recordDate));
  133. // gf.setForeignKeyId("-2");
  134. // gf.setLocation(Location.rg.getValue());
  135. //
  136. // fd.setRegionId(cp.getId());
  137. //
  138. // fd.setRecordDate(DateUtils.truncDay(recordDate));
  139. // fd.setForeignKeyId("-1");
  140. // fd.setLocation(Location.rg.getValue());
  141. //
  142. // qb.setRegionId(cp.getId());
  143. //
  144. // qb.setRecordDate(DateUtils.truncDay(recordDate));
  145. // qb.setForeignKeyId("0");
  146. // qb.setLocation(Location.rg.getValue());
  147. //
  148. // //计算区域级全部
  149. // calCp(qb,qbls);
  150. // //计算公司级风电场站
  151. // calCp(fd,fdls);
  152. // //计算公司级光电场站
  153. // calCp(gf,gfls);
  154. //
  155. // proEconWindpowerInfoMonthService.save(qb);
  156. // proEconWindpowerInfoMonthService.save(fd);
  157. // proEconWindpowerInfoMonthService.save(gf);
  158. // }
  159. //
  160. //
  161. //// }else
  162. //// {
  163. //// logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
  164. ////
  165. //// }
  166. //
  167. //
  168. //
  169. //
  170. //
  171. // };
  172. // }
  173. //
  174. // }
  175. //
  176. // /**
  177. // * 计算公司日信息
  178. // * @param recordDate
  179. // * @throws Exception
  180. // */
  181. // public void calCompanyInfoDay(Date recordDate) throws Exception {
  182. //
  183. // List<ProEconWindpowerInfoMonth> wpinfodayls = proEconWindpowerInfoMonthService.list().stream()
  184. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  185. //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  186. // && i.getLocation().equals(Location.wp.getValue()))
  187. // .collect(Collectors.toList());
  188. // if(!wpinfodayls.isEmpty())
  189. // {
  190. //
  191. // Map<String, Map<String, List<ProEconWindpowerInfoMonth>>>cpmap=new HashMap<>();
  192. //
  193. //
  194. //
  195. //
  196. // for(ProEconWindpowerInfoMonth wpinfo:wpinfodayls)
  197. // {
  198. //
  199. // if(cpmap.containsKey(wpinfo.getCompanyId()))
  200. // {
  201. // Map<String, List<ProEconWindpowerInfoMonth>> map=cpmap.get(wpinfo.getCompanyId());
  202. // List<ProEconWindpowerInfoMonth> qbls=map.get("qb");
  203. // List<ProEconWindpowerInfoMonth> gfls=map.get("fd");
  204. // List<ProEconWindpowerInfoMonth> fdls=map.get("gf");
  205. //
  206. // if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
  207. // {
  208. // fdls.add(wpinfo);
  209. // }else {
  210. // gfls.add(wpinfo);
  211. // }
  212. // qbls.add(wpinfo);
  213. // }else
  214. // {
  215. // Map<String, List<ProEconWindpowerInfoMonth>> map=new HashMap<>();
  216. //
  217. // List<ProEconWindpowerInfoMonth> qbls=new ArrayList<>();
  218. // List<ProEconWindpowerInfoMonth> gfls=new ArrayList<>();
  219. // List<ProEconWindpowerInfoMonth> fdls=new ArrayList<>();
  220. //
  221. // if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
  222. // {
  223. // fdls.add(wpinfo);
  224. // }else {
  225. // gfls.add(wpinfo);
  226. // }
  227. // qbls.add(wpinfo);
  228. // map.put("qb",qbls);
  229. // map.put("fd",fdls);
  230. // map.put("gf",gfls);
  231. // }
  232. // }
  233. //
  234. //
  235. // //判断是否有重复记录,先删除重复记录
  236. // List<String> idls = proEconWindpowerInfoMonthService.list().stream()
  237. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  238. //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  239. // && i.getLocation().equals(Location.cp.getValue())).map(ProEconWindpowerInfoMonth::getId)
  240. // .collect(Collectors.toList());
  241. //
  242. // if (idls != null && idls.size() > 0) {
  243. //
  244. // proEconWindpowerInfoMonthService.removeByIds(idls);
  245. //
  246. // }
  247. // for(Map.Entry<String, Map<String, List<ProEconWindpowerInfoMonth>>> entry:cpmap.entrySet()){
  248. // Map<String, List<ProEconWindpowerInfoMonth>> map=entry.getValue();
  249. // List<ProEconWindpowerInfoMonth> qbls=map.get("qb");
  250. // List<ProEconWindpowerInfoMonth> gfls=map.get("fd");
  251. // List<ProEconWindpowerInfoMonth> fdls=map.get("gf");
  252. //// if(CacheContext.cpwpmap.size()==qbls.size())
  253. //// {
  254. //
  255. // ProEconWindpowerInfoMonth qb=new ProEconWindpowerInfoMonth();
  256. // ProEconWindpowerInfoMonth fd=new ProEconWindpowerInfoMonth();
  257. // ProEconWindpowerInfoMonth gf=new ProEconWindpowerInfoMonth();
  258. //
  259. // if(CacheContext.cpmap.containsKey(entry.getKey()))
  260. // {
  261. // ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
  262. // gf.setRegionId(cp.getRegionId());
  263. // gf.setCompanyId(cp.getId());
  264. // gf.setRecordDate(DateUtils.truncDay(recordDate));
  265. // gf.setForeignKeyId("-2");
  266. // gf.setLocation(Location.cp.getValue());
  267. //
  268. //
  269. //
  270. // fd.setRegionId(cp.getRegionId());
  271. // fd.setCompanyId(cp.getId());
  272. // fd.setRecordDate(DateUtils.truncDay(recordDate));
  273. // fd.setForeignKeyId("-1");
  274. // fd.setLocation(Location.cp.getValue());
  275. //
  276. // qb.setRegionId(cp.getRegionId());
  277. // qb.setCompanyId(cp.getId());
  278. // qb.setRecordDate(DateUtils.truncDay(recordDate));
  279. // qb.setForeignKeyId("0");
  280. // qb.setLocation(Location.cp.getValue());
  281. //
  282. // //计算公司级全部场站
  283. // calCp(qb,qbls);
  284. // //计算公司级风电场站
  285. // calCp(fd,fdls);
  286. // //计算公司级光电场站
  287. // calCp(gf,gfls);
  288. //
  289. // proEconWindpowerInfoMonthService.save(qb);
  290. // proEconWindpowerInfoMonthService.save(fd);
  291. // proEconWindpowerInfoMonthService.save(gf);
  292. // }
  293. //
  294. //
  295. //// }else
  296. //// {
  297. //// logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
  298. ////
  299. //// }
  300. //
  301. //
  302. //
  303. //
  304. //
  305. // };
  306. // }
  307. //
  308. // }
  309. //
  310. // private void calCp(ProEconWindpowerInfoMonth pewp,List<ProEconWindpowerInfoMonth> ls) throws Exception {
  311. //
  312. // if(!ls.isEmpty())
  313. // {
  314. // DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(n -> n.getYzdfs()).summaryStatistics();
  315. // //日最大风速
  316. // pewp.setYzdfs(summaryStatistics.getMax());
  317. // //日最小风速
  318. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzxfs()).summaryStatistics();
  319. // pewp.setYzxfs(summaryStatistics.getMin());
  320. // //日平均风速
  321. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYpjfs()).summaryStatistics();
  322. // pewp.setYpjfs(summaryStatistics.getAverage());
  323. //
  324. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzdgl()).summaryStatistics();
  325. // //日最大功率
  326. // pewp.setYzdgl(summaryStatistics.getMax());
  327. // //日最小功率
  328. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzxgl()).summaryStatistics();
  329. // pewp.setYzxgl(summaryStatistics.getMin());
  330. // //日平均功率
  331. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYpjgl()).summaryStatistics();
  332. // pewp.setYpjgl(summaryStatistics.getAverage());
  333. //
  334. //
  335. // //日发电量
  336. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYfdl()).summaryStatistics();
  337. // pewp.setYfdl(StringUtils.round(summaryStatistics.getSum(),2));
  338. //
  339. // //日可用电量
  340. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYkydl()).summaryStatistics();
  341. // pewp.setYkydl(StringUtils.round(summaryStatistics.getSum(),2));
  342. //
  343. //
  344. // //日理论发电量
  345. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYllfdl()).summaryStatistics();
  346. // pewp.setYllfdl(StringUtils.round(summaryStatistics.getSum(),2));
  347. //
  348. //
  349. // //日故障损失电量
  350. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYgzssdl()).summaryStatistics();
  351. // pewp.setYgzssdl(StringUtils.round(summaryStatistics.getSum(),2));
  352. //
  353. //
  354. // //日场内受累故障损失电量
  355. //
  356. // pewp.setYcnslgzssdl(StringUtils.round(summaryStatistics.getSum(),2));
  357. //
  358. // //日检修损失电量
  359. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYjxssdl()).summaryStatistics();
  360. // pewp.setYjxssdl(StringUtils.round(summaryStatistics.getSum(),2));
  361. //
  362. // //日场内受累检修损失电量
  363. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYcnsljxssdl()).summaryStatistics();
  364. // pewp.setYcnsljxssdl(StringUtils.round(summaryStatistics.getSum(),2));
  365. //
  366. //
  367. // //日待机损失电量
  368. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYdjssdl()).summaryStatistics();
  369. // pewp.setYdjssdl(StringUtils.round(summaryStatistics.getSum(),2));
  370. //
  371. // //日缺陷降出力损失电量
  372. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYqxjclssdl()).summaryStatistics();
  373. // pewp.setYqxjclssdl(StringUtils.round(summaryStatistics.getSum(),2));
  374. //
  375. // //日手动停机损失电量
  376. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYsdtjssdl()).summaryStatistics();
  377. // pewp.setYsdtjssdl(StringUtils.round(summaryStatistics.getSum(),2));
  378. //
  379. // //日性能损失电量
  380. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYxnssdl()).summaryStatistics();
  381. // pewp.setYxnssdl(StringUtils.round(summaryStatistics.getSum(),2));
  382. //
  383. // //日限电停机损失电量
  384. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYxdtjssdl()).summaryStatistics();
  385. // pewp.setYxdtjssdl(StringUtils.round(summaryStatistics.getSum(),2));
  386. //
  387. // //日限电降出力损失电量
  388. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYxdjclssdl()).summaryStatistics();
  389. // pewp.setYxdjclssdl(StringUtils.round(summaryStatistics.getSum(),2));
  390. //
  391. //
  392. // //日场外受累电网损失电量
  393. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYcwsldwssdl()).summaryStatistics();
  394. // pewp.setYcwsldwssdl(StringUtils.round(summaryStatistics.getSum(),2));
  395. //
  396. //
  397. // //日场外受累天气损失电量
  398. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYcwsltqssdl()).summaryStatistics();
  399. // pewp.setYcwsltqssdl(StringUtils.round(summaryStatistics.getSum(),2));
  400. //
  401. // //日增发电量
  402. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzfdl()).summaryStatistics();
  403. // pewp.setYzfdl(StringUtils.round(summaryStatistics.getSum(),2));
  404. //
  405. // //日欠发电量
  406. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYqfdl()).summaryStatistics();
  407. // pewp.setYqfdl(StringUtils.round(summaryStatistics.getSum(),2));
  408. //
  409. // //日自耗电
  410. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzhd()).summaryStatistics();
  411. // pewp.setYzhd(StringUtils.round(summaryStatistics.getSum(),2));
  412. //
  413. //
  414. // double rfdlsyz=0.0;
  415. // double rswdlsyz=0.0;
  416. // double rgwgwdlsyz=0.0;
  417. // double rnwgwdlsyz=0.0;
  418. //
  419. // //日发电量(升压站)
  420. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYfdldb()).summaryStatistics();
  421. // rfdlsyz=StringUtils.round(summaryStatistics.getSum(),2);
  422. // pewp.setYfdldb(rfdlsyz);
  423. //
  424. // //日上网电量
  425. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYswdldb()).summaryStatistics();
  426. // rswdlsyz=StringUtils.round(summaryStatistics.getSum(),2);
  427. // pewp.setYswdldb(rswdlsyz);
  428. //
  429. // //日工网购网电量
  430. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYgwgwdldb()).summaryStatistics();
  431. // rgwgwdlsyz=StringUtils.round(summaryStatistics.getSum(),2);
  432. // pewp.setYgwgwdldb(rgwgwdlsyz);
  433. //
  434. //
  435. // //日农网购网电量
  436. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYnwgwdldb()).summaryStatistics();
  437. // rnwgwdlsyz=StringUtils.round(summaryStatistics.getSum(),2);
  438. // pewp.setYnwgwdldb(rnwgwdlsyz);
  439. //
  440. //
  441. // //日综合场用电量(电表)
  442. // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2));
  443. //
  444. //
  445. // //日厂用电量
  446. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYfdcydldb()).summaryStatistics();
  447. // pewp.setYfdcydldb(StringUtils.round(summaryStatistics.getSum(),2));
  448. //
  449. //
  450. //
  451. // //日最大功率(出线)
  452. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzdglcx()).summaryStatistics();
  453. // pewp.setYzdglcx(summaryStatistics.getMax());
  454. // //日最小功率(出线)
  455. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzxglcx()).summaryStatistics();
  456. // pewp.setYzxglcx(summaryStatistics.getMin());
  457. // //日平均功率(出线)
  458. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYpjglcx()).summaryStatistics();
  459. // pewp.setYpjglcx(summaryStatistics.getAverage());
  460. //
  461. //
  462. //
  463. // //日合计待机小时
  464. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjxs()).summaryStatistics();
  465. // pewp.setYhjdjxs(StringUtils.round(summaryStatistics.getSum(),2));
  466. // //日合计维护停机小时
  467. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjjxtjxs()).summaryStatistics();
  468. // pewp.setYhjjxtjxs(StringUtils.round(summaryStatistics.getSum(),2));
  469. // // 日合计待机小时
  470. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjxs()).summaryStatistics();
  471. // pewp.setYhjdjxs(StringUtils.round(summaryStatistics.getSum(),2));
  472. // //日合计运行小时
  473. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjyxxs()).summaryStatistics();
  474. // pewp.setYhjyxxs(StringUtils.round(summaryStatistics.getSum(),2));
  475. // //日合计限电小时
  476. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdxs()).summaryStatistics();
  477. // pewp.setYhjxdxs(StringUtils.round(summaryStatistics.getSum(),2));
  478. // //日合计通讯中断小时
  479. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjtxzdxs()).summaryStatistics();
  480. // pewp.setYhjtxzdxs(StringUtils.round(summaryStatistics.getSum(),2));
  481. //
  482. //
  483. // //日合计故障次数
  484. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjcs()).summaryStatistics();
  485. // pewp.setYhjdjcs(StringUtils.round(summaryStatistics.getSum(),2));
  486. // //日合计检修次数
  487. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjjxtjcs()).summaryStatistics();
  488. // pewp.setYhjjxtjcs(StringUtils.round(summaryStatistics.getSum(),2));
  489. // //日合计待机次数
  490. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjcs()).summaryStatistics();
  491. // pewp.setYhjdjcs(StringUtils.round(summaryStatistics.getSum(),2));
  492. // //日合计性能次数
  493. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjyxcs()).summaryStatistics();
  494. // pewp.setYhjyxcs(StringUtils.round(summaryStatistics.getSum(),2));
  495. // //日合计限电停机次数
  496. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdcs()).summaryStatistics();
  497. // pewp.setYhjxdcs(StringUtils.round(summaryStatistics.getSum(),2));
  498. // //日合计通讯中断次数
  499. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjtxzdcs()).summaryStatistics();
  500. // pewp.setYhjtxzdcs(StringUtils.round(summaryStatistics.getSum(),2));
  501. //
  502. //
  503. // //日合计故障小时(明细)
  504. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjgzxsmx()).summaryStatistics();
  505. // pewp.setYhjgzxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  506. // //日合计场内受累故障小时(明细)
  507. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcnslgzxsmx()).summaryStatistics();
  508. // pewp.setYhjcnslgzxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  509. // //日合计检修小时(明细)
  510. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjjxxsmx()).summaryStatistics();
  511. // pewp.setYhjjxxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  512. // //日合计场内受累检修小时(明细)
  513. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcnsljxxsmx()).summaryStatistics();
  514. // pewp.setYhjcnsljxxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  515. // //日合计待机小时(明细)
  516. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjxsmx()).summaryStatistics();
  517. // pewp.setYhjdjxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  518. // //日合计缺陷降出力小时(明细)
  519. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjqxjclxsmx()).summaryStatistics();
  520. // pewp.setYhjqxjclxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  521. // //日合计手动停机小时(明细)
  522. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjsdtjxsmx()).summaryStatistics();
  523. // pewp.setYhjsdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  524. // //日合计性能小时(明细)
  525. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxnxsmx()).summaryStatistics();
  526. // pewp.setYhjxnxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  527. // //日合计限电停机小时(明细)
  528. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdtjxsmx()).summaryStatistics();
  529. // pewp.setYhjxdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  530. // //日合计限电降出力小时(明细)
  531. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdjclxsmx()).summaryStatistics();
  532. // pewp.setYhjxdjclxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  533. // //日合计场外受累电网小时(明细)
  534. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcwsldwxsmx()).summaryStatistics();
  535. // pewp.setYhjcwsldwxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  536. // //日合计场外受累电网小时(明细)
  537. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcwsltqxsmx()).summaryStatistics();
  538. // pewp.setYhjcwsltqxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  539. // //日合计通讯中断小时(明细)
  540. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjtxzdxsmx()).summaryStatistics();
  541. // pewp.setYhjtxzdxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  542. // //日合计离线小时(明细)
  543. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjlxxsmx()).summaryStatistics();
  544. // pewp.setYhjlxxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  545. //
  546. //
  547. // //日合计故障次数(明细)
  548. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjgzcsmx()).summaryStatistics();
  549. // pewp.setYhjgzcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  550. // //日合计场内受累故障次数(明细)
  551. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcnslgzcsmx()).summaryStatistics();
  552. // pewp.setYhjcnslgzcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  553. // //日合计检修次数(明细)
  554. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjjxcsmx()).summaryStatistics();
  555. // pewp.setYhjjxcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  556. // //日合计场内受累检修次数(明细)
  557. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcnsljxcsmx()).summaryStatistics();
  558. // pewp.setYhjcnsljxcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  559. // //日合计待机次数(明细)
  560. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjcsmx()).summaryStatistics();
  561. // pewp.setYhjdjcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  562. // //日合计缺陷降出力次数(明细)
  563. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjqxjclcsmx()).summaryStatistics();
  564. // pewp.setYhjqxjclcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  565. // //日合计手动停机次数(明细)
  566. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjsdtjcsmx()).summaryStatistics();
  567. // pewp.setYhjsdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  568. // //日合计性能次数(明细)
  569. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxncsmx()).summaryStatistics();
  570. // pewp.setYhjxncsmx(StringUtils.round(summaryStatistics.getSum(),2));
  571. // //日合计限电停机次数(明细)
  572. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdtjcsmx()).summaryStatistics();
  573. // pewp.setYhjxdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  574. // //日合计限电降出力次数(明细)
  575. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdjclcsmx()).summaryStatistics();
  576. // pewp.setYhjxdjclcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  577. // //日合计场外受累电网次数(明细)
  578. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcwsldwcsmx()).summaryStatistics();
  579. // pewp.setYhjcwsldwcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  580. // //日合计场外受累电网次数(明细)
  581. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcwsltqcsmx()).summaryStatistics();
  582. // pewp.setYhjcwsltqcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  583. // //日合计通讯中断次数(明细)
  584. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjtxzdcsmx()).summaryStatistics();
  585. // pewp.setYhjtxzdcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  586. // //日合计离线次数(明细)
  587. // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjlxcsmx()).summaryStatistics();
  588. // pewp.setYhjlxcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  589. // }
  590. // }
  591. // /**
  592. // * 计算场站日信息
  593. // * @param recordDate
  594. // * @throws Exception
  595. // */
  596. // public void calWindpowerInfoDay(Date recordDate) throws Exception {
  597. // Calendar c=Calendar.getInstance();
  598. // c.setTime(recordDate);
  599. //
  600. // Date end=c.getTime();
  601. //
  602. // Date begin= DateUtils.truncDay(c.getTime());
  603. //
  604. //
  605. //
  606. // //判断是否有重复记录,先删除重复记录
  607. // List<String> idls = proEconWindpowerInfoMonthService.list().stream()
  608. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  609. // && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  610. // && i.getLocation().equals(Location.wp.getValue())).map(ProEconWindpowerInfoMonth::getId)
  611. // .collect(Collectors.toList());
  612. //
  613. // if (idls != null && idls.size() > 0) {
  614. //
  615. // proEconWindpowerInfoMonthService.removeByIds(idls);
  616. //
  617. // }
  618. // for(ProBasicWindpowerstation wp:CacheContext.wpls)
  619. // {
  620. // if(CacheContext.wppointmap.containsKey(wp.getId()))
  621. // {
  622. // Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(wp.getId());
  623. //
  624. // ProEconWindpowerInfoMonth pewp=new ProEconWindpowerInfoMonth();
  625. // Initial.initial(pewp);
  626. // pewp.setRegionId(wp.getRegionId());
  627. // pewp.setCompanyId(wp.getCompanyId());
  628. // pewp.setRecordDate(DateUtils.truncDay(recordDate));
  629. // pewp.setForeignKeyId("0");
  630. // pewp.setWindpowerstationId(wp.getId());
  631. // pewp.setLocation(Location.wp.getValue());
  632. // if(pointmap.containsKey(ContantXk.SSPJFS));
  633. // {
  634. // ProBasicWppoint point=pointmap.get(ContantXk.SSPJFS);
  635. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  636. // if(!pointls.isEmpty())
  637. // {
  638. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  639. // //日最大风速
  640. // pewp.setYzdfs(summaryStatistics.getMax());
  641. // //日最小风速
  642. // pewp.setYzxfs(summaryStatistics.getMin());
  643. // //日平均风速
  644. // pewp.setYpjfs(summaryStatistics.getAverage());
  645. // }
  646. //
  647. // }
  648. //
  649. // if(pointmap.containsKey(ContantXk.SSZGL));
  650. // {
  651. // ProBasicWppoint point=pointmap.get(ContantXk.SSZGL);
  652. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  653. // if(!pointls.isEmpty())
  654. // {
  655. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  656. // //日最大功率
  657. // pewp.setYzdgl(summaryStatistics.getMax());
  658. // //日最小功率
  659. // pewp.setYzxgl(summaryStatistics.getMin());
  660. // //日平均功率
  661. // pewp.setYpjgl(summaryStatistics.getAverage());
  662. // }
  663. // }
  664. //
  665. //
  666. // if(pointmap.containsKey(ContantXk.RFDL));
  667. // {
  668. // ProBasicWppoint point=pointmap.get(ContantXk.RFDL);
  669. //
  670. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  671. // if(StringUtils.notEmp(pointValue))
  672. // {
  673. // //日发电量
  674. // pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  675. //
  676. // }
  677. // }
  678. // if(pointmap.containsKey(ContantXk.RKYDL));
  679. // {
  680. // ProBasicWppoint point=pointmap.get(ContantXk.RKYDL);
  681. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  682. // if(StringUtils.notEmp(pointValue))
  683. // {
  684. // //日可用电量
  685. // pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  686. //
  687. // }
  688. // }
  689. //
  690. //
  691. // if(pointmap.containsKey(ContantXk.RLLFDL));
  692. // {
  693. // ProBasicWppoint point=pointmap.get(ContantXk.RLLFDL);
  694. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  695. // if(StringUtils.notEmp(pointValue))
  696. // {
  697. // //日理论发电量
  698. // pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  699. //
  700. // }
  701. // }
  702. //
  703. //
  704. //
  705. //
  706. // if(pointmap.containsKey(ContantXk.RGZSSDL));
  707. // {
  708. // ProBasicWppoint point=pointmap.get(ContantXk.RGZSSDL);
  709. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  710. // if(StringUtils.notEmp(pointValue))
  711. // {
  712. // //日故障损失电量
  713. // pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  714. //
  715. // }
  716. // }
  717. // if(pointmap.containsKey(ContantXk.RCNSLGZSSDL));
  718. // {
  719. // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLGZSSDL);
  720. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  721. // if(StringUtils.notEmp(pointValue))
  722. // {
  723. // //日场内受累故障损失电量
  724. // pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  725. //
  726. // }
  727. // }
  728. //
  729. // if(pointmap.containsKey(ContantXk.RJXSSDL));
  730. // {
  731. // ProBasicWppoint point=pointmap.get(ContantXk.RJXSSDL);
  732. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  733. // if(StringUtils.notEmp(pointValue))
  734. // {
  735. // //日检修损失电量
  736. // pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  737. //
  738. // }
  739. // }
  740. //
  741. // if(pointmap.containsKey(ContantXk.RCNSLJXSSDL));
  742. // {
  743. // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLJXSSDL);
  744. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  745. // if(StringUtils.notEmp(pointValue))
  746. // {
  747. // //日场内受累检修损失电量
  748. // pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  749. //
  750. // }
  751. // }
  752. //
  753. // if(pointmap.containsKey(ContantXk.RDJSSDL));
  754. // {
  755. // ProBasicWppoint point=pointmap.get(ContantXk.RDJSSDL);
  756. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  757. // if(StringUtils.notEmp(pointValue))
  758. // {
  759. // //日待机损失电量
  760. // pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  761. //
  762. // }
  763. // }
  764. // if(pointmap.containsKey(ContantXk.RQXJCLSSDL));
  765. // {
  766. // ProBasicWppoint point=pointmap.get(ContantXk.RQXJCLSSDL);
  767. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  768. // if(StringUtils.notEmp(pointValue))
  769. // {
  770. // //日缺陷降出力损失电量
  771. // pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  772. //
  773. // }
  774. // }
  775. // if(pointmap.containsKey(ContantXk.RSDTJSSDL));
  776. // {
  777. // ProBasicWppoint point=pointmap.get(ContantXk.RSDTJSSDL);
  778. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  779. // if(StringUtils.notEmp(pointValue))
  780. // {
  781. // //日手动停机损失电量
  782. // pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  783. //
  784. // }
  785. // }
  786. // if(pointmap.containsKey(ContantXk.RXNSSDL));
  787. // {
  788. // ProBasicWppoint point=pointmap.get(ContantXk.RXNSSDL);
  789. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  790. // if(StringUtils.notEmp(pointValue))
  791. // {
  792. // //日性能损失电量
  793. // pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  794. //
  795. // }
  796. // }
  797. //
  798. // if(pointmap.containsKey(ContantXk.RXDTJSSDL));
  799. // {
  800. // ProBasicWppoint point=pointmap.get(ContantXk.RXDTJSSDL);
  801. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  802. // if(StringUtils.notEmp(pointValue))
  803. // {
  804. // //日限电停机损失电量
  805. // pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  806. //
  807. // }
  808. // }
  809. //
  810. //
  811. // if(pointmap.containsKey(ContantXk.RXDJCLSSDL));
  812. // {
  813. // ProBasicWppoint point=pointmap.get(ContantXk.RXDJCLSSDL);
  814. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  815. // if(StringUtils.notEmp(pointValue))
  816. // {
  817. // //日限电降出力损失电量
  818. // pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  819. //
  820. // }
  821. // }
  822. //
  823. // if(pointmap.containsKey(ContantXk.RCWSLDWSSDL));
  824. // {
  825. // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLDWSSDL);
  826. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  827. // if(StringUtils.notEmp(pointValue))
  828. // {
  829. // //日场外受累电网损失电量
  830. // pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  831. //
  832. // }
  833. // }
  834. // if(pointmap.containsKey(ContantXk.RCWSLTQSSDL));
  835. // {
  836. // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLTQSSDL);
  837. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  838. // if(StringUtils.notEmp(pointValue))
  839. // {
  840. // //日场外受累天气损失电量
  841. // pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  842. //
  843. // }
  844. // }
  845. //
  846. // if(pointmap.containsKey(ContantXk.RZFDL));
  847. // {
  848. // ProBasicWppoint point=pointmap.get(ContantXk.RZFDL);
  849. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  850. // if(StringUtils.notEmp(pointValue))
  851. // {
  852. // //日增发电量
  853. // pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  854. //
  855. // }
  856. // }
  857. //
  858. // if(pointmap.containsKey(ContantXk.RQFDL));
  859. // {
  860. // ProBasicWppoint point=pointmap.get(ContantXk.RQFDL);
  861. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  862. // if(StringUtils.notEmp(pointValue))
  863. // {
  864. // //日欠发电量
  865. // pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  866. //
  867. // }
  868. // }
  869. // if(pointmap.containsKey(ContantXk.RZHD));
  870. // {
  871. // ProBasicWppoint point=pointmap.get(ContantXk.RZHD);
  872. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  873. // if(StringUtils.notEmp(pointValue))
  874. // {
  875. // //日自耗电
  876. // pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
  877. //
  878. // }
  879. // }
  880. //
  881. // double rfdlsyz=0.0;
  882. // double rswdlsyz=0.0;
  883. // double rgwgwdlsyz=0.0;
  884. // double rnwgwdlsyz=0.0;
  885. // if(pointmap.containsKey(ContantXk.RFDLSYZ));
  886. // {
  887. // ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ);
  888. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  889. // if(StringUtils.notEmp(pointValue))
  890. // {
  891. // //日发电量(升压站)
  892. // rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  893. // pewp.setYfdldb(rfdlsyz);
  894. //
  895. // }
  896. // }
  897. //
  898. // if(pointmap.containsKey(ContantXk.RSWDL));
  899. // {
  900. // ProBasicWppoint point=pointmap.get(ContantXk.RSWDL);
  901. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  902. // if(StringUtils.notEmp(pointValue))
  903. // {
  904. // //日上网电量
  905. // rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  906. // pewp.setYswdldb(rswdlsyz);
  907. //
  908. // }
  909. // }
  910. //
  911. // if(pointmap.containsKey(ContantXk.RGWGWDL));
  912. // {
  913. // ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL);
  914. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  915. // if(StringUtils.notEmp(pointValue))
  916. // {
  917. // //日工网购网电量
  918. // rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  919. // pewp.setYgwgwdldb(rgwgwdlsyz);
  920. //
  921. // }
  922. // }
  923. //
  924. // if(pointmap.containsKey(ContantXk.RNWGWDL));
  925. // {
  926. // ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL);
  927. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  928. // if(StringUtils.notEmp(pointValue))
  929. // {
  930. // //日农网购网电量
  931. // rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  932. // pewp.setYnwgwdldb(rnwgwdlsyz);
  933. //
  934. // }
  935. // }
  936. //
  937. // //日综合场用电量(电表)
  938. // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2));
  939. //
  940. //
  941. // if(pointmap.containsKey(ContantXk.RCYDL));
  942. // {
  943. // ProBasicWppoint point=pointmap.get(ContantXk.RCYDL);
  944. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  945. // if(StringUtils.notEmp(pointValue))
  946. // {
  947. // //日厂用电量
  948. // pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
  949. //
  950. // }
  951. // }
  952. //
  953. // if(pointmap.containsKey(ContantXk.TPOINT_WP_CXGL));
  954. // {
  955. // ProBasicWppoint point=pointmap.get(ContantXk.TPOINT_WP_CXGL);
  956. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  957. // if(!pointls.isEmpty())
  958. // {
  959. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  960. // //日最大功率(出线)
  961. // pewp.setYzdglcx(summaryStatistics.getMax());
  962. // //日最小功率(出线)
  963. // pewp.setYzxglcx(summaryStatistics.getMin());
  964. // //日平均功率(出线)
  965. // pewp.setYpjglcx(summaryStatistics.getAverage());
  966. // }
  967. //
  968. // }
  969. //
  970. // List<ProEconWindpowerInfoDay> wpinfodayls = proEconWindpowerInfoDayService.list().stream()
  971. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  972. //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  973. // && i.getLocation().equals(Location.wp.getValue()))
  974. // .collect(Collectors.toList());
  975. // //统计14种状态明细指标的时长和次数
  976. // calDetiall(pewp,recordDate,wpinfodayls);
  977. // //统计7种状态指标的时长和次数
  978. // calSimple(pewp,recordDate,wpinfodayls);
  979. //
  980. // proEconWindpowerInfoMonthService.save(pewp);
  981. //
  982. //
  983. //// wpinfodayls.add(pewp);
  984. // proEconWindpowerInfoMonthService.save(pewp);
  985. //
  986. // }
  987. //
  988. //
  989. // }
  990. //
  991. // }
  992. //
  993. //
  994. //
  995. //
  996. // /**
  997. // * 计算项目日信息
  998. // * @param recordDate
  999. // * @throws Exception
  1000. // */
  1001. // public void calProjectInfoDay(Date recordDate) throws Exception {
  1002. // Calendar c=Calendar.getInstance();
  1003. // c.setTime(recordDate);
  1004. //
  1005. // Date end=c.getTime();
  1006. //
  1007. // Date begin= DateUtils.truncDay(c.getTime());
  1008. //
  1009. // //判断是否有重复记录,先删除重复记录
  1010. // List<String> idls = proEconWindpowerInfoMonthService.list().stream()
  1011. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  1012. // && CacheContext.proMap.containsKey(i.getProjectId())
  1013. // && i.getLocation().equals(Location.pj.getValue())).map(ProEconWindpowerInfoMonth::getId)
  1014. // .collect(Collectors.toList());
  1015. //
  1016. // if (idls != null && idls.size() > 0) {
  1017. //
  1018. // proEconWindpowerInfoMonthService.removeByIds(idls);
  1019. //
  1020. // }
  1021. // for(ProBasicProject wp:CacheContext.projects)
  1022. // {
  1023. // if(CacheContext.wppointmap.containsKey(wp.getId()))
  1024. // {
  1025. // Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(wp.getId());
  1026. //
  1027. // ProEconWindpowerInfoMonth pewp=new ProEconWindpowerInfoMonth();
  1028. // Initial.initial(pewp);
  1029. // pewp.setForeignKeyId("0");
  1030. // pewp.setWindpowerstationId(wp.getWindpowerstationId());
  1031. // pewp.setProjectId(wp.getId());
  1032. // pewp.setLocation(Location.pj.getValue());
  1033. // pewp.setRecordDate(DateUtils.truncDay(recordDate));
  1034. // if(pointmap.containsKey(ContantXk.SSPJFS));
  1035. // {
  1036. // ProBasicWppoint point=pointmap.get(ContantXk.SSPJFS);
  1037. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  1038. // if(!pointls.isEmpty())
  1039. // {
  1040. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  1041. // //日最大风速
  1042. // pewp.setYzdfs(summaryStatistics.getMax());
  1043. // //日最小风速
  1044. // pewp.setYzxfs(summaryStatistics.getMin());
  1045. // //日平均风速
  1046. // pewp.setYpjfs(summaryStatistics.getAverage());
  1047. // }
  1048. //
  1049. // }
  1050. //
  1051. // if(pointmap.containsKey(ContantXk.SSZGL));
  1052. // {
  1053. // ProBasicWppoint point=pointmap.get(ContantXk.SSZGL);
  1054. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  1055. // if(!pointls.isEmpty())
  1056. // {
  1057. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  1058. // //日最大功率
  1059. // pewp.setYzdgl(summaryStatistics.getMax());
  1060. // //日最小功率
  1061. // pewp.setYzxgl(summaryStatistics.getMin());
  1062. // //日平均功率
  1063. // pewp.setYpjgl(summaryStatistics.getAverage());
  1064. // }
  1065. // }
  1066. //
  1067. //
  1068. // if(pointmap.containsKey(ContantXk.RFDL));
  1069. // {
  1070. // ProBasicWppoint point=pointmap.get(ContantXk.RFDL);
  1071. //
  1072. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1073. // if(StringUtils.notEmp(pointValue))
  1074. // {
  1075. // //日发电量
  1076. // pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1077. //
  1078. // }
  1079. // }
  1080. // if(pointmap.containsKey(ContantXk.RKYDL));
  1081. // {
  1082. // ProBasicWppoint point=pointmap.get(ContantXk.RKYDL);
  1083. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1084. // if(StringUtils.notEmp(pointValue))
  1085. // {
  1086. // //日可用电量
  1087. // pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1088. //
  1089. // }
  1090. // }
  1091. //
  1092. //
  1093. //
  1094. //
  1095. // if(pointmap.containsKey(ContantXk.RLLFDL));
  1096. // {
  1097. // ProBasicWppoint point=pointmap.get(ContantXk.RLLFDL);
  1098. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1099. // if(StringUtils.notEmp(pointValue))
  1100. // {
  1101. // //日理论发电量
  1102. // pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1103. //
  1104. // }
  1105. // }
  1106. //
  1107. //
  1108. // if(pointmap.containsKey(ContantXk.RGZSSDL));
  1109. // {
  1110. // ProBasicWppoint point=pointmap.get(ContantXk.RGZSSDL);
  1111. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1112. // if(StringUtils.notEmp(pointValue))
  1113. // {
  1114. // //日故障损失电量
  1115. // pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1116. //
  1117. // }
  1118. // }
  1119. // if(pointmap.containsKey(ContantXk.RCNSLGZSSDL));
  1120. // {
  1121. // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLGZSSDL);
  1122. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1123. // if(StringUtils.notEmp(pointValue))
  1124. // {
  1125. // //日场内受累故障损失电量
  1126. // pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1127. //
  1128. // }
  1129. // }
  1130. //
  1131. // if(pointmap.containsKey(ContantXk.RJXSSDL));
  1132. // {
  1133. // ProBasicWppoint point=pointmap.get(ContantXk.RJXSSDL);
  1134. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1135. // if(StringUtils.notEmp(pointValue))
  1136. // {
  1137. // //日检修损失电量
  1138. // pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1139. //
  1140. // }
  1141. // }
  1142. //
  1143. // if(pointmap.containsKey(ContantXk.RCNSLJXSSDL));
  1144. // {
  1145. // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLJXSSDL);
  1146. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1147. // if(StringUtils.notEmp(pointValue))
  1148. // {
  1149. // //日场内受累检修损失电量
  1150. // pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1151. //
  1152. // }
  1153. // }
  1154. //
  1155. // if(pointmap.containsKey(ContantXk.RDJSSDL));
  1156. // {
  1157. // ProBasicWppoint point=pointmap.get(ContantXk.RDJSSDL);
  1158. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1159. // if(StringUtils.notEmp(pointValue))
  1160. // {
  1161. // //日待机损失电量
  1162. // pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1163. //
  1164. // }
  1165. // }
  1166. // if(pointmap.containsKey(ContantXk.RQXJCLSSDL));
  1167. // {
  1168. // ProBasicWppoint point=pointmap.get(ContantXk.RQXJCLSSDL);
  1169. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1170. // if(StringUtils.notEmp(pointValue))
  1171. // {
  1172. // //日缺陷降出力损失电量
  1173. // pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1174. //
  1175. // }
  1176. // }
  1177. // if(pointmap.containsKey(ContantXk.RSDTJSSDL));
  1178. // {
  1179. // ProBasicWppoint point=pointmap.get(ContantXk.RSDTJSSDL);
  1180. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1181. // if(StringUtils.notEmp(pointValue))
  1182. // {
  1183. // //日手动停机损失电量
  1184. // pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1185. //
  1186. // }
  1187. // }
  1188. // if(pointmap.containsKey(ContantXk.RXNSSDL));
  1189. // {
  1190. // ProBasicWppoint point=pointmap.get(ContantXk.RXNSSDL);
  1191. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1192. // if(StringUtils.notEmp(pointValue))
  1193. // {
  1194. // //日性能损失电量
  1195. // pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1196. //
  1197. // }
  1198. // }
  1199. //
  1200. // if(pointmap.containsKey(ContantXk.RXDTJSSDL));
  1201. // {
  1202. // ProBasicWppoint point=pointmap.get(ContantXk.RXDTJSSDL);
  1203. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1204. // if(StringUtils.notEmp(pointValue))
  1205. // {
  1206. // //日限电停机损失电量
  1207. // pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1208. //
  1209. // }
  1210. // }
  1211. //
  1212. //
  1213. // if(pointmap.containsKey(ContantXk.RXDJCLSSDL));
  1214. // {
  1215. // ProBasicWppoint point=pointmap.get(ContantXk.RXDJCLSSDL);
  1216. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1217. // if(StringUtils.notEmp(pointValue))
  1218. // {
  1219. // //日限电降出力损失电量
  1220. // pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1221. //
  1222. // }
  1223. // }
  1224. //
  1225. // if(pointmap.containsKey(ContantXk.RCWSLDWSSDL));
  1226. // {
  1227. // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLDWSSDL);
  1228. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1229. // if(StringUtils.notEmp(pointValue))
  1230. // {
  1231. // //日场外受累电网损失电量
  1232. // pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1233. //
  1234. // }
  1235. // }
  1236. // if(pointmap.containsKey(ContantXk.RCWSLTQSSDL));
  1237. // {
  1238. // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLTQSSDL);
  1239. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1240. // if(StringUtils.notEmp(pointValue))
  1241. // {
  1242. // //日场外受累天气损失电量
  1243. // pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1244. //
  1245. // }
  1246. // }
  1247. //
  1248. // if(pointmap.containsKey(ContantXk.RZFDL));
  1249. // {
  1250. // ProBasicWppoint point=pointmap.get(ContantXk.RZFDL);
  1251. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1252. // if(StringUtils.notEmp(pointValue))
  1253. // {
  1254. // //日增发电量
  1255. // pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1256. //
  1257. // }
  1258. // }
  1259. //
  1260. // if(pointmap.containsKey(ContantXk.RQFDL));
  1261. // {
  1262. // ProBasicWppoint point=pointmap.get(ContantXk.RQFDL);
  1263. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1264. // if(StringUtils.notEmp(pointValue))
  1265. // {
  1266. // //日欠发电量
  1267. // pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1268. //
  1269. // }
  1270. // }
  1271. // if(pointmap.containsKey(ContantXk.RZHD));
  1272. // {
  1273. // ProBasicWppoint point=pointmap.get(ContantXk.RZHD);
  1274. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1275. // if(StringUtils.notEmp(pointValue))
  1276. // {
  1277. // //日自耗电
  1278. // pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1279. //
  1280. // }
  1281. // }
  1282. //
  1283. // double rfdlsyz=0.0;
  1284. // double rswdlsyz=0.0;
  1285. // double rgwgwdlsyz=0.0;
  1286. // double rnwgwdlsyz=0.0;
  1287. // if(pointmap.containsKey(ContantXk.RFDLSYZ));
  1288. // {
  1289. // ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ);
  1290. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1291. // if(StringUtils.notEmp(pointValue))
  1292. // {
  1293. // //日发电量(升压站)
  1294. // rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  1295. // pewp.setYfdldb(rfdlsyz);
  1296. //
  1297. // }
  1298. // }
  1299. //
  1300. // if(pointmap.containsKey(ContantXk.RSWDL));
  1301. // {
  1302. // ProBasicWppoint point=pointmap.get(ContantXk.RSWDL);
  1303. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1304. // if(StringUtils.notEmp(pointValue))
  1305. // {
  1306. // //日上网电量
  1307. // rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  1308. // pewp.setYswdldb(rswdlsyz);
  1309. //
  1310. // }
  1311. // }
  1312. //
  1313. // if(pointmap.containsKey(ContantXk.RGWGWDL));
  1314. // {
  1315. // ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL);
  1316. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1317. // if(StringUtils.notEmp(pointValue))
  1318. // {
  1319. // //日工网购网电量
  1320. // rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  1321. // pewp.setYgwgwdldb(rgwgwdlsyz);
  1322. //
  1323. // }
  1324. // }
  1325. //
  1326. // if(pointmap.containsKey(ContantXk.RNWGWDL));
  1327. // {
  1328. // ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL);
  1329. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1330. // if(StringUtils.notEmp(pointValue))
  1331. // {
  1332. // //日农网购网电量
  1333. // rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  1334. // pewp.setYnwgwdldb(rnwgwdlsyz);
  1335. //
  1336. // }
  1337. // }
  1338. //
  1339. // //日综合场用电量(电表)
  1340. // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2));
  1341. //
  1342. //
  1343. // if(pointmap.containsKey(ContantXk.RCYDL));
  1344. // {
  1345. // ProBasicWppoint point=pointmap.get(ContantXk.RCYDL);
  1346. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1347. // if(StringUtils.notEmp(pointValue))
  1348. // {
  1349. // //日厂用电量
  1350. // pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1351. //
  1352. // }
  1353. // }
  1354. //
  1355. // if(pointmap.containsKey(ContantXk.TPOINT_WP_CXGL));
  1356. // {
  1357. // ProBasicWppoint point=pointmap.get(ContantXk.TPOINT_WP_CXGL);
  1358. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  1359. // if(!pointls.isEmpty())
  1360. // {
  1361. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  1362. // //日最大功率(出线)
  1363. // pewp.setYzdglcx(summaryStatistics.getMax());
  1364. // //日最小功率(出线)
  1365. // pewp.setYzxglcx(summaryStatistics.getMin());
  1366. // //日平均功率(出线)
  1367. // pewp.setYpjglcx(summaryStatistics.getAverage());
  1368. // }
  1369. //
  1370. // }
  1371. //
  1372. // List<ProEconWindpowerInfoDay> wpinfodayls = proEconWindpowerInfoDayService.list().stream()
  1373. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  1374. //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  1375. // && i.getLocation().equals(Location.pj.getValue()))
  1376. // .collect(Collectors.toList());
  1377. // //统计14种状态明细指标的时长和次数
  1378. // calDetiall(pewp,recordDate,wpinfodayls);
  1379. // //统计7种状态指标的时长和次数
  1380. // calSimple(pewp,recordDate,wpinfodayls);
  1381. //
  1382. // proEconWindpowerInfoMonthService.save(pewp);
  1383. //
  1384. // proEconWindpowerInfoMonthService.save(pewp);
  1385. //
  1386. // }
  1387. //
  1388. //
  1389. // }
  1390. //
  1391. // }
  1392. //
  1393. //
  1394. // /**
  1395. // * 计算线路日信息
  1396. // * @param recordDate
  1397. // * @throws Exception
  1398. // */
  1399. // public void calLineInfoDay(Date recordDate) throws Exception {
  1400. // Calendar c=Calendar.getInstance();
  1401. // c.setTime(recordDate);
  1402. //
  1403. // Date end=c.getTime();
  1404. //
  1405. // Date begin= DateUtils.truncDay(c.getTime());
  1406. //
  1407. // //判断是否有重复记录,先删除重复记录
  1408. // List<String> idls = proEconWindpowerInfoMonthService.list().stream()
  1409. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  1410. // && CacheContext.lnmap.containsKey(i.getLineId())
  1411. // && i.getLocation().equals(Location.ln.getValue()) ).map(ProEconWindpowerInfoMonth::getId)
  1412. // .collect(Collectors.toList());
  1413. //
  1414. // if (idls != null && idls.size() > 0) {
  1415. //
  1416. // proEconWindpowerInfoMonthService.removeByIds(idls);
  1417. //
  1418. // }
  1419. // for(ProBasicLine wp:CacheContext.lines)
  1420. // {
  1421. // if(CacheContext.wppointmap.containsKey(wp.getId()))
  1422. // {
  1423. // Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(wp.getId());
  1424. //
  1425. // ProEconWindpowerInfoMonth pewp=new ProEconWindpowerInfoMonth();
  1426. // Initial.initial(pewp);
  1427. // pewp.setForeignKeyId("0");
  1428. // pewp.setLineId(wp.getId());
  1429. // pewp.setLocation(Location.ln.getValue());
  1430. // pewp.setProjectId(wp.getProjectId());
  1431. // pewp.setRecordDate(DateUtils.truncDay(recordDate));
  1432. // if(pointmap.containsKey(ContantXk.SSPJFS));
  1433. // {
  1434. // ProBasicWppoint point=pointmap.get(ContantXk.SSPJFS);
  1435. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  1436. // if(!pointls.isEmpty())
  1437. // {
  1438. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  1439. // //日最大风速
  1440. // pewp.setYzdfs(summaryStatistics.getMax());
  1441. // //日最小风速
  1442. // pewp.setYzxfs(summaryStatistics.getMin());
  1443. // //日平均风速
  1444. // pewp.setYpjfs(summaryStatistics.getAverage());
  1445. // }
  1446. //
  1447. // }
  1448. //
  1449. // if(pointmap.containsKey(ContantXk.SSZGL));
  1450. // {
  1451. // ProBasicWppoint point=pointmap.get(ContantXk.SSZGL);
  1452. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  1453. // if(!pointls.isEmpty())
  1454. // {
  1455. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  1456. // //日最大功率
  1457. // pewp.setYzdgl(summaryStatistics.getMax());
  1458. // //日最小功率
  1459. // pewp.setYzxgl(summaryStatistics.getMin());
  1460. // //日平均功率
  1461. // pewp.setYpjgl(summaryStatistics.getAverage());
  1462. // }
  1463. // }
  1464. //
  1465. //
  1466. // if(pointmap.containsKey(ContantXk.RFDL));
  1467. // {
  1468. // ProBasicWppoint point=pointmap.get(ContantXk.RFDL);
  1469. //
  1470. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1471. // if(StringUtils.notEmp(pointValue))
  1472. // {
  1473. // //日发电量
  1474. // pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1475. //
  1476. // }
  1477. // }
  1478. // if(pointmap.containsKey(ContantXk.RKYDL));
  1479. // {
  1480. // ProBasicWppoint point=pointmap.get(ContantXk.RKYDL);
  1481. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1482. // if(StringUtils.notEmp(pointValue))
  1483. // {
  1484. // //日可用电量
  1485. // pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1486. //
  1487. // }
  1488. // }
  1489. //
  1490. //
  1491. //
  1492. //
  1493. // if(pointmap.containsKey(ContantXk.RLLFDL));
  1494. // {
  1495. // ProBasicWppoint point=pointmap.get(ContantXk.RLLFDL);
  1496. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1497. // if(StringUtils.notEmp(pointValue))
  1498. // {
  1499. // //日理论发电量
  1500. // pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1501. //
  1502. // }
  1503. // }
  1504. //
  1505. //
  1506. // if(pointmap.containsKey(ContantXk.RGZSSDL));
  1507. // {
  1508. // ProBasicWppoint point=pointmap.get(ContantXk.RGZSSDL);
  1509. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1510. // if(StringUtils.notEmp(pointValue))
  1511. // {
  1512. // //日故障损失电量
  1513. // pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1514. //
  1515. // }
  1516. // }
  1517. // if(pointmap.containsKey(ContantXk.RCNSLGZSSDL));
  1518. // {
  1519. // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLGZSSDL);
  1520. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1521. // if(StringUtils.notEmp(pointValue))
  1522. // {
  1523. // //日场内受累故障损失电量
  1524. // pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1525. //
  1526. // }
  1527. // }
  1528. //
  1529. // if(pointmap.containsKey(ContantXk.RJXSSDL));
  1530. // {
  1531. // ProBasicWppoint point=pointmap.get(ContantXk.RJXSSDL);
  1532. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1533. // if(StringUtils.notEmp(pointValue))
  1534. // {
  1535. // //日检修损失电量
  1536. // pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1537. //
  1538. // }
  1539. // }
  1540. //
  1541. // if(pointmap.containsKey(ContantXk.RCNSLJXSSDL));
  1542. // {
  1543. // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLJXSSDL);
  1544. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1545. // if(StringUtils.notEmp(pointValue))
  1546. // {
  1547. // //日场内受累检修损失电量
  1548. // pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1549. //
  1550. // }
  1551. // }
  1552. //
  1553. // if(pointmap.containsKey(ContantXk.RDJSSDL));
  1554. // {
  1555. // ProBasicWppoint point=pointmap.get(ContantXk.RDJSSDL);
  1556. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1557. // if(StringUtils.notEmp(pointValue))
  1558. // {
  1559. // //日待机损失电量
  1560. // pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1561. //
  1562. // }
  1563. // }
  1564. // if(pointmap.containsKey(ContantXk.RQXJCLSSDL));
  1565. // {
  1566. // ProBasicWppoint point=pointmap.get(ContantXk.RQXJCLSSDL);
  1567. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1568. // if(StringUtils.notEmp(pointValue))
  1569. // {
  1570. // //日缺陷降出力损失电量
  1571. // pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1572. //
  1573. // }
  1574. // }
  1575. // if(pointmap.containsKey(ContantXk.RSDTJSSDL));
  1576. // {
  1577. // ProBasicWppoint point=pointmap.get(ContantXk.RSDTJSSDL);
  1578. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1579. // if(StringUtils.notEmp(pointValue))
  1580. // {
  1581. // //日手动停机损失电量
  1582. // pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1583. //
  1584. // }
  1585. // }
  1586. // if(pointmap.containsKey(ContantXk.RXNSSDL));
  1587. // {
  1588. // ProBasicWppoint point=pointmap.get(ContantXk.RXNSSDL);
  1589. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1590. // if(StringUtils.notEmp(pointValue))
  1591. // {
  1592. // //日性能损失电量
  1593. // pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1594. //
  1595. // }
  1596. // }
  1597. //
  1598. // if(pointmap.containsKey(ContantXk.RXDTJSSDL));
  1599. // {
  1600. // ProBasicWppoint point=pointmap.get(ContantXk.RXDTJSSDL);
  1601. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1602. // if(StringUtils.notEmp(pointValue))
  1603. // {
  1604. // //日限电停机损失电量
  1605. // pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1606. //
  1607. // }
  1608. // }
  1609. //
  1610. //
  1611. // if(pointmap.containsKey(ContantXk.RXDJCLSSDL));
  1612. // {
  1613. // ProBasicWppoint point=pointmap.get(ContantXk.RXDJCLSSDL);
  1614. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1615. // if(StringUtils.notEmp(pointValue))
  1616. // {
  1617. // //日限电降出力损失电量
  1618. // pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1619. //
  1620. // }
  1621. // }
  1622. //
  1623. // if(pointmap.containsKey(ContantXk.RCWSLDWSSDL));
  1624. // {
  1625. // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLDWSSDL);
  1626. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1627. // if(StringUtils.notEmp(pointValue))
  1628. // {
  1629. // //日场外受累电网损失电量
  1630. // pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1631. //
  1632. // }
  1633. // }
  1634. // if(pointmap.containsKey(ContantXk.RCWSLTQSSDL));
  1635. // {
  1636. // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLTQSSDL);
  1637. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1638. // if(StringUtils.notEmp(pointValue))
  1639. // {
  1640. // //日场外受累天气损失电量
  1641. // pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1642. //
  1643. // }
  1644. // }
  1645. //
  1646. // if(pointmap.containsKey(ContantXk.RZFDL));
  1647. // {
  1648. // ProBasicWppoint point=pointmap.get(ContantXk.RZFDL);
  1649. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1650. // if(StringUtils.notEmp(pointValue))
  1651. // {
  1652. // //日增发电量
  1653. // pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1654. //
  1655. // }
  1656. // }
  1657. //
  1658. // if(pointmap.containsKey(ContantXk.RQFDL));
  1659. // {
  1660. // ProBasicWppoint point=pointmap.get(ContantXk.RQFDL);
  1661. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1662. // if(StringUtils.notEmp(pointValue))
  1663. // {
  1664. // //日欠发电量
  1665. // pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1666. //
  1667. // }
  1668. // }
  1669. // if(pointmap.containsKey(ContantXk.RZHD));
  1670. // {
  1671. // ProBasicWppoint point=pointmap.get(ContantXk.RZHD);
  1672. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1673. // if(StringUtils.notEmp(pointValue))
  1674. // {
  1675. // //日自耗电
  1676. // pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1677. //
  1678. // }
  1679. // }
  1680. //
  1681. // double rfdlsyz=0.0;
  1682. // double rswdlsyz=0.0;
  1683. // double rgwgwdlsyz=0.0;
  1684. // double rnwgwdlsyz=0.0;
  1685. // if(pointmap.containsKey(ContantXk.RFDLSYZ));
  1686. // {
  1687. // ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ);
  1688. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1689. // if(StringUtils.notEmp(pointValue))
  1690. // {
  1691. // //日发电量(升压站)
  1692. // rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  1693. // pewp.setYfdldb(rfdlsyz);
  1694. //
  1695. // }
  1696. // }
  1697. //
  1698. // if(pointmap.containsKey(ContantXk.RSWDL));
  1699. // {
  1700. // ProBasicWppoint point=pointmap.get(ContantXk.RSWDL);
  1701. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1702. // if(StringUtils.notEmp(pointValue))
  1703. // {
  1704. // //日上网电量
  1705. // rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  1706. // pewp.setYswdldb(rswdlsyz);
  1707. //
  1708. // }
  1709. // }
  1710. //
  1711. // if(pointmap.containsKey(ContantXk.RGWGWDL));
  1712. // {
  1713. // ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL);
  1714. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1715. // if(StringUtils.notEmp(pointValue))
  1716. // {
  1717. // //日工网购网电量
  1718. // rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  1719. // pewp.setYgwgwdldb(rgwgwdlsyz);
  1720. //
  1721. // }
  1722. // }
  1723. //
  1724. // if(pointmap.containsKey(ContantXk.RNWGWDL));
  1725. // {
  1726. // ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL);
  1727. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1728. // if(StringUtils.notEmp(pointValue))
  1729. // {
  1730. // //日农网购网电量
  1731. // rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  1732. // pewp.setYnwgwdldb(rnwgwdlsyz);
  1733. //
  1734. // }
  1735. // }
  1736. //
  1737. // //日综合场用电量(电表)
  1738. // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2));
  1739. //
  1740. //
  1741. // if(pointmap.containsKey(ContantXk.RCYDL));
  1742. // {
  1743. // ProBasicWppoint point=pointmap.get(ContantXk.RCYDL);
  1744. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1745. // if(StringUtils.notEmp(pointValue))
  1746. // {
  1747. // //日厂用电量
  1748. // pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1749. //
  1750. // }
  1751. // }
  1752. //
  1753. // if(pointmap.containsKey(ContantXk.TPOINT_WP_CXGL));
  1754. // {
  1755. // ProBasicWppoint point=pointmap.get(ContantXk.TPOINT_WP_CXGL);
  1756. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  1757. // if(!pointls.isEmpty())
  1758. // {
  1759. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  1760. // //日最大功率(出线)
  1761. // pewp.setYzdglcx(summaryStatistics.getMax());
  1762. // //日最小功率(出线)
  1763. // pewp.setYzxglcx(summaryStatistics.getMin());
  1764. // //日平均功率(出线)
  1765. // pewp.setYpjglcx(summaryStatistics.getAverage());
  1766. // }
  1767. //
  1768. // }
  1769. //
  1770. // List<ProEconWindpowerInfoDay> wpinfodayls = proEconWindpowerInfoDayService.list().stream()
  1771. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  1772. //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  1773. // && i.getLocation().equals(Location.ln.getValue()))
  1774. // .collect(Collectors.toList());
  1775. // //统计14种状态明细指标的时长和次数
  1776. // calDetiall(pewp,recordDate,wpinfodayls);
  1777. // //统计7种状态指标的时长和次数
  1778. // calSimple(pewp,recordDate,wpinfodayls);
  1779. //
  1780. // proEconWindpowerInfoMonthService.save(pewp);
  1781. //
  1782. // }
  1783. //
  1784. //
  1785. // }
  1786. //
  1787. // }
  1788. //
  1789. //
  1790. //
  1791. // /**
  1792. // * 计算方阵日信息
  1793. // * @param recordDate
  1794. // * @throws Exception
  1795. // */
  1796. // public void calSquareInfoDay(Date recordDate) throws Exception {
  1797. // Calendar c=Calendar.getInstance();
  1798. // c.setTime(recordDate);
  1799. //
  1800. // Date end=c.getTime();
  1801. //
  1802. // Date begin= DateUtils.truncDay(c.getTime());
  1803. //
  1804. // //判断是否有重复记录,先删除重复记录
  1805. // List<String> idls = proEconWindpowerInfoMonthService.list().stream()
  1806. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 && i.getLocation().equals(Location.sq.getValue()) ).map(ProEconWindpowerInfoMonth::getId)
  1807. // .collect(Collectors.toList());
  1808. //
  1809. // if (idls != null && idls.size() > 0) {
  1810. //
  1811. // proEconWindpowerInfoMonthService.removeByIds(idls);
  1812. //
  1813. // }
  1814. // for(ProBasicSquare wp:CacheContext.sqls)
  1815. // {
  1816. // if(CacheContext.wppointmap.containsKey(wp.getId()))
  1817. // {
  1818. // Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(wp.getId());
  1819. //
  1820. // ProEconWindpowerInfoMonth pewp=new ProEconWindpowerInfoMonth();
  1821. // Initial.initial(pewp);
  1822. // pewp.setForeignKeyId("0");
  1823. // pewp.setSquareId(wp.getId());
  1824. // pewp.setLocation(Location.sq.getValue());
  1825. // if(pointmap.containsKey(ContantXk.SSPJFS));
  1826. // {
  1827. // ProBasicWppoint point=pointmap.get(ContantXk.SSPJFS);
  1828. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  1829. // if(!pointls.isEmpty())
  1830. // {
  1831. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  1832. // //日最大风速
  1833. // pewp.setYzdfs(summaryStatistics.getMax());
  1834. // //日最小风速
  1835. // pewp.setYzxfs(summaryStatistics.getMin());
  1836. // //日平均风速
  1837. // pewp.setYpjfs(summaryStatistics.getAverage());
  1838. // }
  1839. //
  1840. // }
  1841. //
  1842. // if(pointmap.containsKey(ContantXk.SSZGL));
  1843. // {
  1844. // ProBasicWppoint point=pointmap.get(ContantXk.SSZGL);
  1845. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  1846. // if(!pointls.isEmpty())
  1847. // {
  1848. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  1849. // //日最大功率
  1850. // pewp.setYzdgl(summaryStatistics.getMax());
  1851. // //日最小功率
  1852. // pewp.setYzxgl(summaryStatistics.getMin());
  1853. // //日平均功率
  1854. // pewp.setYpjgl(summaryStatistics.getAverage());
  1855. // }
  1856. // }
  1857. //
  1858. //
  1859. // if(pointmap.containsKey(ContantXk.RFDL));
  1860. // {
  1861. // ProBasicWppoint point=pointmap.get(ContantXk.RFDL);
  1862. //
  1863. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1864. // if(StringUtils.notEmp(pointValue))
  1865. // {
  1866. // //日发电量
  1867. // pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1868. //
  1869. // }
  1870. // }
  1871. // if(pointmap.containsKey(ContantXk.RKYDL));
  1872. // {
  1873. // ProBasicWppoint point=pointmap.get(ContantXk.RKYDL);
  1874. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1875. // if(StringUtils.notEmp(pointValue))
  1876. // {
  1877. // //日可用电量
  1878. // pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1879. //
  1880. // }
  1881. // }
  1882. //
  1883. //
  1884. //
  1885. //
  1886. // if(pointmap.containsKey(ContantXk.RLLFDL));
  1887. // {
  1888. // ProBasicWppoint point=pointmap.get(ContantXk.RLLFDL);
  1889. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1890. // if(StringUtils.notEmp(pointValue))
  1891. // {
  1892. // //日理论发电量
  1893. // pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1894. //
  1895. // }
  1896. // }
  1897. //
  1898. //
  1899. // if(pointmap.containsKey(ContantXk.RGZSSDL));
  1900. // {
  1901. // ProBasicWppoint point=pointmap.get(ContantXk.RGZSSDL);
  1902. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1903. // if(StringUtils.notEmp(pointValue))
  1904. // {
  1905. // //日故障损失电量
  1906. // pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1907. //
  1908. // }
  1909. // }
  1910. // if(pointmap.containsKey(ContantXk.RCNSLGZSSDL));
  1911. // {
  1912. // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLGZSSDL);
  1913. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1914. // if(StringUtils.notEmp(pointValue))
  1915. // {
  1916. // //日场内受累故障损失电量
  1917. // pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1918. //
  1919. // }
  1920. // }
  1921. //
  1922. // if(pointmap.containsKey(ContantXk.RJXSSDL));
  1923. // {
  1924. // ProBasicWppoint point=pointmap.get(ContantXk.RJXSSDL);
  1925. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1926. // if(StringUtils.notEmp(pointValue))
  1927. // {
  1928. // //日检修损失电量
  1929. // pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1930. //
  1931. // }
  1932. // }
  1933. //
  1934. // if(pointmap.containsKey(ContantXk.RCNSLJXSSDL));
  1935. // {
  1936. // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLJXSSDL);
  1937. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1938. // if(StringUtils.notEmp(pointValue))
  1939. // {
  1940. // //日场内受累检修损失电量
  1941. // pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1942. //
  1943. // }
  1944. // }
  1945. //
  1946. // if(pointmap.containsKey(ContantXk.RDJSSDL));
  1947. // {
  1948. // ProBasicWppoint point=pointmap.get(ContantXk.RDJSSDL);
  1949. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1950. // if(StringUtils.notEmp(pointValue))
  1951. // {
  1952. // //日待机损失电量
  1953. // pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1954. //
  1955. // }
  1956. // }
  1957. // if(pointmap.containsKey(ContantXk.RQXJCLSSDL));
  1958. // {
  1959. // ProBasicWppoint point=pointmap.get(ContantXk.RQXJCLSSDL);
  1960. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1961. // if(StringUtils.notEmp(pointValue))
  1962. // {
  1963. // //日缺陷降出力损失电量
  1964. // pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1965. //
  1966. // }
  1967. // }
  1968. // if(pointmap.containsKey(ContantXk.RSDTJSSDL));
  1969. // {
  1970. // ProBasicWppoint point=pointmap.get(ContantXk.RSDTJSSDL);
  1971. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1972. // if(StringUtils.notEmp(pointValue))
  1973. // {
  1974. // //日手动停机损失电量
  1975. // pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1976. //
  1977. // }
  1978. // }
  1979. // if(pointmap.containsKey(ContantXk.RXNSSDL));
  1980. // {
  1981. // ProBasicWppoint point=pointmap.get(ContantXk.RXNSSDL);
  1982. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1983. // if(StringUtils.notEmp(pointValue))
  1984. // {
  1985. // //日性能损失电量
  1986. // pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1987. //
  1988. // }
  1989. // }
  1990. //
  1991. // if(pointmap.containsKey(ContantXk.RXDTJSSDL));
  1992. // {
  1993. // ProBasicWppoint point=pointmap.get(ContantXk.RXDTJSSDL);
  1994. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  1995. // if(StringUtils.notEmp(pointValue))
  1996. // {
  1997. // //日限电停机损失电量
  1998. // pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  1999. //
  2000. // }
  2001. // }
  2002. //
  2003. //
  2004. // if(pointmap.containsKey(ContantXk.RXDJCLSSDL));
  2005. // {
  2006. // ProBasicWppoint point=pointmap.get(ContantXk.RXDJCLSSDL);
  2007. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2008. // if(StringUtils.notEmp(pointValue))
  2009. // {
  2010. // //日限电降出力损失电量
  2011. // pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  2012. //
  2013. // }
  2014. // }
  2015. //
  2016. // if(pointmap.containsKey(ContantXk.RCWSLDWSSDL));
  2017. // {
  2018. // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLDWSSDL);
  2019. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2020. // if(StringUtils.notEmp(pointValue))
  2021. // {
  2022. // //日场外受累电网损失电量
  2023. // pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  2024. //
  2025. // }
  2026. // }
  2027. // if(pointmap.containsKey(ContantXk.RCWSLTQSSDL));
  2028. // {
  2029. // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLTQSSDL);
  2030. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2031. // if(StringUtils.notEmp(pointValue))
  2032. // {
  2033. // //日场外受累天气损失电量
  2034. // pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  2035. //
  2036. // }
  2037. // }
  2038. //
  2039. // if(pointmap.containsKey(ContantXk.RZFDL));
  2040. // {
  2041. // ProBasicWppoint point=pointmap.get(ContantXk.RZFDL);
  2042. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2043. // if(StringUtils.notEmp(pointValue))
  2044. // {
  2045. // //日增发电量
  2046. // pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  2047. //
  2048. // }
  2049. // }
  2050. //
  2051. // if(pointmap.containsKey(ContantXk.RQFDL));
  2052. // {
  2053. // ProBasicWppoint point=pointmap.get(ContantXk.RQFDL);
  2054. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2055. // if(StringUtils.notEmp(pointValue))
  2056. // {
  2057. // //日欠发电量
  2058. // pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
  2059. //
  2060. // }
  2061. // }
  2062. // if(pointmap.containsKey(ContantXk.RZHD));
  2063. // {
  2064. // ProBasicWppoint point=pointmap.get(ContantXk.RZHD);
  2065. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2066. // if(StringUtils.notEmp(pointValue))
  2067. // {
  2068. // //日自耗电
  2069. // pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
  2070. //
  2071. // }
  2072. // }
  2073. //
  2074. // double rfdlsyz=0.0;
  2075. // double rswdlsyz=0.0;
  2076. // double rgwgwdlsyz=0.0;
  2077. // double rnwgwdlsyz=0.0;
  2078. // if(pointmap.containsKey(ContantXk.RFDLSYZ));
  2079. // {
  2080. // ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ);
  2081. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2082. // if(StringUtils.notEmp(pointValue))
  2083. // {
  2084. // //日发电量(升压站)
  2085. // rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  2086. // pewp.setYfdldb(rfdlsyz);
  2087. //
  2088. // }
  2089. // }
  2090. //
  2091. // if(pointmap.containsKey(ContantXk.RSWDL));
  2092. // {
  2093. // ProBasicWppoint point=pointmap.get(ContantXk.RSWDL);
  2094. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2095. // if(StringUtils.notEmp(pointValue))
  2096. // {
  2097. // //日上网电量
  2098. // rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  2099. // pewp.setYswdldb(rswdlsyz);
  2100. //
  2101. // }
  2102. // }
  2103. //
  2104. // if(pointmap.containsKey(ContantXk.RGWGWDL));
  2105. // {
  2106. // ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL);
  2107. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2108. // if(StringUtils.notEmp(pointValue))
  2109. // {
  2110. // //日工网购网电量
  2111. // rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  2112. // pewp.setYgwgwdldb(rgwgwdlsyz);
  2113. //
  2114. // }
  2115. // }
  2116. //
  2117. // if(pointmap.containsKey(ContantXk.RNWGWDL));
  2118. // {
  2119. // ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL);
  2120. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2121. // if(StringUtils.notEmp(pointValue))
  2122. // {
  2123. // //日农网购网电量
  2124. // rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  2125. // pewp.setYnwgwdldb(rnwgwdlsyz);
  2126. //
  2127. // }
  2128. // }
  2129. //
  2130. // //日综合场用电量(电表)
  2131. // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2));
  2132. //
  2133. //
  2134. // if(pointmap.containsKey(ContantXk.RCYDL));
  2135. // {
  2136. // ProBasicWppoint point=pointmap.get(ContantXk.RCYDL);
  2137. // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  2138. // if(StringUtils.notEmp(pointValue))
  2139. // {
  2140. // //日厂用电量
  2141. // pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
  2142. //
  2143. // }
  2144. // }
  2145. //
  2146. // if(pointmap.containsKey(ContantXk.TPOINT_WP_CXGL));
  2147. // {
  2148. // ProBasicWppoint point=pointmap.get(ContantXk.TPOINT_WP_CXGL);
  2149. // List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000);
  2150. // if(!pointls.isEmpty())
  2151. // {
  2152. // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
  2153. // //日最大功率(出线)
  2154. // pewp.setYzdglcx(summaryStatistics.getMax());
  2155. // //日最小功率(出线)
  2156. // pewp.setYzxglcx(summaryStatistics.getMin());
  2157. // //日平均功率(出线)
  2158. // pewp.setYpjglcx(summaryStatistics.getAverage());
  2159. // }
  2160. //
  2161. // }
  2162. //
  2163. // List<ProEconWindpowerInfoDay> wpinfodayls = proEconWindpowerInfoDayService.list().stream()
  2164. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  2165. //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  2166. // && i.getLocation().equals(Location.sq.getValue()))
  2167. // .collect(Collectors.toList());
  2168. //
  2169. //
  2170. // List<ProEconWindpowerInfoMonth> monthls =null;
  2171. // Calendar cl=Calendar.getInstance();
  2172. // cl.setTime(recordDate);
  2173. // if(cl.get(Calendar.DAY_OF_MONTH)==1)
  2174. // {
  2175. // monthls=new ArrayList<>();
  2176. // }else
  2177. // {
  2178. // cl.add(Calendar.DAY_OF_MONTH,-1);
  2179. //
  2180. // }
  2181. //
  2182. // monthls = proEconWindpowerInfoMonthService.list().stream()
  2183. // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime()))==0
  2184. //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  2185. // && i.getLocation().equals(Location.sq.getValue()))
  2186. // .collect(Collectors.toList());
  2187. // //统计14种状态明细指标的时长和次数
  2188. // calDetiall(pewp,recordDate,wpinfodayls,monthls);
  2189. // //统计7种状态指标的时长和次数
  2190. // calSimple(pewp,recordDate,wpinfodayls);
  2191. //
  2192. // proEconWindpowerInfoMonthService.save(pewp);
  2193. //
  2194. // }
  2195. //
  2196. //
  2197. // }
  2198. //
  2199. // }
  2200. // private void calDetiall(ProEconWindpowerInfoMonth pewp,Date recordDate,List<ProEconWindpowerInfoDay> ls,List<ProEconWindpowerInfoMonth> monthls) throws Exception {
  2201. // // 0 待机
  2202. //// 1 手动停机
  2203. //// 2 正常发电
  2204. //// 3 发电降出力
  2205. //// 4 故障
  2206. //// 5 故障受累
  2207. //// 6 检修
  2208. //// 7 检修受累
  2209. //// 8 限电降出力
  2210. //// 9 限电停机
  2211. //// 10 电网受累
  2212. //// 11 环境受累
  2213. //// 12 通讯中断
  2214. //// 13 设备离线
  2215. //
  2216. //
  2217. // if(monthls.isEmpty())
  2218. // {
  2219. // if(!ls.isEmpty())
  2220. // {
  2221. //
  2222. // //日合计故障小时(明细)
  2223. // DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjgzxsmx()).summaryStatistics();
  2224. // pewp.setYhjgzxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2225. // //日合计场内受累故障小时(明细)
  2226. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnslgzxsmx()).summaryStatistics();
  2227. // pewp.setYhjcnslgzxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2228. // //日合计检修小时(明细)
  2229. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxxsmx()).summaryStatistics();
  2230. // pewp.setYhjjxxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2231. // //日合计场内受累检修小时(明细)
  2232. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnsljxxsmx()).summaryStatistics();
  2233. // pewp.setYhjcnsljxxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2234. // //日合计待机小时(明细)
  2235. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjxsmx()).summaryStatistics();
  2236. // pewp.setYhjdjxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2237. // //日合计缺陷降出力小时(明细)
  2238. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjqxjclxsmx()).summaryStatistics();
  2239. // pewp.setYhjqxjclxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2240. // //日合计手动停机小时(明细)
  2241. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjsdtjxsmx()).summaryStatistics();
  2242. // pewp.setYhjsdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2243. // //日合计性能小时(明细)
  2244. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxnxsmx()).summaryStatistics();
  2245. // pewp.setYhjxnxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2246. // //日合计限电停机小时(明细)
  2247. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdtjxsmx()).summaryStatistics();
  2248. // pewp.setYhjxdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2249. // //日合计限电降出力小时(明细)
  2250. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdjclxsmx()).summaryStatistics();
  2251. // pewp.setYhjxdjclxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2252. // //日合计场外受累电网小时(明细)
  2253. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsldwxsmx()).summaryStatistics();
  2254. // pewp.setYhjcwsldwxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2255. // //日合计场外受累电网小时(明细)
  2256. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsltqxsmx()).summaryStatistics();
  2257. // pewp.setYhjcwsltqxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2258. // //日合计通讯中断小时(明细)
  2259. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdxsmx()).summaryStatistics();
  2260. // pewp.setYhjtxzdxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2261. // //日合计离线小时(明细)
  2262. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjlxxsmx()).summaryStatistics();
  2263. // pewp.setYhjlxxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2264. //
  2265. //
  2266. // //日合计故障次数(明细)
  2267. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjgzcsmx()).summaryStatistics();
  2268. // pewp.setYhjgzcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2269. // //日合计场内受累故障次数(明细)
  2270. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnslgzcsmx()).summaryStatistics();
  2271. // pewp.setYhjcnslgzcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2272. // //日合计检修次数(明细)
  2273. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxcsmx()).summaryStatistics();
  2274. // pewp.setYhjjxcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2275. // //日合计场内受累检修次数(明细)
  2276. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnsljxcsmx()).summaryStatistics();
  2277. // pewp.setYhjcnsljxcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2278. // //日合计待机次数(明细)
  2279. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjcsmx()).summaryStatistics();
  2280. // pewp.setYhjdjcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2281. // //日合计缺陷降出力次数(明细)
  2282. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjqxjclcsmx()).summaryStatistics();
  2283. // pewp.setYhjqxjclcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2284. // //日合计手动停机次数(明细)
  2285. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjsdtjcsmx()).summaryStatistics();
  2286. // pewp.setYhjsdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2287. // //日合计性能次数(明细)
  2288. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxncsmx()).summaryStatistics();
  2289. // pewp.setYhjxncsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2290. // //日合计限电停机次数(明细)
  2291. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdtjcsmx()).summaryStatistics();
  2292. // pewp.setYhjxdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2293. // //日合计限电降出力次数(明细)
  2294. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdjclcsmx()).summaryStatistics();
  2295. // pewp.setYhjxdjclcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2296. // //日合计场外受累电网次数(明细)
  2297. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsldwcsmx()).summaryStatistics();
  2298. // pewp.setYhjcwsldwcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2299. // //日合计场外受累电网次数(明细)
  2300. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsltqcsmx()).summaryStatistics();
  2301. // pewp.setYhjcwsltqcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2302. // //日合计通讯中断次数(明细)
  2303. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdcsmx()).summaryStatistics();
  2304. // pewp.setYhjtxzdcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2305. // //日合计离线次数(明细)
  2306. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjlxcsmx()).summaryStatistics();
  2307. // pewp.setYhjlxcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2308. // }
  2309. // }else {
  2310. // if(!ls.isEmpty())
  2311. // {
  2312. // ProEconWindpowerInfoMonth monthdata=monthls.get(0);
  2313. // //日合计故障小时(明细)
  2314. // DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjgzxsmx()).summaryStatistics();
  2315. //
  2316. // pewp.setYhjgzxsmx(StringUtils.round( monthdata.getYhjgzxsmx()+summaryStatistics.getSum(),2));
  2317. // //日合计场内受累故障小时(明细)
  2318. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnslgzxsmx()).summaryStatistics();
  2319. // pewp.setYhjcnslgzxsmx(StringUtils.round(monthdata.getYhjcnslgzxsmx()+summaryStatistics.getSum(),2));
  2320. // //日合计检修小时(明细)
  2321. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxxsmx()).summaryStatistics();
  2322. // pewp.setYhjjxxsmx(StringUtils.round(monthdata.getRhjjxxsmx()+summaryStatistics.getSum(),2));
  2323. // //日合计场内受累检修小时(明细)
  2324. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnsljxxsmx()).summaryStatistics();
  2325. // pewp.setYhjcnsljxxsmx(StringUtils.round(monthdata.getRhjcnsljxxsmx()+summaryStatistics.getSum(),2));
  2326. // //日合计待机小时(明细)
  2327. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjxsmx()).summaryStatistics();
  2328. // pewp.setYhjdjxsmx(StringUtils.round(monthdata.getRhjdjxsmx()+summaryStatistics.getSum(),2));
  2329. // //日合计缺陷降出力小时(明细)
  2330. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjqxjclxsmx()).summaryStatistics();
  2331. // pewp.setYhjqxjclxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2332. // //日合计手动停机小时(明细)
  2333. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjsdtjxsmx()).summaryStatistics();
  2334. // pewp.setYhjsdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2335. // //日合计性能小时(明细)
  2336. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxnxsmx()).summaryStatistics();
  2337. // pewp.setYhjxnxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2338. // //日合计限电停机小时(明细)
  2339. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdtjxsmx()).summaryStatistics();
  2340. // pewp.setYhjxdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2341. // //日合计限电降出力小时(明细)
  2342. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdjclxsmx()).summaryStatistics();
  2343. // pewp.setYhjxdjclxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2344. // //日合计场外受累电网小时(明细)
  2345. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsldwxsmx()).summaryStatistics();
  2346. // pewp.setYhjcwsldwxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2347. // //日合计场外受累电网小时(明细)
  2348. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsltqxsmx()).summaryStatistics();
  2349. // pewp.setYhjcwsltqxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2350. // //日合计通讯中断小时(明细)
  2351. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdxsmx()).summaryStatistics();
  2352. // pewp.setYhjtxzdxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2353. // //日合计离线小时(明细)
  2354. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjlxxsmx()).summaryStatistics();
  2355. // pewp.setYhjlxxsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2356. //
  2357. //
  2358. // //日合计故障次数(明细)
  2359. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjgzcsmx()).summaryStatistics();
  2360. // pewp.setYhjgzcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2361. // //日合计场内受累故障次数(明细)
  2362. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnslgzcsmx()).summaryStatistics();
  2363. // pewp.setYhjcnslgzcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2364. // //日合计检修次数(明细)
  2365. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxcsmx()).summaryStatistics();
  2366. // pewp.setYhjjxcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2367. // //日合计场内受累检修次数(明细)
  2368. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnsljxcsmx()).summaryStatistics();
  2369. // pewp.setYhjcnsljxcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2370. // //日合计待机次数(明细)
  2371. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjcsmx()).summaryStatistics();
  2372. // pewp.setYhjdjcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2373. // //日合计缺陷降出力次数(明细)
  2374. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjqxjclcsmx()).summaryStatistics();
  2375. // pewp.setYhjqxjclcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2376. // //日合计手动停机次数(明细)
  2377. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjsdtjcsmx()).summaryStatistics();
  2378. // pewp.setYhjsdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2379. // //日合计性能次数(明细)
  2380. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxncsmx()).summaryStatistics();
  2381. // pewp.setYhjxncsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2382. // //日合计限电停机次数(明细)
  2383. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdtjcsmx()).summaryStatistics();
  2384. // pewp.setYhjxdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2385. // //日合计限电降出力次数(明细)
  2386. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdjclcsmx()).summaryStatistics();
  2387. // pewp.setYhjxdjclcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2388. // //日合计场外受累电网次数(明细)
  2389. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsldwcsmx()).summaryStatistics();
  2390. // pewp.setYhjcwsldwcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2391. // //日合计场外受累电网次数(明细)
  2392. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsltqcsmx()).summaryStatistics();
  2393. // pewp.setYhjcwsltqcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2394. // //日合计通讯中断次数(明细)
  2395. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdcsmx()).summaryStatistics();
  2396. // pewp.setYhjtxzdcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2397. // //日合计离线次数(明细)
  2398. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjlxcsmx()).summaryStatistics();
  2399. // pewp.setYhjlxcsmx(StringUtils.round(summaryStatistics.getSum(),2));
  2400. // }
  2401. // }
  2402. //
  2403. //
  2404. //
  2405. // }
  2406. //
  2407. //
  2408. //
  2409. // private void calSimple(ProEconWindpowerInfoMonth pewp,Date recordDate,List<ProEconWindpowerInfoDay> ls) throws Exception {
  2410. //// 0 待机
  2411. //// 1 运行
  2412. //// 2 故障
  2413. //// 3 检修
  2414. //// 4 限电
  2415. //// 5 受累
  2416. //// 6 离线
  2417. // if(!ls.isEmpty())
  2418. // {
  2419. // //日合计待机小时
  2420. // DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjxs()).summaryStatistics();
  2421. // pewp.setYhjdjxs(StringUtils.round(summaryStatistics.getSum(),2));
  2422. // //日合计维护停机小时
  2423. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxtjxs()).summaryStatistics();
  2424. // pewp.setYhjjxtjxs(StringUtils.round(summaryStatistics.getSum(),2));
  2425. // // 日合计待机小时
  2426. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjxs()).summaryStatistics();
  2427. // pewp.setYhjdjxs(StringUtils.round(summaryStatistics.getSum(),2));
  2428. // //日合计运行小时
  2429. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjyxxs()).summaryStatistics();
  2430. // pewp.setYhjyxxs(StringUtils.round(summaryStatistics.getSum(),2));
  2431. // //日合计限电小时
  2432. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdxs()).summaryStatistics();
  2433. // pewp.setYhjxdxs(StringUtils.round(summaryStatistics.getSum(),2));
  2434. // //日合计通讯中断小时
  2435. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdxs()).summaryStatistics();
  2436. // pewp.setYhjtxzdxs(StringUtils.round(summaryStatistics.getSum(),2));
  2437. //
  2438. //
  2439. // //日合计故障次数
  2440. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjcs()).summaryStatistics();
  2441. // pewp.setYhjdjcs(StringUtils.round(summaryStatistics.getSum(),2));
  2442. // //日合计检修次数
  2443. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxtjcs()).summaryStatistics();
  2444. // pewp.setYhjjxtjcs(StringUtils.round(summaryStatistics.getSum(),2));
  2445. // //日合计待机次数
  2446. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjcs()).summaryStatistics();
  2447. // pewp.setYhjdjcs(StringUtils.round(summaryStatistics.getSum(),2));
  2448. // //日合计性能次数
  2449. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjyxcs()).summaryStatistics();
  2450. // pewp.setYhjyxcs(StringUtils.round(summaryStatistics.getSum(),2));
  2451. // //日合计限电停机次数
  2452. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdcs()).summaryStatistics();
  2453. // pewp.setYhjxdcs(StringUtils.round(summaryStatistics.getSum(),2));
  2454. // //日合计通讯中断次数
  2455. // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdcs()).summaryStatistics();
  2456. // pewp.setYhjtxzdcs(StringUtils.round(summaryStatistics.getSum(),2));
  2457. // }
  2458. //
  2459. // }
  2460. //
  2461. //}
  2462. //
  2463. //
  2464. //
  2465. //
  2466. //
  2467. //
  2468. //