//package com.gyee.generation.service; // //import com.gyee.common.contant.ContantXk; //import com.gyee.common.model.PointData; //import com.gyee.common.model.StringUtils; //import com.gyee.generation.init.CacheContext; //import com.gyee.generation.model.auto.*; //import com.gyee.generation.model.vo.Location; //import com.gyee.generation.service.auto.*; //import com.gyee.generation.util.DateUtils; //import com.gyee.generation.util.realtimesource.IEdosUtil; //import com.gyee.generation.util.statisticcs.Initial; //import org.slf4j.Logger; //import org.slf4j.LoggerFactory; //import org.springframework.stereotype.Service; // //import javax.annotation.Resource; //import java.math.BigDecimal; //import java.math.RoundingMode; //import java.util.*; //import java.util.stream.Collectors; // //@Service //public class WindpowerInfoMonthService { // // private static final Logger logger = LoggerFactory.getLogger(WindpowerInfoMonthService.class); // @Resource // private IEdosUtil edosUtil; // // @Resource // private IProEconWindpowerInfoDayService proEconWindpowerInfoDayService; // @Resource // private IProEconWindpowerInfoMonthService proEconWindpowerInfoMonthService; // @Resource // private IProEconWindpowerInfoYearService proEconWindpowerInfoYearService; // @Resource // private IProEconWindturbineInfoDayService proEconWindturbineInfoDayService; // @Resource // private IProEconWindturbineInfoMonthService proEconWindturbineInfoMonthService; // @Resource // private IProEconWindturbineInfoYearService proEconWindturbineInfoYearService; // // // /** // * 计算区域日信息 // * @param recordDate // * @throws Exception // */ // public void calRegionInfoDay(Date recordDate) throws Exception { // // List wpinfodayls = proEconWindpowerInfoMonthService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.cp.getValue())) // .collect(Collectors.toList()); // if(!wpinfodayls.isEmpty()) // { // // Map>>rgmap=new HashMap<>(); // // // // // for(ProEconWindpowerInfoMonth wpinfo:wpinfodayls) // { // // if(rgmap.containsKey(wpinfo.getCompanyId())) // { // Map> map=rgmap.get(wpinfo.getCompanyId()); // List qbls=map.get("qb"); // List gfls=map.get("fd"); // List fdls=map.get("gf"); // // if(wpinfo.getForeignKeyId().equals("-1")) // { // fdls.add(wpinfo); // }else if(wpinfo.getForeignKeyId().equals("-2")){ // gfls.add(wpinfo); // } // qbls.add(wpinfo); // }else // { // Map> map=new HashMap<>(); // // List qbls=new ArrayList<>(); // List gfls=new ArrayList<>(); // List fdls=new ArrayList<>(); // // if(wpinfo.getForeignKeyId().equals("-1")) // { // fdls.add(wpinfo); // }else if(wpinfo.getForeignKeyId().equals("-2")){ // gfls.add(wpinfo); // } // qbls.add(wpinfo); // map.put("qb",qbls); // map.put("fd",fdls); // map.put("gf",gfls); // } // } // // // //判断是否有重复记录,先删除重复记录 // List idls = proEconWindpowerInfoMonthService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.rg.getValue())).map(ProEconWindpowerInfoMonth::getId) // .collect(Collectors.toList()); // // if (idls != null && idls.size() > 0) { // // proEconWindpowerInfoMonthService.removeByIds(idls); // // } // for(Map.Entry>> entry:rgmap.entrySet()){ // Map> map=entry.getValue(); // List qbls=map.get("qb"); // List gfls=map.get("fd"); // List fdls=map.get("gf"); //// if(CacheContext.cpwpmap.size()==qbls.size()) //// { // // ProEconWindpowerInfoMonth qb=new ProEconWindpowerInfoMonth(); // ProEconWindpowerInfoMonth fd=new ProEconWindpowerInfoMonth(); // ProEconWindpowerInfoMonth gf=new ProEconWindpowerInfoMonth(); // // if(CacheContext.rgmap.containsKey(entry.getKey())) // { // ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey()); // gf.setRegionId(cp.getId()); // // gf.setRecordDate(DateUtils.truncDay(recordDate)); // gf.setForeignKeyId("-2"); // gf.setLocation(Location.rg.getValue()); // // fd.setRegionId(cp.getId()); // // fd.setRecordDate(DateUtils.truncDay(recordDate)); // fd.setForeignKeyId("-1"); // fd.setLocation(Location.rg.getValue()); // // qb.setRegionId(cp.getId()); // // qb.setRecordDate(DateUtils.truncDay(recordDate)); // qb.setForeignKeyId("0"); // qb.setLocation(Location.rg.getValue()); // // //计算区域级全部 // calCp(qb,qbls); // //计算公司级风电场站 // calCp(fd,fdls); // //计算公司级光电场站 // calCp(gf,gfls); // // proEconWindpowerInfoMonthService.save(qb); // proEconWindpowerInfoMonthService.save(fd); // proEconWindpowerInfoMonthService.save(gf); // } // // //// }else //// { //// logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey()); //// //// } // // // // // // }; // } // // } // // /** // * 计算公司日信息 // * @param recordDate // * @throws Exception // */ // public void calCompanyInfoDay(Date recordDate) throws Exception { // // List wpinfodayls = proEconWindpowerInfoMonthService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.wp.getValue())) // .collect(Collectors.toList()); // if(!wpinfodayls.isEmpty()) // { // // Map>>cpmap=new HashMap<>(); // // // // // for(ProEconWindpowerInfoMonth wpinfo:wpinfodayls) // { // // if(cpmap.containsKey(wpinfo.getCompanyId())) // { // Map> map=cpmap.get(wpinfo.getCompanyId()); // List qbls=map.get("qb"); // List gfls=map.get("fd"); // List fdls=map.get("gf"); // // if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0) // { // fdls.add(wpinfo); // }else { // gfls.add(wpinfo); // } // qbls.add(wpinfo); // }else // { // Map> map=new HashMap<>(); // // List qbls=new ArrayList<>(); // List gfls=new ArrayList<>(); // List fdls=new ArrayList<>(); // // if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0) // { // fdls.add(wpinfo); // }else { // gfls.add(wpinfo); // } // qbls.add(wpinfo); // map.put("qb",qbls); // map.put("fd",fdls); // map.put("gf",gfls); // } // } // // // //判断是否有重复记录,先删除重复记录 // List idls = proEconWindpowerInfoMonthService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.cp.getValue())).map(ProEconWindpowerInfoMonth::getId) // .collect(Collectors.toList()); // // if (idls != null && idls.size() > 0) { // // proEconWindpowerInfoMonthService.removeByIds(idls); // // } // for(Map.Entry>> entry:cpmap.entrySet()){ // Map> map=entry.getValue(); // List qbls=map.get("qb"); // List gfls=map.get("fd"); // List fdls=map.get("gf"); //// if(CacheContext.cpwpmap.size()==qbls.size()) //// { // // ProEconWindpowerInfoMonth qb=new ProEconWindpowerInfoMonth(); // ProEconWindpowerInfoMonth fd=new ProEconWindpowerInfoMonth(); // ProEconWindpowerInfoMonth gf=new ProEconWindpowerInfoMonth(); // // if(CacheContext.cpmap.containsKey(entry.getKey())) // { // ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey()); // gf.setRegionId(cp.getRegionId()); // gf.setCompanyId(cp.getId()); // gf.setRecordDate(DateUtils.truncDay(recordDate)); // gf.setForeignKeyId("-2"); // gf.setLocation(Location.cp.getValue()); // // // // fd.setRegionId(cp.getRegionId()); // fd.setCompanyId(cp.getId()); // fd.setRecordDate(DateUtils.truncDay(recordDate)); // fd.setForeignKeyId("-1"); // fd.setLocation(Location.cp.getValue()); // // qb.setRegionId(cp.getRegionId()); // qb.setCompanyId(cp.getId()); // qb.setRecordDate(DateUtils.truncDay(recordDate)); // qb.setForeignKeyId("0"); // qb.setLocation(Location.cp.getValue()); // // //计算公司级全部场站 // calCp(qb,qbls); // //计算公司级风电场站 // calCp(fd,fdls); // //计算公司级光电场站 // calCp(gf,gfls); // // proEconWindpowerInfoMonthService.save(qb); // proEconWindpowerInfoMonthService.save(fd); // proEconWindpowerInfoMonthService.save(gf); // } // // //// }else //// { //// logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey()); //// //// } // // // // // // }; // } // // } // // private void calCp(ProEconWindpowerInfoMonth pewp,List ls) throws Exception { // // if(!ls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(n -> n.getYzdfs()).summaryStatistics(); // //日最大风速 // pewp.setYzdfs(summaryStatistics.getMax()); // //日最小风速 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzxfs()).summaryStatistics(); // pewp.setYzxfs(summaryStatistics.getMin()); // //日平均风速 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYpjfs()).summaryStatistics(); // pewp.setYpjfs(summaryStatistics.getAverage()); // // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzdgl()).summaryStatistics(); // //日最大功率 // pewp.setYzdgl(summaryStatistics.getMax()); // //日最小功率 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzxgl()).summaryStatistics(); // pewp.setYzxgl(summaryStatistics.getMin()); // //日平均功率 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYpjgl()).summaryStatistics(); // pewp.setYpjgl(summaryStatistics.getAverage()); // // // //日发电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYfdl()).summaryStatistics(); // pewp.setYfdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日可用电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYkydl()).summaryStatistics(); // pewp.setYkydl(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日理论发电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYllfdl()).summaryStatistics(); // pewp.setYllfdl(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日故障损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYgzssdl()).summaryStatistics(); // pewp.setYgzssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日场内受累故障损失电量 // // pewp.setYcnslgzssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日检修损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYjxssdl()).summaryStatistics(); // pewp.setYjxssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日场内受累检修损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYcnsljxssdl()).summaryStatistics(); // pewp.setYcnsljxssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日待机损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYdjssdl()).summaryStatistics(); // pewp.setYdjssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日缺陷降出力损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYqxjclssdl()).summaryStatistics(); // pewp.setYqxjclssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日手动停机损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYsdtjssdl()).summaryStatistics(); // pewp.setYsdtjssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日性能损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYxnssdl()).summaryStatistics(); // pewp.setYxnssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日限电停机损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYxdtjssdl()).summaryStatistics(); // pewp.setYxdtjssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日限电降出力损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYxdjclssdl()).summaryStatistics(); // pewp.setYxdjclssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日场外受累电网损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYcwsldwssdl()).summaryStatistics(); // pewp.setYcwsldwssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日场外受累天气损失电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYcwsltqssdl()).summaryStatistics(); // pewp.setYcwsltqssdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日增发电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzfdl()).summaryStatistics(); // pewp.setYzfdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日欠发电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYqfdl()).summaryStatistics(); // pewp.setYqfdl(StringUtils.round(summaryStatistics.getSum(),2)); // // //日自耗电 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzhd()).summaryStatistics(); // pewp.setYzhd(StringUtils.round(summaryStatistics.getSum(),2)); // // // double rfdlsyz=0.0; // double rswdlsyz=0.0; // double rgwgwdlsyz=0.0; // double rnwgwdlsyz=0.0; // // //日发电量(升压站) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYfdldb()).summaryStatistics(); // rfdlsyz=StringUtils.round(summaryStatistics.getSum(),2); // pewp.setYfdldb(rfdlsyz); // // //日上网电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYswdldb()).summaryStatistics(); // rswdlsyz=StringUtils.round(summaryStatistics.getSum(),2); // pewp.setYswdldb(rswdlsyz); // // //日工网购网电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYgwgwdldb()).summaryStatistics(); // rgwgwdlsyz=StringUtils.round(summaryStatistics.getSum(),2); // pewp.setYgwgwdldb(rgwgwdlsyz); // // // //日农网购网电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYnwgwdldb()).summaryStatistics(); // rnwgwdlsyz=StringUtils.round(summaryStatistics.getSum(),2); // pewp.setYnwgwdldb(rnwgwdlsyz); // // // //日综合场用电量(电表) // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2)); // // // //日厂用电量 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYfdcydldb()).summaryStatistics(); // pewp.setYfdcydldb(StringUtils.round(summaryStatistics.getSum(),2)); // // // // //日最大功率(出线) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzdglcx()).summaryStatistics(); // pewp.setYzdglcx(summaryStatistics.getMax()); // //日最小功率(出线) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYzxglcx()).summaryStatistics(); // pewp.setYzxglcx(summaryStatistics.getMin()); // //日平均功率(出线) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYpjglcx()).summaryStatistics(); // pewp.setYpjglcx(summaryStatistics.getAverage()); // // // // //日合计待机小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjxs()).summaryStatistics(); // pewp.setYhjdjxs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计维护停机小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjjxtjxs()).summaryStatistics(); // pewp.setYhjjxtjxs(StringUtils.round(summaryStatistics.getSum(),2)); // // 日合计待机小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjxs()).summaryStatistics(); // pewp.setYhjdjxs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计运行小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjyxxs()).summaryStatistics(); // pewp.setYhjyxxs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdxs()).summaryStatistics(); // pewp.setYhjxdxs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjtxzdxs()).summaryStatistics(); // pewp.setYhjtxzdxs(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日合计故障次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjcs()).summaryStatistics(); // pewp.setYhjdjcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计检修次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjjxtjcs()).summaryStatistics(); // pewp.setYhjjxtjcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计待机次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjcs()).summaryStatistics(); // pewp.setYhjdjcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计性能次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjyxcs()).summaryStatistics(); // pewp.setYhjyxcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电停机次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdcs()).summaryStatistics(); // pewp.setYhjxdcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjtxzdcs()).summaryStatistics(); // pewp.setYhjtxzdcs(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日合计故障小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjgzxsmx()).summaryStatistics(); // pewp.setYhjgzxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累故障小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcnslgzxsmx()).summaryStatistics(); // pewp.setYhjcnslgzxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计检修小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjjxxsmx()).summaryStatistics(); // pewp.setYhjjxxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累检修小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcnsljxxsmx()).summaryStatistics(); // pewp.setYhjcnsljxxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计待机小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjxsmx()).summaryStatistics(); // pewp.setYhjdjxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计缺陷降出力小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjqxjclxsmx()).summaryStatistics(); // pewp.setYhjqxjclxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计手动停机小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjsdtjxsmx()).summaryStatistics(); // pewp.setYhjsdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计性能小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxnxsmx()).summaryStatistics(); // pewp.setYhjxnxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电停机小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdtjxsmx()).summaryStatistics(); // pewp.setYhjxdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电降出力小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdjclxsmx()).summaryStatistics(); // pewp.setYhjxdjclxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcwsldwxsmx()).summaryStatistics(); // pewp.setYhjcwsldwxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcwsltqxsmx()).summaryStatistics(); // pewp.setYhjcwsltqxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjtxzdxsmx()).summaryStatistics(); // pewp.setYhjtxzdxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计离线小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjlxxsmx()).summaryStatistics(); // pewp.setYhjlxxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日合计故障次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjgzcsmx()).summaryStatistics(); // pewp.setYhjgzcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累故障次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcnslgzcsmx()).summaryStatistics(); // pewp.setYhjcnslgzcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计检修次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjjxcsmx()).summaryStatistics(); // pewp.setYhjjxcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累检修次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcnsljxcsmx()).summaryStatistics(); // pewp.setYhjcnsljxcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计待机次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjdjcsmx()).summaryStatistics(); // pewp.setYhjdjcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计缺陷降出力次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjqxjclcsmx()).summaryStatistics(); // pewp.setYhjqxjclcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计手动停机次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjsdtjcsmx()).summaryStatistics(); // pewp.setYhjsdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计性能次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxncsmx()).summaryStatistics(); // pewp.setYhjxncsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电停机次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdtjcsmx()).summaryStatistics(); // pewp.setYhjxdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电降出力次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjxdjclcsmx()).summaryStatistics(); // pewp.setYhjxdjclcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcwsldwcsmx()).summaryStatistics(); // pewp.setYhjcwsldwcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjcwsltqcsmx()).summaryStatistics(); // pewp.setYhjcwsltqcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjtxzdcsmx()).summaryStatistics(); // pewp.setYhjtxzdcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计离线次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getYhjlxcsmx()).summaryStatistics(); // pewp.setYhjlxcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // } // } // /** // * 计算场站日信息 // * @param recordDate // * @throws Exception // */ // public void calWindpowerInfoDay(Date recordDate) throws Exception { // Calendar c=Calendar.getInstance(); // c.setTime(recordDate); // // Date end=c.getTime(); // // Date begin= DateUtils.truncDay(c.getTime()); // // // // //判断是否有重复记录,先删除重复记录 // List idls = proEconWindpowerInfoMonthService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 // && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.wp.getValue())).map(ProEconWindpowerInfoMonth::getId) // .collect(Collectors.toList()); // // if (idls != null && idls.size() > 0) { // // proEconWindpowerInfoMonthService.removeByIds(idls); // // } // for(ProBasicWindpowerstation wp:CacheContext.wpls) // { // if(CacheContext.wppointmap.containsKey(wp.getId())) // { // Map pointmap=CacheContext.wppointmap.get(wp.getId()); // // ProEconWindpowerInfoMonth pewp=new ProEconWindpowerInfoMonth(); // Initial.initial(pewp); // pewp.setRegionId(wp.getRegionId()); // pewp.setCompanyId(wp.getCompanyId()); // pewp.setRecordDate(DateUtils.truncDay(recordDate)); // pewp.setForeignKeyId("0"); // pewp.setWindpowerstationId(wp.getId()); // pewp.setLocation(Location.wp.getValue()); // if(pointmap.containsKey(ContantXk.SSPJFS)); // { // ProBasicWppoint point=pointmap.get(ContantXk.SSPJFS); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大风速 // pewp.setYzdfs(summaryStatistics.getMax()); // //日最小风速 // pewp.setYzxfs(summaryStatistics.getMin()); // //日平均风速 // pewp.setYpjfs(summaryStatistics.getAverage()); // } // // } // // if(pointmap.containsKey(ContantXk.SSZGL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.SSZGL); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大功率 // pewp.setYzdgl(summaryStatistics.getMax()); // //日最小功率 // pewp.setYzxgl(summaryStatistics.getMin()); // //日平均功率 // pewp.setYpjgl(summaryStatistics.getAverage()); // } // } // // // if(pointmap.containsKey(ContantXk.RFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RFDL); // // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日发电量 // pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RKYDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RKYDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日可用电量 // pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // if(pointmap.containsKey(ContantXk.RLLFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RLLFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日理论发电量 // pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // // // if(pointmap.containsKey(ContantXk.RGZSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RGZSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日故障损失电量 // pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RCNSLGZSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLGZSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场内受累故障损失电量 // pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RJXSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RJXSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日检修损失电量 // pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RCNSLJXSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLJXSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场内受累检修损失电量 // pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RDJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RDJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日待机损失电量 // pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RQXJCLSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RQXJCLSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日缺陷降出力损失电量 // pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RSDTJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RSDTJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日手动停机损失电量 // pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RXNSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXNSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日性能损失电量 // pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RXDTJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXDTJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日限电停机损失电量 // pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // if(pointmap.containsKey(ContantXk.RXDJCLSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXDJCLSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日限电降出力损失电量 // pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RCWSLDWSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLDWSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场外受累电网损失电量 // pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RCWSLTQSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLTQSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场外受累天气损失电量 // pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RZFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RZFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日增发电量 // pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RQFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RQFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日欠发电量 // pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RZHD)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RZHD); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日自耗电 // pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // double rfdlsyz=0.0; // double rswdlsyz=0.0; // double rgwgwdlsyz=0.0; // double rnwgwdlsyz=0.0; // if(pointmap.containsKey(ContantXk.RFDLSYZ)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日发电量(升压站) // rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYfdldb(rfdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RSWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RSWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日上网电量 // rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYswdldb(rswdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RGWGWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日工网购网电量 // rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYgwgwdldb(rgwgwdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RNWGWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日农网购网电量 // rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYnwgwdldb(rnwgwdlsyz); // // } // } // // //日综合场用电量(电表) // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2)); // // // if(pointmap.containsKey(ContantXk.RCYDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCYDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日厂用电量 // pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.TPOINT_WP_CXGL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.TPOINT_WP_CXGL); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大功率(出线) // pewp.setYzdglcx(summaryStatistics.getMax()); // //日最小功率(出线) // pewp.setYzxglcx(summaryStatistics.getMin()); // //日平均功率(出线) // pewp.setYpjglcx(summaryStatistics.getAverage()); // } // // } // // List wpinfodayls = proEconWindpowerInfoDayService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.wp.getValue())) // .collect(Collectors.toList()); // //统计14种状态明细指标的时长和次数 // calDetiall(pewp,recordDate,wpinfodayls); // //统计7种状态指标的时长和次数 // calSimple(pewp,recordDate,wpinfodayls); // // proEconWindpowerInfoMonthService.save(pewp); // // //// wpinfodayls.add(pewp); // proEconWindpowerInfoMonthService.save(pewp); // // } // // // } // // } // // // // // /** // * 计算项目日信息 // * @param recordDate // * @throws Exception // */ // public void calProjectInfoDay(Date recordDate) throws Exception { // Calendar c=Calendar.getInstance(); // c.setTime(recordDate); // // Date end=c.getTime(); // // Date begin= DateUtils.truncDay(c.getTime()); // // //判断是否有重复记录,先删除重复记录 // List idls = proEconWindpowerInfoMonthService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 // && CacheContext.proMap.containsKey(i.getProjectId()) // && i.getLocation().equals(Location.pj.getValue())).map(ProEconWindpowerInfoMonth::getId) // .collect(Collectors.toList()); // // if (idls != null && idls.size() > 0) { // // proEconWindpowerInfoMonthService.removeByIds(idls); // // } // for(ProBasicProject wp:CacheContext.projects) // { // if(CacheContext.wppointmap.containsKey(wp.getId())) // { // Map pointmap=CacheContext.wppointmap.get(wp.getId()); // // ProEconWindpowerInfoMonth pewp=new ProEconWindpowerInfoMonth(); // Initial.initial(pewp); // pewp.setForeignKeyId("0"); // pewp.setWindpowerstationId(wp.getWindpowerstationId()); // pewp.setProjectId(wp.getId()); // pewp.setLocation(Location.pj.getValue()); // pewp.setRecordDate(DateUtils.truncDay(recordDate)); // if(pointmap.containsKey(ContantXk.SSPJFS)); // { // ProBasicWppoint point=pointmap.get(ContantXk.SSPJFS); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大风速 // pewp.setYzdfs(summaryStatistics.getMax()); // //日最小风速 // pewp.setYzxfs(summaryStatistics.getMin()); // //日平均风速 // pewp.setYpjfs(summaryStatistics.getAverage()); // } // // } // // if(pointmap.containsKey(ContantXk.SSZGL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.SSZGL); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大功率 // pewp.setYzdgl(summaryStatistics.getMax()); // //日最小功率 // pewp.setYzxgl(summaryStatistics.getMin()); // //日平均功率 // pewp.setYpjgl(summaryStatistics.getAverage()); // } // } // // // if(pointmap.containsKey(ContantXk.RFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RFDL); // // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日发电量 // pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RKYDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RKYDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日可用电量 // pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // // // if(pointmap.containsKey(ContantXk.RLLFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RLLFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日理论发电量 // pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // if(pointmap.containsKey(ContantXk.RGZSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RGZSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日故障损失电量 // pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RCNSLGZSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLGZSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场内受累故障损失电量 // pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RJXSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RJXSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日检修损失电量 // pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RCNSLJXSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLJXSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场内受累检修损失电量 // pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RDJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RDJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日待机损失电量 // pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RQXJCLSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RQXJCLSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日缺陷降出力损失电量 // pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RSDTJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RSDTJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日手动停机损失电量 // pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RXNSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXNSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日性能损失电量 // pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RXDTJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXDTJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日限电停机损失电量 // pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // if(pointmap.containsKey(ContantXk.RXDJCLSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXDJCLSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日限电降出力损失电量 // pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RCWSLDWSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLDWSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场外受累电网损失电量 // pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RCWSLTQSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLTQSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场外受累天气损失电量 // pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RZFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RZFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日增发电量 // pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RQFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RQFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日欠发电量 // pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RZHD)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RZHD); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日自耗电 // pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // double rfdlsyz=0.0; // double rswdlsyz=0.0; // double rgwgwdlsyz=0.0; // double rnwgwdlsyz=0.0; // if(pointmap.containsKey(ContantXk.RFDLSYZ)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日发电量(升压站) // rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYfdldb(rfdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RSWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RSWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日上网电量 // rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYswdldb(rswdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RGWGWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日工网购网电量 // rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYgwgwdldb(rgwgwdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RNWGWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日农网购网电量 // rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYnwgwdldb(rnwgwdlsyz); // // } // } // // //日综合场用电量(电表) // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2)); // // // if(pointmap.containsKey(ContantXk.RCYDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCYDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日厂用电量 // pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.TPOINT_WP_CXGL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.TPOINT_WP_CXGL); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大功率(出线) // pewp.setYzdglcx(summaryStatistics.getMax()); // //日最小功率(出线) // pewp.setYzxglcx(summaryStatistics.getMin()); // //日平均功率(出线) // pewp.setYpjglcx(summaryStatistics.getAverage()); // } // // } // // List wpinfodayls = proEconWindpowerInfoDayService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.pj.getValue())) // .collect(Collectors.toList()); // //统计14种状态明细指标的时长和次数 // calDetiall(pewp,recordDate,wpinfodayls); // //统计7种状态指标的时长和次数 // calSimple(pewp,recordDate,wpinfodayls); // // proEconWindpowerInfoMonthService.save(pewp); // // proEconWindpowerInfoMonthService.save(pewp); // // } // // // } // // } // // // /** // * 计算线路日信息 // * @param recordDate // * @throws Exception // */ // public void calLineInfoDay(Date recordDate) throws Exception { // Calendar c=Calendar.getInstance(); // c.setTime(recordDate); // // Date end=c.getTime(); // // Date begin= DateUtils.truncDay(c.getTime()); // // //判断是否有重复记录,先删除重复记录 // List idls = proEconWindpowerInfoMonthService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 // && CacheContext.lnmap.containsKey(i.getLineId()) // && i.getLocation().equals(Location.ln.getValue()) ).map(ProEconWindpowerInfoMonth::getId) // .collect(Collectors.toList()); // // if (idls != null && idls.size() > 0) { // // proEconWindpowerInfoMonthService.removeByIds(idls); // // } // for(ProBasicLine wp:CacheContext.lines) // { // if(CacheContext.wppointmap.containsKey(wp.getId())) // { // Map pointmap=CacheContext.wppointmap.get(wp.getId()); // // ProEconWindpowerInfoMonth pewp=new ProEconWindpowerInfoMonth(); // Initial.initial(pewp); // pewp.setForeignKeyId("0"); // pewp.setLineId(wp.getId()); // pewp.setLocation(Location.ln.getValue()); // pewp.setProjectId(wp.getProjectId()); // pewp.setRecordDate(DateUtils.truncDay(recordDate)); // if(pointmap.containsKey(ContantXk.SSPJFS)); // { // ProBasicWppoint point=pointmap.get(ContantXk.SSPJFS); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大风速 // pewp.setYzdfs(summaryStatistics.getMax()); // //日最小风速 // pewp.setYzxfs(summaryStatistics.getMin()); // //日平均风速 // pewp.setYpjfs(summaryStatistics.getAverage()); // } // // } // // if(pointmap.containsKey(ContantXk.SSZGL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.SSZGL); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大功率 // pewp.setYzdgl(summaryStatistics.getMax()); // //日最小功率 // pewp.setYzxgl(summaryStatistics.getMin()); // //日平均功率 // pewp.setYpjgl(summaryStatistics.getAverage()); // } // } // // // if(pointmap.containsKey(ContantXk.RFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RFDL); // // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日发电量 // pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RKYDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RKYDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日可用电量 // pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // // // if(pointmap.containsKey(ContantXk.RLLFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RLLFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日理论发电量 // pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // if(pointmap.containsKey(ContantXk.RGZSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RGZSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日故障损失电量 // pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RCNSLGZSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLGZSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场内受累故障损失电量 // pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RJXSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RJXSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日检修损失电量 // pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RCNSLJXSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLJXSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场内受累检修损失电量 // pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RDJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RDJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日待机损失电量 // pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RQXJCLSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RQXJCLSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日缺陷降出力损失电量 // pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RSDTJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RSDTJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日手动停机损失电量 // pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RXNSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXNSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日性能损失电量 // pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RXDTJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXDTJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日限电停机损失电量 // pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // if(pointmap.containsKey(ContantXk.RXDJCLSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXDJCLSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日限电降出力损失电量 // pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RCWSLDWSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLDWSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场外受累电网损失电量 // pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RCWSLTQSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLTQSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场外受累天气损失电量 // pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RZFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RZFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日增发电量 // pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RQFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RQFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日欠发电量 // pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RZHD)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RZHD); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日自耗电 // pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // double rfdlsyz=0.0; // double rswdlsyz=0.0; // double rgwgwdlsyz=0.0; // double rnwgwdlsyz=0.0; // if(pointmap.containsKey(ContantXk.RFDLSYZ)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日发电量(升压站) // rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYfdldb(rfdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RSWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RSWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日上网电量 // rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYswdldb(rswdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RGWGWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日工网购网电量 // rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYgwgwdldb(rgwgwdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RNWGWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日农网购网电量 // rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYnwgwdldb(rnwgwdlsyz); // // } // } // // //日综合场用电量(电表) // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2)); // // // if(pointmap.containsKey(ContantXk.RCYDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCYDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日厂用电量 // pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.TPOINT_WP_CXGL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.TPOINT_WP_CXGL); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大功率(出线) // pewp.setYzdglcx(summaryStatistics.getMax()); // //日最小功率(出线) // pewp.setYzxglcx(summaryStatistics.getMin()); // //日平均功率(出线) // pewp.setYpjglcx(summaryStatistics.getAverage()); // } // // } // // List wpinfodayls = proEconWindpowerInfoDayService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.ln.getValue())) // .collect(Collectors.toList()); // //统计14种状态明细指标的时长和次数 // calDetiall(pewp,recordDate,wpinfodayls); // //统计7种状态指标的时长和次数 // calSimple(pewp,recordDate,wpinfodayls); // // proEconWindpowerInfoMonthService.save(pewp); // // } // // // } // // } // // // // /** // * 计算方阵日信息 // * @param recordDate // * @throws Exception // */ // public void calSquareInfoDay(Date recordDate) throws Exception { // Calendar c=Calendar.getInstance(); // c.setTime(recordDate); // // Date end=c.getTime(); // // Date begin= DateUtils.truncDay(c.getTime()); // // //判断是否有重复记录,先删除重复记录 // List idls = proEconWindpowerInfoMonthService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 && i.getLocation().equals(Location.sq.getValue()) ).map(ProEconWindpowerInfoMonth::getId) // .collect(Collectors.toList()); // // if (idls != null && idls.size() > 0) { // // proEconWindpowerInfoMonthService.removeByIds(idls); // // } // for(ProBasicSquare wp:CacheContext.sqls) // { // if(CacheContext.wppointmap.containsKey(wp.getId())) // { // Map pointmap=CacheContext.wppointmap.get(wp.getId()); // // ProEconWindpowerInfoMonth pewp=new ProEconWindpowerInfoMonth(); // Initial.initial(pewp); // pewp.setForeignKeyId("0"); // pewp.setSquareId(wp.getId()); // pewp.setLocation(Location.sq.getValue()); // if(pointmap.containsKey(ContantXk.SSPJFS)); // { // ProBasicWppoint point=pointmap.get(ContantXk.SSPJFS); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大风速 // pewp.setYzdfs(summaryStatistics.getMax()); // //日最小风速 // pewp.setYzxfs(summaryStatistics.getMin()); // //日平均风速 // pewp.setYpjfs(summaryStatistics.getAverage()); // } // // } // // if(pointmap.containsKey(ContantXk.SSZGL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.SSZGL); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大功率 // pewp.setYzdgl(summaryStatistics.getMax()); // //日最小功率 // pewp.setYzxgl(summaryStatistics.getMin()); // //日平均功率 // pewp.setYpjgl(summaryStatistics.getAverage()); // } // } // // // if(pointmap.containsKey(ContantXk.RFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RFDL); // // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日发电量 // pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RKYDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RKYDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日可用电量 // pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // // // if(pointmap.containsKey(ContantXk.RLLFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RLLFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日理论发电量 // pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // if(pointmap.containsKey(ContantXk.RGZSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RGZSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日故障损失电量 // pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RCNSLGZSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLGZSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场内受累故障损失电量 // pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RJXSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RJXSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日检修损失电量 // pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RCNSLJXSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCNSLJXSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场内受累检修损失电量 // pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RDJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RDJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日待机损失电量 // pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RQXJCLSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RQXJCLSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日缺陷降出力损失电量 // pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RSDTJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RSDTJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日手动停机损失电量 // pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RXNSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXNSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日性能损失电量 // pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RXDTJSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXDTJSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日限电停机损失电量 // pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // // if(pointmap.containsKey(ContantXk.RXDJCLSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RXDJCLSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日限电降出力损失电量 // pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RCWSLDWSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLDWSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场外受累电网损失电量 // pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RCWSLTQSSDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCWSLTQSSDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日场外受累天气损失电量 // pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RZFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RZFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日增发电量 // pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.RQFDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RQFDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日欠发电量 // pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // if(pointmap.containsKey(ContantXk.RZHD)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RZHD); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日自耗电 // pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // double rfdlsyz=0.0; // double rswdlsyz=0.0; // double rgwgwdlsyz=0.0; // double rnwgwdlsyz=0.0; // if(pointmap.containsKey(ContantXk.RFDLSYZ)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日发电量(升压站) // rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYfdldb(rfdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RSWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RSWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日上网电量 // rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYswdldb(rswdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RGWGWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日工网购网电量 // rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYgwgwdldb(rgwgwdlsyz); // // } // } // // if(pointmap.containsKey(ContantXk.RNWGWDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日农网购网电量 // rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2); // pewp.setYnwgwdldb(rnwgwdlsyz); // // } // } // // //日综合场用电量(电表) // pewp.setYzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2)); // // // if(pointmap.containsKey(ContantXk.RCYDL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.RCYDL); // PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000); // if(StringUtils.notEmp(pointValue)) // { // //日厂用电量 // pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2)); // // } // } // // if(pointmap.containsKey(ContantXk.TPOINT_WP_CXGL)); // { // ProBasicWppoint point=pointmap.get(ContantXk.TPOINT_WP_CXGL); // List pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(),begin.getTime()/1000,end.getTime()/1000); // if(!pointls.isEmpty()) // { // DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics(); // //日最大功率(出线) // pewp.setYzdglcx(summaryStatistics.getMax()); // //日最小功率(出线) // pewp.setYzxglcx(summaryStatistics.getMin()); // //日平均功率(出线) // pewp.setYpjglcx(summaryStatistics.getAverage()); // } // // } // // List wpinfodayls = proEconWindpowerInfoDayService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0 //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.sq.getValue())) // .collect(Collectors.toList()); // // // List monthls =null; // Calendar cl=Calendar.getInstance(); // cl.setTime(recordDate); // if(cl.get(Calendar.DAY_OF_MONTH)==1) // { // monthls=new ArrayList<>(); // }else // { // cl.add(Calendar.DAY_OF_MONTH,-1); // // } // // monthls = proEconWindpowerInfoMonthService.list().stream() // .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime()))==0 //// && CacheContext.wpmap.containsKey(i.getWindpowerstationId()) // && i.getLocation().equals(Location.sq.getValue())) // .collect(Collectors.toList()); // //统计14种状态明细指标的时长和次数 // calDetiall(pewp,recordDate,wpinfodayls,monthls); // //统计7种状态指标的时长和次数 // calSimple(pewp,recordDate,wpinfodayls); // // proEconWindpowerInfoMonthService.save(pewp); // // } // // // } // // } // private void calDetiall(ProEconWindpowerInfoMonth pewp,Date recordDate,List ls,List monthls) throws Exception { // // 0 待机 //// 1 手动停机 //// 2 正常发电 //// 3 发电降出力 //// 4 故障 //// 5 故障受累 //// 6 检修 //// 7 检修受累 //// 8 限电降出力 //// 9 限电停机 //// 10 电网受累 //// 11 环境受累 //// 12 通讯中断 //// 13 设备离线 // // // if(monthls.isEmpty()) // { // if(!ls.isEmpty()) // { // // //日合计故障小时(明细) // DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjgzxsmx()).summaryStatistics(); // pewp.setYhjgzxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累故障小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnslgzxsmx()).summaryStatistics(); // pewp.setYhjcnslgzxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计检修小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxxsmx()).summaryStatistics(); // pewp.setYhjjxxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累检修小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnsljxxsmx()).summaryStatistics(); // pewp.setYhjcnsljxxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计待机小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjxsmx()).summaryStatistics(); // pewp.setYhjdjxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计缺陷降出力小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjqxjclxsmx()).summaryStatistics(); // pewp.setYhjqxjclxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计手动停机小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjsdtjxsmx()).summaryStatistics(); // pewp.setYhjsdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计性能小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxnxsmx()).summaryStatistics(); // pewp.setYhjxnxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电停机小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdtjxsmx()).summaryStatistics(); // pewp.setYhjxdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电降出力小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdjclxsmx()).summaryStatistics(); // pewp.setYhjxdjclxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsldwxsmx()).summaryStatistics(); // pewp.setYhjcwsldwxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsltqxsmx()).summaryStatistics(); // pewp.setYhjcwsltqxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdxsmx()).summaryStatistics(); // pewp.setYhjtxzdxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计离线小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjlxxsmx()).summaryStatistics(); // pewp.setYhjlxxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日合计故障次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjgzcsmx()).summaryStatistics(); // pewp.setYhjgzcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累故障次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnslgzcsmx()).summaryStatistics(); // pewp.setYhjcnslgzcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计检修次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxcsmx()).summaryStatistics(); // pewp.setYhjjxcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累检修次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnsljxcsmx()).summaryStatistics(); // pewp.setYhjcnsljxcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计待机次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjcsmx()).summaryStatistics(); // pewp.setYhjdjcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计缺陷降出力次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjqxjclcsmx()).summaryStatistics(); // pewp.setYhjqxjclcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计手动停机次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjsdtjcsmx()).summaryStatistics(); // pewp.setYhjsdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计性能次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxncsmx()).summaryStatistics(); // pewp.setYhjxncsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电停机次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdtjcsmx()).summaryStatistics(); // pewp.setYhjxdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电降出力次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdjclcsmx()).summaryStatistics(); // pewp.setYhjxdjclcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsldwcsmx()).summaryStatistics(); // pewp.setYhjcwsldwcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsltqcsmx()).summaryStatistics(); // pewp.setYhjcwsltqcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdcsmx()).summaryStatistics(); // pewp.setYhjtxzdcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计离线次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjlxcsmx()).summaryStatistics(); // pewp.setYhjlxcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // } // }else { // if(!ls.isEmpty()) // { // ProEconWindpowerInfoMonth monthdata=monthls.get(0); // //日合计故障小时(明细) // DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjgzxsmx()).summaryStatistics(); // // pewp.setYhjgzxsmx(StringUtils.round( monthdata.getYhjgzxsmx()+summaryStatistics.getSum(),2)); // //日合计场内受累故障小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnslgzxsmx()).summaryStatistics(); // pewp.setYhjcnslgzxsmx(StringUtils.round(monthdata.getYhjcnslgzxsmx()+summaryStatistics.getSum(),2)); // //日合计检修小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxxsmx()).summaryStatistics(); // pewp.setYhjjxxsmx(StringUtils.round(monthdata.getRhjjxxsmx()+summaryStatistics.getSum(),2)); // //日合计场内受累检修小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnsljxxsmx()).summaryStatistics(); // pewp.setYhjcnsljxxsmx(StringUtils.round(monthdata.getRhjcnsljxxsmx()+summaryStatistics.getSum(),2)); // //日合计待机小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjxsmx()).summaryStatistics(); // pewp.setYhjdjxsmx(StringUtils.round(monthdata.getRhjdjxsmx()+summaryStatistics.getSum(),2)); // //日合计缺陷降出力小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjqxjclxsmx()).summaryStatistics(); // pewp.setYhjqxjclxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计手动停机小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjsdtjxsmx()).summaryStatistics(); // pewp.setYhjsdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计性能小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxnxsmx()).summaryStatistics(); // pewp.setYhjxnxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电停机小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdtjxsmx()).summaryStatistics(); // pewp.setYhjxdtjxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电降出力小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdjclxsmx()).summaryStatistics(); // pewp.setYhjxdjclxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsldwxsmx()).summaryStatistics(); // pewp.setYhjcwsldwxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsltqxsmx()).summaryStatistics(); // pewp.setYhjcwsltqxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdxsmx()).summaryStatistics(); // pewp.setYhjtxzdxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计离线小时(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjlxxsmx()).summaryStatistics(); // pewp.setYhjlxxsmx(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日合计故障次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjgzcsmx()).summaryStatistics(); // pewp.setYhjgzcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累故障次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnslgzcsmx()).summaryStatistics(); // pewp.setYhjcnslgzcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计检修次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxcsmx()).summaryStatistics(); // pewp.setYhjjxcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场内受累检修次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcnsljxcsmx()).summaryStatistics(); // pewp.setYhjcnsljxcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计待机次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjcsmx()).summaryStatistics(); // pewp.setYhjdjcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计缺陷降出力次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjqxjclcsmx()).summaryStatistics(); // pewp.setYhjqxjclcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计手动停机次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjsdtjcsmx()).summaryStatistics(); // pewp.setYhjsdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计性能次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxncsmx()).summaryStatistics(); // pewp.setYhjxncsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电停机次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdtjcsmx()).summaryStatistics(); // pewp.setYhjxdtjcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电降出力次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdjclcsmx()).summaryStatistics(); // pewp.setYhjxdjclcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsldwcsmx()).summaryStatistics(); // pewp.setYhjcwsldwcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计场外受累电网次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjcwsltqcsmx()).summaryStatistics(); // pewp.setYhjcwsltqcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdcsmx()).summaryStatistics(); // pewp.setYhjtxzdcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计离线次数(明细) // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjlxcsmx()).summaryStatistics(); // pewp.setYhjlxcsmx(StringUtils.round(summaryStatistics.getSum(),2)); // } // } // // // // } // // // // private void calSimple(ProEconWindpowerInfoMonth pewp,Date recordDate,List ls) throws Exception { //// 0 待机 //// 1 运行 //// 2 故障 //// 3 检修 //// 4 限电 //// 5 受累 //// 6 离线 // if(!ls.isEmpty()) // { // //日合计待机小时 // DoubleSummaryStatistics summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjxs()).summaryStatistics(); // pewp.setYhjdjxs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计维护停机小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxtjxs()).summaryStatistics(); // pewp.setYhjjxtjxs(StringUtils.round(summaryStatistics.getSum(),2)); // // 日合计待机小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjxs()).summaryStatistics(); // pewp.setYhjdjxs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计运行小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjyxxs()).summaryStatistics(); // pewp.setYhjyxxs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdxs()).summaryStatistics(); // pewp.setYhjxdxs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断小时 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdxs()).summaryStatistics(); // pewp.setYhjtxzdxs(StringUtils.round(summaryStatistics.getSum(),2)); // // // //日合计故障次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjcs()).summaryStatistics(); // pewp.setYhjdjcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计检修次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjjxtjcs()).summaryStatistics(); // pewp.setYhjjxtjcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计待机次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjdjcs()).summaryStatistics(); // pewp.setYhjdjcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计性能次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjyxcs()).summaryStatistics(); // pewp.setYhjyxcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计限电停机次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjxdcs()).summaryStatistics(); // pewp.setYhjxdcs(StringUtils.round(summaryStatistics.getSum(),2)); // //日合计通讯中断次数 // summaryStatistics=ls.stream().mapToDouble(n -> n.getRhjtxzdcs()).summaryStatistics(); // pewp.setYhjtxzdcs(StringUtils.round(summaryStatistics.getSum(),2)); // } // // } // //} // // // // // // //