package com.gyee.generation.task.thread;

import com.gyee.common.contant.ContantXk;
import com.gyee.common.model.PointData;
import com.gyee.common.model.StringUtils;
import com.gyee.generation.config.feign.RemoteServiceBuilder;
import com.gyee.generation.config.feign.TsDoubleData;
import com.gyee.generation.init.CacheContext;
import com.gyee.generation.model.auto.ProBasicEquipment;
import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
import com.gyee.generation.model.auto.ProEconEquipmentInfoDay1;
import com.gyee.generation.model.vo.WpType;
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 javax.annotation.Resource;
import java.io.Serializable;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.stream.Collectors;

public class EquipmentInfo1ThreadPool implements Callable<String>, Serializable {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    private static final long serialVersionUID = 0;

    // 保存任务所需要的数据

    private Object threadPoolTaskData;
    private ProBasicEquipment wt;
    private Map<String, ProEconEquipmentInfoDay1> pep1map;

    private Date recordDate;
    private Date end;

    private Date begin;
    private List<ProEconEquipmentInfoDay1> dayls;
    private IEdosUtil edosUtil;

    private RemoteServiceBuilder remoteService;

    public EquipmentInfo1ThreadPool(Object tasks, ProBasicEquipment wt, Map<String, ProEconEquipmentInfoDay1> pep1map,
                                    Date recordDate, Date end, Date begin, List<ProEconEquipmentInfoDay1> dayls,
                                    IEdosUtil edosUtil, RemoteServiceBuilder remoteService
    ) {

        this.threadPoolTaskData = tasks;
        this.wt = wt;
        this.pep1map = pep1map;
        this.recordDate = recordDate;
        this.end = end;
        this.begin = begin;
        this.dayls = dayls;
        this.edosUtil = edosUtil;
        this.remoteService = remoteService;
    }

