Jelajahi Sumber

Merge branch 'master' of http://124.70.43.205:3000/wangb/runeconomy-nx

hlf 1 bulan lalu
induk
melakukan
0d9b69f285

+ 34 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/FiveLoss/FiveLossInfoController.java

@@ -0,0 +1,34 @@
+package com.gyee.runeconomy.controller.FiveLoss;
+
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.runeconomy.dto.result.JsonResult;
+import com.gyee.runeconomy.dto.result.ResultCode;
+import com.gyee.runeconomy.service.fiveloss.FiveLossService;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.Map;
+
+/**
+ * 损失电量分析
+ */
+@RestController
+@CrossOrigin
+@RequestMapping("/fjjxb")
+public class FiveLossInfoController {
+
+    @Resource
+    private FiveLossService fiveLossService;
+
+    @GetMapping("/five/loss/cal")
+    public JSONObject fiveLossCal(String ids){
+        Map<String, Object> map = fiveLossService.fiveLossCalByZSGL3(ids);
+        if (map.size() > 0)
+            return JsonResult.successData(ResultCode.SUCCESS, map);
+
+        return JsonResult.error(ResultCode.ERROR_MODEL);
+    }
+}

+ 98 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/base/WindInfoController.java

@@ -0,0 +1,98 @@
+package com.gyee.runeconomy.controller.base;
+
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.runeconomy.dto.result.JsonResult;
+import com.gyee.runeconomy.dto.result.ResultCode;
+import com.gyee.runeconomy.model.auto.ProBasicEquipment;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
+import com.gyee.runeconomy.service.TokenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 场站风机等基础数据
+ */
+@RestController
+@CrossOrigin
+@RequestMapping("/base")
+public class WindInfoController {
+
+
+    @Autowired
+    private ProEconPowerFittingAnalySisService powerService;
+
+    @Resource
+    private TokenService tokenService;
+
+    @Autowired
+    private HttpServletRequest request;
+
+
+    @GetMapping("station")
+    public JSONObject getStation() {
+        List<ProBasicPowerstation> list = InitialRunner.wpNewList;
+//        List<ProBasicPowerstation> list = tokenService.getWpls(request);
+//        list = list.stream().filter(f -> f.getId().contains("FDC")).collect(Collectors.toList());
+        return JsonResult.successData(ResultCode.SUCCESS, list);
+    }
+
+    @GetMapping("windturbine")
+    public JSONObject getWindTurbine(String stationId) {
+        List<ProBasicEquipment> list = InitialRunner.wpNewMap.get(stationId);
+        List<ProBasicEquipment> orderlist = list.stream()
+                .sorted(Comparator.comparing(ProBasicEquipment::getOrderNum))
+                .collect(Collectors.toList());
+        return JsonResult.successData(ResultCode.SUCCESS, orderlist);
+    }
+
+    @GetMapping("/gfstation")
+    public JSONObject getGFStation() {
+
+        List<ProBasicPowerstation> list = tokenService.getWpls(request);
+        list = list.stream().filter(f -> f.getId().contains("GDC")).collect(Collectors.toList());
+//        List<ProBasicPowerstation> list = InitialRunner.gfwpNewList;
+        return JsonResult.successData(ResultCode.SUCCESS, list);
+    }
+
+    @GetMapping("/inverter")
+    public JSONObject getInverter(String stationId) {
+        List<ProBasicEquipment> list = InitialRunner.gfwpNewMap.get(stationId);
+        return JsonResult.successData(ResultCode.SUCCESS, list);
+    }
+
+
+
+    /**
+     * 获取风机经纬度信息
+     * @param ids
+     * @return
+     */
+    @GetMapping("location")
+    public JSONObject dataLocation(String ids){
+        List<ProBasicEquipment> result = new ArrayList<>();
+        List<ProEconPowerFittingAnalySis> list = powerService.listByIds(Arrays.asList(ids.split(",")));
+        for (ProEconPowerFittingAnalySis obj : list){
+            String[] pids = obj.getProcessid().split(",");
+            for (String id : pids){
+                ProEconPowerFittingAnalySis item = powerService.getById(id);
+                ProBasicEquipment wt = InitialRunner.wtNewMap.get(item.getWindturbineId());
+                wt.setProcessId(id);
+                wt.setFittingId(obj.getId());
+                result.add(wt);
+            }
+        }
+        return JsonResult.successData(ResultCode.SUCCESS, result);
+    }
+
+}

