123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104 |
- package com.gyee.generation.service;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
- import com.gyee.common.contant.Contant;
- import com.gyee.common.model.PointData;
- import com.gyee.common.model.StringUtils;
- import com.gyee.common.util.CommonUtils;
- import com.gyee.common.util.DateUtils;
- import com.gyee.generation.init.CacheContext;
- import com.gyee.generation.model.auto.*;
- import com.gyee.generation.service.auto.IShutdowneventService;
- import com.gyee.generation.util.realtimesource.IEdosUtil;
- import org.springframework.stereotype.Service;
- import javax.annotation.Resource;
- import java.util.*;
- import java.util.concurrent.atomic.AtomicReference;
- import java.util.stream.Collectors;
- /**
- * @ClassName : FiveLossesService
- * @Author : xieshengjie
- * @Date: 2022/5/2 16:13
- * @Description : 五项损失,欠发状态,欠发发电量
- */
- @Service
- public class FiveLossesService {
- @Resource
- private IEdosUtil edosUtil;
- private List<Windturbine> wtls;
- private Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap;
- private Date samedayZero;
- private Date currentDate;
- private Date tomorrow;
- private List<Windpowerstation> wpls;
- private Map<String, List<Project>> wppromap;
- private Map<String, List<Line>> prolinemap;
- private Map<String, List<Windturbine>> linewtmap;
- private Map<String, Map<String, Windpowerstationpointnew>> wppointmap;
- private Map<String, Map<String, Windpowerstationpointnew>> linepointmap;
- private Map<String, Map<String, Windpowerstationpointnew>> propointmap;
- @Resource
- private IShutdowneventService shutdowneventService;
- private void init(){
- wpls = CacheContext.wpls;
- wtls = CacheContext.wtls;
- wppromap = CacheContext.wppromap;
- prolinemap = CacheContext.prolinemap;
- wppointmap = CacheContext.wppointmap;
- linepointmap = CacheContext.linepointmap;
- propointmap = CacheContext.propointmap;
- wtpAimap = CacheContext.wtpAimap;
- linewtmap = CacheContext.linewtmap;
- samedayZero = DateUtils.getSamedayZero();
- currentDate = DateUtils.getCurrentDate();
- tomorrow = DateUtils.addDays(samedayZero,1);
- }
- public void lossesReal() throws Exception {
- init();
- wtDaylossesReal();
- wtMonthYearlossesReal();
- wpDaylossesReal();
- }
- /**
- * 存储shutdownevent
- */
- public void saveShutdownevent(){
- init();
- List<PointData> resultList = new ArrayList<>();
- QueryWrapper<Shutdownevent> qw = new QueryWrapper<>();
- qw.isNull("starttime");
- qw.isNotNull("stoptime");
- qw.in("windpowerstationid",wpls.stream().map(wp->wp.getId()).collect(Collectors.toList()));
- //查出有故障但没恢复的事件
- List<Shutdownevent> shutdownevents = shutdowneventService.list(qw);
- List<String> faultWinturbines = null;
- List<String> mainWinturbines = null;
- if (StringUtils.isNotEmpty(shutdownevents)){
- faultWinturbines = shutdownevents.stream().filter(i->i.getStatuscode()==2).map(s -> s.getWindturbineid()).collect(Collectors.toList());
- mainWinturbines = shutdownevents.stream().filter(i->i.getStatuscode()==4).map(s -> s.getWindturbineid()).collect(Collectors.toList());
- }
- List<String> finalFaultWinturbines = faultWinturbines;
- List<String> finalMainWinturbines = mainWinturbines;
- wtls.stream().forEach(wt->{
- Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
- Windturbinetestingpointnew ztmxPoint = windturbinetestingpointnewMap.get(Contant.ZTMX);
- Windturbinetestingpointnew bzglPoint = windturbinetestingpointnewMap.get(Contant.BZGL);
- Windturbinetestingpointnew zsglPoint = windturbinetestingpointnewMap.get(Contant.ZSGL);
- Windturbinetestingpointnew powerPoint = windturbinetestingpointnewMap.get(Contant.AI130);
- PointData sectionData = null;
- try {
- sectionData = edosUtil.getSectionData(ztmxPoint, tomorrow.getTime());
- } catch (Exception e) {
- e.printStackTrace();
- }
- double fjzt = sectionData.getPointValueInDouble();
- if (StringUtils.isNotEmpty(finalFaultWinturbines) && finalFaultWinturbines.contains(wt.getId())){ //此风机在之前故障未恢复列表
- if (fjzt!=6){
- //将时间存储到结束时间,算时间与电量
- Optional<Shutdownevent> first = shutdownevents.stream().filter(i -> i.getWindturbineid().equals(wt.getId())).findFirst();
- if (first.isPresent()){
- Shutdownevent shutdownevent = first.get();
- Date starttime = DateUtils.parseLongToDate(sectionData.getPointTime()*1000);
- shutdownevent.setStarttime(starttime);
- Date stoptime = shutdownevent.getStoptime();
- double hour = DateUtils.hoursDiff2(stoptime, starttime);
- shutdownevent.setStophours(hour);
- List<PointData> ztmxDatasSnap = null;
- List<PointData> bzglDatasSnap = null;
- List<PointData> zsglDatasSnap = null;
- List<PointData> powerDatasSnap = null;
- try {
- ztmxDatasSnap = edosUtil.getHistoryDatasSnap(ztmxPoint,stoptime.getTime()/1000,starttime.getTime()/1000,null,60l);
- bzglDatasSnap = edosUtil.getHistoryDatasSnap(bzglPoint,stoptime.getTime()/1000,starttime.getTime()/1000,null,60l);
- zsglDatasSnap = edosUtil.getHistoryDatasSnap(zsglPoint,stoptime.getTime()/1000,starttime.getTime()/1000,null,60l);
- powerDatasSnap = edosUtil.getHistoryDatasSnap(powerPoint, stoptime.getTime() / 1000, starttime.getTime() / 1000, null, 60l);
- } catch (Exception e) {
- e.printStackTrace();
- }
- if (ztmxDatasSnap.size() == zsglDatasSnap.size()){
- //故障
- double gzss = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 6.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRGZSSDL));
- shutdownevent.setLosspower(gzss);
- }
- shutdowneventService.saveOrUpdate(shutdownevent);
- }
- }
- if (fjzt==8){
- Shutdownevent shutdownevent = new Shutdownevent();
- shutdownevent.setId(CommonUtils.getUUID());
- shutdownevent.setWindpowerstationid(wt.getWindpowerstationid());
- shutdownevent.setWindturbineid(wt.getId());
- Date date = DateUtils.parseLongToDate(sectionData.getPointTime()*1000);
- shutdownevent.setStoptime(date);
- shutdownevent.setProjectid(wt.getProjectid());
- shutdownevent.setStatuscode(4);
- shutdowneventService.save(shutdownevent);
- }
- }
- else if (StringUtils.isNotEmpty(finalMainWinturbines) && finalMainWinturbines.contains(wt.getId())){ //此风机在之前故障未恢复列表
- if (fjzt!=8){
- //将时间存储到结束时间,算时间与电量
- Optional<Shutdownevent> first = shutdownevents.stream().filter(i -> i.getWindturbineid().equals(wt.getId())).findFirst();
- if (first.isPresent()){
- Shutdownevent shutdownevent = first.get();
- Date starttime = DateUtils.parseLongToDate(sectionData.getPointTime()*1000);
- shutdownevent.setStarttime(starttime);
- Date stoptime = shutdownevent.getStoptime();
- double hour = DateUtils.hoursDiff2(stoptime, starttime);
- shutdownevent.setStophours(hour);
- List<PointData> ztmxDatasSnap = null;
- List<PointData> bzglDatasSnap = null;
- List<PointData> zsglDatasSnap = null;
- List<PointData> powerDatasSnap = null;
- try {
- ztmxDatasSnap = edosUtil.getHistoryDatasSnap(ztmxPoint,stoptime.getTime()/1000,starttime.getTime()/1000,null,60l);
- bzglDatasSnap = edosUtil.getHistoryDatasSnap(bzglPoint,stoptime.getTime()/1000,starttime.getTime()/1000,null,60l);
- zsglDatasSnap = edosUtil.getHistoryDatasSnap(zsglPoint,stoptime.getTime()/1000,starttime.getTime()/1000,null,60l);
- powerDatasSnap = edosUtil.getHistoryDatasSnap(powerPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
- } catch (Exception e) {
- e.printStackTrace();
- }
- if (ztmxDatasSnap.size() == zsglDatasSnap.size()){
- //维护
- double jxss = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 8.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRJXSSDL));
- shutdownevent.setLosspower(jxss);
- }
- shutdowneventService.saveOrUpdate(shutdownevent);
- }
- }
- if (fjzt==6){
- Shutdownevent shutdownevent = new Shutdownevent();
- shutdownevent.setId(CommonUtils.getUUID());
- shutdownevent.setWindpowerstationid(wt.getWindpowerstationid());
- shutdownevent.setWindturbineid(wt.getId());
- Date date = DateUtils.parseLongToDate(sectionData.getPointTime()*1000);
- shutdownevent.setStoptime(date);
- shutdownevent.setProjectid(wt.getProjectid());
- shutdownevent.setStatuscode(2);
- shutdowneventService.save(shutdownevent);
- }
- }
- else { //没有没结束的故障维护事件
- if (fjzt==6 || fjzt==8){
- Shutdownevent shutdownevent = new Shutdownevent();
- shutdownevent.setId(CommonUtils.getUUID());
- shutdownevent.setWindpowerstationid(wt.getWindpowerstationid());
- shutdownevent.setWindturbineid(wt.getId());
- Date date = DateUtils.parseLongToDate(sectionData.getPointTime()*1000);
- shutdownevent.setStoptime(date);
- shutdownevent.setProjectid(wt.getProjectid());
- if (fjzt == 6){
- shutdownevent.setStatuscode(2);
- }else {
- shutdownevent.setStatuscode(4);
- }
- shutdowneventService.save(shutdownevent);
- }
- }
- });
- }
- /**
- * 场站五损,欠发电量
- */
- private void wpDaylossesReal() throws Exception {
- List<PointData> resultList = new ArrayList<>();
- wpls.stream().forEach(wp->{
- List<Project> projects = wppromap.get(wp.getId());
- Map<String, Windpowerstationpointnew> wppointnewMap = wppointmap.get(wp.getId());
- AtomicReference<Double> wpdaydjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthdjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyeardjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdaysdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthsdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyearsdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayxnloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthxnloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyearxnloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayfdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthfdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyearfdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdaygzloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthgzloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyeargzloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdaygzslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthgzslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyeargzslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdaywhloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthwhloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyearwhloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdaywhslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthwhslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyearwhslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayxdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthxdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyearxdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayxdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthxdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyearxdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdaydwslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthdwslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyeardwslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayhjslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpmonthhjslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpyearhjslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayqf0 = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayqf1 = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayqf2 = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayqf3 = new AtomicReference<>(0.0);
- AtomicReference<Double> wpdayqf4= new AtomicReference<>(0.0);
- projects.stream().forEach(project -> {
- List<Line> lines = prolinemap.get(project.getId());
- Map<String, Windpowerstationpointnew> projectpointnewMap = propointmap.get(project.getId());
- AtomicReference<Double> projectdaydjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthdjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyeardjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdaysdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthsdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyearsdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayxnloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthxnloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyearxnloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayfdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthfdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyearfdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdaygzloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthgzloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyeargzloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdaygzslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthgzslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyeargzslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdaywhloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthwhloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyearwhloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdaywhslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthwhslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyearwhslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayxdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthxdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyearxdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayxdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthxdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyearxdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdaydwslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthdwslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyeardwslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayhjslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectmonthhjslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectyearhjslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayqf0 = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayqf1 = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayqf2 = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayqf3 = new AtomicReference<>(0.0);
- AtomicReference<Double> projectdayqf4 = new AtomicReference<>(0.0);
- lines.stream().forEach(line -> {
- List<Windturbine> windturbines = linewtmap.get(line.getId());
- Map<String, Windpowerstationpointnew> linepointnewMap = linepointmap.get(line.getId());
- AtomicReference<Double> linedaydjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthdjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyeardjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedaysdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthsdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyearsdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayxnloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthxnloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyearxnloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayfdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthfdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyearfdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedaygzloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthgzloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyeargzloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedaygzslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthgzslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyeargzslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedaywhloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthwhloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyearwhloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedaywhslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthwhslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyearwhslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayxdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthxdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyearxdtjloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayxdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthxdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyearxdjclloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedaydwslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthdwslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyeardwslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayhjslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linemonthhjslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> lineyearhjslloss = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayqf0 = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayqf1 = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayqf2 = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayqf3 = new AtomicReference<>(0.0);
- AtomicReference<Double> linedayqf4 = new AtomicReference<>(0.0);
- windturbines.stream().forEach(wt->{
- Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
- //待机
- Windturbinetestingpointnew dayDjPoint = windturbinetestingpointnewMap.get(Contant.WTRDJSSDL);
- Windturbinetestingpointnew monthDjPoint = windturbinetestingpointnewMap.get(Contant.WTYDJSSDL);
- Windturbinetestingpointnew yearDjPoint = windturbinetestingpointnewMap.get(Contant.WTNDJSSDL);
- geneLineloss(linedaydjloss, linemonthdjloss, lineyeardjloss, dayDjPoint, monthDjPoint, yearDjPoint);
- //手动停机
- Windturbinetestingpointnew daySdtjPoint = windturbinetestingpointnewMap.get(Contant.WTRSTSSDL);
- Windturbinetestingpointnew monthSdtjPoint = windturbinetestingpointnewMap.get(Contant.WTYSTSSDL);
- Windturbinetestingpointnew yearSdtjPoint = windturbinetestingpointnewMap.get(Contant.WTNSTSSDL);
- geneLineloss(linedaysdtjloss, linemonthsdtjloss, lineyearsdtjloss, daySdtjPoint, monthSdtjPoint, yearSdtjPoint);
- //性能
- Windturbinetestingpointnew dayXnPoint = windturbinetestingpointnewMap.get(Contant.WTRXNSSDL);
- Windturbinetestingpointnew monthXnPoint = windturbinetestingpointnewMap.get(Contant.WTYXNSSDL);
- Windturbinetestingpointnew yearXnPoint = windturbinetestingpointnewMap.get(Contant.WTNXNSSDL);
- geneLineloss(linedayxnloss, linemonthxnloss, lineyearxnloss, dayXnPoint, monthXnPoint, yearXnPoint);
- //发电降出力
- Windturbinetestingpointnew dayFdjclPoint = windturbinetestingpointnewMap.get(Contant.WTRQXSSDL);
- Windturbinetestingpointnew monthFdjclPoint = windturbinetestingpointnewMap.get(Contant.WTYQXSSDL);
- Windturbinetestingpointnew yearFdjclPoint = windturbinetestingpointnewMap.get(Contant.WTNQXSSDL);
- geneLineloss(linedayfdjclloss, linemonthfdjclloss, lineyearfdjclloss, dayFdjclPoint, monthFdjclPoint, yearFdjclPoint);
- //故障
- Windturbinetestingpointnew dayGzPoint = windturbinetestingpointnewMap.get(Contant.WTRGZSSDL);
- Windturbinetestingpointnew monthGzPoint = windturbinetestingpointnewMap.get(Contant.WTYGZSSDL);
- Windturbinetestingpointnew yearGzPoint = windturbinetestingpointnewMap.get(Contant.WTNGZSSDL);
- geneLineloss(linedaygzloss, linemonthgzloss, lineyeargzloss, dayGzPoint, monthGzPoint, yearGzPoint);
- //故障受累
- Windturbinetestingpointnew dayGzslPoint = windturbinetestingpointnewMap.get(Contant.WTRSZSSDL);
- Windturbinetestingpointnew monthGzslPoint = windturbinetestingpointnewMap.get(Contant.WTYSZSSDL);
- Windturbinetestingpointnew yearGzslPoint = windturbinetestingpointnewMap.get(Contant.WTNSZSSDL);
- geneLineloss(linedaygzslloss, linemonthgzslloss, lineyeargzslloss, dayGzslPoint, monthGzslPoint, yearGzslPoint);
- //维护
- Windturbinetestingpointnew dayWhPoint = windturbinetestingpointnewMap.get(Contant.WTRJXSSDL);
- Windturbinetestingpointnew monthWhPoint = windturbinetestingpointnewMap.get(Contant.WTYJXSSDL);
- Windturbinetestingpointnew yearWhPoint = windturbinetestingpointnewMap.get(Contant.WTNJXSSDL);
- geneLineloss(linedaywhloss, linemonthwhloss, lineyearwhloss, dayWhPoint, monthWhPoint, yearWhPoint);
- //维护受累
- Windturbinetestingpointnew dayWhslPoint = windturbinetestingpointnewMap.get(Contant.WTRLZSSDL);
- Windturbinetestingpointnew monthWhslPoint = windturbinetestingpointnewMap.get(Contant.WTYLZSSDL);
- Windturbinetestingpointnew yearWhslPoint = windturbinetestingpointnewMap.get(Contant.WTNLZSSDL);
- geneLineloss(linedaywhslloss, linemonthwhslloss, lineyearwhslloss, dayWhslPoint, monthWhslPoint, yearWhslPoint);
- //限电降出力
- Windturbinetestingpointnew dayXdjclPoint = windturbinetestingpointnewMap.get(Contant.WTRQFSSDL);
- Windturbinetestingpointnew monthXdjclPoint = windturbinetestingpointnewMap.get(Contant.WTYQFSSDL);
- Windturbinetestingpointnew yearXdjclPoint = windturbinetestingpointnewMap.get(Contant.WTNQFSSDL);
- geneLineloss(linedayxdjclloss, linemonthxdjclloss, lineyearxdjclloss, dayXdjclPoint, monthXdjclPoint, yearXdjclPoint);
- //限电停机
- Windturbinetestingpointnew dayXdtjPoint = windturbinetestingpointnewMap.get(Contant.WTRXDSSDL);
- Windturbinetestingpointnew monthXdtjPoint = windturbinetestingpointnewMap.get(Contant.WTYXDSSDL);
- Windturbinetestingpointnew yearXdtjPoint = windturbinetestingpointnewMap.get(Contant.WTNXDSSDL);
- geneLineloss(linedayxdtjloss, linemonthxdtjloss, lineyearxdtjloss, dayXdtjPoint, monthXdtjPoint, yearXdtjPoint);
- //电网受累
- Windturbinetestingpointnew dayDwslPoint = windturbinetestingpointnewMap.get(Contant.WTRWZSSDL);
- Windturbinetestingpointnew monthDwslPoint = windturbinetestingpointnewMap.get(Contant.WTYWZSSDL);
- Windturbinetestingpointnew yearDwslPoint = windturbinetestingpointnewMap.get(Contant.WTNWZSSDL);
- geneLineloss(linedaydwslloss, linemonthdwslloss, lineyeardwslloss, dayDwslPoint, monthDwslPoint, yearDwslPoint);
- //环境受累
- Windturbinetestingpointnew dayHjslPoint = windturbinetestingpointnewMap.get(Contant.WTRTZSSDL);
- Windturbinetestingpointnew monthHjslPoint = windturbinetestingpointnewMap.get(Contant.WTYTZSSDL);
- Windturbinetestingpointnew yearHjslPoint = windturbinetestingpointnewMap.get(Contant.WTNTZSSDL);
- geneLineloss(linedayhjslloss, linemonthhjslloss, lineyearhjslloss, dayHjslPoint, monthHjslPoint, yearHjslPoint);
- //欠发发电量
- Windturbinetestingpointnew dayqf0 = windturbinetestingpointnewMap.get(Contant.R0QFZT);
- Windturbinetestingpointnew dayqf1 = windturbinetestingpointnewMap.get(Contant.R1QFZT);
- Windturbinetestingpointnew dayqf2 = windturbinetestingpointnewMap.get(Contant.R2QFZT);
- Windturbinetestingpointnew dayqf3 = windturbinetestingpointnewMap.get(Contant.R3QFZT);
- Windturbinetestingpointnew dayqf4 = windturbinetestingpointnewMap.get(Contant.R4QFZT);
- geneLineQfloss(linedayqf0, linedayqf1, linedayqf2,linedayqf3,linedayqf4, dayqf0, dayqf1, dayqf2,dayqf3,dayqf4);
- });
- //待机
- addWpPoint(resultList, linepointnewMap.get(Contant.RSDJZSDL), linedaydjloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YSDJZSDL), linemonthdjloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NSDJZSDL), lineyeardjloss);
- projectdaydjloss.updateAndGet(v->new Double((double) (v + linedaydjloss.get())));
- projectmonthdjloss.updateAndGet(v->new Double((double) (v + linemonthdjloss.get())));
- projectyeardjloss.updateAndGet(v->new Double((double) (v + lineyeardjloss.get())));
- //手动停机
- addWpPoint(resultList, linepointnewMap.get(Contant.RSSTZSDL), linedaysdtjloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YSSTZSDL), linemonthsdtjloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NSSTZSDL), lineyearsdtjloss);
- projectdaysdtjloss.updateAndGet(v->new Double((double) (v + linedaysdtjloss.get())));
- projectmonthsdtjloss.updateAndGet(v->new Double((double) (v + linemonthsdtjloss.get())));
- projectyearsdtjloss.updateAndGet(v->new Double((double) (v + lineyearsdtjloss.get())));
- //性能
- addWpPoint(resultList, linepointnewMap.get(Contant.RXNZSDL), linedayxnloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YXNZSDL), linemonthxnloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NXNZSDL), lineyearxnloss);
- projectdayxnloss.updateAndGet(v->new Double((double) (v + linedayxnloss.get())));
- projectmonthxnloss.updateAndGet(v->new Double((double) (v + linemonthxnloss.get())));
- projectyearxnloss.updateAndGet(v->new Double((double) (v + lineyearxnloss.get())));
- //发电降出力
- addWpPoint(resultList, linepointnewMap.get(Contant.RSQXZSDL), linedayfdjclloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YSQXZSDL), linemonthfdjclloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NSQXZSDL), lineyearfdjclloss);
- projectdayfdjclloss.updateAndGet(v->new Double((double) (v + linedayfdjclloss.get())));
- projectmonthfdjclloss.updateAndGet(v->new Double((double) (v + linemonthfdjclloss.get())));
- projectyearfdjclloss.updateAndGet(v->new Double((double) (v + lineyearfdjclloss.get())));
- double xnss = linedaydjloss.get() + linedaysdtjloss.get() + linedayxnloss.get() + linedayfdjclloss.get();
- resultList.add(createWpPointData(linepointnewMap.get(Contant.XNSSDL),xnss));
- //故障
- addWpPoint(resultList, linepointnewMap.get(Contant.RGZZSDL), linedaygzloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YGZZSDL), linemonthgzloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NGZZSDL), lineyeargzloss);
- projectdaygzloss.updateAndGet(v->new Double((double) (v + linedaygzloss.get())));
- projectmonthgzloss.updateAndGet(v->new Double((double) (v + linemonthgzloss.get())));
- projectyeargzloss.updateAndGet(v->new Double((double) (v + lineyeargzloss.get())));
- //故障受累
- addWpPoint(resultList, linepointnewMap.get(Contant.RSZZSDL), linedaygzslloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YSZZSDL), linemonthgzslloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NSZZSDL), lineyeargzslloss);
- projectdaygzslloss.updateAndGet(v->new Double((double) (v + linedaygzslloss.get())));
- projectmonthgzslloss.updateAndGet(v->new Double((double) (v + linemonthgzslloss.get())));
- projectyeargzslloss.updateAndGet(v->new Double((double) (v + lineyeargzslloss.get())));
- double gzss = linedaygzloss.get()+linedaygzslloss.get();
- resultList.add(createWpPointData(linepointnewMap.get(Contant.GZSSDL),gzss));
- //维护
- addWpPoint(resultList, linepointnewMap.get(Contant.RJXZSDL), linedaywhloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YJXZSDL), linemonthwhloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NJXZSDL), lineyearwhloss);
- projectdaywhloss.updateAndGet(v->new Double((double) (v + linedaywhloss.get())));
- projectmonthwhloss.updateAndGet(v->new Double((double) (v + linemonthwhloss.get())));
- projectyearwhloss.updateAndGet(v->new Double((double) (v + lineyearwhloss.get())));
- //维护受累
- addWpPoint(resultList, linepointnewMap.get(Contant.RLZZSDL), linedaywhslloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YLZZSDL), linemonthwhslloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NLZZSDL), lineyearwhslloss);
- projectdaywhslloss.updateAndGet(v->new Double((double) (v + linedaywhslloss.get())));
- projectmonthwhslloss.updateAndGet(v->new Double((double) (v + linemonthwhslloss.get())));
- projectyearwhslloss.updateAndGet(v->new Double((double) (v + lineyearwhslloss.get())));
- double whss = linedaywhloss.get()+linedaywhslloss.get();
- resultList.add(createWpPointData(linepointnewMap.get(Contant.WHSSDL),whss));
- //限电降出力
- addWpPoint(resultList, linepointnewMap.get(Contant.RQFZSDL), linedayxdjclloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YQFZSDL), linemonthxdjclloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NQFZSDL), lineyearxdjclloss);
- projectdayxdjclloss.updateAndGet(v->new Double((double) (v + linedayxdjclloss.get())));
- projectmonthxdjclloss.updateAndGet(v->new Double((double) (v + linemonthxdjclloss.get())));
- projectyearxdjclloss.updateAndGet(v->new Double((double) (v + lineyearxdjclloss.get())));
- //限电停机
- addWpPoint(resultList, linepointnewMap.get(Contant.RXDZSDL), linedayxdtjloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YXDZSDL), linemonthxdtjloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NXDZSDL), lineyearxdtjloss);
- projectdayxdtjloss.updateAndGet(v->new Double((double) (v + linedayxdtjloss.get())));
- projectmonthxdtjloss.updateAndGet(v->new Double((double) (v + linemonthxdtjloss.get())));
- projectyearxdtjloss.updateAndGet(v->new Double((double) (v + lineyearxdtjloss.get())));
- double xdss = linedayxdjclloss.get()+linedayxdtjloss.get();
- resultList.add(createWpPointData(linepointnewMap.get(Contant.XDSSDL),xdss));
- //电网受累
- addWpPoint(resultList, linepointnewMap.get(Contant.RWZZSDL), linedaydwslloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YWZZSDL), linemonthdwslloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NWZZSDL), lineyeardwslloss);
- projectdaydwslloss.updateAndGet(v->new Double((double) (v + linedaydwslloss.get())));
- projectmonthdwslloss.updateAndGet(v->new Double((double) (v + linemonthdwslloss.get())));
- projectyeardwslloss.updateAndGet(v->new Double((double) (v + lineyeardwslloss.get())));
- //环境受累
- addWpPoint(resultList, linepointnewMap.get(Contant.RTZZSDL), linedayhjslloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.YTZZSDL), linemonthhjslloss);
- addWpPoint(resultList, linepointnewMap.get(Contant.NTZZSDL), lineyearhjslloss);
- projectdayhjslloss.updateAndGet(v->new Double((double) (v + linedayhjslloss.get())));
- projectmonthhjslloss.updateAndGet(v->new Double((double) (v + linemonthhjslloss.get())));
- projectyearhjslloss.updateAndGet(v->new Double((double) (v + lineyearhjslloss.get())));
- double slss = linedayhjslloss.get()+linedaydwslloss.get();
- resultList.add(createWpPointData(linepointnewMap.get(Contant.SLSSDL),slss));
- //欠发发电量
- addWpPoint(resultList, linepointnewMap.get(Contant.R0QFZT), linedayqf0);
- addWpPoint(resultList, linepointnewMap.get(Contant.R1QFZT), linedayqf1);
- addWpPoint(resultList, linepointnewMap.get(Contant.R2QFZT), linedayqf2);
- addWpPoint(resultList, linepointnewMap.get(Contant.R3QFZT), linedayqf3);
- addWpPoint(resultList, linepointnewMap.get(Contant.R4QFZT), linedayqf4);
- projectdayqf0.updateAndGet(v->new Double((double) (v + linedayqf0.get())));
- projectdayqf1.updateAndGet(v->new Double((double) (v + linedayqf1.get())));
- projectdayqf2.updateAndGet(v->new Double((double) (v + linedayqf2.get())));
- projectdayqf3.updateAndGet(v->new Double((double) (v + linedayqf3.get())));
- projectdayqf4.updateAndGet(v->new Double((double) (v + linedayqf4.get())));
- });
- //待机
- addWpPoint(resultList, projectpointnewMap.get(Contant.RSDJZSDL), projectdaydjloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YSDJZSDL), projectmonthdjloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NSDJZSDL), projectyeardjloss);
- wpdaydjloss.updateAndGet(v->new Double((double) (v + projectdaydjloss.get())));
- wpmonthdjloss.updateAndGet(v->new Double((double) (v + projectmonthdjloss.get())));
- wpyeardjloss.updateAndGet(v->new Double((double) (v + projectyeardjloss.get())));
- //手动停机
- addWpPoint(resultList, projectpointnewMap.get(Contant.RSSTZSDL), projectdaysdtjloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YSSTZSDL), projectmonthsdtjloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NSSTZSDL), projectyearsdtjloss);
- wpdaysdtjloss.updateAndGet(v->new Double((double) (v + projectdaysdtjloss.get())));
- wpmonthsdtjloss.updateAndGet(v->new Double((double) (v + projectmonthsdtjloss.get())));
- wpyearsdtjloss.updateAndGet(v->new Double((double) (v + projectyearsdtjloss.get())));
- //性能
- addWpPoint(resultList, projectpointnewMap.get(Contant.RXNZSDL), projectdayxnloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YXNZSDL), projectmonthxnloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NXNZSDL), projectyearxnloss);
- wpdayxnloss.updateAndGet(v->new Double((double) (v + projectdayxnloss.get())));
- wpmonthxnloss.updateAndGet(v->new Double((double) (v + projectmonthxnloss.get())));
- wpyearxnloss.updateAndGet(v->new Double((double) (v + projectyearxnloss.get())));
- //发电降出力
- addWpPoint(resultList, projectpointnewMap.get(Contant.RSQXZSDL), projectdayfdjclloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YSQXZSDL), projectmonthfdjclloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NSQXZSDL), projectyearfdjclloss);
- wpdayfdjclloss.updateAndGet(v->new Double((double) (v + projectdayfdjclloss.get())));
- wpmonthfdjclloss.updateAndGet(v->new Double((double) (v + projectmonthfdjclloss.get())));
- wpyearfdjclloss.updateAndGet(v->new Double((double) (v + projectyearfdjclloss.get())));
- double xnss = projectdaydjloss.get() + projectdaysdtjloss.get()+projectdayxnloss.get()+projectdayfdjclloss.get();
- resultList.add(createWpPointData(projectpointnewMap.get(Contant.XNSSDL),xnss));
- //故障
- addWpPoint(resultList, projectpointnewMap.get(Contant.RGZZSDL), projectdaygzloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YGZZSDL), projectmonthgzloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NGZZSDL), projectyeargzloss);
- wpdaygzloss.updateAndGet(v->new Double((double) (v + projectdaygzloss.get())));
- wpmonthgzloss.updateAndGet(v->new Double((double) (v + projectmonthgzloss.get())));
- wpyeargzloss.updateAndGet(v->new Double((double) (v + projectyeargzloss.get())));
- //故障受累
- addWpPoint(resultList, projectpointnewMap.get(Contant.RSZZSDL), projectdaygzslloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YSZZSDL), projectmonthgzslloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NSZZSDL), projectyeargzslloss);
- wpdaygzslloss.updateAndGet(v->new Double((double) (v + projectdaygzslloss.get())));
- wpmonthgzslloss.updateAndGet(v->new Double((double) (v + projectmonthgzslloss.get())));
- wpyeargzslloss.updateAndGet(v->new Double((double) (v + projectyeargzslloss.get())));
- double gzss = projectdaygzloss.get() + projectdaygzslloss.get();
- resultList.add(createWpPointData(projectpointnewMap.get(Contant.GZSSDL),gzss));
- //维护
- addWpPoint(resultList, projectpointnewMap.get(Contant.RJXZSDL), projectdaywhloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YJXZSDL), projectmonthwhloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NJXZSDL), projectyearwhloss);
- wpdaywhloss.updateAndGet(v->new Double((double) (v + projectdaywhloss.get())));
- wpmonthwhloss.updateAndGet(v->new Double((double) (v + projectmonthwhloss.get())));
- wpyearwhloss.updateAndGet(v->new Double((double) (v + projectyearwhloss.get())));
- //维护受累
- addWpPoint(resultList, projectpointnewMap.get(Contant.RLZZSDL), projectdaywhslloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YLZZSDL), projectmonthwhslloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NLZZSDL), projectyearwhslloss);
- wpdaywhslloss.updateAndGet(v->new Double((double) (v + projectdaywhslloss.get())));
- wpmonthwhslloss.updateAndGet(v->new Double((double) (v + projectmonthwhslloss.get())));
- wpyearwhslloss.updateAndGet(v->new Double((double) (v + projectyearwhslloss.get())));
- double whss = projectdaywhloss.get() + projectdaywhslloss.get();
- resultList.add(createWpPointData(projectpointnewMap.get(Contant.WHSSDL),whss));
- //限电降出力
- addWpPoint(resultList, projectpointnewMap.get(Contant.RQFZSDL), projectdayxdjclloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YQFZSDL), projectmonthxdjclloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NQFZSDL), projectyearxdjclloss);
- wpdayxdjclloss.updateAndGet(v->new Double((double) (v + projectdayxdjclloss.get())));
- wpmonthxdjclloss.updateAndGet(v->new Double((double) (v + projectmonthxdjclloss.get())));
- wpyearxdjclloss.updateAndGet(v->new Double((double) (v + projectyearxdjclloss.get())));
- //限电停机
- addWpPoint(resultList, projectpointnewMap.get(Contant.RXDZSDL), projectdayxdtjloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YXDZSDL), projectmonthxdtjloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NXDZSDL), projectyearxdtjloss);
- wpdayxdtjloss.updateAndGet(v->new Double((double) (v + projectdayxdtjloss.get())));
- wpmonthxdtjloss.updateAndGet(v->new Double((double) (v + projectmonthxdtjloss.get())));
- wpyearxdtjloss.updateAndGet(v->new Double((double) (v + projectyearxdtjloss.get())));
- double xdss = projectdayxdjclloss.get() + projectdayxdtjloss.get();
- resultList.add(createWpPointData(projectpointnewMap.get(Contant.XDSSDL),xdss));
- //电网受累
- addWpPoint(resultList, projectpointnewMap.get(Contant.RWZZSDL), projectdaydwslloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YWZZSDL), projectmonthdwslloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NWZZSDL), projectyeardwslloss);
- wpdaydwslloss.updateAndGet(v->new Double((double) (v + projectdaydwslloss.get())));
- wpmonthdwslloss.updateAndGet(v->new Double((double) (v + projectmonthdwslloss.get())));
- wpyeardwslloss.updateAndGet(v->new Double((double) (v + projectyeardwslloss.get())));
- //环境受累
- addWpPoint(resultList, projectpointnewMap.get(Contant.RTZZSDL), projectdayhjslloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.YTZZSDL), projectmonthhjslloss);
- addWpPoint(resultList, projectpointnewMap.get(Contant.NTZZSDL), projectyearhjslloss);
- wpdayhjslloss.updateAndGet(v->new Double((double) (v + projectdayhjslloss.get())));
- wpmonthhjslloss.updateAndGet(v->new Double((double) (v + projectmonthhjslloss.get())));
- wpyearhjslloss.updateAndGet(v->new Double((double) (v + projectyearhjslloss.get())));
- double slss = projectdaydwslloss.get() + projectdayhjslloss.get();
- resultList.add(createWpPointData(projectpointnewMap.get(Contant.SLSSDL),slss));
- //欠发发电量
- addWpPoint(resultList, projectpointnewMap.get(Contant.R0QFZT), projectdayqf0);
- addWpPoint(resultList, projectpointnewMap.get(Contant.R1QFZT), projectdayqf1);
- addWpPoint(resultList, projectpointnewMap.get(Contant.R2QFZT), projectdayqf2);
- addWpPoint(resultList, projectpointnewMap.get(Contant.R3QFZT), projectdayqf3);
- addWpPoint(resultList, projectpointnewMap.get(Contant.R4QFZT), projectdayqf4);
- wpdayqf0.updateAndGet(v->new Double((double) (v + projectdayqf0.get())));
- wpdayqf1.updateAndGet(v->new Double((double) (v + projectdayqf1.get())));
- wpdayqf2.updateAndGet(v->new Double((double) (v + projectdayqf2.get())));
- wpdayqf3.updateAndGet(v->new Double((double) (v + projectdayqf3.get())));
- wpdayqf4.updateAndGet(v->new Double((double) (v + projectdayqf4.get())));
- });
- //待机
- addWpPoint(resultList, wppointnewMap.get(Contant.RSDJZSDL), wpdaydjloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YSDJZSDL), wpmonthdjloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NSDJZSDL), wpyeardjloss);
- //手动停机
- addWpPoint(resultList, wppointnewMap.get(Contant.RSSTZSDL), wpdaysdtjloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YSSTZSDL), wpmonthsdtjloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NSSTZSDL), wpyearsdtjloss);
- //性能
- addWpPoint(resultList, wppointnewMap.get(Contant.RXNZSDL), wpdayxnloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YXNZSDL), wpmonthxnloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NXNZSDL), wpyearxnloss);
- //发电降出力
- addWpPoint(resultList, wppointnewMap.get(Contant.RSQXZSDL), wpdayfdjclloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YSQXZSDL), wpmonthfdjclloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NSQXZSDL), wpyearfdjclloss);
- double xnss = wpdaydjloss.get() + wpdaysdtjloss.get()+wpdayxnloss.get()+wpdayfdjclloss.get();
- resultList.add(createWpPointData(wppointnewMap.get(Contant.XNSSDL),xnss));
- //故障
- addWpPoint(resultList, wppointnewMap.get(Contant.RGZZSDL), wpdaygzloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YGZZSDL), wpmonthgzloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NGZZSDL), wpyeargzloss);
- //故障受累
- addWpPoint(resultList, wppointnewMap.get(Contant.RSZZSDL), wpdaygzslloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YSZZSDL), wpmonthgzslloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NSZZSDL), wpyeargzslloss);
- double gzss = wpdaygzloss.get() + wpdaygzslloss.get();
- resultList.add(createWpPointData(wppointnewMap.get(Contant.GZSSDL),gzss));
- //维护
- addWpPoint(resultList, wppointnewMap.get(Contant.RJXZSDL), wpdaywhloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YJXZSDL), wpmonthwhloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NJXZSDL), wpyearwhloss);
- //维护受累
- addWpPoint(resultList, wppointnewMap.get(Contant.RLZZSDL), wpdaywhslloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YLZZSDL), wpmonthwhslloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NLZZSDL), wpyearwhslloss);
- double whss = wpdaywhloss.get() + wpdaywhslloss.get();
- resultList.add(createWpPointData(wppointnewMap.get(Contant.WHSSDL),whss));
- //限电降出力
- addWpPoint(resultList, wppointnewMap.get(Contant.RQFZSDL), wpdayxdjclloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YQFZSDL), wpmonthxdjclloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NQFZSDL), wpyearxdjclloss);
- //限电停机
- addWpPoint(resultList, wppointnewMap.get(Contant.RXDZSDL), wpdayxdtjloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YXDZSDL), wpmonthxdtjloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NXDZSDL), wpyearxdtjloss);
- double xdss = wpdayxdjclloss.get() + wpdayxdtjloss.get();
- resultList.add(createWpPointData(wppointnewMap.get(Contant.XDSSDL),xdss));
- //电网受累
- addWpPoint(resultList, wppointnewMap.get(Contant.RWZZSDL), wpdaydwslloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YWZZSDL), wpmonthdwslloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NWZZSDL), wpyeardwslloss);
- //环境受累
- addWpPoint(resultList, wppointnewMap.get(Contant.RTZZSDL), wpdayhjslloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.YTZZSDL), wpmonthhjslloss);
- addWpPoint(resultList, wppointnewMap.get(Contant.NTZZSDL), wpyearhjslloss);
- double slss = wpdaydwslloss.get() + wpdayhjslloss.get();
- resultList.add(createWpPointData(wppointnewMap.get(Contant.SLSSDL),slss));
- //欠发发电量
- addWpPoint(resultList, wppointnewMap.get(Contant.R0QFZT), wpdayqf0);
- addWpPoint(resultList, wppointnewMap.get(Contant.R1QFZT), wpdayqf1);
- addWpPoint(resultList, wppointnewMap.get(Contant.R2QFZT), wpdayqf2);
- addWpPoint(resultList, wppointnewMap.get(Contant.R3QFZT), wpdayqf3);
- addWpPoint(resultList, wppointnewMap.get(Contant.R4QFZT), wpdayqf4);
- });
- edosUtil.sendMultiPoint(resultList);
- }
- private void geneLineQfloss(AtomicReference<Double> linedayqf0, AtomicReference<Double> linedayqf1, AtomicReference<Double> linedayqf2, AtomicReference<Double> linedayqf3, AtomicReference<Double> linedayqf4, Windturbinetestingpointnew dayqf0, Windturbinetestingpointnew dayqf1, Windturbinetestingpointnew dayqf2, Windturbinetestingpointnew dayqf3, Windturbinetestingpointnew dayqf4) {
- double wtdayqf0 = 0.0;
- double wtdayqf1 = 0.0;
- double wtdayqf2 = 0.0;
- double wtdayqf3 = 0.0;
- double wtdayqf4 = 0.0;
- try {
- wtdayqf0 = edosUtil.getSectionData(dayqf0,tomorrow.getTime()).getPointValueInDouble();
- wtdayqf1 = edosUtil.getSectionData(dayqf1,tomorrow.getTime()).getPointValueInDouble();
- wtdayqf2 = edosUtil.getSectionData(dayqf2,tomorrow.getTime()).getPointValueInDouble();
- wtdayqf3 = edosUtil.getSectionData(dayqf3,tomorrow.getTime()).getPointValueInDouble();
- wtdayqf4 = edosUtil.getSectionData(dayqf4,tomorrow.getTime()).getPointValueInDouble();
- } catch (Exception e) {
- e.printStackTrace();
- }
- double finalWtdayqf = wtdayqf0;
- linedayqf0.updateAndGet(v -> new Double((double) (v + finalWtdayqf)));
- double finalWtdayqf1 = wtdayqf1;
- linedayqf1.updateAndGet(v -> new Double((double) (v + finalWtdayqf1)));
- double finalWtdayqf2 = wtdayqf2;
- linedayqf2.updateAndGet(v -> new Double((double) (v + finalWtdayqf2)));
- double finalWtdayqf3 = wtdayqf3;
- linedayqf3.updateAndGet(v -> new Double((double) (v + finalWtdayqf3)));
- double finalWtdayqf4 = wtdayqf4;
- linedayqf4.updateAndGet(v -> new Double((double) (v + finalWtdayqf4)));
- }
- private void addWpPoint(List<PointData> resultList, Windpowerstationpointnew pointnew, AtomicReference<Double> linedaydjloss) {
- PointData wpPointData = createWpPointData(pointnew, linedaydjloss.get());
- resultList.add(wpPointData);
- }
- private void geneLineloss(AtomicReference<Double> linedaydjloss, AtomicReference<Double> linemonthdjloss, AtomicReference<Double> lineyeardjloss, Windturbinetestingpointnew dayDjPoint, Windturbinetestingpointnew monthDjPoint, Windturbinetestingpointnew yearDjPoint) {
- double wtdaydj = 0.0;
- double wtmonthdj = 0.0;
- double wtyeardj = 0.0;
- try {
- wtdaydj = edosUtil.getSectionData(dayDjPoint,tomorrow.getTime()).getPointValueInDouble();
- wtmonthdj = edosUtil.getSectionData(monthDjPoint,tomorrow.getTime()).getPointValueInDouble();
- wtyeardj = edosUtil.getSectionData(yearDjPoint,tomorrow.getTime()).getPointValueInDouble();
- } catch (Exception e) {
- e.printStackTrace();
- }
- double finalWtdaydj = wtdaydj;
- linedaydjloss.updateAndGet(v -> new Double((double) (v + finalWtdaydj)));
- double finalWtmonthdj = wtmonthdj;
- linemonthdjloss.updateAndGet(v -> new Double((double) (v + finalWtmonthdj)));
- double finalWtyeardj = wtyeardj;
- lineyeardjloss.updateAndGet(v -> new Double((double) (v + finalWtyeardj)));
- }
- /**
- * 风机日五损,欠发状态,欠发电量
- * @throws Exception
- */
- private void wtDaylossesReal() throws Exception {
- List<PointData> resultList = new ArrayList<>();
- wtls.stream().forEach(wt->{
- Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
- Windturbinetestingpointnew powerPoint = windturbinetestingpointnewMap.get(Contant.AI130);
- Windturbinetestingpointnew ztmxPoint = windturbinetestingpointnewMap.get(Contant.ZTMX);
- Windturbinetestingpointnew bzglPoint = windturbinetestingpointnewMap.get(Contant.BZGL);
- Windturbinetestingpointnew zsglPoint = windturbinetestingpointnewMap.get(Contant.ZSGL);
- Windturbinetestingpointnew qfztPoint = windturbinetestingpointnewMap.get(Contant.RSSQFZT);
- List<PointData> powerDatasSnap = null;
- List<PointData> ztmxDatasSnap = null;
- List<PointData> bzglDatasSnap = null;
- List<PointData> zsglDatasSnap = null;
- List<PointData> qfztDatasSnap = null;
- try {
- powerDatasSnap = edosUtil.getHistoryDatasSnap(powerPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
- if (powerDatasSnap.size()==1){
- return;
- }
- ztmxDatasSnap = edosUtil.getHistoryDatasSnap(ztmxPoint,samedayZero.getTime()/1000,currentDate.getTime()/1000,null,60l);
- bzglDatasSnap = edosUtil.getHistoryDatasSnap(bzglPoint,samedayZero.getTime()/1000,currentDate.getTime()/1000,null,60l);
- zsglDatasSnap = edosUtil.getHistoryDatasSnap(zsglPoint,samedayZero.getTime()/1000,currentDate.getTime()/1000,null,60l);
- qfztDatasSnap = edosUtil.getHistoryDatasSnap(qfztPoint,samedayZero.getTime()/1000,currentDate.getTime()/1000,null,60l);
- } catch (Exception e) {
- e.printStackTrace();
- }
- if (ztmxDatasSnap.size() == powerDatasSnap.size()){
- //待机损失
- double djss = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 0.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRDJSSDL));
- //手动停机
- double sdtj = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 1.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRSTSSDL));
- //并网损失电量
- double bwss = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 2.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRXNSSDL));
- //发电降出力
- double fdjcl = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 3.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRQXSSDL));
- double xnss = djss + sdtj + bwss + fdjcl;
- resultList.add(createWtPointData(windturbinetestingpointnewMap.get(Contant.XNSSDL),xnss));
- //限电降出力
- double xdjcl = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 4.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRQFSSDL));
- //限电停机
- double xdtj = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 5.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRXDSSDL));
- double xdss = xdjcl + xdtj;
- resultList.add(createWtPointData(windturbinetestingpointnewMap.get(Contant.XDSSDL),xdss));
- //故障
- double gzss = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 6.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRGZSSDL));
- //故障受累
- double gzsl = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 7.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRSZSSDL));
- double gzsss = gzss + gzsl;
- resultList.add(createWtPointData(windturbinetestingpointnewMap.get(Contant.GZSSDL),gzsss));
- //检修
- double jxss = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 8.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRJXSSDL));
- //检修受累
- double jxsl = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 9.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRLZSSDL));
- double whss = jxss + jxsl;
- resultList.add(createWtPointData(windturbinetestingpointnewMap.get(Contant.WHSSDL),whss));
- //电网受累
- double dwsl = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 10.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRWZSSDL));
- //环境受累
- double hjsl = generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 11.0, resultList, windturbinetestingpointnewMap.get(Contant.WTRTZSSDL));
- double slss = dwsl + hjsl;
- resultList.add(createWtPointData(windturbinetestingpointnewMap.get(Contant.SLSSDL),slss));
- //欠发状态
- generalQfzt(powerDatasSnap, ztmxDatasSnap, zsglDatasSnap,qfztPoint,resultList);
- //欠发电量
- generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,0.0,resultList,windturbinetestingpointnewMap.get(Contant.R0QFZT));
- generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,1.0,resultList,windturbinetestingpointnewMap.get(Contant.R1QFZT));
- generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,2.0,resultList,windturbinetestingpointnewMap.get(Contant.R2QFZT));
- generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,3.0,resultList,windturbinetestingpointnewMap.get(Contant.R3QFZT));
- generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,4.0,resultList,windturbinetestingpointnewMap.get(Contant.R4QFZT));
- }
- });
- edosUtil.sendMultiPoint(resultList);
- }
- private double generalQfss(List<PointData> ztmxDatasSnap, List<PointData> bzglDatasSnap, List<PointData> zsglDatasSnap, List<PointData> powerDatasSnap,Double statusValue,List<PointData> resultList,Windturbinetestingpointnew point) {
- List<PointData> pointDataList = ztmxDatasSnap.stream().filter(zt -> zt.getPointValueInDouble() == statusValue).collect(Collectors.toList());
- Double bzss = 0.0;
- Double zsss = 0.0;
- for(int i= 0;i<ztmxDatasSnap.size();i++){
- for (int j=0;j<pointDataList.size();j++){
- if (pointDataList.get(j).getPointTime().equals(ztmxDatasSnap.get(i).getPointTime())){
- if (i<bzglDatasSnap.size() && i<zsglDatasSnap.size() && i<powerDatasSnap.size()){
- double bzgl = bzglDatasSnap.get(i).getPointValueInDouble();
- double zsgl = zsglDatasSnap.get(i).getPointValueInDouble();
- double power = powerDatasSnap.get(i).getPointValueInDouble();
- double temp = bzgl - power;
- if (temp>0){
- bzss+=temp;
- }
- double temp1 = zsgl - power;
- if (temp1>0){
- zsss+=temp1;
- }
- // bzss += (bzgl-power<0?0:bzgl-power);
- // zsss += (zsgl-power<0?0:zsgl-power);
- }
- }
- }
- }
- bzss = bzss /60>=0?bzss/60:0;
- zsss = zsss/60>=0?zsss/60:0;
- //待有历史改为用自算损失
- PointData wtPointData = createWtPointData(point, zsss);
- resultList.add(wtPointData);
- return zsss;
- }
- private void generalQfzt(List<PointData> powerDatasSnap, List<PointData> ztmxDatasSnap, List<PointData> zsglDatasSnap,Windturbinetestingpointnew qfztPoint,List<PointData> resultList) {
- double zs = 0;
- double pp = 0;
- int i = 1;
- for ( ; i <= 5; i++) {
- zs += zsglDatasSnap.get(zsglDatasSnap.size()-i).getPointValueInDouble();
- pp += powerDatasSnap.get(powerDatasSnap.size()-1).getPointValueInDouble();
- }
- zs /= i;
- pp /= i;
- double ztmx = ztmxDatasSnap.get(ztmxDatasSnap.size() - 1).getPointValueInDouble();
- double[] underissuanceArray = {0,1,2,3,4,5,11};
- double qfzt = 0;
- if (Arrays.asList(underissuanceArray).contains(ztmx)){
- double ratioll = 0;
- if (zs != 0){
- ratioll = (zs-pp)/zs;
- }
- if (ratioll<0.05){
- qfzt = 0;
- }else if (ratioll >= 0.05 && ratioll < 0.1){
- qfzt = 1;
- }else if (ratioll >= 0.1 && ratioll < 0.2){
- qfzt = 2;
- }else if (ratioll >= 0.2 && ratioll < 0.4) {
- qfzt = 3;
- }else {
- qfzt = 4;
- }
- }
- PointData wtPointData = createWtPointData(qfztPoint, qfzt);
- resultList.add(wtPointData);
- }
- private PointData createWpPointData(Windpowerstationpointnew linepointnew, double linespeed) {
- PointData pointData = new PointData();
- pointData.setEdnaId(linepointnew.getCode());
- pointData.setPointTime(currentDate.getTime());
- pointData.setPointName(linepointnew.getName());
- pointData.setPointValue(String.valueOf(linespeed));
- pointData.setPointValueInDouble(linespeed);
- return pointData;
- }
- /**
- * 风机月、年五损
- * @throws Exception
- */
- private void wtMonthYearlossesReal() throws Exception {
- List<PointData> resultList = new ArrayList<>();
- boolean firstDayOfMonth = DateUtils.isFirstDayOfMonth(currentDate);
- boolean firstDayOfYear = DateUtils.isFirstDayOfYear(currentDate);
- wtls.stream().forEach(wt->{
- Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
- //待机
- Windturbinetestingpointnew dayDjPoint = windturbinetestingpointnewMap.get(Contant.WTRDJSSDL);
- Windturbinetestingpointnew monthDjPoint = windturbinetestingpointnewMap.get(Contant.WTYDJSSDL);
- Windturbinetestingpointnew yearDjPoint = windturbinetestingpointnewMap.get(Contant.WTNDJSSDL);
- geneMonthOrYearLoss(resultList, dayDjPoint,monthDjPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayDjPoint,yearDjPoint,firstDayOfYear);
- //手动停机
- Windturbinetestingpointnew daySdtjPoint = windturbinetestingpointnewMap.get(Contant.WTRSTSSDL);
- Windturbinetestingpointnew monthSdtjPoint = windturbinetestingpointnewMap.get(Contant.WTYSTSSDL);
- Windturbinetestingpointnew yearSdtjPoint = windturbinetestingpointnewMap.get(Contant.WTNSTSSDL);
- geneMonthOrYearLoss(resultList, daySdtjPoint,monthSdtjPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, daySdtjPoint,yearSdtjPoint,firstDayOfYear);
- //性能
- Windturbinetestingpointnew dayXnPoint = windturbinetestingpointnewMap.get(Contant.WTRXNSSDL);
- Windturbinetestingpointnew monthXnPoint = windturbinetestingpointnewMap.get(Contant.WTYXNSSDL);
- Windturbinetestingpointnew yearXnPoint = windturbinetestingpointnewMap.get(Contant.WTNXNSSDL);
- geneMonthOrYearLoss(resultList, dayXnPoint,monthXnPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayXnPoint,yearXnPoint,firstDayOfYear);
- //发电降出力
- Windturbinetestingpointnew dayFdjclPoint = windturbinetestingpointnewMap.get(Contant.WTRQXSSDL);
- Windturbinetestingpointnew monthFdjclPoint = windturbinetestingpointnewMap.get(Contant.WTYQXSSDL);
- Windturbinetestingpointnew yearFdjclPoint = windturbinetestingpointnewMap.get(Contant.WTNQXSSDL);
- geneMonthOrYearLoss(resultList, dayFdjclPoint,monthFdjclPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayFdjclPoint,yearFdjclPoint,firstDayOfYear);
- //故障
- Windturbinetestingpointnew dayGzPoint = windturbinetestingpointnewMap.get(Contant.WTRGZSSDL);
- Windturbinetestingpointnew monthGzPoint = windturbinetestingpointnewMap.get(Contant.WTYGZSSDL);
- Windturbinetestingpointnew yearGzPoint = windturbinetestingpointnewMap.get(Contant.WTNGZSSDL);
- geneMonthOrYearLoss(resultList, dayGzPoint,monthGzPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayGzPoint,yearGzPoint,firstDayOfYear);
- //故障受累
- Windturbinetestingpointnew dayGzslPoint = windturbinetestingpointnewMap.get(Contant.WTRSZSSDL);
- Windturbinetestingpointnew monthGzslPoint = windturbinetestingpointnewMap.get(Contant.WTYSZSSDL);
- Windturbinetestingpointnew yearGzslPoint = windturbinetestingpointnewMap.get(Contant.WTNSZSSDL);
- geneMonthOrYearLoss(resultList, dayGzslPoint,monthGzslPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayGzslPoint,yearGzslPoint,firstDayOfYear);
- //维护
- Windturbinetestingpointnew dayWhPoint = windturbinetestingpointnewMap.get(Contant.WTRJXSSDL);
- Windturbinetestingpointnew monthWhPoint = windturbinetestingpointnewMap.get(Contant.WTYJXSSDL);
- Windturbinetestingpointnew yearWhPoint = windturbinetestingpointnewMap.get(Contant.WTNJXSSDL);
- geneMonthOrYearLoss(resultList, dayWhPoint,monthWhPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayWhPoint,yearWhPoint,firstDayOfYear);
- //维护受累
- Windturbinetestingpointnew dayWhslPoint = windturbinetestingpointnewMap.get(Contant.WTRLZSSDL);
- Windturbinetestingpointnew monthWhslPoint = windturbinetestingpointnewMap.get(Contant.WTYLZSSDL);
- Windturbinetestingpointnew yearWhslPoint = windturbinetestingpointnewMap.get(Contant.WTNLZSSDL);
- geneMonthOrYearLoss(resultList, dayWhslPoint,monthWhslPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayWhslPoint,yearWhslPoint,firstDayOfYear);
- //限电降出力
- Windturbinetestingpointnew dayXdjclPoint = windturbinetestingpointnewMap.get(Contant.WTRQFSSDL);
- Windturbinetestingpointnew monthXdjclPoint = windturbinetestingpointnewMap.get(Contant.WTYQFSSDL);
- Windturbinetestingpointnew yearXdjclPoint = windturbinetestingpointnewMap.get(Contant.WTNQFSSDL);
- geneMonthOrYearLoss(resultList, dayXdjclPoint,monthXdjclPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayXdjclPoint,yearXdjclPoint,firstDayOfYear);
- //限电停机
- Windturbinetestingpointnew dayXdtjPoint = windturbinetestingpointnewMap.get(Contant.WTRXDSSDL);
- Windturbinetestingpointnew monthXdtjPoint = windturbinetestingpointnewMap.get(Contant.WTYXDSSDL);
- Windturbinetestingpointnew yearXdtjPoint = windturbinetestingpointnewMap.get(Contant.WTNXDSSDL);
- geneMonthOrYearLoss(resultList, dayXdtjPoint,monthXdtjPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayXdtjPoint,yearXdtjPoint,firstDayOfYear);
- //电网受累
- Windturbinetestingpointnew dayDwslPoint = windturbinetestingpointnewMap.get(Contant.WTRWZSSDL);
- Windturbinetestingpointnew monthDwslPoint = windturbinetestingpointnewMap.get(Contant.WTYWZSSDL);
- Windturbinetestingpointnew yearDwslPoint = windturbinetestingpointnewMap.get(Contant.WTNWZSSDL);
- geneMonthOrYearLoss(resultList, dayDwslPoint,monthDwslPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayDwslPoint,yearDwslPoint,firstDayOfYear);
- //环境受累
- Windturbinetestingpointnew dayHjslPoint = windturbinetestingpointnewMap.get(Contant.WTRTZSSDL);
- Windturbinetestingpointnew monthHjslPoint = windturbinetestingpointnewMap.get(Contant.WTYTZSSDL);
- Windturbinetestingpointnew yearHjslPoint = windturbinetestingpointnewMap.get(Contant.WTNTZSSDL);
- geneMonthOrYearLoss(resultList, dayHjslPoint,monthHjslPoint,firstDayOfMonth);
- geneMonthOrYearLoss(resultList, dayHjslPoint,yearHjslPoint,firstDayOfYear);
- });
- edosUtil.sendMultiPoint(resultList);
- }
- private void geneMonthOrYearLoss(List<PointData> resultList,Windturbinetestingpointnew dayPoint,Windturbinetestingpointnew monthPoint,boolean firstDayOfMonthOrYear) {
- Double dayValue = 0.0;
- Double yestodayMonth = 0.0;
- try {
- if (!firstDayOfMonthOrYear){
- yestodayMonth = edosUtil.getSectionData(monthPoint, DateUtils.getYesterdayEnd().getTime()).getPointValueInDouble();
- }
- dayValue = edosUtil.getSectionData(dayPoint,tomorrow.getTime()).getPointValueInDouble();
- } catch (Exception e) {
- e.printStackTrace();
- }
- Double monthValue = dayValue + yestodayMonth;
- resultList.add(createWtPointData(monthPoint,monthValue));
- }
- private double generalLoss(List<PointData> ztmxDatasSnap, List<PointData> bzglDatasSnap, List<PointData> zsglDatasSnap, List<PointData> powerDatasSnap,Double statusValue,List<PointData> resultList,Windturbinetestingpointnew point) {
- List<PointData> pointDataList = ztmxDatasSnap.stream().filter(zt -> zt.getPointValueInDouble() == statusValue).collect(Collectors.toList());
- Double bzss = 0.0;
- Double zsss = 0.0;
- if (statusValue == 2.0 || statusValue == 3.0 || statusValue == 4.0){
- for(int i= 0;i<ztmxDatasSnap.size();i++){
- for (int j=0;j<pointDataList.size();j++){
- if (pointDataList.get(j).getPointTime().equals(ztmxDatasSnap.get(i).getPointTime())){
- double bzgl = bzglDatasSnap.get(i).getPointValueInDouble();
- double zsgl = zsglDatasSnap.get(i).getPointValueInDouble();
- double power = powerDatasSnap.get(i).getPointValueInDouble();
- double temp = bzgl - power;
- if (temp>0){
- bzss+=temp;
- }
- double temp1 = zsgl - power;
- if (temp1>0){
- zsss+=temp1;
- }
- // bzss += (bzgl-power<0?0:bzgl-power);
- // zsss += (zsgl-power<0?0:zsgl-power);
- }
- }
- }
- }else {
- for(int i= 0;i<ztmxDatasSnap.size();i++){
- for (int j=0;j<pointDataList.size();j++){
- if (pointDataList.get(j).getPointTime().equals(ztmxDatasSnap.get(i).getPointTime())){
- double bzgl = bzglDatasSnap.get(i).getPointValueInDouble();
- double zsgl = zsglDatasSnap.get(i).getPointValueInDouble();
- if (bzgl>0){
- bzss+=bzgl;
- }
- if (zsgl>0){
- zsss+=zsgl;
- }
- // bzss += bzgl<0?0:bzgl;
- // zsss += zsgl<0?0:zsgl;
- }
- }
- }
- }
- bzss = bzss /60>=0?bzss/60:0;
- zsss = zsss/60>=0?zsss/60:0;
- //待有历史改为用自算损失
- PointData wtPointData = createWtPointData(point, zsss);
- resultList.add(wtPointData);
- return zsss;
- }
- private PointData createWtPointData(Windturbinetestingpointnew fjfdl, Double rfdl) {
- PointData pointData = new PointData();
- pointData.setEdnaId(fjfdl.getCode());
- pointData.setPointName(fjfdl.getName());
- pointData.setPointTime(currentDate.getTime());
- pointData.setPointValueInDouble(rfdl);
- pointData.setPointValue(String.valueOf(rfdl));
- return pointData;
- }
- }
|