    public synchronized String call() throws Exception {


        // 处理一个任务，这里的处理方式太简单了，仅仅是一个打印语句

        //System.out.println("开始执行任务：" + threadPoolTaskData);

        String result = "";

        // //便于观察，等待一段时间

        try {
            //			if(wt.getId().equals("SXJ_KGDL_BHB_F_WT_0005_EQ"))
            //			{
            //				System.out.println("");
            //			}
            if (CacheContext.wtpAimap.containsKey(wt.getId())) {
                Map<String, ProBasicEquipmentPoint> pointmap = CacheContext.wtpAimap.get(wt.getId());

                ProEconEquipmentInfoDay1 pewp = new ProEconEquipmentInfoDay1();
                Initial.initial(pewp);
                pewp.setCompanyId(wt.getCompanyId());
                pewp.setWindpowerstationId(wt.getWindpowerstationId());
                pewp.setLineId(wt.getLineId());
                pewp.setProjectId(wt.getProjectId());
                pewp.setRegionId(wt.getRegionId());
                pewp.setRecordDate(DateUtils.truncate(recordDate));
                pewp.setWindturbineId(wt.getId());
                //昨日的统计结果
                List<ProEconEquipmentInfoDay1> pep1ls = new ArrayList<>();

                if (pep1map.containsKey(wt.getId())) {

                    Calendar c = Calendar.getInstance();
                    c.setTime(recordDate);

                    if (c.get(Calendar.DAY_OF_MONTH) == 1) {
                        pep1ls.add(pep1map.get(wt.getId()));
                    }

                }
                extracted(pep1map, recordDate, end, begin, pointmap, pewp, pep1ls);

                dayls.add(pewp);
                // proEconEquipmentInfoDay1Service.save(pewp);

            }

        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        threadPoolTaskData = null;

        return result;

    }

    private void extracted(Map<String, ProEconEquipmentInfoDay1> pep1map, Date recordDate, Date end, Date begin, Map<String, ProBasicEquipmentPoint> pointmap, ProEconEquipmentInfoDay1 pewp, List<ProEconEquipmentInfoDay1> pepid1ls) throws Exception {


        if (pewp.getWindpowerstationId().contains(WpType.FDC.id)) {
            //*******************************************日信息统计*********************************************************/
            if (pointmap.containsKey(ContantXk.CJ_SSFS)) {
                ProBasicEquipmentPoint point = pointmap.get(ContantXk.CJ_SSFS);
                List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);

//                List<TsDoubleData> historySnap = remoteService.adapterfd().getHistorySnap(point.getNemCode(), begin.getTime(), end.getTime(), 60);
                pointls = pointls.stream().filter(n -> (n.getPointValueInDouble() > 0 && n.getPointValueInDouble() < 30)).collect(Collectors.toList());

                if (!pointls.isEmpty()) {
                    DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
                    //日最大风速
                    if (summaryStatistics.getMax() > 30) {
                        pewp.setRzdfs(StringUtils.round(25, 2));

                    } else {
                        pewp.setRzdfs(StringUtils.round(summaryStatistics.getMax(), 2));
                    }

                    //日最小风速
                    if (summaryStatistics.getMin() < 0) {
                        pewp.setRzxfs(StringUtils.round(0, 2));
                    } else {
                        pewp.setRzxfs(StringUtils.round(summaryStatistics.getMin(), 2));
                    }
                    //日平均风速
                    if (summaryStatistics.getAverage() > 30) {
                        pewp.setRpjfs(StringUtils.round(25, 2));
                    } else if (summaryStatistics.getAverage() < 0) {
                        pewp.setRpjfs(StringUtils.round(0, 2));
                    } else {
                        pewp.setRpjfs(StringUtils.round(summaryStatistics.getAverage(), 2));
                    }
                }

            }
        } else {
            //*******************************************日信息统计*********************************************************/
            if (pointmap.containsKey(ContantXk.RPJGZD)) {
                ProBasicEquipmentPoint point = pointmap.get(ContantXk.RPJGZD);
                PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
                if (StringUtils.notEmp(pointValue)) {
                    //日平均风速
                    pewp.setRpjfs(StringUtils.round(pointValue.getPointValueInDouble(), 2));

                }
                //				Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
                //
                //				Map<String, ProBasicPowerstationPoint> wpPointMap = wppointmap.get(wt.getWindpowerstationId());
                //
                //				ProBasicPowerstationPoint gzdPoint=wpPointMap.get("GCGZQD");
                //				List<PointData> pointls = edosUtil.getHistoryDatasSnap(gzdPoint, begin.getTime() / 1000, end.getTime() / 1000, null, 60l);
                //				if(!pointls.isEmpty())
                //				{
                //					List<PointData> filterls=new ArrayList<>();
                //					for(PointData po:pointls)
                //					{
                //						if(po.getPointValueInDouble()>10)
                //						{
                //							filterls.add(po);
                //						}
                //					}
                //
                //
                //					if(!filterls.isEmpty())
                //					{
                //						Date beginTime=new Date(filterls.get(0).getPointTime());
                //						Date endTime=new Date(filterls.get(filterls.size()-1).getPointTime());
                //						double hours=DateUtils.hoursDiff(beginTime,endTime);
                //
                //						DoubleSummaryStatistics summaryStatistics=filterls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
                //						//日最大风速
                //						pewp.setRzdfs(StringUtils.round(summaryStatistics.getMax(),2));
                //						//日最小风速
                //						pewp.setRzxfs(StringUtils.round(summaryStatistics.getMin(),2));
                //
                //						double avg= StringUtils.round(summaryStatistics.getAverage(),2);
                //
                //						double result =new BigDecimal(avg*hours).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
                //
                //						//日平均风速
                //						pewp.setRpjfs(result);
                //
                //
                //					}
                //
                //
                //				}

            }
        }


        if (pointmap.containsKey(ContantXk.RPJGL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RPJGL);
            List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);

            double powerProduction = 1500;
            if (CacheContext.wtmap.containsKey(pewp.getWindturbineId())) {
                ProBasicEquipment wt = CacheContext.wtmap.get(pewp.getWindturbineId());
                if (CacheContext.modelMap.containsKey(wt.getModelId())) {
                    powerProduction = CacheContext.modelMap.get(wt.getModelId()).getPowerProduction();
                }
            }
            double finalPowerProduction = powerProduction;
            pointls = pointls.stream().filter(n -> (n.getPointValueInDouble() > -100 && n.getPointValueInDouble() <= finalPowerProduction)).collect(Collectors.toList());

            if (!pointls.isEmpty()) {
                DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
                //日最大功率
                pewp.setRzdgl(StringUtils.round(summaryStatistics.getMax(), 2));

                //日最小功率
                pewp.setRzxgl(StringUtils.round(summaryStatistics.getMin(), 2));

                //日平均功率
                pewp.setRpjgl(StringUtils.round(summaryStatistics.getAverage(), 2));

            }
        }

