WindPowerInfo5Service.java 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  1. package com.gyee.generation.service;//package com.gyee.generation.service;
  2. import com.gyee.common.contant.ContantXk;
  3. import com.gyee.common.model.PointData;
  4. import com.gyee.common.model.StringUtils;
  5. import com.gyee.generation.init.CacheContext;
  6. import com.gyee.generation.model.auto.*;
  7. import com.gyee.generation.model.vo.Location;
  8. import com.gyee.generation.service.auto.*;
  9. import com.gyee.generation.util.DateUtils;
  10. import com.gyee.generation.util.realtimesource.IEdosUtil;
  11. import com.gyee.generation.util.statisticcs.Initial;
  12. import org.slf4j.Logger;
  13. import org.slf4j.LoggerFactory;
  14. import org.springframework.stereotype.Service;
  15. import javax.annotation.Resource;
  16. import java.util.*;
  17. import java.util.stream.Collectors;
  18. @Service
  19. public class WindPowerInfo5Service {
  20. private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo1Service.class);
  21. @Resource
  22. private IEdosUtil edosUtil;
  23. @Resource
  24. private IProEconPowerstationInfoDay5Service proEconPowerstationInfoDay5Service;
  25. /**
  26. * 计算区域日信息
  27. * @param recordDate
  28. * @throws Exception
  29. */
  30. public void calRegionInfoDay(Date recordDate) throws Exception {
  31. List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
  32. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  33. // && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  34. && i.getLocation().equals(Location.cp.getValue()))
  35. .collect(Collectors.toList());
  36. if(!wpinfodayls.isEmpty())
  37. {
  38. Map<String, Map<String, List<ProEconPowerstationInfoDay5>>>rgmap=new HashMap<>();
  39. for(ProEconPowerstationInfoDay5 wpinfo:wpinfodayls)
  40. {
  41. if(rgmap.containsKey(wpinfo.getCompanyId()))
  42. {
  43. Map<String, List<ProEconPowerstationInfoDay5>> map=rgmap.get(wpinfo.getCompanyId());
  44. List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
  45. List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
  46. List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
  47. if(wpinfo.getForeignKeyId().equals("-1"))
  48. {
  49. fdls.add(wpinfo);
  50. }else if(wpinfo.getForeignKeyId().equals("-2")){
  51. gfls.add(wpinfo);
  52. }
  53. qbls.add(wpinfo);
  54. }else
  55. {
  56. Map<String, List<ProEconPowerstationInfoDay5>> map=new HashMap<>();
  57. List<ProEconPowerstationInfoDay5> qbls=new ArrayList<>();
  58. List<ProEconPowerstationInfoDay5> gfls=new ArrayList<>();
  59. List<ProEconPowerstationInfoDay5> fdls=new ArrayList<>();
  60. if(wpinfo.getForeignKeyId().equals("-1"))
  61. {
  62. fdls.add(wpinfo);
  63. }else if(wpinfo.getForeignKeyId().equals("-2")){
  64. gfls.add(wpinfo);
  65. }
  66. qbls.add(wpinfo);
  67. map.put("qb",qbls);
  68. map.put("fd",fdls);
  69. map.put("gf",gfls);
  70. }
  71. }
  72. //判断是否有重复记录,先删除重复记录
  73. List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
  74. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  75. // && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  76. && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay5::getId)
  77. .collect(Collectors.toList());
  78. if (idls != null && idls.size() > 0) {
  79. proEconPowerstationInfoDay5Service.removeByIds(idls);
  80. }
  81. for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay5>>> entry:rgmap.entrySet()){
  82. Map<String, List<ProEconPowerstationInfoDay5>> map=entry.getValue();
  83. List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
  84. List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
  85. List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
  86. // if(CacheContext.cpwpmap.size()==qbls.size())
  87. // {
  88. ProEconPowerstationInfoDay5 qb=new ProEconPowerstationInfoDay5();
  89. ProEconPowerstationInfoDay5 fd=new ProEconPowerstationInfoDay5();
  90. ProEconPowerstationInfoDay5 gf=new ProEconPowerstationInfoDay5();
  91. if(CacheContext.rgmap.containsKey(entry.getKey()))
  92. {
  93. ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
  94. gf.setRegionId(cp.getId());
  95. gf.setRecordDate(DateUtils.truncDay(recordDate));
  96. gf.setForeignKeyId("-2");
  97. gf.setLocation(Location.rg.getValue());
  98. fd.setRegionId(cp.getId());
  99. fd.setRecordDate(DateUtils.truncDay(recordDate));
  100. fd.setForeignKeyId("-1");
  101. fd.setLocation(Location.rg.getValue());
  102. qb.setRegionId(cp.getId());
  103. qb.setRecordDate(DateUtils.truncDay(recordDate));
  104. qb.setForeignKeyId("0");
  105. qb.setLocation(Location.rg.getValue());
  106. //计算区域级全部
  107. calCp(qb,qbls);
  108. //计算公司级风电场站
  109. calCp(fd,fdls);
  110. //计算公司级光电场站
  111. calCp(gf,gfls);
  112. proEconPowerstationInfoDay5Service.save(qb);
  113. proEconPowerstationInfoDay5Service.save(fd);
  114. proEconPowerstationInfoDay5Service.save(gf);
  115. }
  116. // }else
  117. // {
  118. // logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
  119. //
  120. // }
  121. };
  122. }
  123. }
  124. /**
  125. * 计算公司日信息
  126. * @param recordDate
  127. * @throws Exception
  128. */
  129. public void calCompanyInfoDay(Date recordDate) throws Exception {
  130. List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
  131. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  132. // && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  133. && i.getLocation().equals(Location.wp.getValue()))
  134. .collect(Collectors.toList());
  135. if(!wpinfodayls.isEmpty())
  136. {
  137. Map<String, Map<String, List<ProEconPowerstationInfoDay5>>>cpmap=new HashMap<>();
  138. for(ProEconPowerstationInfoDay5 wpinfo:wpinfodayls)
  139. {
  140. if(cpmap.containsKey(wpinfo.getCompanyId()))
  141. {
  142. Map<String, List<ProEconPowerstationInfoDay5>> map=cpmap.get(wpinfo.getCompanyId());
  143. List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
  144. List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
  145. List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
  146. if(wpinfo.getWindpowerstationId().contains("FDC"))
  147. {
  148. fdls.add(wpinfo);
  149. }else {
  150. gfls.add(wpinfo);
  151. }
  152. qbls.add(wpinfo);
  153. }else
  154. {
  155. Map<String, List<ProEconPowerstationInfoDay5>> map=new HashMap<>();
  156. List<ProEconPowerstationInfoDay5> qbls=new ArrayList<>();
  157. List<ProEconPowerstationInfoDay5> gfls=new ArrayList<>();
  158. List<ProEconPowerstationInfoDay5> fdls=new ArrayList<>();
  159. if(wpinfo.getWindpowerstationId().contains("FDC"))
  160. {
  161. fdls.add(wpinfo);
  162. }else {
  163. gfls.add(wpinfo);
  164. }
  165. qbls.add(wpinfo);
  166. map.put("qb",qbls);
  167. map.put("fd",fdls);
  168. map.put("gf",gfls);
  169. }
  170. }
  171. //判断是否有重复记录,先删除重复记录
  172. List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
  173. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  174. // && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  175. && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay5::getId)
  176. .collect(Collectors.toList());
  177. if (idls != null && idls.size() > 0) {
  178. proEconPowerstationInfoDay5Service.removeByIds(idls);
  179. }
  180. for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay5>>> entry:cpmap.entrySet()){
  181. Map<String, List<ProEconPowerstationInfoDay5>> map=entry.getValue();
  182. List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
  183. List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
  184. List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
  185. // if(CacheContext.cpwpmap.size()==qbls.size())
  186. // {
  187. ProEconPowerstationInfoDay5 qb=new ProEconPowerstationInfoDay5();
  188. ProEconPowerstationInfoDay5 fd=new ProEconPowerstationInfoDay5();
  189. ProEconPowerstationInfoDay5 gf=new ProEconPowerstationInfoDay5();
  190. if(CacheContext.cpmap.containsKey(entry.getKey()))
  191. {
  192. ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
  193. gf.setRegionId(cp.getRegionId());
  194. gf.setCompanyId(cp.getId());
  195. gf.setRecordDate(DateUtils.truncDay(recordDate));
  196. gf.setForeignKeyId("-2");
  197. gf.setLocation(Location.cp.getValue());
  198. fd.setRegionId(cp.getRegionId());
  199. fd.setCompanyId(cp.getId());
  200. fd.setRecordDate(DateUtils.truncDay(recordDate));
  201. fd.setForeignKeyId("-1");
  202. fd.setLocation(Location.cp.getValue());
  203. qb.setRegionId(cp.getRegionId());
  204. qb.setCompanyId(cp.getId());
  205. qb.setRecordDate(DateUtils.truncDay(recordDate));
  206. qb.setForeignKeyId("0");
  207. qb.setLocation(Location.cp.getValue());
  208. //计算公司级全部场站
  209. calCp(qb,qbls);
  210. //计算公司级风电场站
  211. calCp(fd,fdls);
  212. //计算公司级光电场站
  213. calCp(gf,gfls);
  214. proEconPowerstationInfoDay5Service.save(qb);
  215. proEconPowerstationInfoDay5Service.save(fd);
  216. proEconPowerstationInfoDay5Service.save(gf);
  217. }
  218. // }else
  219. // {
  220. // logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
  221. //
  222. // }
  223. };
  224. }
  225. }
  226. private void calCp(ProEconPowerstationInfoDay5 pewp,List<ProEconPowerstationInfoDay5> ls) throws Exception {
  227. if(!ls.isEmpty())
  228. {
  229. for(ProEconPowerstationInfoDay5 pepid:ls)
  230. {
  231. //日发电量(升压站)
  232. pewp.setRfdldb(StringUtils.round(pewp.getRfdldb()+pepid.getRfdldb(),2));
  233. //日上网电量
  234. pewp.setRswdldb(StringUtils.round(pewp.getRswdldb()+pepid.getRswdldb(),2));
  235. //日工网购网电量
  236. pewp.setRgwgwdldb(StringUtils.round(pewp.getRgwgwdldb()+pepid.getRgwgwdldb(),2));
  237. //日农网购网电量
  238. pewp.setRnwgwdldb(StringUtils.round(pewp.getRnwgwdldb()+pepid.getRnwgwdldb(),2));
  239. //日综合场用电量(电表)
  240. pewp.setRzhcydldb(StringUtils.round(pewp.getRzhcydldb()+pepid.getRzhcydldb(),2));
  241. //日厂用电量
  242. pewp.setRfdcydldb(StringUtils.round(pewp.getRfdcydldb()+pepid.getRfdcydldb(),2));
  243. //月发电量(升压站)
  244. pewp.setYfdldb(StringUtils.round(pewp.getYfdldb()+pepid.getYfdldb(),2));
  245. //月上网电量
  246. pewp.setYswdldb(StringUtils.round(pewp.getYswdldb()+pepid.getYswdldb(),2));
  247. //月工网购网电量
  248. pewp.setYgwgwdldb(StringUtils.round(pewp.getYgwgwdldb()+pepid.getYgwgwdldb(),2));
  249. //月农网购网电量
  250. pewp.setYnwgwdldb(StringUtils.round(pewp.getYnwgwdldb()+pepid.getYnwgwdldb(),2));
  251. //月综合场用电量(电表)
  252. pewp.setYzhcydldb(StringUtils.round(pewp.getYzhcydldb()+pepid.getYzhcydldb(),2));
  253. //月厂用电量
  254. pewp.setYfdcydldb(StringUtils.round(pewp.getYfdcydldb()+pepid.getYfdcydldb(),2));
  255. //年发电量(升压站)
  256. pewp.setNfdldb(StringUtils.round(pewp.getNfdldb()+pepid.getNfdldb(),2));
  257. //年上网电量
  258. pewp.setNswdldb(StringUtils.round(pewp.getNswdldb()+pepid.getNswdldb(),2));
  259. //年工网购网电量
  260. pewp.setNgwgwdldb(StringUtils.round(pewp.getNgwgwdldb()+pepid.getNgwgwdldb(),2));
  261. //年农网购网电量
  262. pewp.setNnwgwdldb(StringUtils.round(pewp.getNnwgwdldb()+pepid.getNnwgwdldb(),2));
  263. //年综合场用电量(电表)
  264. pewp.setNzhcydldb(StringUtils.round(pewp.getNzhcydldb()+pepid.getNzhcydldb(),2));
  265. //年厂用电量
  266. pewp.setNfdcydldb(StringUtils.round(pewp.getNfdcydldb()+pepid.getNfdcydldb(),2));
  267. }
  268. }
  269. }
  270. /**
  271. * 计算场站日信息
  272. * @param recordDate
  273. * @throws Exception
  274. */
  275. public void calWindpowerInfoDay(Date recordDate) throws Exception {
  276. Calendar c=Calendar.getInstance();
  277. c.setTime(recordDate);
  278. Date end=c.getTime();
  279. Date begin= DateUtils.truncDay(c.getTime());
  280. List<ProEconPowerstationInfoDay5> wpinfodayls=new ArrayList<>();
  281. //判断是否有重复记录,先删除重复记录
  282. List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
  283. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  284. && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
  285. && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay5::getId)
  286. .collect(Collectors.toList());
  287. if (idls != null && idls.size() > 0) {
  288. proEconPowerstationInfoDay5Service.removeByIds(idls);
  289. }
  290. for(ProBasicPowerstation wp:CacheContext.wpls)
  291. {
  292. if(CacheContext.wppointmap.containsKey(wp.getId()))
  293. {
  294. Map<String, ProBasicPowerstationPoint> pointmap=CacheContext.wppointmap.get(wp.getId());
  295. ProEconPowerstationInfoDay5 pewp=new ProEconPowerstationInfoDay5();
  296. Initial.initial(pewp);
  297. pewp.setRegionId(wp.getRegionId());
  298. pewp.setCompanyId(wp.getCompanyId());
  299. pewp.setRecordDate(DateUtils.truncDay(recordDate));
  300. pewp.setForeignKeyId("0");
  301. pewp.setWindpowerstationId(wp.getId());
  302. pewp.setLocation(Location.wp.getValue());
  303. //昨日的统计结果
  304. List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
  305. Calendar cl=Calendar.getInstance();
  306. cl.setTime(recordDate);
  307. if(cl.get(Calendar.DAY_OF_MONTH)!=1)
  308. {
  309. pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
  310. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
  311. && i.getWindpowerstationId().equals(wp.getId())
  312. && i.getLocation().equals(Location.wp.getValue()))
  313. .collect(Collectors.toList());
  314. }
  315. extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
  316. /*******************************************年信息统计*********************************************************/
  317. // wpinfodayls.add(pewp);
  318. proEconPowerstationInfoDay5Service.save(pewp);
  319. }
  320. }
  321. }
  322. /**
  323. * 计算项目日信息
  324. * @param recordDate
  325. * @throws Exception
  326. */
  327. public void calProjectInfoDay(Date recordDate) throws Exception {
  328. Calendar c=Calendar.getInstance();
  329. c.setTime(recordDate);
  330. Date end=c.getTime();
  331. Date begin= DateUtils.truncDay(c.getTime());
  332. //判断是否有重复记录,先删除重复记录
  333. List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
  334. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  335. && CacheContext.pjmap.containsKey(i.getProjectId())
  336. && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay5::getId)
  337. .collect(Collectors.toList());
  338. if (idls != null && idls.size() > 0) {
  339. proEconPowerstationInfoDay5Service.removeByIds(idls);
  340. }
  341. for(ProBasicProject pj:CacheContext.pjls)
  342. {
  343. if(CacheContext.wppointmap.containsKey(pj.getId()))
  344. {
  345. Map<String, ProBasicPowerstationPoint> pointmap=CacheContext.wppointmap.get(pj.getId());
  346. ProEconPowerstationInfoDay5 pewp=new ProEconPowerstationInfoDay5();
  347. Initial.initial(pewp);
  348. pewp.setForeignKeyId("0");
  349. pewp.setWindpowerstationId(pj.getWindpowerstationId());
  350. pewp.setProjectId(pj.getId());
  351. pewp.setLocation(Location.pj.getValue());
  352. pewp.setRecordDate(DateUtils.truncDay(recordDate));
  353. //昨日的统计结果
  354. List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
  355. Calendar cl=Calendar.getInstance();
  356. cl.setTime(recordDate);
  357. if(cl.get(Calendar.DAY_OF_MONTH)!=1)
  358. {
  359. pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
  360. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
  361. && i.getProjectId().equals(pj.getId())
  362. && i.getLocation().equals(Location.pj.getValue()))
  363. .collect(Collectors.toList());
  364. }
  365. extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
  366. proEconPowerstationInfoDay5Service.save(pewp);
  367. }
  368. }
  369. }
  370. /**
  371. * 计算线路日信息
  372. * @param recordDate
  373. * @throws Exception
  374. */
  375. public void calLineInfoDay(Date recordDate) throws Exception {
  376. Calendar c=Calendar.getInstance();
  377. c.setTime(recordDate);
  378. Date end=c.getTime();
  379. Date begin= DateUtils.truncDay(c.getTime());
  380. //判断是否有重复记录,先删除重复记录
  381. List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
  382. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
  383. && CacheContext.lnmap.containsKey(i.getLineId())
  384. && i.getLocation().equals(Location.ln.getValue()) ).map(ProEconPowerstationInfoDay5::getId)
  385. .collect(Collectors.toList());
  386. if (idls != null && idls.size() > 0) {
  387. proEconPowerstationInfoDay5Service.removeByIds(idls);
  388. }
  389. for(ProBasicLine ln:CacheContext.lnls)
  390. {
  391. if(CacheContext.wppointmap.containsKey(ln.getId()))
  392. {
  393. Map<String, ProBasicPowerstationPoint> pointmap=CacheContext.wppointmap.get(ln.getId());
  394. ProEconPowerstationInfoDay5 pewp=new ProEconPowerstationInfoDay5();
  395. Initial.initial(pewp);
  396. pewp.setForeignKeyId("0");
  397. pewp.setLineId(ln.getId());
  398. pewp.setLocation(Location.ln.getValue());
  399. pewp.setProjectId(ln.getProjectId());
  400. pewp.setRecordDate(DateUtils.truncDay(recordDate));
  401. //昨日的统计结果
  402. List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
  403. Calendar cl=Calendar.getInstance();
  404. cl.setTime(recordDate);
  405. if(cl.get(Calendar.DAY_OF_MONTH)!=1)
  406. {
  407. pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
  408. .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
  409. && i.getLineId().equals(ln.getId())
  410. && i.getLocation().equals(Location.ln.getValue()))
  411. .collect(Collectors.toList());
  412. }
  413. extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
  414. proEconPowerstationInfoDay5Service.save(pewp);
  415. }
  416. }
  417. }
  418. private void extracted(Date recordDate, Date end, Date begin, Map<String, ProBasicPowerstationPoint> pointmap, ProEconPowerstationInfoDay5 pewp, List<ProEconPowerstationInfoDay5> pepid1ls) throws Exception {
  419. /*******************************************日信息统计*********************************************************/
  420. double rfdlsyz=0.0;
  421. double rswdlsyz=0.0;
  422. double rgwgwdlsyz=0.0;
  423. double rnwgwdlsyz=0.0;
  424. if(pointmap.containsKey(ContantXk.RFDLSYZ));
  425. {
  426. ProBasicPowerstationPoint point=pointmap.get(ContantXk.RFDLSYZ);
  427. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  428. if(StringUtils.notEmp(pointValue))
  429. {
  430. //日发电量(升压站)
  431. rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  432. pewp.setRfdldb(rfdlsyz);
  433. }
  434. }
  435. if(pointmap.containsKey(ContantXk.RSWDL));
  436. {
  437. ProBasicPowerstationPoint point=pointmap.get(ContantXk.RSWDL);
  438. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  439. if(StringUtils.notEmp(pointValue))
  440. {
  441. //日上网电量
  442. rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  443. pewp.setRswdldb(rswdlsyz);
  444. }
  445. }
  446. if(pointmap.containsKey(ContantXk.RGWGWDL));
  447. {
  448. ProBasicPowerstationPoint point=pointmap.get(ContantXk.RGWGWDL);
  449. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  450. if(StringUtils.notEmp(pointValue))
  451. {
  452. //日工网购网电量
  453. rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  454. pewp.setRgwgwdldb(rgwgwdlsyz);
  455. }
  456. }
  457. if(pointmap.containsKey(ContantXk.RNWGWDL));
  458. {
  459. ProBasicPowerstationPoint point=pointmap.get(ContantXk.RNWGWDL);
  460. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  461. if(StringUtils.notEmp(pointValue))
  462. {
  463. //日农网购网电量
  464. rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  465. pewp.setRnwgwdldb(rnwgwdlsyz);
  466. }
  467. }
  468. //日综合场用电量(电表)
  469. pewp.setRzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2));
  470. if(pointmap.containsKey(ContantXk.RCYDL));
  471. {
  472. ProBasicPowerstationPoint point=pointmap.get(ContantXk.RCYDL);
  473. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  474. if(StringUtils.notEmp(pointValue))
  475. {
  476. //日厂用电量
  477. pewp.setRfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
  478. }
  479. }
  480. /*******************************************日信息统计*********************************************************/
  481. /*******************************************月信息统计*********************************************************/
  482. double yfdlsyz=0.0;
  483. double yswdlsyz=0.0;
  484. double ygwgwdlsyz=0.0;
  485. double ynwgwdlsyz=0.0;
  486. if(pointmap.containsKey(ContantXk.YFDLSYZ));
  487. {
  488. ProBasicPowerstationPoint point=pointmap.get(ContantXk.YFDLSYZ);
  489. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  490. if(StringUtils.notEmp(pointValue))
  491. {
  492. //月发电量(升压站)
  493. yfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  494. pewp.setYfdldb(yfdlsyz);
  495. }
  496. }
  497. if(pointmap.containsKey(ContantXk.YSWDL));
  498. {
  499. ProBasicPowerstationPoint point=pointmap.get(ContantXk.YSWDL);
  500. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  501. if(StringUtils.notEmp(pointValue))
  502. {
  503. //月上网电量
  504. yswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  505. pewp.setYswdldb(yswdlsyz);
  506. }
  507. }
  508. if(pointmap.containsKey(ContantXk.YGWGWDL));
  509. {
  510. ProBasicPowerstationPoint point=pointmap.get(ContantXk.YGWGWDL);
  511. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  512. if(StringUtils.notEmp(pointValue))
  513. {
  514. //月工网购网电量
  515. ygwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  516. pewp.setYgwgwdldb(ygwgwdlsyz);
  517. }
  518. }
  519. if(pointmap.containsKey(ContantXk.YNWGWDL));
  520. {
  521. ProBasicPowerstationPoint point=pointmap.get(ContantXk.YNWGWDL);
  522. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  523. if(StringUtils.notEmp(pointValue))
  524. {
  525. //月农网购网电量
  526. ynwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  527. pewp.setYnwgwdldb(ynwgwdlsyz);
  528. }
  529. }
  530. //月综合场用电量(电表)
  531. pewp.setYzhcydldb(StringUtils.round(yfdlsyz-yswdlsyz+ygwgwdlsyz+ynwgwdlsyz,2));
  532. if(pointmap.containsKey(ContantXk.YCYDL));
  533. {
  534. ProBasicPowerstationPoint point=pointmap.get(ContantXk.YCYDL);
  535. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  536. if(StringUtils.notEmp(pointValue))
  537. {
  538. //月厂用电量
  539. pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
  540. }
  541. }
  542. /*******************************************月信息统计*********************************************************/
  543. /*******************************************年信息统计*********************************************************/
  544. double nfdlsyz=0.0;
  545. double nswdlsyz=0.0;
  546. double ngwgwdlsyz=0.0;
  547. double nnwgwdlsyz=0.0;
  548. if(pointmap.containsKey(ContantXk.NFDLSYZ));
  549. {
  550. ProBasicPowerstationPoint point=pointmap.get(ContantXk.NFDLSYZ);
  551. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  552. if(StringUtils.notEmp(pointValue))
  553. {
  554. //年发电量(升压站)
  555. nfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  556. pewp.setNfdldb(nfdlsyz);
  557. }
  558. }
  559. if(pointmap.containsKey(ContantXk.NSWDL));
  560. {
  561. ProBasicPowerstationPoint point=pointmap.get(ContantXk.NSWDL);
  562. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  563. if(StringUtils.notEmp(pointValue))
  564. {
  565. //年上网电量
  566. nswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  567. pewp.setNswdldb(nswdlsyz);
  568. }
  569. }
  570. if(pointmap.containsKey(ContantXk.NGWGWDL));
  571. {
  572. ProBasicPowerstationPoint point=pointmap.get(ContantXk.NGWGWDL);
  573. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  574. if(StringUtils.notEmp(pointValue))
  575. {
  576. //年工网购网电量
  577. ngwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  578. pewp.setNgwgwdldb(ngwgwdlsyz);
  579. }
  580. }
  581. if(pointmap.containsKey(ContantXk.NNWGWDL));
  582. {
  583. ProBasicPowerstationPoint point=pointmap.get(ContantXk.NNWGWDL);
  584. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  585. if(StringUtils.notEmp(pointValue))
  586. {
  587. //年农网购网电量
  588. nnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
  589. pewp.setNnwgwdldb(nnwgwdlsyz);
  590. }
  591. }
  592. //年综合场用电量(电表)
  593. pewp.setNzhcydldb(StringUtils.round(nfdlsyz-nswdlsyz+ngwgwdlsyz+nnwgwdlsyz,2));
  594. if(pointmap.containsKey(ContantXk.NCYDL));
  595. {
  596. ProBasicPowerstationPoint point=pointmap.get(ContantXk.NCYDL);
  597. PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
  598. if(StringUtils.notEmp(pointValue))
  599. {
  600. //年厂用电量
  601. pewp.setNfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
  602. }
  603. }
  604. }
  605. }