+ 78 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/FiveLoss/AnnotationTool.java

@@ -0,0 +1,78 @@
+package com.gyee.runeconomy.dto.FiveLoss;
+
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * 注解工具类,提供解析注解的方法
+ */
+public class AnnotationTool {
+
+    /**
+     * 获取打了Desc注解的字典属性列表
+     * 该方法用于从给定的Class<T>对象中获取所有带有Desc注解的字段,并将这些字段的信息封装到FixedVo对象中,然后返回一个包含这些FixedVo对象的列表
+     * @return 字典属性列表
+     */
+    public static <T> List<FixedVo> getFixedVoList(Class<T> c) {
+        if (c == null) {
+            return Collections.emptyList();
+        }
+        try {
+            T cls = c.newInstance();
+            Field[] fields = c.getDeclaredFields();
+            List<FixedVo> fixedVoList = new LinkedList<>();
+            for (Field field : fields) {
+                //使私有对象可以访问
+                field.setAccessible(true);
+                //检查字段是否有Desc注解
+                Desc desc = field.getAnnotation(Desc.class);
+                if (desc != null) {
+                    FixedVo vo = new FixedVo();
+                    vo.setKey(String.valueOf(field.get(cls)));
+                    vo.setName(field.getName());
+                    vo.setDes(desc.des());
+                    vo.setUniformCode(desc.uniformCode());
+                    vo.setRemark(desc.remark());
+                    fixedVoList.add(vo);
+                }
+            }
+            return fixedVoList;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return Collections.emptyList();
+    }
+
+    /**
+     * 通过反射获取值
+     * @param object
+     * @return
+     */
+    public static List<FixedVo> getValueList(Object object) {
+        if (object == null) {
+            return Collections.emptyList();
+        }
+        try {
+            Field[] fields = object.getClass().getDeclaredFields();
+            List<FixedVo> fixedVoList = new LinkedList<>();
+            for (Field field : fields) {
+                //使私有对象可以访问
+                field.setAccessible(true);
+                Desc desc = field.getAnnotation(Desc.class);
+                if (desc != null) {
+                    FixedVo vo = new FixedVo();
+                    Object o = field.get(object);
+                    vo.setKey(String.valueOf(o));
+                    vo.setRemark(desc.remark());
+                    fixedVoList.add(vo);
+                }
+            }
+            return fixedVoList;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return Collections.emptyList();
+    }
+}

+ 22 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/FiveLoss/Desc.java

@@ -0,0 +1,22 @@
+package com.gyee.runeconomy.dto.FiveLoss;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * 配置通过注解
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Desc {
+
+    String des();
+
+    String uniformCode() default "";
+
+    String remark() default "";
+
+}

+ 28 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/FiveLoss/FixedVo.java

@@ -0,0 +1,28 @@
+package com.gyee.runeconomy.dto.FiveLoss;
+
+import lombok.Data;
+
+/**
+ * 与注解属性对应的类 @Desc
+ */
+@Data
+public class FixedVo {
+
+    public String key;
+    public String name;
+    public String des;
+    public String uniformCode;
+    public String remark;
+
+
+    @Override
+    public String toString() {
+        return "FixedVo{" +
+                "key='" + key + '\'' +
+                ", name='" + name + '\'' +
+                ", des='" + des + '\'' +
+                ", uniformCode='" + uniformCode + '\'' +
+                ", remark='" + remark + '\'' +
+                '}';
+    }
+}

+ 18 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/FiveLoss/TableTitle.java

@@ -0,0 +1,18 @@
+package com.gyee.runeconomy.dto.FiveLoss;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 和 PowerPointData / PowerFittingPoint 对应
+ * 主要给前端表格提供对应标题
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TableTitle {
+
+    private String key;
+    private String des;
+}

+ 58 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/FiveLoss/exception/AdviceException.java

@@ -0,0 +1,58 @@
+package com.gyee.runeconomy.dto.FiveLoss.exception;
+
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.runeconomy.dto.result.JsonResult;
+import com.gyee.runeconomy.dto.result.ResultCode;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+@Slf4j
+@RestControllerAdvice
+public class AdviceException {
+
+    /**
+     * 拦截未知的运行时异常
+     */
+    @ExceptionHandler(Exception.class)
+    public JSONObject runException(Exception e)
+    {
+        log.error(e.getMessage());
+        return JsonResult.error(ResultCode.ERROR);
+    }
+
+
+    /**
+     * 拦截未知的运行时异常
+     */
+    @ExceptionHandler(NullPointerException.class)
+    public JSONObject nullPointerException(NullPointerException e)
+    {
+        log.error(e.getMessage());
+        return JsonResult.error(ResultCode.ERROR);
+    }
+
+
+    /**
+     * 拦截自定义异常
+     */
+    @ExceptionHandler(RuntimeException.class)
+    public JSONObject runException(RuntimeException e)
+    {
+        log.error(e.getMessage());
+        return JsonResult.error(ResultCode.ERROR);
+    }
+
+
+
+    /**
+     * 拦截自定义异常
+     */
+    @ExceptionHandler(CustomException.class)
+    public JSONObject customException(CustomException e)
+    {
+        log.error(e.getMessage());
+        return JsonResult.error(e.getCode(), e.getMessage());
+    }
+
+}

+ 24 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/FiveLoss/exception/CustomException.java

@@ -0,0 +1,24 @@
+package com.gyee.runeconomy.dto.FiveLoss.exception;
+
+
+import com.gyee.runeconomy.dto.result.ResultCode;
+import lombok.Data;
+
+@Data
+public class CustomException extends RuntimeException {
+
+    private Integer code;
+    private String message;
+
+    public CustomException(){}
+
+    public CustomException(ResultCode result){
+        super();
+        this.code = result.getCode();
+        this.message = result.getMessage();
+    }
+
+    public CustomException(Exception e){
+        super();
+    }
+}

+ 127 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/result/PowerPointData.java

@@ -0,0 +1,127 @@
+package com.gyee.runeconomy.dto.result;
+
+import com.gyee.runeconomy.dto.speed.Desc;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.DecimalFormat;
+
+/**
+ * 数据准备的测点
+ * remark  0:表示该字段不在前端显示  1:表示该字段在前端显示
+ */
+@Data
+public class PowerPointData {
+
+    public PowerPointData(){}
+
+    public PowerPointData(String[] str, boolean isFilter){
+        DecimalFormat df = new DecimalFormat("0.00");
+            this.time = str[0];
+            this.power = Double.valueOf(df.format(Double.valueOf(str[1])));
+            this.speed = Double.valueOf(df.format(Double.valueOf(str[2])));
+            this.rr = Double.valueOf(df.format(Double.valueOf(str[3])));
+            this.mxzt = Double.valueOf(str[4]).intValue();
+            this.dl = Double.valueOf(df.format(Double.valueOf(str[5])));
+            this.qfzt = Double.valueOf(str[6]).intValue();
+            this.fx = Double.valueOf(df.format(Double.valueOf(str[7])));
+            this.dfwc = Double.valueOf(df.format(Double.valueOf(str[8])));
+            this.angle = Double.valueOf(df.format(Double.valueOf(str[9])));
+            this.hjwd = Double.valueOf(df.format(Double.valueOf(str[10])));
+            this.yp1 = Double.valueOf(df.format(Double.valueOf(str[11])));
+            this.yp2 = Double.valueOf(df.format(Double.valueOf(str[12])));
+            this.yp3 = Double.valueOf(df.format(Double.valueOf(str[13])));
+            if (isFilter){
+                BigDecimal bd = new BigDecimal(str[str.length - 1]);
+                bd = bd.setScale(2, RoundingMode.HALF_UP);
+                this.filter =  bd.intValue();
+            }
+
+
+    }
+
+    //时间
+    @Desc(des = "时间", remark = "1")
+    private String time = "1970-01-01 00:00:00";
+
+    //功率 AI114
+    @Desc(des = "功率", uniformCode = "AI114", remark = "1")
+    private double power = 0;
+
+    //风速 AI066
+    @Desc(des = "风速", uniformCode = "AI066", remark = "1")
+    private double speed = 0;
+
+    //转速 AI060
+    @Desc(des = "转速",  uniformCode = "AI060", remark = "1")
+    private double rr = 0;
+
+    //明细状态
+    // 0-待机  1-手动停机  2-正常发电  3-缺陷降出力  4-限电降出力  5-限电停机  6-故障停机
+    // 7-场内受累停机  8-检修停机  9-场内受累检修  10-电网受累  11-环境受累  12-风机离线 MXZT
+    @Desc(des = "风机状态",  uniformCode = "MXZT", remark = "1")
+    private int mxzt = 0;
+
+    //电量 RFDL AI121
+    @Desc(des = "电量",  uniformCode = "AI121", remark = "1")
+    private double dl = 0;
+
+    //欠发状态 SSQFZT
+    @Desc(des = "欠发状态",  uniformCode = "SSQFZT", remark = "1")
+    private int qfzt = 0;
+
+
+    //风向 AI067
+    @Desc(des = "风向",  uniformCode = "AI067", remark = "1")
+    private double fx = 0;
+
+    //对风误差
+    @Desc(des = "对风误差",  uniformCode = "AI073", remark = "1")
+    private double dfwc = 0;
+
+    //偏航角度 AI073
+    @Desc(des = "偏航角度",  uniformCode = "AI028", remark = "1")
+    private double angle = 0;
+
+    /**
+     * AI072
+     */
+    @Desc(des = "环境温度",  uniformCode = "AI072", remark = "1")
+    private double hjwd = 0;
+
+    @Desc(des = "叶片1",  uniformCode = "AI082", remark = "1")
+    private double yp1 = 0;
+
+    @Desc(des = "叶片2",  uniformCode = "AI083", remark = "1")
+    private double yp2 = 0;
+
+    @Desc(des = "叶片3",  uniformCode = "AI084", remark = "1")
+    private double yp3 = 0;
+
+    //是否过滤  0:不过滤 1:过滤
+    @Desc(des = "筛选", uniformCode = "筛选",remark = "0")
+    private int filter = 0;
+
+    private String wtId;
+
+    @Override
+    public String toString() {
+        return "PowerPointData{" +
+                "time='" + time + '\'' +
+                ", power=" + power +
+                ", speed=" + speed +
+                ", rr=" + rr +
+                ", mxzt=" + mxzt +
+                ", dl=" + dl +
+                ", qfzt=" + qfzt +
+                ", fx=" + fx +
+                ", dfwc=" + dfwc +
+                ", angle=" + angle +
+                ", hjwd=" + hjwd +
+                ", filter=" + filter +
+                ", wtId='" + wtId + '\'' +
+                '}';
+    }
+}
+

+ 313 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/fiveloss/FiveLossService.java

@@ -0,0 +1,313 @@
+package com.gyee.runeconomy.service.fiveloss;
+
+
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.vo.benchmark.FjjxbVo;
+import com.gyee.runeconomy.dto.FiveLoss.AnnotationTool;
+import com.gyee.runeconomy.dto.FiveLoss.FixedVo;
+import com.gyee.runeconomy.dto.FiveLoss.TableTitle;
+import com.gyee.runeconomy.dto.FiveLoss.exception.CustomException;
+import com.gyee.runeconomy.dto.result.PowerPointData;
+import com.gyee.runeconomy.dto.result.ResultCode;
+import com.gyee.runeconomy.model.auto.ProEconEquipmentInfoDay1;
+import com.gyee.runeconomy.service.auto.IProEconEquipmentInfoDay1Service;
+import lombok.extern.slf4j.Slf4j;
+import lombok.val;
+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;
+
+@Slf4j
+@Service
+public class FiveLossService {
+
+    @Resource
+    private ProEconPowerFittingAnalySisService analysisService;
+
+    @Resource
+    private IProEconEquipmentInfoDay1Service equipmentInfoDay1Service;
+    @Resource
+    private ITurbineInfoDayService turbineInfoDayService;
+
+    /**
+     * 损失电量计算  eg: 1.5MW   一小时发电:1500kWh    一分钟发电:1500/60 == 25kW
+     *
+     * @param ztmxData 状态明细
+     * @param zsglData 设备的理论功率
+     * @param interval 原始数据的间隔
+     * @param status   风机当前状态
+     * @return
+     */
+    private double generalLoss(List<PowerPointData> ztmxData, Map<Double, Double> zsglData, int interval, double status) {
+        double ssdl = 0.0;
+        List<PowerPointData> pointData = ztmxData.stream().filter(zt -> zt.getMxzt() == status).collect(Collectors.toList());
+        if (status == 0.0 || status == 2.0 || status == 3.0 || status == 4.0 || status == 9.0 || status == 10.0 || status == 11.0) {
+            for (PowerPointData obj : pointData) {
+                double speed = new BigDecimal(obj.getSpeed()).setScale(2, RoundingMode.FLOOR).doubleValue();
+                double zsgl = null == zsglData.get(speed) ? 0:zsglData.get(speed);
+                double power = obj.getPower();
+                double temp = (zsgl - power) > 0 ? zsgl - power : 0;
+                ssdl = ssdl + (temp / 60) * (interval / 60);
+            }
+        } else {
+            for (PowerPointData obj : pointData) {
+                if (obj.getSpeed() < 3.0) continue;
+                double speed = new BigDecimal(obj.getSpeed()).setScale(2, RoundingMode.FLOOR).doubleValue();
+                double zsgl =  null == zsglData.get(speed) ? 0:zsglData.get(speed);
+                ssdl = ssdl + (zsgl / 60) * (interval / 60);
+            }
+        }
+
+        //理论发电量 status < 0
+        if (status < 0){
+            for (PowerPointData obj : ztmxData) {
+                if (obj.getSpeed() < 3.0) continue;
+                double speed = new BigDecimal(obj.getSpeed()).setScale(2, RoundingMode.FLOOR).doubleValue();
+                double zsgl =  null == zsglData.get(speed) ? 0:zsglData.get(speed);
+                ssdl = ssdl + (zsgl / 60) * (interval / 60);
+            }
+        }
+
+        return ssdl > 0 ? ssdl : 0;
+    }
+
+
+    //新的五损计算方法
+    //1.思路整理 实际电量、计划检修损失电量、非计划检修损失电量、限电损失电量、受累损失电量、性能损失电量、理论发电量
+    //计算思路        实际电量 当前功率 * 时间 = 电量
+    //计划检修损失电量
+
+
+
+    /**
+     * 使用文件,通过自诉案功率计算五损数据
+     * @param ids  准备的数据ID
+     */
+    public Map<String, Object> fiveLossCalByZSGL(String ids) {
+        Map<String, Object> promise = null;
+        try {
+            log.info("======风机绩效榜计算开始.............");
+            promise = new HashMap<>();
+            List<FjjxbVo> result = new ArrayList<>();
+            Map<String, Map<Double, Double>> zsglmap = InitialRunner.zsllglNewMap;
+
+            List<ProEconPowerFittingAnalySis> analyses = analysisService.selectListByIds(ids);
+            if (analyses.isEmpty()){
+                log.info("======风机榜效帮计算结束,数据为空.............");
+                throw new CustomException(ResultCode.ERROR);
+            }
+
+            for (ProEconPowerFittingAnalySis p : analyses) {
+                List<String> content = FileUtil.readFile(p.getPath(), true);
+                if (content.isEmpty() || zsglmap.isEmpty() || zsglmap.get(p.getWindturbineId()) == null){
+                    log.info("======风机榜效帮计算结束," + p.getWindturbineId() + "文件内容或当前风机的自算功率为空.............");
+                    continue;
+                }
+                log.info("======风机绩效榜计算:" + p.getWindturbineId());
+                double llfdl = 0.0; //理论发电量
+                double rfdl = 0.0; //日发电量
+                double jhjxssdl = 0.0;//计划检修损失电量
+                double fjhjxssdl =0.0;//非计划检修电量
+                double xdssdl = 0.0;//限电损失电量
+                double slssdl = 0.0;//受累损失电量
+                double xnssdl = 0.0;//性能损失电量
+                double speed = 0.0;//风速
+                content.remove(0); //去掉标题栏
+                int count = 86400 / p.getInterp(); //一天86400s  一天的条数
+                List<List<String>> coll = CollectUtil.groupListByQty(content, count);
+                for (List<String> ls : coll) {
+                    List<PowerPointData> pdl = ls.stream().map(mp -> new PowerPointData(mp.split(","), false)).collect(Collectors.toList());
+                    double lldl = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), -1); //理论发电量
+                    double dj = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 0); //待机
+                    double sdtj = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 1); //手动停机
+                    double zcfd = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 2); //正常发电
+                    double xdss = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 5);  //限电损失电量
+                    double qxjcl = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 3); //缺陷降出力损失电量
+                    double xdjcl = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 4); //限电降出力损失电量
+                    double cnsltj = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 7); //场内受累停机损失电量
+                    double cnsljx = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 9); //场内受累检修损失电量
+                    double dwsl = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 10); //电网受累损失电量
+                    double hjsl = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 11); //环境受累损失电量
+                    double gzss = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 6); //故障损失电量
+                    double tjjx = generalLoss(pdl, zsglmap.get(p.getWindturbineId()), p.getInterp(), 8); //停机检修
+
+                    llfdl += lldl;
+                    jhjxssdl += (tjjx + cnsljx);
+                    fjhjxssdl += (gzss + cnsltj);
+                    xdssdl += (xdjcl + xdss);
+                    slssdl += (dwsl + hjsl);
+                    xnssdl += (dj + sdtj + zcfd + qxjcl);
+                    rfdl += pdl.get(pdl.size() - 1).getDl();
+                    speed += pdl.stream().mapToDouble(PowerPointData::getSpeed).sum();
+                }
+                FjjxbVo vo = new FjjxbVo();
+                vo.setId(p.getWindturbineId());
+                vo.setName(p.getCode());
+                vo.setLlfdl(new BigDecimal(llfdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setSjfdl(new BigDecimal(rfdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setJhjx(new BigDecimal(jhjxssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setFjhjx(new BigDecimal(fjhjxssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setXd(new BigDecimal(xdssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setXn(new BigDecimal(xnssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setSl(new BigDecimal(slssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setSpeed(new BigDecimal(speed/content.size()).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setFnlly(llfdl > 0 ? new BigDecimal(rfdl / llfdl).setScale(2, RoundingMode.FLOOR).doubleValue() : 0);
+                result.add(vo);
+            }
+            log.info("======风机榜效帮计算结束.............");
+            result.stream().sorted(Comparator.comparing(FjjxbVo::getId));
+            /** 添加标题 **/
+            val fxList = AnnotationTool.getFixedVoList(FjjxbVo.class);
+            List<TableTitle> lt = fxList.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
+            promise.put("title", lt);
+            promise.put("data", result);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return promise;
+    }
+    public Map<String, Object> fiveLossCalByZSGL2(String ids) {
+        Map<String, Object> promise = null;
+        try {
+            log.info("======风机绩效榜计算开始.............");
+            promise = new HashMap<>();
+            List<FjjxbVo> result = new ArrayList<>();
+            Map<String, Map<Double, Double>> zsglmap = InitialRunner.zsllglNewMap;
+
+            List<ProEconPowerFittingAnalySis> analyses = analysisService.selectListByIds(ids);
+            if (analyses.isEmpty()){
+                log.info("======风机榜效帮计算结束,数据为空.............");
+                throw new CustomException(ResultCode.ERROR);
+            }
+
+            QueryWrapper<ProEconEquipmentInfoDay1> wrapper = new QueryWrapper<>();
+            String[] split = analyses.get(0).getTime().split("-");
+            Date start = DateUtil.parse(split[0]).toJdkDate();
+            Date end = DateUtil.parse(split[1]).toJdkDate();
+            wrapper.lambda().between(ProEconEquipmentInfoDay1::getRecordDate, start, end);
+            List<ProEconEquipmentInfoDay1> list = equipmentInfoDay1Service.list(wrapper);
+            Map<String, List<ProEconEquipmentInfoDay1>> collect = list.stream().collect(Collectors.groupingBy(ProEconEquipmentInfoDay1::getWindturbineId));
+
+            List<ProEconEquipmentInfoDay1> day1s;
+            for (ProEconPowerFittingAnalySis p : analyses) {
+                day1s = collect.get(p.getWindturbineId());
+                double llfdl = day1s.stream().mapToDouble(ProEconEquipmentInfoDay1::getRllfdl).sum(); //理论发电量
+                double rfdl = day1s.stream().mapToDouble(ProEconEquipmentInfoDay1::getRfdl).sum(); //日发电量
+                double jhjxssdl = day1s.stream().mapToDouble(ProEconEquipmentInfoDay1::getRjxssdl).sum();//计划检修损失电量
+                double fjhjxssdl = day1s.stream().mapToDouble(ProEconEquipmentInfoDay1::getRgzssdl).sum();//非计划检修电量
+                double xdssdl = day1s.stream().mapToDouble(ProEconEquipmentInfoDay1::getRxdtjssdl).sum()+
+                        day1s.stream().mapToDouble(ProEconEquipmentInfoDay1::getRxdjclssdl).sum();//限电损失电量
+                double slssdl = 0.0;//受累损失电量
+                double xnssdl = day1s.stream().mapToDouble(ProEconEquipmentInfoDay1::getRxnssdl).sum();//性能损失电量
+                double speed = day1s.stream().mapToDouble(ProEconEquipmentInfoDay1::getRpjfs).average().orElse(0.0);//风速
+
+                FjjxbVo vo = new FjjxbVo();
+                vo.setId(p.getWindturbineId());
+                vo.setName(p.getCode());
+                vo.setLlfdl(new BigDecimal(llfdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setSjfdl(new BigDecimal(rfdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setJhjx(new BigDecimal(jhjxssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setFjhjx(new BigDecimal(fjhjxssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setXd(new BigDecimal(xdssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setXn(new BigDecimal(xnssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setSl(new BigDecimal(slssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setSpeed(new BigDecimal(speed).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setFnlly(llfdl > 0 ? new BigDecimal(rfdl / llfdl).setScale(2, RoundingMode.FLOOR).doubleValue() : 0);
+                result.add(vo);
+            }
+            log.info("======风机榜效帮计算结束.............");
+            result.stream().sorted(Comparator.comparing(FjjxbVo::getId));
+            /** 添加标题 **/
+            List<FixedVo> fxList = AnnotationTool.getFixedVoList(FjjxbVo.class);
+            List<TableTitle> lt = fxList.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
+            promise.put("title", lt);
+            promise.put("data", result);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return promise;
+    }
+    public Map<String, Object> fiveLossCalByZSGL3(String ids) {
+        Map<String, Object> promise = null;
+        try {
+            log.info("======风机绩效榜计算开始.............");
+            promise = new HashMap<>();
+            List<FjjxbVo> result = new ArrayList<>();
+//            Map<String, Map<Double, Double>> zsglmap = InitialRunner.zsllglNewMap;
+
+            List<ProEconPowerFittingAnalySis> analyses = analysisService.selectListByIds(ids);
+            if (analyses.isEmpty()){
+                log.info("======风机榜效帮计算结束,数据为空.............");
+                throw new CustomException(ResultCode.ERROR);
+            }
+
+            QueryWrapper<TurbineInfoDay> wrapper = new QueryWrapper<>();
+            String[] split = analyses.get(0).getTime().split("-");
+            Date start = DateUtil.parse(split[0]).toJdkDate();
+            Date end = DateUtil.parse(split[1]).toJdkDate();
+            wrapper.lambda().between(TurbineInfoDay::getRecordDate, start, end);
+            List<TurbineInfoDay> list = turbineInfoDayService.list(wrapper);
+            Map<String, List<TurbineInfoDay>> collect = list.stream().collect(Collectors.groupingBy(TurbineInfoDay::getTurbineId));
+            Map<String, List<TurbineInfoDay>> collectcz = list.stream().collect(Collectors.groupingBy(TurbineInfoDay::getStationId));
+
+            List<TurbineInfoDay> day1s;
+            for (ProEconPowerFittingAnalySis p : analyses) {
+                FjjxbVo vo = new FjjxbVo();
+                if("A".equals(p.getWindturbineId())){
+                    day1s = collectcz.get(p.getStation());
+                    vo.setId(p.getStation());
+                    vo.setName(p.getStationcn().replaceFirst("风电场",""));
+                }else {
+                    day1s = collect.get(p.getWindturbineId());
+                    vo.setId(p.getWindturbineId());
+                    vo.setName(p.getCode());
+                }
+                double llfdl = day1s.stream().mapToDouble(TurbineInfoDay::getLlfdl).sum(); //理论发电量
+                double rfdl = day1s.stream().mapToDouble(TurbineInfoDay::getRfdl).sum(); //日发电量
+                double jhjxssdl = day1s.stream().mapToDouble(TurbineInfoDay::getJhjxss).sum();//计划检修损失电量
+                double fjhjxssdl = day1s.stream().mapToDouble(TurbineInfoDay::getFjhjxss).sum();//非计划检修电量
+                double xdssdl = day1s.stream().mapToDouble(TurbineInfoDay::getXdss).sum();//限电损失电量
+                double slssdl = 0.0;//受累损失电量
+                double xnssdl = day1s.stream().mapToDouble(TurbineInfoDay::getXnss).sum();//性能损失电量
+                double speed = day1s.stream().mapToDouble(TurbineInfoDay::getPjfs).average().orElse(0.0);//风速
+
+                llfdl = llfdl/1000;
+                rfdl = rfdl/1000;
+                jhjxssdl = jhjxssdl/1000;
+                fjhjxssdl = fjhjxssdl/1000;
+                xdssdl = xdssdl/1000;
+                xnssdl = xnssdl/1000;
+
+                vo.setLlfdl(new BigDecimal(llfdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setSjfdl(new BigDecimal(rfdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setJhjx(new BigDecimal(jhjxssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setFjhjx(new BigDecimal(fjhjxssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setXd(new BigDecimal(xdssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setXn(new BigDecimal(xnssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setSl(new BigDecimal(slssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setSpeed(new BigDecimal(speed).setScale(2, RoundingMode.FLOOR).doubleValue());
+                vo.setFnlly(llfdl > 0 ? new BigDecimal(rfdl / llfdl).setScale(2, RoundingMode.FLOOR).doubleValue() : 0);
+                result.add(vo);
+            }
+            log.info("======风机榜效帮计算结束.............");
+            result.stream().sorted(Comparator.comparing(FjjxbVo::getId));
+            /** 添加标题 **/
+            List<FixedVo> fxList = AnnotationTool.getFixedVoList(FjjxbVo.class);
+            List<TableTitle> lt = fxList.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
+            promise.put("title", lt);
+            promise.put("data", result);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return promise;
+    }
+
+}