WindPowerInfo5Service.java 30 KB

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