123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786 |
- package com.gyee.generation.service;//package com.gyee.generation.service;
- import com.gyee.common.contant.ContantXk;
- import com.gyee.common.model.PointData;
- import com.gyee.common.model.StringUtils;
- import com.gyee.generation.init.CacheContext;
- import com.gyee.generation.model.auto.*;
- import com.gyee.generation.model.vo.Location;
- import com.gyee.generation.service.auto.*;
- import com.gyee.generation.util.DateUtils;
- import com.gyee.generation.util.realtimesource.IEdosUtil;
- import com.gyee.generation.util.statisticcs.Initial;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.stereotype.Service;
- import javax.annotation.Resource;
- import java.math.BigDecimal;
- import java.math.RoundingMode;
- import java.util.*;
- import java.util.stream.Collectors;
- @Service
- public class WindPowerInfo5Service {
- private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo1Service.class);
- @Resource
- private IEdosUtil edosUtil;
- @Resource
- private IProEconPowerstationInfoDay5Service proEconPowerstationInfoDay5Service;
- /**
- * 计算区域日信息
- * @param recordDate
- * @throws Exception
- */
- public void calRegionInfoDay(Date recordDate) throws Exception {
- List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
- // && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
- && i.getLocation().equals(Location.cp.getValue()))
- .collect(Collectors.toList());
- if(!wpinfodayls.isEmpty())
- {
- Map<String, Map<String, List<ProEconPowerstationInfoDay5>>>rgmap=new HashMap<>();
- for(ProEconPowerstationInfoDay5 wpinfo:wpinfodayls)
- {
- if(rgmap.containsKey(wpinfo.getCompanyId()))
- {
- Map<String, List<ProEconPowerstationInfoDay5>> map=rgmap.get(wpinfo.getCompanyId());
- List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
- List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
- List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
- if(wpinfo.getForeignKeyId().equals("-1"))
- {
- fdls.add(wpinfo);
- }else if(wpinfo.getForeignKeyId().equals("-2")){
- gfls.add(wpinfo);
- }
- qbls.add(wpinfo);
- }else
- {
- Map<String, List<ProEconPowerstationInfoDay5>> map=new HashMap<>();
- List<ProEconPowerstationInfoDay5> qbls=new ArrayList<>();
- List<ProEconPowerstationInfoDay5> gfls=new ArrayList<>();
- List<ProEconPowerstationInfoDay5> fdls=new ArrayList<>();
- if(wpinfo.getForeignKeyId().equals("-1"))
- {
- fdls.add(wpinfo);
- }else if(wpinfo.getForeignKeyId().equals("-2")){
- gfls.add(wpinfo);
- }
- qbls.add(wpinfo);
- map.put("qb",qbls);
- map.put("fd",fdls);
- map.put("gf",gfls);
- }
- }
- //判断是否有重复记录,先删除重复记录
- List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
- // && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
- && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay5::getId)
- .collect(Collectors.toList());
- if (idls != null && idls.size() > 0) {
- proEconPowerstationInfoDay5Service.removeByIds(idls);
- }
- for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay5>>> entry:rgmap.entrySet()){
- Map<String, List<ProEconPowerstationInfoDay5>> map=entry.getValue();
- List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
- List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
- List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
- // if(CacheContext.cpwpmap.size()==qbls.size())
- // {
- ProEconPowerstationInfoDay5 qb=new ProEconPowerstationInfoDay5();
- ProEconPowerstationInfoDay5 fd=new ProEconPowerstationInfoDay5();
- ProEconPowerstationInfoDay5 gf=new ProEconPowerstationInfoDay5();
- if(CacheContext.rgmap.containsKey(entry.getKey()))
- {
- ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
- gf.setRegionId(cp.getId());
- gf.setRecordDate(DateUtils.truncDay(recordDate));
- gf.setForeignKeyId("-2");
- gf.setLocation(Location.rg.getValue());
- fd.setRegionId(cp.getId());
- fd.setRecordDate(DateUtils.truncDay(recordDate));
- fd.setForeignKeyId("-1");
- fd.setLocation(Location.rg.getValue());
- qb.setRegionId(cp.getId());
- qb.setRecordDate(DateUtils.truncDay(recordDate));
- qb.setForeignKeyId("0");
- qb.setLocation(Location.rg.getValue());
- //计算区域级全部
- calCp(qb,qbls);
- //计算公司级风电场站
- calCp(fd,fdls);
- //计算公司级光电场站
- calCp(gf,gfls);
- proEconPowerstationInfoDay5Service.save(qb);
- proEconPowerstationInfoDay5Service.save(fd);
- proEconPowerstationInfoDay5Service.save(gf);
- }
- // }else
- // {
- // logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
- //
- // }
- };
- }
- }
- /**
- * 计算公司日信息
- * @param recordDate
- * @throws Exception
- */
- public void calCompanyInfoDay(Date recordDate) throws Exception {
- List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
- // && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
- && i.getLocation().equals(Location.wp.getValue()))
- .collect(Collectors.toList());
- if(!wpinfodayls.isEmpty())
- {
- Map<String, Map<String, List<ProEconPowerstationInfoDay5>>>cpmap=new HashMap<>();
- for(ProEconPowerstationInfoDay5 wpinfo:wpinfodayls)
- {
- if(cpmap.containsKey(wpinfo.getCompanyId()))
- {
- Map<String, List<ProEconPowerstationInfoDay5>> map=cpmap.get(wpinfo.getCompanyId());
- List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
- List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
- List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
- if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
- {
- fdls.add(wpinfo);
- }else {
- gfls.add(wpinfo);
- }
- qbls.add(wpinfo);
- }else
- {
- Map<String, List<ProEconPowerstationInfoDay5>> map=new HashMap<>();
- List<ProEconPowerstationInfoDay5> qbls=new ArrayList<>();
- List<ProEconPowerstationInfoDay5> gfls=new ArrayList<>();
- List<ProEconPowerstationInfoDay5> fdls=new ArrayList<>();
- if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
- {
- fdls.add(wpinfo);
- }else {
- gfls.add(wpinfo);
- }
- qbls.add(wpinfo);
- map.put("qb",qbls);
- map.put("fd",fdls);
- map.put("gf",gfls);
- }
- }
- //判断是否有重复记录,先删除重复记录
- List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
- // && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
- && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay5::getId)
- .collect(Collectors.toList());
- if (idls != null && idls.size() > 0) {
- proEconPowerstationInfoDay5Service.removeByIds(idls);
- }
- for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay5>>> entry:cpmap.entrySet()){
- Map<String, List<ProEconPowerstationInfoDay5>> map=entry.getValue();
- List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
- List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
- List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
- // if(CacheContext.cpwpmap.size()==qbls.size())
- // {
- ProEconPowerstationInfoDay5 qb=new ProEconPowerstationInfoDay5();
- ProEconPowerstationInfoDay5 fd=new ProEconPowerstationInfoDay5();
- ProEconPowerstationInfoDay5 gf=new ProEconPowerstationInfoDay5();
- if(CacheContext.cpmap.containsKey(entry.getKey()))
- {
- ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
- gf.setRegionId(cp.getRegionId());
- gf.setCompanyId(cp.getId());
- gf.setRecordDate(DateUtils.truncDay(recordDate));
- gf.setForeignKeyId("-2");
- gf.setLocation(Location.cp.getValue());
- fd.setRegionId(cp.getRegionId());
- fd.setCompanyId(cp.getId());
- fd.setRecordDate(DateUtils.truncDay(recordDate));
- fd.setForeignKeyId("-1");
- fd.setLocation(Location.cp.getValue());
- qb.setRegionId(cp.getRegionId());
- qb.setCompanyId(cp.getId());
- qb.setRecordDate(DateUtils.truncDay(recordDate));
- qb.setForeignKeyId("0");
- qb.setLocation(Location.cp.getValue());
- //计算公司级全部场站
- calCp(qb,qbls);
- //计算公司级风电场站
- calCp(fd,fdls);
- //计算公司级光电场站
- calCp(gf,gfls);
- proEconPowerstationInfoDay5Service.save(qb);
- proEconPowerstationInfoDay5Service.save(fd);
- proEconPowerstationInfoDay5Service.save(gf);
- }
- // }else
- // {
- // logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
- //
- // }
- };
- }
- }
- private void calCp(ProEconPowerstationInfoDay5 pewp,List<ProEconPowerstationInfoDay5> ls) throws Exception {
- if(!ls.isEmpty())
- {
- for(ProEconPowerstationInfoDay5 pepid:ls)
- {
- //日发电量(升压站)
- pewp.setRfdldb(StringUtils.round(pewp.getRfdldb()+pepid.getRfdldb(),2));
- //日上网电量
- pewp.setRswdldb(StringUtils.round(pewp.getRswdldb()+pepid.getRswdldb(),2));
- //日工网购网电量
- pewp.setRgwgwdldb(StringUtils.round(pewp.getRgwgwdldb()+pepid.getRgwgwdldb(),2));
- //日农网购网电量
- pewp.setRnwgwdldb(StringUtils.round(pewp.getRnwgwdldb()+pepid.getRnwgwdldb(),2));
- //日综合场用电量(电表)
- pewp.setRzhcydldb(StringUtils.round(pewp.getRzhcydldb()+pepid.getRzhcydldb(),2));
- //日厂用电量
- pewp.setRfdcydldb(StringUtils.round(pewp.getRfdcydldb()+pepid.getRfdcydldb(),2));
- //月发电量(升压站)
- pewp.setYfdldb(StringUtils.round(pewp.getYfdldb()+pepid.getYfdldb(),2));
- //月上网电量
- pewp.setYswdldb(StringUtils.round(pewp.getYswdldb()+pepid.getYswdldb(),2));
- //月工网购网电量
- pewp.setYgwgwdldb(StringUtils.round(pewp.getYgwgwdldb()+pepid.getYgwgwdldb(),2));
- //月农网购网电量
- pewp.setYnwgwdldb(StringUtils.round(pewp.getYnwgwdldb()+pepid.getYnwgwdldb(),2));
- //月综合场用电量(电表)
- pewp.setYzhcydldb(StringUtils.round(pewp.getYzhcydldb()+pepid.getYzhcydldb(),2));
- //月厂用电量
- pewp.setYfdcydldb(StringUtils.round(pewp.getYfdcydldb()+pepid.getYfdcydldb(),2));
- //年发电量(升压站)
- pewp.setNfdldb(StringUtils.round(pewp.getNfdldb()+pepid.getNfdldb(),2));
- //年上网电量
- pewp.setNswdldb(StringUtils.round(pewp.getNswdldb()+pepid.getNswdldb(),2));
- //年工网购网电量
- pewp.setNgwgwdldb(StringUtils.round(pewp.getNgwgwdldb()+pepid.getNgwgwdldb(),2));
- //年农网购网电量
- pewp.setNnwgwdldb(StringUtils.round(pewp.getNnwgwdldb()+pepid.getNnwgwdldb(),2));
- //年综合场用电量(电表)
- pewp.setNzhcydldb(StringUtils.round(pewp.getNzhcydldb()+pepid.getNzhcydldb(),2));
- //年厂用电量
- pewp.setNfdcydldb(StringUtils.round(pewp.getNfdcydldb()+pepid.getNfdcydldb(),2));
- }
- }
- }
- /**
- * 计算场站日信息
- * @param recordDate
- * @throws Exception
- */
- public void calWindpowerInfoDay(Date recordDate) throws Exception {
- Calendar c=Calendar.getInstance();
- c.setTime(recordDate);
- Date end=c.getTime();
- Date begin= DateUtils.truncDay(c.getTime());
- List<ProEconPowerstationInfoDay5> wpinfodayls=new ArrayList<>();
- //判断是否有重复记录,先删除重复记录
- List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
- && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
- && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay5::getId)
- .collect(Collectors.toList());
- if (idls != null && idls.size() > 0) {
- proEconPowerstationInfoDay5Service.removeByIds(idls);
- }
- for(ProBasicWindpowerstation wp:CacheContext.wpls)
- {
- if(CacheContext.wppointmap.containsKey(wp.getId()))
- {
- Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(wp.getId());
- ProEconPowerstationInfoDay5 pewp=new ProEconPowerstationInfoDay5();
- Initial.initial(pewp);
- pewp.setRegionId(wp.getRegionId());
- pewp.setCompanyId(wp.getCompanyId());
- pewp.setRecordDate(DateUtils.truncDay(recordDate));
- pewp.setForeignKeyId("0");
- pewp.setWindpowerstationId(wp.getId());
- pewp.setLocation(Location.wp.getValue());
- //昨日的统计结果
- List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
- Calendar cl=Calendar.getInstance();
- cl.setTime(recordDate);
- if(cl.get(Calendar.DAY_OF_MONTH)!=1)
- {
- pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
- && i.getWindpowerstationId().equals(wp.getId())
- && i.getLocation().equals(Location.wp.getValue()))
- .collect(Collectors.toList());
- }
- extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
- /*******************************************年信息统计*********************************************************/
- // wpinfodayls.add(pewp);
- proEconPowerstationInfoDay5Service.save(pewp);
- }
- }
- }
- /**
- * 计算项目日信息
- * @param recordDate
- * @throws Exception
- */
- public void calProjectInfoDay(Date recordDate) throws Exception {
- Calendar c=Calendar.getInstance();
- c.setTime(recordDate);
- Date end=c.getTime();
- Date begin= DateUtils.truncDay(c.getTime());
- //判断是否有重复记录,先删除重复记录
- List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
- && CacheContext.pjmap.containsKey(i.getProjectId())
- && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay5::getId)
- .collect(Collectors.toList());
- if (idls != null && idls.size() > 0) {
- proEconPowerstationInfoDay5Service.removeByIds(idls);
- }
- for(ProBasicProject pj:CacheContext.pjls)
- {
- if(CacheContext.wppointmap.containsKey(pj.getId()))
- {
- Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(pj.getId());
- ProEconPowerstationInfoDay5 pewp=new ProEconPowerstationInfoDay5();
- Initial.initial(pewp);
- pewp.setForeignKeyId("0");
- pewp.setWindpowerstationId(pj.getWindpowerstationId());
- pewp.setProjectId(pj.getId());
- pewp.setLocation(Location.pj.getValue());
- pewp.setRecordDate(DateUtils.truncDay(recordDate));
- //昨日的统计结果
- List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
- Calendar cl=Calendar.getInstance();
- cl.setTime(recordDate);
- if(cl.get(Calendar.DAY_OF_MONTH)!=1)
- {
- pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
- && i.getWindpowerstationId().equals(pj.getId())
- && i.getLocation().equals(Location.pj.getValue()))
- .collect(Collectors.toList());
- }
- extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
- proEconPowerstationInfoDay5Service.save(pewp);
- }
- }
- }
- /**
- * 计算线路日信息
- * @param recordDate
- * @throws Exception
- */
- public void calLineInfoDay(Date recordDate) throws Exception {
- Calendar c=Calendar.getInstance();
- c.setTime(recordDate);
- Date end=c.getTime();
- Date begin= DateUtils.truncDay(c.getTime());
- //判断是否有重复记录,先删除重复记录
- List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
- && CacheContext.lnmap.containsKey(i.getLineId())
- && i.getLocation().equals(Location.ln.getValue()) ).map(ProEconPowerstationInfoDay5::getId)
- .collect(Collectors.toList());
- if (idls != null && idls.size() > 0) {
- proEconPowerstationInfoDay5Service.removeByIds(idls);
- }
- for(ProBasicLine ln:CacheContext.lnls)
- {
- if(CacheContext.wppointmap.containsKey(ln.getId()))
- {
- Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(ln.getId());
- ProEconPowerstationInfoDay5 pewp=new ProEconPowerstationInfoDay5();
- Initial.initial(pewp);
- pewp.setForeignKeyId("0");
- pewp.setLineId(ln.getId());
- pewp.setLocation(Location.ln.getValue());
- pewp.setProjectId(ln.getProjectId());
- pewp.setRecordDate(DateUtils.truncDay(recordDate));
- //昨日的统计结果
- List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
- Calendar cl=Calendar.getInstance();
- cl.setTime(recordDate);
- if(cl.get(Calendar.DAY_OF_MONTH)!=1)
- {
- pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
- && i.getWindpowerstationId().equals(ln.getId())
- && i.getLocation().equals(Location.ln.getValue()))
- .collect(Collectors.toList());
- }
- extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
- proEconPowerstationInfoDay5Service.save(pewp);
- }
- }
- }
- private void extracted(Date recordDate, Date end, Date begin,Map<String, ProBasicWppoint> pointmap, ProEconPowerstationInfoDay5 pewp,List<ProEconPowerstationInfoDay5> pepid1ls) throws Exception {
- /*******************************************日信息统计*********************************************************/
- double rfdlsyz=0.0;
- double rswdlsyz=0.0;
- double rgwgwdlsyz=0.0;
- double rnwgwdlsyz=0.0;
- if(pointmap.containsKey(ContantXk.RFDLSYZ));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日发电量(升压站)
- rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setRfdldb(rfdlsyz);
- }
- }
- if(pointmap.containsKey(ContantXk.RSWDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.RSWDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日上网电量
- rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setRswdldb(rswdlsyz);
- }
- }
- if(pointmap.containsKey(ContantXk.RGWGWDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日工网购网电量
- rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setRgwgwdldb(rgwgwdlsyz);
- }
- }
- if(pointmap.containsKey(ContantXk.RNWGWDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日农网购网电量
- rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setRnwgwdldb(rnwgwdlsyz);
- }
- }
- //日综合场用电量(电表)
- pewp.setRzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2));
- if(pointmap.containsKey(ContantXk.RCYDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.RCYDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日厂用电量
- pewp.setRfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- /*******************************************日信息统计*********************************************************/
- /*******************************************月信息统计*********************************************************/
- double yfdlsyz=0.0;
- double yswdlsyz=0.0;
- double ygwgwdlsyz=0.0;
- double ynwgwdlsyz=0.0;
- if(pointmap.containsKey(ContantXk.YFDLSYZ));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.YFDLSYZ);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月发电量(升压站)
- yfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setYfdldb(yfdlsyz);
- }
- }
- if(pointmap.containsKey(ContantXk.YSWDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.YSWDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月上网电量
- yswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setYswdldb(yswdlsyz);
- }
- }
- if(pointmap.containsKey(ContantXk.YGWGWDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.YGWGWDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月工网购网电量
- ygwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setYgwgwdldb(ygwgwdlsyz);
- }
- }
- if(pointmap.containsKey(ContantXk.YNWGWDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.YNWGWDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月农网购网电量
- ynwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setYnwgwdldb(ynwgwdlsyz);
- }
- }
- //月综合场用电量(电表)
- pewp.setYzhcydldb(StringUtils.round(yfdlsyz-yswdlsyz+ygwgwdlsyz+ynwgwdlsyz,2));
- if(pointmap.containsKey(ContantXk.YCYDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.YCYDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月厂用电量
- pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- /*******************************************月信息统计*********************************************************/
- /*******************************************年信息统计*********************************************************/
- double nfdlsyz=0.0;
- double nswdlsyz=0.0;
- double ngwgwdlsyz=0.0;
- double nnwgwdlsyz=0.0;
- if(pointmap.containsKey(ContantXk.NFDLSYZ));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.NFDLSYZ);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年发电量(升压站)
- nfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setNfdldb(nfdlsyz);
- }
- }
- if(pointmap.containsKey(ContantXk.NSWDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.NSWDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年上网电量
- nswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setNswdldb(nswdlsyz);
- }
- }
- if(pointmap.containsKey(ContantXk.NGWGWDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.NGWGWDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年工网购网电量
- ngwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setNgwgwdldb(ngwgwdlsyz);
- }
- }
- if(pointmap.containsKey(ContantXk.NNWGWDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.NNWGWDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年农网购网电量
- nnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
- pewp.setNnwgwdldb(nnwgwdlsyz);
- }
- }
- //年综合场用电量(电表)
- pewp.setNzhcydldb(StringUtils.round(nfdlsyz-nswdlsyz+ngwgwdlsyz+nnwgwdlsyz,2));
- if(pointmap.containsKey(ContantXk.NCYDL));
- {
- ProBasicWppoint point=pointmap.get(ContantXk.NCYDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getCode(),recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年厂用电量
- pewp.setNfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- }
- }
|