        double rfdl = 0.0;
        double rgzssdl = 0.0;
        double rcnslgzssdl = 0.0;
        double rjxssdl = 0.0;
        double rcnsljxssdl = 0.0;
        double rdjssdl = 0.0;
        double rqxjclssdl = 0.0;
        double rsdtjssdl = 0.0;
        double rxnssdl = 0.0;
        double rxdtjssdl = 0.0;
        double rxdjclssdl = 0.0;
        double rcwsldwssdl = 0.0;
        double rcwsltqssdl = 0.0;


        if (pointmap.containsKey(ContantXk.RFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RFDL);

            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日发电量
                pewp.setRfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rfdl = pewp.getRfdl();
            }
        }
        if (pointmap.containsKey(ContantXk.RKYDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RKYDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日可用电量
                pewp.setRkydl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }


        if (pointmap.containsKey(ContantXk.RLLFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RLLFDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日理论发电量
                pewp.setRllfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }


        if (pointmap.containsKey(ContantXk.RGZSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RGZSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日故障损失电量
                pewp.setRgzssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rgzssdl = pewp.getRgzssdl();
            }
        }
        if (pointmap.containsKey(ContantXk.RCNSLGZSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RCNSLGZSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日场内受累故障损失电量
                pewp.setRcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rcnslgzssdl = pewp.getRcnslgzssdl();
            }
        }

        if (pointmap.containsKey(ContantXk.RJXSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RJXSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日检修损失电量
                pewp.setRjxssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rjxssdl = pewp.getRjxssdl();
            }
        }

        if (pointmap.containsKey(ContantXk.RCNSLJXSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RCNSLJXSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日场内受累检修损失电量
                pewp.setRcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rcnsljxssdl = pewp.getRcnsljxssdl();

            }
        }

        if (pointmap.containsKey(ContantXk.RDJSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RDJSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日待机损失电量
                pewp.setRdjssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rdjssdl = pewp.getRdjssdl();
            }
        }
        if (pointmap.containsKey(ContantXk.RQXJCLSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RQXJCLSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日缺陷降出力损失电量
                pewp.setRqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rqxjclssdl = pewp.getRqxjclssdl();
            }
        }
        if (pointmap.containsKey(ContantXk.RSDTJSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RSDTJSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日手动停机损失电量
                pewp.setRsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rsdtjssdl = pewp.getRsdtjssdl();

            }
        }
        if (pointmap.containsKey(ContantXk.RXNSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RXNSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日性能损失电量
                pewp.setRxnssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rxnssdl = pewp.getRxnssdl();
            }
        }

        if (pointmap.containsKey(ContantXk.RXDTJSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RXDTJSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日限电停机损失电量
                pewp.setRxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rxdtjssdl = pewp.getRxdtjssdl();

                rxdtjssdl = 0.0;
                pewp.setRxdtjssdl(0.0);
            }
        }


        if (pointmap.containsKey(ContantXk.RXDJCLSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RXDJCLSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日限电降出力损失电量
                pewp.setRxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rxdjclssdl = pewp.getRxdjclssdl();
                rxdjclssdl = 0.0;
                pewp.setRxdjclssdl(0.0);
            }
        }

        if (pointmap.containsKey(ContantXk.RCWSLDWSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RCWSLDWSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日场外受累电网损失电量
                pewp.setRcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rcwsldwssdl = pewp.getRcwsldwssdl();
                rcwsldwssdl = 0.0;
                pewp.setRcwsldwssdl(0.0);
            }
        }
        if (pointmap.containsKey(ContantXk.RCWSLTQSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RCWSLTQSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日场外受累天气损失电量
                pewp.setRcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                rcwsltqssdl = pewp.getRcwsltqssdl();
                rcwsltqssdl = 0.0;
                pewp.setRcwsltqssdl(0.0);
            }
        }

        if (pointmap.containsKey(ContantXk.RZFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RZFDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日增发电量
                pewp.setRzfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }

        if (pointmap.containsKey(ContantXk.RQFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RQFDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日欠发电量
                pewp.setRqfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }
        if (pointmap.containsKey(ContantXk.RZHD)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.RZHD);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //日自耗电
                pewp.setRzhd(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }

        double rllfdl = rfdl + rgzssdl + rcnslgzssdl + rjxssdl + rcnsljxssdl + rcnsljxssdl + rxdtjssdl + rxdjclssdl + rcwsldwssdl + rcwsltqssdl + rdjssdl + rqxjclssdl + rsdtjssdl + rxnssdl;
        pewp.setRllfdl(StringUtils.round(rllfdl, 2));

        //*******************************************日信息统计*********************************************************/

        //*******************************************月信息统计*********************************************************/

        if (!pepid1ls.isEmpty()) {
            setPowerandSpeedMonth(pewp);
        } else {

            if (pewp.getWindpowerstationId().contains(WpType.FDC.id)) {
                //*******************************************日信息统计*********************************************************/
                if (pointmap.containsKey(ContantXk.YPJFS)) {
                    ProBasicEquipmentPoint point = pointmap.get(ContantXk.YPJFS);
                    List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);

                    pointls = pointls.stream().filter(n -> (n.getPointValueInDouble() > 0 && n.getPointValueInDouble() < 30)).collect(Collectors.toList());

                    if (!pointls.isEmpty()) {
                        DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
                        //月最大风速
                        if (summaryStatistics.getMax() > 30) {
                            pewp.setYzdfs(StringUtils.round(25, 2));

                        } else {
                            pewp.setYzdfs(StringUtils.round(summaryStatistics.getMax(), 2));
                        }

                        //月最小风速

                        if (summaryStatistics.getMin() < 0) {
                            pewp.setYzxfs(StringUtils.round(0, 2));
                        } else {
                            pewp.setYzxfs(StringUtils.round(summaryStatistics.getMin(), 2));
                        }
                        //月平均风速

                        if (summaryStatistics.getAverage() > 30) {
                            pewp.setYpjfs(StringUtils.round(25, 2));
                        } else if (summaryStatistics.getAverage() < 0) {
                            pewp.setYpjfs(StringUtils.round(0, 2));
                        } else {
                            pewp.setYpjfs(StringUtils.round(summaryStatistics.getAverage(), 2));
                        }
                    }

                }
            } else {
                //*******************************************日信息统计*********************************************************/

                if (pep1map.containsKey(wt.getId())) {
                    ProEconEquipmentInfoDay1 day1 = pep1map.get(wt.getId());
                    //月累计光照度
                    pewp.setYpjfs(StringUtils.round(day1.getYpjfs() + pewp.getRpjfs(), 2));
                    //月最大光照度
                    if (day1.getYzdfs() < pewp.getRpjfs()) {
                        pewp.setYzdfs(StringUtils.round(pewp.getRpjfs(), 2));
                    }
                    //月最小光照度
                    if (day1.getYzxfs() > pewp.getRpjfs()) {
                        pewp.setYzxfs(StringUtils.round(pewp.getRpjfs(), 2));
                    }
                }

            }


            if (pointmap.containsKey(ContantXk.YPJGL)) {
                ProBasicEquipmentPoint point = pointmap.get(ContantXk.YPJGL);
                List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
                if (!pointls.isEmpty()) {
                    DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
                    //月最大功率
                    pewp.setYzdgl(StringUtils.round(summaryStatistics.getMax(), 2));
                    //月最小功率
                    pewp.setYzxgl(StringUtils.round(summaryStatistics.getMin(), 2));
                    //月平均功率
                    pewp.setYpjgl(StringUtils.round(summaryStatistics.getAverage(), 2));
                }
            }

        }

        double yfdl = 0.0;
        double ygzssdl = 0.0;
        double ycnslgzssdl = 0.0;
        double yjxssdl = 0.0;
        double ycnsljxssdl = 0.0;
        double ydjssdl = 0.0;
        double yqxjclssdl = 0.0;
        double ysdtjssdl = 0.0;
        double yxnssdl = 0.0;
        double yxdtjssdl = 0.0;
        double yxdjclssdl = 0.0;
        double ycwsldwssdl = 0.0;
        double ycwsltqssdl = 0.0;

        if (pointmap.containsKey(ContantXk.YFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YFDL);

            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月发电量
                pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                yfdl = pewp.getYfdl();

            }
        }
        if (pointmap.containsKey(ContantXk.YKYDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YKYDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月可用电量
                pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }


        if (pointmap.containsKey(ContantXk.YLLFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YLLFDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月理论发电量
                pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }


        if (pointmap.containsKey(ContantXk.YGZSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YGZSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月故障损失电量
                pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ygzssdl = pewp.getYgzssdl();

            }
        }
        if (pointmap.containsKey(ContantXk.YCNSLGZSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YCNSLGZSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月场内受累故障损失电量
                pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ycnslgzssdl = pewp.getYcnslgzssdl();

            }
        }

        if (pointmap.containsKey(ContantXk.YJXSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YJXSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月检修损失电量
                pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                yjxssdl = pewp.getYjxssdl();

            }
        }

        if (pointmap.containsKey(ContantXk.YCNSLJXSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YCNSLJXSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月场内受累检修损失电量
                pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ycnsljxssdl = pewp.getYcnsljxssdl();

            }
        }

        if (pointmap.containsKey(ContantXk.YDJSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YDJSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月待机损失电量
                pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ydjssdl = pewp.getYdjssdl();


            }
        }
        if (pointmap.containsKey(ContantXk.YQXJCLSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YQXJCLSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月缺陷降出力损失电量
                pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                yqxjclssdl = pewp.getYqxjclssdl();


            }
        }
        if (pointmap.containsKey(ContantXk.YSDTJSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YSDTJSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月手动停机损失电量
                pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ysdtjssdl = pewp.getYsdtjssdl();


            }
        }
        if (pointmap.containsKey(ContantXk.YXNSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YXNSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月性能损失电量
                pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                yxnssdl = pewp.getYxnssdl();


            }
        }

        if (pointmap.containsKey(ContantXk.YXDTJSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YXDTJSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月限电停机损失电量
                pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                yxdtjssdl = pewp.getYxdtjssdl();

                yxdtjssdl = 0.0;
                pewp.setYxdtjssdl(0.0);
            }
        }


        if (pointmap.containsKey(ContantXk.YXDJCLSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YXDJCLSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月限电降出力损失电量
                pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                yxdjclssdl = pewp.getYxdjclssdl();

                yxdjclssdl = 0.0;
                pewp.setYxdjclssdl(0.0);
            }
        }

        if (pointmap.containsKey(ContantXk.YCWSLDWSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YCWSLDWSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月场外受累电网损失电量
                pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ycwsldwssdl = pewp.getYcwsldwssdl();

                ycwsldwssdl = 0.0;
                pewp.setYcwsldwssdl(0.0);
            }
        }
        if (pointmap.containsKey(ContantXk.YCWSLTQSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YCWSLTQSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月场外受累天气损失电量
                pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ycwsltqssdl = pewp.getYcwsltqssdl();

                ycwsltqssdl = 0.0;
                pewp.setYcwsltqssdl(0.0);
            }
        }

        if (pointmap.containsKey(ContantXk.YZFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YZFDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月增发电量
                pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }

        if (pointmap.containsKey(ContantXk.YQFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YQFDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月欠发电量
                pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }
        if (pointmap.containsKey(ContantXk.YZHD)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.YZHD);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //月自耗电
                pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }

        double yllfdl = yfdl + ygzssdl + ycnslgzssdl + yjxssdl + ycnsljxssdl + ycnsljxssdl + yxdtjssdl + yxdjclssdl + ycwsldwssdl + ycwsltqssdl + ydjssdl + yqxjclssdl + ysdtjssdl + yxnssdl;
        pewp.setYllfdl(StringUtils.round(yllfdl, 2));
        //*******************************************月信息统计*********************************************************/

        //*******************************************年信息统计*********************************************************/
        if (!pepid1ls.isEmpty()) {
            setPowerandSpeedYear(pewp);
        } else {

            if (pewp.getWindpowerstationId().contains(WpType.FDC.id)) {
                //*******************************************日信息统计*********************************************************/
                if (pointmap.containsKey(ContantXk.NPJFS)) {
                    ProBasicEquipmentPoint point = pointmap.get(ContantXk.NPJFS);
                    List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);

                    pointls = pointls.stream().filter(n -> (n.getPointValueInDouble() > 0 && n.getPointValueInDouble() < 30)).collect(Collectors.toList());

                    if (!pointls.isEmpty()) {
                        DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
                        //年最大风速
                        if (summaryStatistics.getMax() > 30) {
                            pewp.setNzdfs(StringUtils.round(25, 2));

                        } else {
                            pewp.setNzdfs(StringUtils.round(summaryStatistics.getMax(), 2));
                        }

                        //年最小风速

                        if (summaryStatistics.getMin() < 0) {
                            pewp.setNzxfs(StringUtils.round(0, 2));
                        } else {
                            pewp.setNzxfs(StringUtils.round(summaryStatistics.getMin(), 2));
                        }
                        //年平均风速

                        if (summaryStatistics.getAverage() > 30) {
                            pewp.setNpjfs(StringUtils.round(25, 2));
                        } else if (summaryStatistics.getAverage() < 0) {
                            pewp.setNpjfs(StringUtils.round(0, 2));
                        } else {
                            pewp.setNpjfs(StringUtils.round(summaryStatistics.getAverage(), 2));
                        }
                    }

                }
            } else {
                //*******************************************日信息统计*********************************************************/
                if (pep1map.containsKey(wt.getId())) {
                    ProEconEquipmentInfoDay1 day1 = pep1map.get(wt.getId());
                    //年累计光照度
                    pewp.setNpjfs(StringUtils.round(day1.getNpjfs() + pewp.getRpjfs(), 2));
                    //年最大光照度
                    if (day1.getNzdfs() < pewp.getRpjfs()) {
                        pewp.setNzdfs(StringUtils.round(pewp.getRpjfs(), 2));
                    }
                    //年最小光照度
                    if (day1.getNzxfs() > pewp.getRpjfs()) {
                        pewp.setNzxfs(StringUtils.round(pewp.getRpjfs(), 2));
                    }

                }
            }


            if (pointmap.containsKey(ContantXk.NPJGL)) {
                ProBasicEquipmentPoint point = pointmap.get(ContantXk.NPJGL);
                List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
                if (!pointls.isEmpty()) {
                    DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
                    //年最大功率

                    pewp.setNzdgl(StringUtils.round(summaryStatistics.getMax(), 2));
                    //年最小功率
                    pewp.setNzxgl(StringUtils.round(summaryStatistics.getMin(), 2));

                    //年平均功率
                    pewp.setNpjgl(StringUtils.round(summaryStatistics.getAverage(), 2));

                }
            }

        }
        double nfdl = 0.0;
        double ngzssdl = 0.0;
        double ncnslgzssdl = 0.0;
        double njxssdl = 0.0;
        double ncnsljxssdl = 0.0;
        double ndjssdl = 0.0;
        double nqxjclssdl = 0.0;
        double nsdtjssdl = 0.0;
        double nxnssdl = 0.0;
        double nxdtjssdl = 0.0;
        double nxdjclssdl = 0.0;
        double ncwsldwssdl = 0.0;
        double ncwsltqssdl = 0.0;
        if (pointmap.containsKey(ContantXk.NFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NFDL);

            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年发电量
                pewp.setNfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                nfdl = pewp.getNfdl();

            }
        }
        if (pointmap.containsKey(ContantXk.NKYDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NKYDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年可用电量
                pewp.setNkydl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }


        if (pointmap.containsKey(ContantXk.NLLFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NLLFDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年理论发电量
                pewp.setNllfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }


        if (pointmap.containsKey(ContantXk.NGZSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NGZSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年故障损失电量
                pewp.setNgzssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ngzssdl = pewp.getNgzssdl();

            }
        }
        if (pointmap.containsKey(ContantXk.NCNSLGZSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NCNSLGZSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年场内受累故障损失电量
                pewp.setNcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ncnslgzssdl = pewp.getNcnslgzssdl();

            }
        }

        if (pointmap.containsKey(ContantXk.NJXSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NJXSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年检修损失电量
                pewp.setNjxssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                njxssdl = pewp.getNjxssdl();

            }
        }

        if (pointmap.containsKey(ContantXk.NCNSLJXSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NCNSLJXSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年场内受累检修损失电量
                pewp.setNcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ncnsljxssdl = pewp.getNcnsljxssdl();


            }
        }

        if (pointmap.containsKey(ContantXk.NDJSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NDJSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年待机损失电量
                pewp.setNdjssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ndjssdl = pewp.getNdjssdl();


            }
        }
        if (pointmap.containsKey(ContantXk.NQXJCLSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NQXJCLSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年缺陷降出力损失电量
                pewp.setNqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

                nqxjclssdl = pewp.getNqxjclssdl();

            }
        }
        if (pointmap.containsKey(ContantXk.NSDTJSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NSDTJSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年手动停机损失电量
                pewp.setNsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

                nsdtjssdl = pewp.getNsdtjssdl();

            }
        }
        if (pointmap.containsKey(ContantXk.NXNSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NXNSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年性能损失电量
                pewp.setNxnssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                nxnssdl = pewp.getNxnssdl();


            }
        }

        if (pointmap.containsKey(ContantXk.NXDTJSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NXDTJSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年限电停机损失电量
                pewp.setNxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                nxdtjssdl = pewp.getNxdtjssdl();

                nxdtjssdl = 0.0;
                pewp.setNxdtjssdl(0.0);
            }
        }


        if (pointmap.containsKey(ContantXk.NXDJCLSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NXDJCLSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年限电降出力损失电量
                pewp.setNxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                nxdjclssdl = pewp.getNxdjclssdl();

                nxdjclssdl = 0.0;
                pewp.setNxdjclssdl(0.0);

            }
        }

        if (pointmap.containsKey(ContantXk.NCWSLDWSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NCWSLDWSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年场外受累电网损失电量
                pewp.setNcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ncwsldwssdl = pewp.getNcwsldwssdl();

                ncwsldwssdl = 0.0;
                pewp.setNcwsldwssdl(0.0);

            }
        }
        if (pointmap.containsKey(ContantXk.NCWSLTQSSDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NCWSLTQSSDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年场外受累天气损失电量
                pewp.setNcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));
                ncwsltqssdl = pewp.getNcwsltqssdl();

                ncwsltqssdl = 0.0;
                pewp.setNcwsltqssdl(0.0);
            }
        }

        if (pointmap.containsKey(ContantXk.NZFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NZFDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年增发电量
                pewp.setNzfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }

        if (pointmap.containsKey(ContantXk.NQFDL)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NQFDL);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年欠发电量
                pewp.setNqfdl(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }
        if (pointmap.containsKey(ContantXk.NZHD)) {
            ProBasicEquipmentPoint point = pointmap.get(ContantXk.NZHD);
            PointData pointValue = edosUtil.getHistMatrix(point.getNemCode(), end.getTime() / 1000);
            if (StringUtils.notEmp(pointValue)) {
                //年自耗电
                pewp.setNzhd(StringUtils.round(pointValue.getPointValueInDouble(), 2));

            }
        }

        double nllfdl = nfdl + ngzssdl + ncnslgzssdl + njxssdl + ncnsljxssdl + ncnsljxssdl + nxdtjssdl + nxdjclssdl + ncwsldwssdl + ncwsltqssdl + ndjssdl + nqxjclssdl + nsdtjssdl + nxnssdl;
        pewp.setNllfdl(StringUtils.round(nllfdl, 2));
    }

    private void setPowerandSpeedYear(ProEconEquipmentInfoDay1 pewp) {
        //年最大风速
        pewp.setNzdfs(StringUtils.round(pewp.getRzdfs(), 2));

        //年最小风速
        pewp.setNzxfs(StringUtils.round(pewp.getRzxfs(), 2));
        //年平均风速
        pewp.setNpjfs(StringUtils.round(pewp.getRpjfs(), 2));

        //年最大功率
        pewp.setNzdgl(StringUtils.round(pewp.getRzdgl(), 2));
        //年最小功率
        pewp.setNzxgl(StringUtils.round(pewp.getRzxgl(), 2));
        //年平均功率
        pewp.setNpjgl(StringUtils.round(pewp.getRpjgl(), 2));

    }

    private void setPowerandSpeedMonth(ProEconEquipmentInfoDay1 pewp) {

        //月最大风速
        pewp.setYzdfs(StringUtils.round(pewp.getRzdfs(), 2));
        //月最小风速
        pewp.setYzxfs(StringUtils.round(pewp.getRzxfs(), 2));
        //月平均风速
        pewp.setYpjfs(StringUtils.round(pewp.getRpjfs(), 2));

        //月最大功率
        pewp.setYzdgl(StringUtils.round(pewp.getRzdgl(), 2));
        //月最小功率
        pewp.setYzxgl(StringUtils.round(pewp.getRzxgl(), 2));
        //月平均功率
        pewp.setYpjgl(StringUtils.round(pewp.getRpjgl(), 2));
    }
}