123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922 |
- 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.ProBasicEquipment;
- import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
- import com.gyee.generation.model.auto.ProEconEquipmentInfoDay1;
- import com.gyee.generation.service.auto.IProEconEquipmentInfoDay1Service;
- import com.gyee.generation.util.DateUtils;
- import com.gyee.generation.util.realtimesource.IEdosUtil;
- import com.gyee.generation.util.statisticcs.Initial;
- 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 EquipmentInfo1Service {
- // private static final Logger logger = LoggerFactory.getLogger(EquipmentInfo1Service.class);
- @Resource
- private IEdosUtil edosUtil;
- @Resource
- private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
- /**
- * 计算设备日信息
- */
- public void calEquipmentInfoDay(Date recordDate) throws Exception {
- Calendar c=Calendar.getInstance();
- c.setTime(recordDate);
- Date end=c.getTime();
- Date begin= DateUtils.truncDay(c.getTime());
- //判断是否有重复记录,先删除重复记录
- List<String> idls = proEconEquipmentInfoDay1Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
- && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconEquipmentInfoDay1::getId)
- .collect(Collectors.toList());
- if (idls.size() > 0) {
- proEconEquipmentInfoDay1Service.removeByIds(idls);
- }
- for(ProBasicEquipment wt:CacheContext.wtls)
- {
- if(CacheContext.wtpAimap.containsKey(wt.getId()))
- {
- Map<String, ProBasicEquipmentPoint> pointmap=CacheContext.wtpAimap.get(wt.getId());
- ProEconEquipmentInfoDay1 pewp=new ProEconEquipmentInfoDay1();
- Initial.initial(pewp);
- pewp.setCompanyId(wt.getCompanyId());
- pewp.setWindpowerstationId(wt.getWindpowerstationId());
- pewp.setLineId(wt.getLineId());
- pewp.setProjectId(wt.getProjectId());
- pewp.setRegionId(wt.getRegionId());
- pewp.setRecordDate(DateUtils.truncDay(recordDate));
- //昨日的统计结果
- List<ProEconEquipmentInfoDay1> pepid1ls =new ArrayList<>();
- Calendar cl=Calendar.getInstance();
- cl.setTime(recordDate);
- if(cl.get(Calendar.DAY_OF_MONTH)!=1)
- {
- pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
- .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
- && CacheContext.wtmap.containsKey(i.getWindturbineId())
- ).collect(Collectors.toList());
- }
- extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
- proEconEquipmentInfoDay1Service.save(pewp);
- }
- }
- }
- private void extracted(Date recordDate, Date end, Date begin,Map<String, ProBasicEquipmentPoint> pointmap, ProEconEquipmentInfoDay1 pewp,List<ProEconEquipmentInfoDay1> pepid1ls) throws Exception {
- //*******************************************日信息统计*********************************************************/
- if(pointmap.containsKey(ContantXk.SSPJFS))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSPJFS);
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
- if(!pointls.isEmpty())
- {
- DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
- //日最大风速
- pewp.setRzdfs(summaryStatistics.getMax());
- //日最小风速
- pewp.setRzxfs(summaryStatistics.getMin());
- //日平均风速
- pewp.setRpjfs(summaryStatistics.getAverage());
- }
- }
- if(pointmap.containsKey(ContantXk.SSZGL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSZGL);
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
- if(!pointls.isEmpty())
- {
- DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
- //日最大功率
- pewp.setRzdgl(summaryStatistics.getMax());
- //日最小功率
- pewp.setRzxgl(summaryStatistics.getMin());
- //日平均功率
- pewp.setRpjgl(summaryStatistics.getAverage());
- }
- }
- if(pointmap.containsKey(ContantXk.RFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日发电量
- pewp.setRfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RKYDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RKYDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日可用电量
- pewp.setRkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RLLFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RLLFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日理论发电量
- pewp.setRllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RGZSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RGZSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日故障损失电量
- pewp.setRgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RCNSLGZSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RCNSLGZSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日场内受累故障损失电量
- pewp.setRcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RJXSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RJXSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日检修损失电量
- pewp.setRjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RCNSLJXSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RCNSLJXSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日场内受累检修损失电量
- pewp.setRcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RDJSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RDJSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日待机损失电量
- pewp.setRdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RQXJCLSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RQXJCLSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日缺陷降出力损失电量
- pewp.setRqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RSDTJSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RSDTJSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日手动停机损失电量
- pewp.setRsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RXNSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RXNSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日性能损失电量
- pewp.setRxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RXDTJSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RXDTJSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日限电停机损失电量
- pewp.setRxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RXDJCLSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RXDJCLSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日限电降出力损失电量
- pewp.setRxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RCWSLDWSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RCWSLDWSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日场外受累电网损失电量
- pewp.setRcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RCWSLTQSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RCWSLTQSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日场外受累天气损失电量
- pewp.setRcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RZFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RZFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日增发电量
- pewp.setRzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RQFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RQFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日欠发电量
- pewp.setRqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.RZHD))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.RZHD);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //日自耗电
- pewp.setRzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- //*******************************************日信息统计*********************************************************/
- //*******************************************月信息统计*********************************************************/
- if(pepid1ls.isEmpty())
- {
- setPowerandSpeedMonth(pewp);
- }else
- {
- ProEconEquipmentInfoDay1 pepid=pepid1ls.get(0);
- //如果昨日大于今日最大功率
- if(pepid.getYzdgl()> pewp.getRzdgl())
- {
- pewp.setYzdgl(pepid.getYzdgl());
- }else {
- pewp.setYzdgl(pewp.getRzdgl());
- }
- //如果昨日大于今日最大风速
- if(pepid.getYzdfs()> pewp.getRzdfs())
- {
- pewp.setYzdfs(pepid.getYzdfs());
- }else
- {
- pewp.setYzdfs(pewp.getRzdfs());
- }
- //如果昨日小于今日最小功率
- if(pepid.getYzxgl()< pewp.getRzxgl())
- {
- pewp.setYzxgl(pepid.getYzxgl());
- }else
- {
- pewp.setYzxgl(pewp.getRzxgl());
- }
- //如果昨日小于今日最小风速
- if(pepid.getYzxfs()< pewp.getRzxfs())
- {
- pewp.setYzxfs(pepid.getYzxfs());
- }else
- {
- pewp.setYzxfs(pewp.getRzxfs());
- }
- double pjfs = BigDecimal.valueOf(pewp.getYpjfs() + pepid.getRpjfs()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
- pewp.setYzxfs(pjfs);
- double pjgl = BigDecimal.valueOf(pewp.getYpjgl() + pepid.getRpjgl()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
- pewp.setYzxgl(pjgl);
- }
- if(pointmap.containsKey(ContantXk.YFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月发电量
- pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YKYDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YKYDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月可用电量
- pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YLLFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YLLFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月理论发电量
- pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YGZSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YGZSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月故障损失电量
- pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YCNSLGZSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YCNSLGZSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月场内受累故障损失电量
- pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YJXSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YJXSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月检修损失电量
- pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YCNSLJXSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YCNSLJXSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月场内受累检修损失电量
- pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YDJSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YDJSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月待机损失电量
- pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YQXJCLSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YQXJCLSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月缺陷降出力损失电量
- pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YSDTJSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YSDTJSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月手动停机损失电量
- pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YXNSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YXNSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月性能损失电量
- pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YXDTJSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YXDTJSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月限电停机损失电量
- pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YXDJCLSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YXDJCLSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月限电降出力损失电量
- pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YCWSLDWSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YCWSLDWSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月场外受累电网损失电量
- pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YCWSLTQSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YCWSLTQSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月场外受累天气损失电量
- pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YZFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YZFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月增发电量
- pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YQFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YQFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月欠发电量
- pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.YZHD))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.YZHD);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //月自耗电
- pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- //*******************************************月信息统计*********************************************************/
- //*******************************************年信息统计*********************************************************/
- if(pepid1ls.isEmpty())
- {
- setPowerandSpeedYear(pewp);
- }else
- {
- ProEconEquipmentInfoDay1 pepid=pepid1ls.get(0);
- //如果昨日大于今日最大功率
- if(pepid.getNzdgl()> pewp.getRzdgl())
- {
- pewp.setNzdgl(pepid.getNzdgl());
- }else {
- pewp.setNzdgl(pewp.getRzdgl());
- }
- //如果昨日大于今日最大风速
- if(pepid.getNzdfs()> pewp.getRzdfs())
- {
- pewp.setNzdfs(pepid.getNzdfs());
- }else
- {
- pewp.setNzdfs(pewp.getRzdfs());
- }
- //如果昨日小于今日最小功率
- if(pepid.getNzxgl()< pewp.getRzxgl())
- {
- pewp.setNzxgl(pepid.getNzxgl());
- }else
- {
- pewp.setNzxgl(pewp.getRzxgl());
- }
- //如果昨日小于今日最小风速
- if(pepid.getNzxfs()< pewp.getRzxfs())
- {
- pewp.setNzxfs(pepid.getNzxfs());
- }else
- {
- pewp.setNzxfs(pewp.getRzxfs());
- }
- double pjfs = BigDecimal.valueOf(pewp.getNpjfs() + pepid.getRpjfs()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
- pewp.setNzxfs(pjfs);
- double pjgl = BigDecimal.valueOf(pewp.getNpjgl() + pepid.getRpjgl()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
- pewp.setNzxgl(pjgl);
- }
- if(pointmap.containsKey(ContantXk.NFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年发电量
- pewp.setNfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NKYDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NKYDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年可用电量
- pewp.setNkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NLLFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NLLFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年理论发电量
- pewp.setNllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NGZSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NGZSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年故障损失电量
- pewp.setNgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NCNSLGZSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NCNSLGZSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年场内受累故障损失电量
- pewp.setNcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NJXSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NJXSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年检修损失电量
- pewp.setNjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NCNSLJXSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NCNSLJXSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年场内受累检修损失电量
- pewp.setNcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NDJSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NDJSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年待机损失电量
- pewp.setNdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NQXJCLSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NQXJCLSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年缺陷降出力损失电量
- pewp.setNqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NSDTJSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NSDTJSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年手动停机损失电量
- pewp.setNsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NXNSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NXNSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年性能损失电量
- pewp.setNxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NXDTJSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NXDTJSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年限电停机损失电量
- pewp.setNxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NXDJCLSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NXDJCLSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年限电降出力损失电量
- pewp.setNxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NCWSLDWSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NCWSLDWSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年场外受累电网损失电量
- pewp.setNcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NCWSLTQSSDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NCWSLTQSSDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年场外受累天气损失电量
- pewp.setNcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NZFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NZFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年增发电量
- pewp.setNzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NQFDL))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NQFDL);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年欠发电量
- pewp.setNqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- if(pointmap.containsKey(ContantXk.NZHD))
- {
- ProBasicEquipmentPoint point= pointmap.get(ContantXk.NZHD);
- PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
- if(StringUtils.notEmp(pointValue))
- {
- //年自耗电
- pewp.setNzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
- }
- }
- }
- private void setPowerandSpeedYear(ProEconEquipmentInfoDay1 pewp) {
- //年最大风速
- pewp.setNzdfs(pewp.getRzdfs());
- //年最小风速
- pewp.setNzxfs(pewp.getRzxfs());
- //年平均风速
- pewp.setNpjfs(pewp.getRpjfs());
- //年最大功率
- pewp.setNzdgl(pewp.getRzdgl());
- //年最小功率
- pewp.setNzxgl(pewp.getRzxgl());
- //年平均功率
- pewp.setNpjgl(pewp.getRpjgl());
- }
- private void setPowerandSpeedMonth(ProEconEquipmentInfoDay1 pewp) {
- //月最大风速
- pewp.setYzdfs(pewp.getRzdfs());
- //月最小风速
- pewp.setYzxfs(pewp.getRzxfs());
- //月平均风速
- pewp.setYpjfs(pewp.getRpjfs());
- //月最大功率
- pewp.setYzdgl(pewp.getRzdgl());
- //月最小功率
- pewp.setYzxgl(pewp.getRzxgl());
- //月平均功率
- pewp.setYpjgl(pewp.getRpjgl());
- }
- }
|