Переглянути джерело

离散率和光伏拟合无文件

xushili 3 роки тому
батько
коміт
4a9a316933
17 змінених файлів з 1330 додано та 140 видалено
  1. 28 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/controller/EconomyAnalysisController.java
  2. 16 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/mapper/auto/ProjectplanMapper.java
  3. 34 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/model/TsDoubleData.java
  4. 32 32
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/model/auto/Benchmark.java
  5. 100 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/model/auto/Projectplan.java
  6. 713 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/service/EconomyAnalysisService.java
  7. 16 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/service/auto/IProjectplanService.java
  8. 20 0
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/service/auto/impl/ProjectplanServiceImpl.java
  9. 13 9
      benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/util/taos/EdosUtil.java
  10. 6 8
      gradeevaluation/src/main/java/com/gyee/gradeevaluation/model/auto/Wtreportmain.java
  11. 2 1
      gradeevaluation/src/main/java/com/gyee/gradeevaluation/variable/MainConstant.java
  12. 1 1
      gyee-sample-impala/src/main/java/com/gyee/impala/common/feign/IAdapterService.java
  13. 2 1
      gyee-sample-impala/src/main/java/com/gyee/impala/schdule/TaskCasefaultReplenish.java
  14. 76 4
      power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/NewPhotovoltaicController.java
  15. 26 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/dispersionanalysis/InverterData.java
  16. 112 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/dispersionanalysis/InverterPowerAnalysis.java
  17. 133 84
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/NewIvPvCurveFittingService.java

+ 28 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/controller/EconomyAnalysisController.java

@@ -0,0 +1,28 @@
+package com.gyee.benchmarkingimpala.controller;
+
+import com.gyee.benchmarkingimpala.config.R;
+import com.gyee.benchmarkingimpala.service.EconomyAnalysisService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/economy")
+public class EconomyAnalysisController {
+
+    @Resource
+    EconomyAnalysisService economyAnalysisService;
+
+    @GetMapping("/analysis/{year}/{month}")
+    private R getReport(@PathVariable("year") String year, @PathVariable("month") String month) {
+        return economyAnalysisService.getReport(year, month);
+    }
+
+    @GetMapping("/test/{year}/{month}")
+    private void test(@PathVariable("year") String year, @PathVariable("month") String month) {
+        economyAnalysisService.calc(year, month);
+    }
+}

+ 16 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/mapper/auto/ProjectplanMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkingimpala.mapper.auto;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.benchmarkingimpala.model.auto.Projectplan;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author gfhd
+ * @since 2023-04-13
+ */
+public interface ProjectplanMapper extends BaseMapper<Projectplan> {
+
+}

+ 34 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/model/TsDoubleData.java

@@ -0,0 +1,34 @@
+package com.gyee.benchmarkingimpala.model;
+
+public class TsDoubleData {
+
+    private long ts;
+    private int status;
+    private double doubleValue;
+
+    public long getTs() {
+        return ts;
+    }
+
+    public void setTs(long ts) {
+        this.ts = ts;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    public double getDoubleValue() {
+        //        BigDecimal bg = new BigDecimal(doubleValue);
+        //        double v = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+        return doubleValue;
+    }
+
+    public void setDoubleValue(double doubleValue) {
+        this.doubleValue = doubleValue;
+    }
+}

+ 32 - 32
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/model/auto/Benchmark.java

@@ -1,18 +1,18 @@
 package com.gyee.benchmarkingimpala.model.auto;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
+
 /**
  * <p>
- * 
+ *
  * </p>
  *
  * @author 谢生杰
@@ -35,55 +35,55 @@ public class Benchmark extends Model {
     private String foreignkeyid;
 
     @TableField("MARK")
-    private Double mark;
+    private Double mark;//评分
 
     @TableField("CAPACITY")
-    private Double capacity;
+    private Double capacity;//装机容量
 
     @TableField("UNITS")
-    private Double units;
+    private Double units;//在运台数
 
     @TableField("THEORETICALPOWER")
-    private Double theoreticalpower;
+    private Double theoreticalpower;//理论电量
 
     @TableField("ACTUALPOWER")
-    private Double actualpower;
+    private Double actualpower;//实际电量
 
     @TableField("DAYNHGZSSDL")
-    private Double daynhgzssdl;
+    private Double daynhgzssdl;//故障损失电量
 
     @TableField("DAYNHWHSSDL")
-    private Double daynhwhssdl;
+    private Double daynhwhssdl;//维护损失电量
 
     @TableField("DAYNHXDSSDL")
-    private Double daynhxdssdl;
+    private Double daynhxdssdl;//限电损失电量
 
     @TableField("DAYNHQFDL")
-    private Double daynhqfdl;
+    private Double daynhqfdl;//性能损失电量
 
     @TableField("DAYNHCFDL")
-    private Double daynhcfdl;
+    private Double daynhcfdl;//受累损失电量
 
     @TableField("WINDENERGY")
-    private Double windenergy;
+    private Double windenergy;//风能利用率
 
     @TableField("POWERLOSSRATE")
-    private Double powerlossrate;
+    private Double powerlossrate;//限电损失率
 
     @TableField("PERFORMANCELOSSRATE")
-    private Double performancelossrate;
+    private Double performancelossrate;//性能损失率
 
     @TableField("COMPREHENSIVERATE")
-    private Double comprehensiverate;
+    private Double comprehensiverate;//综合厂用电率
 
     @TableField("UTILIZATIONHOURS")
-    private Double utilizationhours;
+    private Double utilizationhours;//设备利用小时
 
     @TableField("WINDPOWERACCURACY")
-    private Double windpoweraccuracy;
+    private Double windpoweraccuracy;//风功率预测准确率
 
     @TableField("AGCCURVEFOLLOWING")
-    private Double agccurvefollowing;
+    private Double agccurvefollowing;//AGC曲线跟随率
 
     @TableField("MTBF")
     private Double mtbf;
@@ -92,41 +92,41 @@ public class Benchmark extends Model {
     private Double mttf;
 
     @TableField("AVAILABILITY")
-    private Double availability;
+    private Double availability;//设备可利用率
 
     @TableField("AVAILABILITYFACTOR")
-    private Double availabilityfactor;
+    private Double availabilityfactor;//等效可用系数
 
     @TableField("FAILURELOSSRATE")
-    private Double failurelossrate;
+    private Double failurelossrate;//非计划检修损失率
 
     @TableField("MAINLOSSRATE")
-    private Double mainlossrate;
+    private Double mainlossrate;//计划检修损失率
 
     @TableField("MTTR")
     private Double mttr;
 
     @TableField("HIDDENTIMELY")
-    private Double hiddentimely;
+    private Double hiddentimely;//隐患发现准确率
 
     @TableField("RESETTIMELYRATE")
-    private Double resettimelyrate;
+    private Double resettimelyrate;//复位及时率
 
     @TableField("STATETRANSITIONRATE")
-    private Double statetransitionrate;
+    private Double statetransitionrate;//状态转换率
 
     @TableField("ELIMINATIONRATE")
-    private Double eliminationrate;
+    private Double eliminationrate;//消缺及时率
 
     @TableField("SPEED")
     private Double speed;
 
     @TableField("STATICWINDFREQUENCY")
-    private Double staticwindfrequency;
+    private Double staticwindfrequency;//风频
 
     @TableField("EFFECTIVEWINDHOURRATE")
     private Double effectivewindhourrate;
     @TableField(exist = false)
-    private Double orderno;
+    private Double orderno;//订单
 
 }

+ 100 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/model/auto/Projectplan.java

@@ -0,0 +1,100 @@
+package com.gyee.benchmarkingimpala.model.auto;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author gfhd
+ * @since 2023-04-13
+ */
+public class Projectplan implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String projectid;
+
+    private String generatingcapacity;
+
+    private BigDecimal outagehours;
+
+    private String year;
+
+    private String month;
+
+    private String windpower;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getProjectid() {
+        return projectid;
+    }
+
+    public void setProjectid(String projectid) {
+        this.projectid = projectid;
+    }
+
+    public String getGeneratingcapacity() {
+        return generatingcapacity;
+    }
+
+    public void setGeneratingcapacity(String generatingcapacity) {
+        this.generatingcapacity = generatingcapacity;
+    }
+
+    public BigDecimal getOutagehours() {
+        return outagehours;
+    }
+
+    public void setOutagehours(BigDecimal outagehours) {
+        this.outagehours = outagehours;
+    }
+
+    public String getYear() {
+        return year;
+    }
+
+    public void setYear(String year) {
+        this.year = year;
+    }
+
+    public String getMonth() {
+        return month;
+    }
+
+    public void setMonth(String month) {
+        this.month = month;
+    }
+
+    public String getWindpower() {
+        return windpower;
+    }
+
+    public void setWindpower(String windpower) {
+        this.windpower = windpower;
+    }
+
+    @Override
+    public String toString() {
+        return "Projectplan{" +
+                "id = " + id +
+                ", projectid = " + projectid +
+                ", generatingcapacity = " + generatingcapacity +
+                ", outagehours = " + outagehours +
+                ", year = " + year +
+                ", month = " + month +
+                ", windpower = " + windpower +
+                "}";
+    }
+}

+ 713 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/service/EconomyAnalysisService.java

@@ -0,0 +1,713 @@
+package com.gyee.benchmarkingimpala.service;
+
+import cn.hutool.core.date.DateField;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.benchmarkingimpala.config.R;
+import com.gyee.benchmarkingimpala.init.CacheContext;
+import com.gyee.benchmarkingimpala.model.auto.Benchmark;
+import com.gyee.benchmarkingimpala.model.auto.Projectplan;
+import com.gyee.benchmarkingimpala.model.auto.Windpowerinfoday;
+import com.gyee.benchmarkingimpala.service.auto.IBenchmarkService;
+import com.gyee.benchmarkingimpala.service.auto.IProjectplanService;
+import com.gyee.benchmarkingimpala.service.auto.IWindpowerinfodayService;
+import com.gyee.benchmarkingimpala.util.taos.EdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class EconomyAnalysisService {
+
+    @Resource
+    private IBenchmarkService benchmarkService;
+    @Resource
+    private IProjectplanService projectplanService;
+
+    private EdosUtil edosUtil = new EdosUtil();
+    private List<String> stationList;
+    @Resource
+    private IWindpowerinfodayService windpowerinfodayService;
+
+    /**
+     * 场站,指标,数据
+     */
+    private Map<String, Map<String, String>> monthMap = new HashMap<>();
+
+    public R getReport(String year, String month) {
+        //Map<String, Map<String, String>> map = getMap();
+        calc(year, month);
+        Map<String, List<String>> word = getWord(year, month);
+
+        return R.ok().data(word);
+    }
+
+    public void calc(String year, String month) {
+        getMonthMap();
+        //月初
+        DateTime monthbegin = DateUtil.parse(year + "-" + month + "-1");
+        //月结束
+        DateTime monthend = DateUtil.endOfMonth(monthbegin);
+        //去年同期
+        DateTime lastyearbegin = DateUtil.offset(monthbegin, DateField.YEAR, -1);
+        //上期
+        DateTime lastmonthbegin = DateUtil.offsetMonth(monthbegin, -1);
+        //去年同期结束
+        DateTime lastyearend = DateUtil.offset(monthend, DateField.YEAR, -1);
+        //上期结束
+        DateTime lastmonthend = DateUtil.offsetMonth(monthend, -1);
+
+        QueryWrapper<Projectplan> ppwrapper = new QueryWrapper<>();
+        ppwrapper.eq("YEAR", year).eq("MONTH", month);
+        List<Projectplan> pplist = projectplanService.list(ppwrapper);
+        int gcyjhfdl = pplist.stream().mapToInt(pp -> Integer.parseInt(pp.getGeneratingcapacity())).sum();
+        monthMap.get("0").put("计划电量", String.valueOf(gcyjhfdl));
+        Map<String, Integer> gczyjhfdl = pplist.stream().collect(Collectors.groupingBy(Projectplan::getWindpower, Collectors.summingInt(gc -> Integer.parseInt(gc.getGeneratingcapacity()))));
+        gczyjhfdl.forEach((cz, jhfdl) -> {
+            monthMap.get(cz).put("计划电量", String.valueOf(jhfdl));
+        });
+        //场站,月发电量点
+        Map<String, String> yfdls = CacheContext.wppointmap.entrySet().stream().filter(cz -> isnotqc(cz.getKey())).collect(Collectors.toMap(Map.Entry::getKey, v -> v.getValue().get("YFDLB").getCode()));
+        yfdls.forEach((cz, p) -> {
+            double sec = edosUtil.getSec(p, monthend.getTime());
+            double lastyearsec = edosUtil.getSec(p, lastyearend.getTime());
+            double lastmonthsec = edosUtil.getSec(p, lastmonthend.getTime());
+            monthMap.get(cz).put("实际电量", NumberUtil.roundStr(sec, 2));
+            monthMap.get(cz).put("去年同期实际电量", NumberUtil.roundStr(lastyearsec, 2));
+            monthMap.get(cz).put("上期实际电量", NumberUtil.roundStr(lastmonthsec, 2));
+            monthMap.get(cz).put("实际电量同比", getRatio(cz, "实际电量", "去年同期实际电量"));
+            monthMap.get(cz).put("实际电量环比", getRatio(cz, "实际电量", "上期实际电量"));
+            monthMap.get(cz).put("实际电量完成率", getCompletRate(cz, "实际电量", "计划电量"));
+        });
+
+        /*----------------------------------------本月----------------------------------------------*/
+        QueryWrapper<Benchmark> bmwrapper = new QueryWrapper<>();
+        bmwrapper.between("RECORDDATE", monthbegin, monthend);
+        List<Benchmark> bmlist = benchmarkService.list(bmwrapper);
+        List<Benchmark> bmlist1 = bmlist.stream().filter(bm -> bm.getForeignkeyid().endsWith("_FDC")).collect(Collectors.toList());
+        List<Benchmark> bmlist2 = bmlist.stream().filter(bm -> bm.getForeignkeyid().endsWith("_GDC")).collect(Collectors.toList());
+
+        putBenchmarkData("0", "", bmlist);
+        putBenchmarkData("-1", "", bmlist1);
+        putBenchmarkData("-2", "", bmlist2);
+        Map<String, List<Benchmark>> bmsl = bmlist.stream().collect(Collectors.groupingBy(Benchmark::getForeignkeyid));
+        bmsl.forEach((cz, bml) -> {
+            putBenchmarkData(cz, "", bml);
+        });
+
+        bmwrapper.clear();
+        bmwrapper.between("RECORDDATE", lastyearbegin, lastyearend);
+        List<Benchmark> qntqbmlist = benchmarkService.list(bmwrapper);
+        List<Benchmark> qntqbmlist1 = qntqbmlist.stream().filter(bm -> bm.getForeignkeyid().endsWith("_FDC")).collect(Collectors.toList());
+        List<Benchmark> qntqbmlist2 = qntqbmlist.stream().filter(bm -> bm.getForeignkeyid().endsWith("_FDC")).collect(Collectors.toList());
+
+        putBenchmarkData("0", "去年同期", qntqbmlist);
+        putBenchmarkData("-1", "去年同期", qntqbmlist1);
+        putBenchmarkData("-2", "去年同期", qntqbmlist2);
+        Map<String, List<Benchmark>> qntqbmsl = qntqbmlist.stream().collect(Collectors.groupingBy(Benchmark::getForeignkeyid));
+        qntqbmsl.forEach((cz, bml) -> {
+            putBenchmarkData(cz, "去年同期", bml);
+        });
+
+        bmwrapper.clear();
+        bmwrapper.between("RECORDDATE", lastmonthbegin, lastmonthend);
+        List<Benchmark> sqbmlist = benchmarkService.list(bmwrapper);
+        List<Benchmark> sqbmlist1 = sqbmlist.stream().filter(bm -> bm.getForeignkeyid().endsWith("_FDC")).collect(Collectors.toList());
+        List<Benchmark> sqbmlist2 = sqbmlist.stream().filter(bm -> bm.getForeignkeyid().endsWith("_FDC")).collect(Collectors.toList());
+
+        putBenchmarkData("0", "上期", sqbmlist);
+        putBenchmarkData("-1", "上期", sqbmlist1);
+        putBenchmarkData("-2", "上期", sqbmlist2);
+        Map<String, List<Benchmark>> sqbmsl = sqbmlist.stream().collect(Collectors.groupingBy(Benchmark::getForeignkeyid));
+        sqbmsl.forEach((cz, bml) -> {
+            putBenchmarkData(cz, "上期", bml);
+        });
+
+        for (String s : getStationList()) {
+            putBenchmarkTBHBData(s);
+        }
+        /***************************************计算厂用电量***********************************************/
+        QueryWrapper<Windpowerinfoday> wpidwrapper = new QueryWrapper<>();
+        wpidwrapper.between("RECORDDATE", monthbegin, monthend);
+        List<Windpowerinfoday> wpidlist = windpowerinfodayService.list(wpidwrapper);
+        List<Windpowerinfoday> wpidlist0 = wpidlist.stream().filter(bm -> "0".equals(bm.getForeignkeyid())).collect(Collectors.toList());
+        double fdl = wpidlist0.stream().mapToDouble(Windpowerinfoday::getGeneratingcapacity).sum();
+        double swdl = wpidlist0.stream().mapToDouble(Windpowerinfoday::getGridelectricity).sum();
+        double gwdl = wpidlist0.stream().mapToDouble(Windpowerinfoday::getBuyelectricity).sum();
+        monthMap.get("0").put("场用电量", NumberUtil.roundStr(fdl + gwdl - swdl, 2));
+        monthMap.get("0").put("场用电率", NumberUtil.roundStr((fdl + gwdl - swdl) / fdl, 2));
+
+        wpidwrapper.clear();
+        wpidwrapper.between("RECORDDATE", lastyearbegin, lastyearend);
+        List<Windpowerinfoday> wpidlistly = windpowerinfodayService.list(wpidwrapper);
+        List<Windpowerinfoday> wpidlist0ly = wpidlistly.stream().filter(bm -> "0".equals(bm.getForeignkeyid())).collect(Collectors.toList());
+        double fdlly = wpidlist0ly.stream().mapToDouble(Windpowerinfoday::getGeneratingcapacity).sum();
+        double swdlly = wpidlist0ly.stream().mapToDouble(Windpowerinfoday::getGridelectricity).sum();
+        double gwdlly = wpidlist0ly.stream().mapToDouble(Windpowerinfoday::getBuyelectricity).sum();
+        monthMap.get("0").put("去年同期场用电量", NumberUtil.roundStr(fdlly + gwdlly - swdlly, 2));
+        monthMap.get("0").put("去年同期场用电率", NumberUtil.roundStr((fdlly + gwdlly - swdlly) / fdlly, 2));
+
+        wpidwrapper.clear();
+        wpidwrapper.between("RECORDDATE", lastmonthbegin, lastmonthend);
+        List<Windpowerinfoday> wpidlistlm = windpowerinfodayService.list(wpidwrapper);
+        List<Windpowerinfoday> wpidlist0lm = wpidlistlm.stream().filter(bm -> "0".equals(bm.getForeignkeyid())).collect(Collectors.toList());
+        double fdllm = wpidlist0lm.stream().mapToDouble(Windpowerinfoday::getGeneratingcapacity).sum();
+        double swdllm = wpidlist0lm.stream().mapToDouble(Windpowerinfoday::getGridelectricity).sum();
+        double gwdllm = wpidlist0lm.stream().mapToDouble(Windpowerinfoday::getBuyelectricity).sum();
+        monthMap.get("0").put("上期场用电量", NumberUtil.roundStr(fdllm + gwdllm - swdllm, 2));
+        monthMap.get("0").put("上期场用电率", NumberUtil.roundStr((fdllm + gwdllm - swdllm) / fdllm, 2));
+
+        monthMap.get("0").put("场用电率同比", getRatio("0", "场用电率", "去年同期场用电率"));
+        monthMap.get("0").put("场用电率环比", getRatio("0", "场用电率", "上期场用电率"));
+        monthMap.get("0").put("场用电量同比", getRatioNoBFB("0", "场用电量", "去年同期场用电量"));
+        monthMap.get("0").put("场用电量环比", getRatioNoBFB("0", "场用电量", "上期场用电量"));
+    }
+
+    //经济运行首页数据同比环比
+    private void putBenchmarkTBHBData(String station) {
+        monthMap.get(station).put("理论发电量同比", getRatio(station, "理论发电量", "去年同期理论发电量"));
+        monthMap.get(station).put("理论发电量环比", getRatio(station, "理论发电量", "上期理论发电量"));
+        monthMap.get(station).put("实际电量同比", getRatio(station, "实际电量", "去年同期实际电量"));
+        monthMap.get(station).put("实际电量环比", getRatio(station, "实际电量", "上期实际电量"));
+        monthMap.get(station).put("设备利用小时同比", getRatioNoBFB(station, "设备利用小时", "去年同期设备利用小时"));
+        monthMap.get(station).put("设备利用小时环比", getRatioNoBFB(station, "设备利用小时", "上期设备利用小时"));
+        monthMap.get(station).put("风能利用率同比", getRatio(station, "风能利用率", "去年同期风能利用率"));
+        monthMap.get(station).put("风能利用率环比", getRatio(station, "风能利用率", "上期风能利用率"));
+        monthMap.get(station).put("故障损失电量同比", getRatio(station, "故障损失电量", "去年同期故障损失电量"));
+        monthMap.get(station).put("故障损失电量环比", getRatio(station, "故障损失电量", "上期故障损失电量"));
+        monthMap.get(station).put("限电损失电量同比", getRatio(station, "限电损失电量", "去年同期限电损失电量"));
+        monthMap.get(station).put("限电损失电量环比", getRatio(station, "限电损失电量", "上期限电损失电量"));
+        monthMap.get(station).put("受累损失电量同比", getRatio(station, "受累损失电量", "去年同期受累损失电量"));
+        monthMap.get(station).put("受累损失电量环比", getRatio(station, "受累损失电量", "上期受累损失电量"));
+        monthMap.get(station).put("性能损失电量同比", getRatioNoBFB(station, "性能损失电量", "去年同期性能损失电量"));
+        monthMap.get(station).put("性能损失电量环比", getRatioNoBFB(station, "性能损失电量", "上期性能损失电量"));
+        monthMap.get(station).put("计划检修损失电量同比", getRatio(station, "计划检修损失电量", "去年同期计划检修损失电量"));
+        monthMap.get(station).put("计划检修损失电量环比", getRatio(station, "计划检修损失电量", "上期计划检修损失电量"));
+        monthMap.get(station).put("故障损失率同比", getRatio(station, "故障损失率", "去年同期故障损失率"));
+        monthMap.get(station).put("故障损失率环比", getRatio(station, "故障损失率", "上期故障损失率"));
+        monthMap.get(station).put("限电损失率同比", getRatio(station, "限电损失率", "去年同期限电损失率"));
+        monthMap.get(station).put("限电损失率环比", getRatio(station, "限电损失率", "上期限电损失率"));
+        monthMap.get(station).put("受累损失率同比", getRatio(station, "受累损失率", "去年同期受累损失率"));
+        monthMap.get(station).put("受累损失率环比", getRatio(station, "受累损失率", "上期受累损失率"));
+        monthMap.get(station).put("性能损失率同比", getRatio(station, "性能损失率", "去年同期性能损失率"));
+        monthMap.get(station).put("性能损失率环比", getRatio(station, "性能损失率", "上期性能损失率"));
+        monthMap.get(station).put("计划检修损失率同比", getRatio(station, "计划检修损失率", "去年同期计划检修损失率"));
+        monthMap.get(station).put("计划检修损失率环比", getRatio(station, "计划检修损失率", "上期计划检修损失率"));
+        monthMap.get(station).put("平均风速同比", getRatio(station, "平均风速", "去年同期平均风速"));
+        monthMap.get(station).put("平均风速环比", getRatio(station, "平均风速", "上期平均风速"));
+        monthMap.get(station).put("损失电量同比", getRatio(station, "损失电量", "去年同期损失电量"));
+        monthMap.get(station).put("损失电量环比", getRatio(station, "损失电量", "上期损失电量"));
+        monthMap.get(station).put("损失率同比", getRatio(station, "损失率", "去年同期损失率"));
+        monthMap.get(station).put("损失率环比", getRatio(station, "损失率", "上期损失率"));
+        monthMap.get(station).put("复位及时率同比", getRatio(station, "复位及时率", "去年同期复位及时率"));
+        monthMap.get(station).put("复位及时率环比", getRatio(station, "复位及时率", "上期复位及时率"));
+        monthMap.get(station).put("状态转换率同比", getRatio(station, "状态转换率", "去年同期状态转换率"));
+        monthMap.get(station).put("状态转换率环比", getRatio(station, "状态转换率", "上期状态转换率"));
+        monthMap.get(station).put("消缺及时率同比", getRatio(station, "消缺及时率", "去年同期消缺及时率"));
+        monthMap.get(station).put("消缺及时率环比", getRatio(station, "消缺及时率", "上期消缺及时率"));
+        monthMap.get(station).put("厂用电率同比", getRatio(station, "厂用电率", "去年同期厂用电率"));
+        monthMap.get(station).put("厂用电率环比", getRatio(station, "厂用电率", "上期厂用电率"));
+        monthMap.get(station).put("厂用电量同比", getRatioNoBFB(station, "厂用电量", "去年同期厂用电量"));
+        monthMap.get(station).put("厂用电量环比", getRatioNoBFB(station, "厂用电量", "上期厂用电量"));
+    }
+
+    //经济运行首页数据
+    private void putBenchmarkData(String station, String addStr, List<Benchmark> bml) {
+        double llfdlsum = bml.stream().mapToDouble(Benchmark::getTheoreticalpower).sum();
+        monthMap.get(station).put(addStr + "理论发电量", String.valueOf(llfdlsum));
+        double sjdlsum = bml.stream().mapToDouble(Benchmark::getActualpower).sum();
+        monthMap.get(station).put(addStr + "实际电量", NumberUtil.roundStr(sjdlsum, 2));
+        double sblyxssum = bml.stream().mapToDouble(Benchmark::getUtilizationhours).sum();
+        monthMap.get(station).put(addStr + "设备利用小时", String.valueOf(sblyxssum));
+        double fnlylsum = bml.stream().mapToDouble(Benchmark::getWindenergy).average().orElse(0);
+        monthMap.get(station).put(addStr + "风能利用率", NumberUtil.roundStr(fnlylsum, 2));
+        double gzsssum = bml.stream().mapToDouble(Benchmark::getDaynhgzssdl).sum();
+        monthMap.get(station).put(addStr + "故障损失电量", String.valueOf(gzsssum));
+        monthMap.get(station).put(addStr + "故障损失率", getCompletRate(station, addStr + "故障损失电量", addStr + "实际电量"));
+        double xdsssum = bml.stream().mapToDouble(Benchmark::getDaynhxdssdl).sum();
+        monthMap.get(station).put(addStr + "限电损失电量", NumberUtil.roundStr(xdsssum, 2));
+        double xdssl = bml.stream().mapToDouble(Benchmark::getPowerlossrate).average().orElse(0);
+        monthMap.get(station).put(addStr + "限电损失率", NumberUtil.roundStr(xdssl, 2));
+        double slsssum = bml.stream().mapToDouble(Benchmark::getDaynhcfdl).sum();
+        monthMap.get(station).put(addStr + "受累损失电量", String.valueOf(slsssum));
+        monthMap.get(station).put(addStr + "受累损失率", getCompletRate(station, addStr + "受累损失电量", addStr + "实际电量"));
+        double xnsssum = bml.stream().mapToDouble(Benchmark::getDaynhqfdl).sum();
+        monthMap.get(station).put(addStr + "性能损失电量", String.valueOf(xnsssum));
+        double xnssl = bml.stream().mapToDouble(Benchmark::getPerformancelossrate).average().orElse(0);
+        monthMap.get(station).put(addStr + "性能损失率", NumberUtil.roundStr(xnssl, 2));
+        double jhjxsum = bml.stream().mapToDouble(Benchmark::getDaynhwhssdl).sum();
+        monthMap.get(station).put(addStr + "计划检修损失电量", String.valueOf(jhjxsum));
+        monthMap.get(station).put(addStr + "计划检修损失率", getCompletRate(station, addStr + "计划检修损失电量", addStr + "实际电量"));
+        double pjfssum = bml.stream().filter(bm -> bm.getSpeed() > 0).mapToDouble(Benchmark::getSpeed).average().orElse(0);
+        monthMap.get(station).put(addStr + "平均风速", NumberUtil.roundStr(pjfssum, 2));
+        monthMap.get(station).put(addStr + "损失电量", getSum(station, addStr + "故障损失电量", addStr + "限电损失电量", addStr + "受累损失电量", addStr + "性能损失电量", addStr + "计划检修损失电量"));
+        monthMap.get(station).put(addStr + "损失率", getCompletRate(station, addStr + "损失电量", addStr + "实际电量"));
+        double fwjsl = bml.stream().mapToDouble(Benchmark::getResettimelyrate).average().orElse(0);
+        monthMap.get(station).put(addStr + "复位及时率", NumberUtil.roundStr(fwjsl, 2));
+        double ztzhl = bml.stream().mapToDouble(Benchmark::getStatetransitionrate).average().orElse(0);
+        monthMap.get(station).put(addStr + "状态转换率", NumberUtil.roundStr(ztzhl, 2));
+        double xqjsl = bml.stream().mapToDouble(Benchmark::getEliminationrate).average().orElse(0);
+        monthMap.get(station).put(addStr + "消缺及时率", NumberUtil.roundStr(xqjsl, 2));
+        double cydl = bml.stream().mapToDouble(Benchmark::getComprehensiverate).average().orElse(0);
+        monthMap.get(station).put(addStr + "厂用电率", NumberUtil.roundStr(cydl, 2));
+        monthMap.get(station).put(addStr + "厂用电量", getProduct(station, addStr + "实际电量", addStr + "厂用电率"));
+        monthMap.get(station).put(addStr + "实际电量完成率", getCompletRate(station, addStr + "实际电量", addStr + "计划电量"));
+    }
+
+    private String getProduct(String station, String one, String two) {
+        String oone = monthMap.get(station).get(one);
+        String otwo = monthMap.get(station).get(two);
+        if (oone == null || otwo == null) return "NaN";
+        Double v = Double.parseDouble(oone) * Double.parseDouble(otwo) / 100;
+        if (!(v.isInfinite() || v.isNaN()))
+            return NumberUtil.roundStr(v, 2);
+        return "NaN";
+    }
+
+    //场站指标合并成公司指标
+    private double getCz2Gs(String data) {
+        double o = 0;
+        for (String s : getStationList()) {
+            if ("0".equals(s) || "-1".equals(s) || "-2".equals(s)) continue;
+            o += Double.valueOf(monthMap.get(s).get(data));
+        }
+        return o;
+    }
+
+    //和
+    private String getSum(String cz, String... ws) {
+        double o = 0;
+        for (String w : ws) {
+            o += Double.parseDouble(monthMap.get(cz).get(w));
+        }
+        return String.valueOf(o);
+    }
+
+    //初始化monthMap
+    public Map<String, Map<String, String>> getMonthMap() {
+        if (monthMap.isEmpty()) {
+            for (String s : getStationList()) {
+                monthMap.put(s, new LinkedHashMap<>());
+            }
+        }
+        return monthMap;
+    }
+
+    //定义场站
+    private List<String> getStationList() {
+        if (stationList == null) {
+            stationList = new ArrayList<>();
+            stationList.add("0");
+            stationList.add("-1");
+            stationList.add("-2");
+            stationList.add("MHS_FDC");
+            stationList.add("NSS_FDC");
+            stationList.add("QS_FDC");
+            stationList.add("SBQ_FDC");
+            stationList.add("XS_FDC");
+            stationList.add("DWK_GDC");
+            stationList.add("PL_GDC");
+            stationList.add("XH_GDC");
+            stationList.add("MCH_GDC");
+            stationList.add("HZJ_GDC");
+            stationList.add("AK_GDC");
+        }
+        return stationList;
+    }
+
+    //场站,同比环比双方,算同比环比
+    private String getRatio(String cz, String one, String two) {
+        String oone = monthMap.get(cz).get(one);
+        String otwo = monthMap.get(cz).get(two);
+        if (oone == null || otwo == null) return "NaN";
+        Double twodou = Double.parseDouble(otwo);
+        Double v = (Double.parseDouble(oone) - twodou) / twodou * 100;
+        if (!(v.isInfinite() || v.isNaN()))
+            return NumberUtil.roundStr(v, 2);
+        return "NaN";
+    }
+
+    //算同比环比,不是百分比
+    private String getRatioNoBFB(String cz, String one, String two) {
+        String oone = monthMap.get(cz).get(one);
+        String otwo = monthMap.get(cz).get(two);
+        if (oone == null || otwo == null) return "NaN";
+        Double v = Double.valueOf(oone) - Double.valueOf(otwo);
+        if (!(v.isInfinite() || v.isNaN()))
+            return NumberUtil.roundStr(v, 2);
+        return "NaN";
+    }
+
+    private String douStr2Str3(String str, String one, String two) {
+        if (str != null && str.startsWith("-")) {
+            return str.replaceFirst("-", two);
+        } else {
+            return one + str;
+        }
+    }
+
+    private String douStr2Str(String str) {
+        return douStr2Str3(str, "增加", "减少");
+    }
+
+    private String douStr2Str2(String str) {
+        return douStr2Str3(str, "上升", "下降");
+    }
+
+    //算比率
+    private String getCompletRate(String cz, String one, String two) {
+        String oone = monthMap.get(cz).get(one);
+        String otwo = monthMap.get(cz).get(two);
+        if (StrUtil.isEmpty(oone) || StrUtil.isEmpty(otwo)) return "NaN";
+        double v = Double.valueOf(oone) / Double.valueOf(otwo) * 100;
+        return String.format("%.2f", v);
+    }
+
+    //过滤期次
+    private boolean isnotqc(String cz) {
+        return cz.endsWith("DC") || cz.equals("0") || cz.equals("-1") || cz.equals("-2");
+    }
+
+    private Map<String, List<String>> getWord(String year, String month) {
+        Map<String, List<String>> map = new LinkedHashMap<>();
+        List<String> title = new ArrayList<>();
+        String str;
+        title.add(StrUtil.format("{}年{}月经济运行分析报告", year, month));
+        map.put("标题", title);
+        title = new ArrayList<>();
+        str = "公司本月计划电量为{}万千瓦时,实际完成{}万千瓦时,同比{}%,环比{}%,计划完成率{}%。";
+        title.add(StrUtil.format(str, monthMap.get("0").get("计划电量"), monthMap.get("0").get("实际电量"),
+                douStr2Str(monthMap.get("0").get("实际电量同比")), douStr2Str(monthMap.get("0").get("实际电量环比")), monthMap.get("0").get("实际电量完成率")));
+        str = "本月各风场发电量:麻黄山{}万千瓦时,完成率{}%、牛首山{}万千瓦时,完成率{}%、青山{}万千瓦时,完成率{}%、石板泉{}万千瓦时,完成率{}%、香山风电场{}万千瓦时,完成率{}%。";
+        title.add(StrUtil.format(str, monthMap.get("MHS_FDC").get("实际电量"), monthMap.get("MHS_FDC").get("实际电量完成率")
+                , monthMap.get("NSS_FDC").get("实际电量"), monthMap.get("NSS_FDC").get("实际电量完成率")
+                , monthMap.get("QS_FDC").get("实际电量"), monthMap.get("QS_FDC").get("实际电量完成率")
+                , monthMap.get("SBQ_FDC").get("实际电量"), monthMap.get("SBQ_FDC").get("实际电量完成率")
+                , monthMap.get("XS_FDC").get("实际电量"), monthMap.get("XS_FDC").get("实际电量完成率")));
+        str = "本月各电站发电量:大武口{}万千瓦时,完成率{}%、平罗{}万千瓦时,完成率{}%、宣和{}万千瓦时,完成率{}%、马场湖{}万千瓦时,完成率{}%、 海子井{}万千瓦时,完成{}%、埃肯{}万千瓦时,完成率{}%。";
+        title.add(StrUtil.format(str, monthMap.get("DWK_GDC").get("实际电量"), monthMap.get("DWK_GDC").get("实际电量完成率")
+                , monthMap.get("PL_GDC").get("实际电量"), monthMap.get("PL_GDC").get("实际电量完成率")
+                , monthMap.get("XH_GDC").get("实际电量"), monthMap.get("XH_GDC").get("实际电量完成率")
+                , monthMap.get("MCH_GDC").get("实际电量"), monthMap.get("MCH_GDC").get("实际电量完成率")
+                , monthMap.get("HZJ_GDC").get("实际电量"), monthMap.get("HZJ_GDC").get("实际电量完成率")
+                , monthMap.get("AK_GDC").get("实际电量"), monthMap.get("AK_GDC").get("实际电量完成率")));
+        map.put("发电量完成情况", title);
+        title = new ArrayList<>();
+        str = "本月各风电场平均风速为{}m/s,同比{}m/s,环比{}m/s。风力发电理论发电量{}万千瓦时,同比{}%,环比{}%。";
+        title.add(StrUtil.format(str, monthMap.get("-1").get("平均风速"), douStr2Str(monthMap.get("-1").get("平均风速同比")), douStr2Str(monthMap.get("-1").get("平均风速环比"))
+                , monthMap.get("-1").get("理论发电量"), douStr2Str(monthMap.get("-1").get("理论发电量同比")), douStr2Str(monthMap.get("-1").get("理论发电量环比"))));
+        str = "本月各光伏场站月累计辐照总量{}MJ/㎡,同比{}%,环比{}%。光伏理论发电量{}万千瓦时,同比{}%,环比{}%。";
+        title.add(StrUtil.format(str, monthMap.get("-2").get("平均风速"), douStr2Str(monthMap.get("-2").get("平均风速同比")), douStr2Str(monthMap.get("-2").get("平均风速环比"))
+                , monthMap.get("-2").get("理论发电量"), douStr2Str(monthMap.get("-2").get("理论发电量同比")), douStr2Str(monthMap.get("-2").get("理论发电量环比"))));
+        str = "公司本月理论发电量为{}万千瓦时,同比{}%,环比{}%;利用小时数{}小时,同比{}小时,环比{}小时;本月风能利用率{}%,同比{}%,环比{}%;光能利用率{}%,同比{}%,环比{}%。";
+        title.add(StrUtil.format(str, monthMap.get("0").get("理论发电量"), douStr2Str(monthMap.get("0").get("理论发电量同比")), douStr2Str(monthMap.get("0").get("理论发电量环比"))
+                , monthMap.get("0").get("设备利用小时"), douStr2Str(monthMap.get("0").get("设备利用小时同比")), douStr2Str(monthMap.get("0").get("设备利用小时环比"))
+                , monthMap.get("-1").get("风能利用率"), douStr2Str(monthMap.get("-1").get("风能利用率同比")), douStr2Str(monthMap.get("-1").get("风能利用率环比"))
+                , monthMap.get("-2").get("风能利用率"), douStr2Str(monthMap.get("-2").get("风能利用率同比")), douStr2Str(monthMap.get("-2").get("风能利用率环比"))));
+        str = "公司本月损失电量{}万千瓦时,同比{}%,环比{}%;损失率{}%,同比{}%,环比{}%。其中,受累损失电量{}万千瓦时,损失率{}%,同比{}%,环比{}%;" +
+                "限电损失电量{}万千瓦时,损失率{}%,同比{}%,环比{}%;故障损失电量{}万千瓦时,损失率{}%,同比{}%,环比{}%;计划检修损失电量{}万千瓦时,损失率{}%,同比{}%,环比{}%;性能损失电量{}万千瓦时,损失率{}%,同比{}%,环比{}%。";
+        title.add(StrUtil.format(str, monthMap.get("0").get("损失电量"), douStr2Str(monthMap.get("0").get("损失电量同比")), douStr2Str(monthMap.get("0").get("损失电量环比"))
+                , monthMap.get("0").get("损失率"), douStr2Str(monthMap.get("0").get("损失率同比")), douStr2Str(monthMap.get("0").get("损失率环比"))
+                , monthMap.get("0").get("受累损失电量"), monthMap.get("0").get("受累损失率"), douStr2Str2(monthMap.get("0").get("受累损失率同比")),
+                douStr2Str2(monthMap.get("0").get("受累损失率环比")), monthMap.get("0").get("限电损失电量"), monthMap.get("0").get("限电损失率")
+                , douStr2Str2(monthMap.get("0").get("限电损失率同比")), douStr2Str2(monthMap.get("0").get("限电损失率环比"))
+                , monthMap.get("0").get("故障损失电量"), monthMap.get("0").get("故障损失率"), douStr2Str2(monthMap.get("0").get("故障损失率同比")), douStr2Str2(monthMap.get("0").get("故障损失率环比"))
+                , monthMap.get("0").get("计划检修损失电量"), monthMap.get("0").get("计划检修损失率"), douStr2Str2(monthMap.get("0").get("计划检修损失率同比")), douStr2Str2(monthMap.get("0").get("计划检修损失率环比"))
+                , monthMap.get("0").get("性能损失电量"), monthMap.get("0").get("性能损失率"), douStr2Str2(monthMap.get("0").get("性能损失率同比")), douStr2Str2(monthMap.get("0").get("性能损失率环比"))));
+        str = "本月各场站发生极端天气{}次,持续时长{}小时,受累损失电量{}万千瓦时。主要事件为:{}";
+        title.add(StrUtil.format(str, "0", "0", monthMap.get("0").get("受累损失电量"), ""));
+        map.put("资源及理论发电量平衡分析", title);
+        title = new ArrayList<>();
+        str = "本月各场站收到电网调度限电指令11次,累计持续时间78小时,同比增加28小时,环比增加14小时。";
+        title.add(StrUtil.format(str));
+        str = "本月累计发生两个细则考核1116.3分,同比(626.07分)增加490.23分,累计补偿34.46分,同比(15.12分)增加19.34分。";
+        title.add(StrUtil.format(str));
+        str = "本月考核指标占比最多的是功率预测指标,共计考核1007.45分,其中风光短期预测考核213.82分,考核最多的场站为香山风电场(香五),考核58.12分;超短期预测考核110.15分,考核最多的场站为石板泉二、三、四期(牛五),考核26.38分;可用电量准确率考核682.84分,考核最高的场站为石板泉一期(星六),考核495分,本月按上限考核,主要原因为远动装置主备机数据不同步,数据上传出现偏差造成考核分值较大,目前已整改完成。";
+        title.add(StrUtil.format(str));
+        str = "本月未发生电网输变电故障,受累电网损失电量为0。";
+        title.add(StrUtil.format(str));
+        map.put("电网调度因素损失分析", title);
+        title = new ArrayList<>();
+        str = "本月各场站累计发生输变电故障2次,故障消缺时长累计48小时,损失电量79.78万千瓦时。故障事件为2月22日-25日石板泉110kV能风六线111开关差动保护跳闸;2月12日-16日香山国风二线315开关零序过流Ⅰ段保护动作跳闸。";
+        title.add(StrUtil.format(str));
+        str = "本月各风电场累计发生风机故障44台次,损失电量4.53万千瓦时,同比增加10%,环比减少5%。";
+        title.add(StrUtil.format(str));
+        str = "本月各场站平均故障消缺时间为4.8小时,同比下降10%,环比下降5%;故障消缺及时率86%,同比增加10%,环比减少5%。";
+        title.add(StrUtil.format(str));
+        map.put("故障及损失分析", title);
+        title = new ArrayList<>();
+        str = "本月累计执行风机计划检修186台次,同比增加90次,环比增加80次,平均检修时长4小时,同比下降0.5小时,环比下降0.5小时。损失电量8.13万千瓦时,同比增长7.06万千瓦时。";
+        title.add(StrUtil.format(str));
+        map.put("计划检修损失分析", title);
+        title = new ArrayList<>();
+        str = "本月风力发电性能损失{}万千瓦时,同比{}万千瓦时,环比{}万千瓦时。损失率{}%,同比{}%,环比{}%;其中性能损失率最高的是{},性能损失率{}%,性能损失率最低的是{},性能损失率{}%;性能损失率改善的场站有:{};性能损失率劣化的场站有{}。";
+        //性能损失率排序
+        List<String> xnsslpx = getTargetSort("FDC", "性能损失率");
+        List<String> xnsslhbpx = getTargetSort("FDC", "性能损失率环比");
+        title.add(StrUtil.format(str, monthMap.get("-1").get("性能损失电量"), douStr2Str2(monthMap.get("-1").get("性能损失电量同比"))
+                , douStr2Str2(monthMap.get("-1").get("性能损失电量环比")), monthMap.get("-1").get("性能损失率")
+                , douStr2Str2(monthMap.get("-1").get("性能损失率同比")), douStr2Str2(monthMap.get("-1").get("性能损失率环比"))
+                , max(xnsslpx), monthMap.get(xnsslpx.get(xnsslpx.size() - 1)).get("性能损失率")
+                , min(xnsslpx), monthMap.get(xnsslpx.get(0)).get("性能损失率")
+                , max2(xnsslhbpx), min2(xnsslhbpx)));
+        str = "本月风机状态转换及时率{}%,同比{}%,环比{}%。其中,状态转换及时率最高的场站是{},状态转换及时率最低的是{}。";
+        //状态转换率排序
+        List<String> ztzhlpx = getTargetSort("FDC", "状态转换率");
+        title.add(StrUtil.format(str, monthMap.get("-1").get("状态转换率"), douStr2Str2(monthMap.get("-1").get("状态转换率同比"))
+                , douStr2Str2(monthMap.get("-1").get("状态转换率环比")), max(ztzhlpx), min(ztzhlpx)));
+        str = "本月风机复位及时率{}%,同比{}%,环比{}%。其中,复位及时率最高的场站是{},复位及时率最低的是{}。";
+        //复位及时率排序
+        List<String> fwjslpx = getTargetSort("FDC", "复位及时率");
+        title.add(StrUtil.format(str, monthMap.get("-1").get("复位及时率"), douStr2Str2(monthMap.get("-1").get("复位及时率同比"))
+                , douStr2Str2(monthMap.get("-1").get("复位及时率环比")), max(fwjslpx), min(fwjslpx)));
+        str = "根据本月风机历史数据分析,存在静态偏航误差的风机有33台,分别是xxxxxxx;存在额定功率不达标的风机有44台,分别是xxxxxx。";
+        title.add(StrUtil.format(str));
+        str = "本月光伏发电性能损失{}万千瓦时,同比{}万千瓦时,环比{}万千瓦时,损失率{}%, 同比{}%, 环比{}%;其中性能损失率最高的是{},性能损失电量{}万千瓦时;性能损失率最低的是{},性能损失电量{}万千瓦时。";
+        //性能损失率排序
+        List<String> xnsslpxgf = getTargetSort("GDC", "性能损失率");
+        title.add(StrUtil.format(str, monthMap.get("-2").get("性能损失电量"), douStr2Str2(monthMap.get("-2").get("性能损失电量同比"))
+                , douStr2Str2(monthMap.get("-2").get("性能损失电量环比")), monthMap.get("-2").get("性能损失率")
+                , douStr2Str2(monthMap.get("-2").get("性能损失率同比")), douStr2Str2(monthMap.get("-2").get("性能损失率环比"))
+                , max(xnsslpxgf), monthMap.get(xnsslpxgf.get(xnsslpxgf.size() - 1)).get("性能损失电量")
+                , min(xnsslpxgf), monthMap.get(xnsslpxgf.get(0)).get("性能损失电量")));
+        str = "根据本月逆变器历史数据分析,存在功率偏差的设备有22台,分别是xxxxxxx。";
+        title.add(StrUtil.format(str));
+        map.put("性能损失分析", title);
+        title = new ArrayList<>();
+        str = "本月场用电量累计{}万千瓦时,同比{}千瓦时,环比{}千瓦时;综合场用电率{}%,同比{}%,环比{}%。";
+        title.add(StrUtil.format(str, monthMap.get("0").get("场用电量"), douStr2Str(monthMap.get("0").get("场用电量同比"))
+                , douStr2Str(monthMap.get("0").get("场用电量环比")), monthMap.get("0").get("场用电率"),
+                douStr2Str2(monthMap.get("0").get("场用电率同比")), douStr2Str2(monthMap.get("0").get("场用电率环比"))));
+        map.put("厂用电量分析", title);
+        title = new ArrayList<>();
+        //风能利用率排序
+        List<String> fnlylpx = getTargetSort("FDC", "风能利用率");
+        str = "{}:风能利用率偏低,设备维护维修及时率有待提高。";
+        title.add(StrUtil.format(str, min(fnlylpx)));
+        //计划检修损失率排序
+        List<String> jhjxsslpx = getTargetSort("FDC", "计划检修损失率");
+        str = "{}:计划检修损失率太高,需要重新审视安排合理检修时间。";
+        title.add(StrUtil.format(str, max(jhjxsslpx)));
+        //风能利用率排序
+        List<String> xnssdlpx = getTargetSort("FDC", "性能损失电量");
+        str = "{}:风机性能损失电量高,存在性能缺陷的风机多,需要限时整改。";
+        title.add(StrUtil.format(str, max(xnssdlpx)));
+        map.put("场站问题总结和建议", title);
+        return map;
+    }
+
+    private String min(List<String> list) {
+        return CacheContext.pmap.get(list.get(0)).getName();
+    }
+
+    private String max(List<String> list) {
+        return CacheContext.pmap.get(list.get(list.size() - 1)).getName();
+    }
+
+    private String min2(List<String> list) {
+        return CacheContext.pmap.get(list.get(1)).getName() + "," + CacheContext.wpmap.get(list.get(0)).getName();
+    }
+
+    private String max2(List<String> list) {
+        return CacheContext.pmap.get(list.get(list.size() - 1)).getName() + "," + CacheContext.wpmap.get(list.get(list.size() - 2)).getName();
+    }
+
+    /**
+     * 按指标从小到大排序
+     *
+     * @param dc     风电场or光电场
+     * @param target 指标
+     * @return 按指标从小到大排序场站
+     */
+    private List<String> getTargetSort(String dc, String target) {
+        List<String> lists = new ArrayList<>();
+        getStationTarget(dc, target).entrySet().stream().sorted(Map.Entry.comparingByValue()).forEach(o -> lists.add(o.getKey()));
+        return lists;
+    }
+
+    /**
+     * 场站,指标值
+     */
+    public Map<String, Double> getStationTarget(String dc, String target) {
+        Map<String, Double> map = new HashMap<>();
+        monthMap.forEach((cz, zb) -> {
+            if (cz.endsWith(dc))
+                map.put(cz, Double.valueOf(zb.get(target)));
+        });
+        return map;
+    }
+
+    private Map<String, Map<String, String>> getMap() {
+        Map<String, String> 公司Map = monthMap.get("0");
+        Map<String, String> 风电场Map = monthMap.get("-1");
+        Map<String, String> 光电场Map = monthMap.get("-2");
+        Map<String, String> 麻黄山Map = monthMap.get("MHS_FDC");
+        Map<String, String> 牛首山Map = monthMap.get("NSS_FDC");
+        Map<String, String> 青山Map = monthMap.get("QS_FDC");
+        Map<String, String> 石板泉Map = monthMap.get("SBQ_FDC");
+        Map<String, String> 香山Map = monthMap.get("XS_FDC");
+        Map<String, String> 大武口Map = monthMap.get("DWK_GDC");
+        Map<String, String> 平罗Map = monthMap.get("PL_GDC");
+        Map<String, String> 宣和Map = monthMap.get("XH_GDC");
+        Map<String, String> 马场湖Map = monthMap.get("MCH_GDC");
+        Map<String, String> 海子井Map = monthMap.get("HZJ_GDC");
+        Map<String, String> 艾肯Map = monthMap.get("AK_GDC");
+
+        公司Map.put("计划电量", "10000");
+        公司Map.put("实际电量", "9332.97");
+        公司Map.put("实际电量同比", "18");
+        公司Map.put("实际电量环比", "-15");
+        公司Map.put("实际电量完成率", "93.33");
+
+        麻黄山Map.put("实际电量", "831.41");
+        麻黄山Map.put("实际电量完成率", "63.08");
+
+        牛首山Map.put("实际电量", "1240.05");
+        牛首山Map.put("实际电量完成率", "70.70");
+
+        青山Map.put("实际电量", "2111.7");
+        青山Map.put("实际电量完成率", "83.27");
+
+        石板泉Map.put("实际电量", "1933.18");
+        石板泉Map.put("实际电量完成率", "82.19");
+
+        香山Map.put("实际电量", "1962.54");
+        香山Map.put("实际电量完成率", "102.75");
+
+        大武口Map.put("实际电量", "94.56");
+        大武口Map.put("实际电量完成率", "95.52");
+
+        平罗Map.put("实际电量", "281.12");
+        平罗Map.put("实际电量完成率", "101.49");
+
+        宣和Map.put("实际电量", "214.82");
+        宣和Map.put("实际电量完成率", "106.88");
+
+        马场湖Map.put("实际电量", "104.79");
+        马场湖Map.put("实际电量完成率", "108.03");
+
+        海子井Map.put("实际电量", "534.97");
+        海子井Map.put("实际电量完成率", "101.32");
+
+        艾肯Map.put("实际电量", "23.83");
+        艾肯Map.put("实际电量完成率", "85.11");
+
+        公司Map.put("电网限电指令", "11");
+        公司Map.put("电网限电指令持续时间", "78");
+        公司Map.put("电网限电指令持续时间同比", "28");//没有百分比
+        公司Map.put("电网限电指令持续时间环比", "14");//没有百分比
+        公司Map.put("两个细则分数", "1116.3");
+        公司Map.put("两个细则分数去年同期", "626.07");
+        公司Map.put("两个细则分数同比", "490.23");//没有百分比
+        公司Map.put("两个细则分数累计补偿", "34.46");
+        公司Map.put("两个细则分数累计补偿上期", "15.12");
+        公司Map.put("两个细则分数累计补偿环比", "19.34");//没有百分比
+        公司Map.put("受累损失电量", "0");
+
+        风电场Map.put("平均风速", "4.63");
+        风电场Map.put("平均风速同比", "0.52");
+        风电场Map.put("平均风速环比", "1.51");
+        风电场Map.put("理论发电量", "9800");
+        风电场Map.put("理论发电量同比", "11");
+        风电场Map.put("理论发电量环比", "-20");
+        光电场Map.put("辐照总量", "2229.66");
+        光电场Map.put("辐照总量同比", "54.18");//没有百分比
+        光电场Map.put("辐照总量环比", "23.45");//没有百分比
+        光电场Map.put("理论发电量", "1200");
+        光电场Map.put("理论发电量同比", "6");
+        光电场Map.put("理论发电量环比", "3");
+
+        公司Map.put("理论发电量", "11000");
+        公司Map.put("理论发电量同比", "20");
+        公司Map.put("理论发电量环比", "-30");
+        公司Map.put("设备利用小时", "120");
+        公司Map.put("设备利用小时同比", "20");
+        公司Map.put("设备利用小时环比", "-13");
+        公司Map.put("风能利用率", "86");
+        公司Map.put("风能利用率同比", "-1");
+        公司Map.put("风能利用率环比", "-2");
+        公司Map.put("光能利用率", "82");
+        公司Map.put("光能利用率同比", "2");
+        公司Map.put("光能利用率环比", "2.2");
+        公司Map.put("损失电量", "1234");
+        公司Map.put("损失电量同比", "18");
+        公司Map.put("损失电量环比", "-45");
+        公司Map.put("损失率", "12.5");
+        公司Map.put("损失率同比", "-1");
+        公司Map.put("损失率环比", "1.2");
+        公司Map.put("受累损失电量", "501.64");
+        公司Map.put("受累损失率", "4.9");
+        公司Map.put("受累损失率同比", "234");
+        公司Map.put("受累损失率环比", "-50");
+        公司Map.put("限电损失电量", "310");
+        公司Map.put("限电损失率", "2.6");
+        公司Map.put("限电损失率同比", "66");
+        公司Map.put("限电损失率环比", "-20");
+        公司Map.put("故障损失电量", "200");
+        公司Map.put("故障损失率", "1.5");
+        公司Map.put("故障损失率同比", "-5");
+        公司Map.put("故障损失率环比", "3");
+        公司Map.put("计划检修损失电量", "8.13");
+        公司Map.put("计划检修损失电量同比", "7.06");
+        公司Map.put("计划检修损失电量环比", "1.13");
+        公司Map.put("计划检修损失率", "0.4");
+        公司Map.put("计划检修损失率同比", "-2");
+        公司Map.put("计划检修损失率环比", "1");
+        公司Map.put("性能损失电量", "434");
+        公司Map.put("性能损失电量同比", "28.62");//没有百分比
+        公司Map.put("性能损失电量环比", "15.73");//没有百分比
+        公司Map.put("性能损失率", "3.8");
+        公司Map.put("性能损失率同比", "5");
+        公司Map.put("性能损失率环比", "2");
+
+        公司Map.put("输变电故障次数", "2");
+        公司Map.put("故障消缺时长", "48");
+        公司Map.put("故障消缺损失电量", "79.78");
+        公司Map.put("故障事件", "2月22日-25日石板泉110kV能风六线111开关差动保护跳闸;2月12日-16日香山国风二线315开关零序过流Ⅰ段保护动作跳闸;");
+        公司Map.put("风机故障台次", "44");
+        公司Map.put("风机故障损失电量", "4.53");
+        公司Map.put("风机故障损失电量同比", "10");
+        公司Map.put("风机故障损失电量环比", "-5");
+        公司Map.put("平均故障消缺时间", "4.8");
+        公司Map.put("平均故障消缺时间同比", "-10");
+        公司Map.put("平均故障消缺时间环比", "-5");
+        公司Map.put("消缺及时率", "86");
+        公司Map.put("消缺及时率同比", "10");
+        公司Map.put("消缺及时率环比", "-5");
+
+        公司Map.put("计划检修台次", "186");
+        公司Map.put("计划检修台次同比", "90");
+        公司Map.put("计划检修台次环比", "80");
+        公司Map.put("平均检修时长", "4");
+        公司Map.put("平均检修时长同比", "-0.5");
+        公司Map.put("平均检修时长环比", "-0.5");
+
+        公司Map.put("状态转换及时率", "98.5");
+        公司Map.put("状态转换及时率同比", "1");
+        公司Map.put("状态转换及时率环比", "0.5");
+        公司Map.put("复位及时率", "88.5");
+        公司Map.put("复位及时率同比", "0.8");
+        公司Map.put("复位及时率环比", "0.3");
+
+        光电场Map.put("性能损失电量", "3.25");
+        光电场Map.put("性能损失电量同比", "-0.3");//没有百分比
+        光电场Map.put("性能损失电量环比", "1.73");//没有百分比
+        光电场Map.put("性能损失率", "6.8");
+        光电场Map.put("性能损失率同比", "-0.5");
+        光电场Map.put("性能损失率环比", "0.5");
+
+        公司Map.put("场用电量", "103");
+        公司Map.put("场用电量同比", "15");//没有百分比
+        公司Map.put("场用电量环比", "11");//没有百分比
+        公司Map.put("场用电率", "1.02");
+        公司Map.put("场用电率", "0.24");
+        公司Map.put("场用电率", "-0.11");
+
+        return monthMap;
+    }
+}

+ 16 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/service/auto/IProjectplanService.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkingimpala.service.auto;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.benchmarkingimpala.model.auto.Projectplan;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author gfhd
+ * @since 2023-04-13
+ */
+public interface IProjectplanService extends IService<Projectplan> {
+
+}

+ 20 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/service/auto/impl/ProjectplanServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkingimpala.service.auto.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.benchmarkingimpala.mapper.auto.ProjectplanMapper;
+import com.gyee.benchmarkingimpala.model.auto.Projectplan;
+import com.gyee.benchmarkingimpala.service.auto.IProjectplanService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author gfhd
+ * @since 2023-04-13
+ */
+@Service
+public class ProjectplanServiceImpl extends ServiceImpl<ProjectplanMapper, Projectplan> implements IProjectplanService {
+
+}

+ 13 - 9
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/util/taos/EdosUtil.java

@@ -3,7 +3,6 @@ package com.gyee.benchmarkingimpala.util.taos;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-
 import com.gyee.benchmarkingimpala.common.DNAStatVal;
 import com.gyee.benchmarkingimpala.common.DNAVal;
 import com.gyee.benchmarkingimpala.common.PointData;
@@ -1252,15 +1251,20 @@ public class EdosUtil implements IEdosUtil {
             }
         } catch (Exception e) {
         	  DNAVal[] errorResult = new DNAVal[nameList.length];
-              for(int i=0;i<nameList.length;i++)
-              {
-              	 DNAVal val = new DNAVal();
-                   val.Status = 0;
-                   errorResult[i] = val;
-              }
-              return errorResult;
+            for (int i = 0; i < nameList.length; i++) {
+                DNAVal val = new DNAVal();
+                val.Status = 0;
+                errorResult[i] = val;
+            }
+            return errorResult;
         }
     }
 
-
+    public double getSec(String nameList, long tTime) {
+        String url = baseURL + "/history/section?tagNames=" + nameList + "&ts=" + tTime;
+        ResponseEntity<JSONObject> forEntity = restTemplate.getForEntity(url, JSONObject.class);
+        JSONObject body = forEntity.getBody();
+        if (body.getJSONObject(nameList) == null) return 0;
+        return body.getJSONObject(nameList).getDoubleValue("doubleValue");
+    }
 }

+ 6 - 8
gradeevaluation/src/main/java/com/gyee/gradeevaluation/model/auto/Wtreportmain.java

@@ -1,19 +1,17 @@
 package com.gyee.gradeevaluation.model.auto;
 
-import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
+
 /**
  * <p>
- * 
+ *
  * </p>
  *
  * @author 谢生杰
@@ -21,7 +19,7 @@ import lombok.EqualsAndHashCode;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-@TableName("WTREPORTMAIN")
+@TableName("WTREPORTFAULT3")
 public class Wtreportmain extends Model {
 
     private static final long serialVersionUID = 1L;

+ 2 - 1
gradeevaluation/src/main/java/com/gyee/gradeevaluation/variable/MainConstant.java

@@ -26,7 +26,8 @@ public class MainConstant {
     public static final String JSFW_NSSWDLB = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0136"; // 牛首山上网电量
     public static final String JSFW_NSSSZGL = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0135"; //牛首山实时总功率
     public static final String JSFW_NSSSFS = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0134"; // 牛首山实时平均风速
-    public static final String NSSDQ_POWER = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_AI1009"; // 牛首山原始测点总功率
+    //public static final String NSSDQ_POWER = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_AI1009"; // 牛首山原始测点总功率
+    public static final String NSSDQ_POWER = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0135"; // 牛首山原始测点总功率
 
     public static final String JSFW_MHRFDLB = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0088"; // 麻黄山日发电量
     public static final String JSFW_MHSWDLB = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0136"; // 麻黄山上网电量

+ 1 - 1
gyee-sample-impala/src/main/java/com/gyee/impala/common/feign/IAdapterService.java

@@ -34,7 +34,7 @@ public interface IAdapterService {
 
     @Headers({"Content-Type: application/json", "Accept: application/json"})
     @RequestLine("GET /ts/history/section?tagNames={tagNames}&ts={ts}")
-    List<TsDoubleData> getHistorySectionAI(@Param(value = "tagNames") String tagNames, @Param(value = "ts") long ts);
+    List<PointData> getHistorySectionAI(@Param(value = "tagNames") String tagNames, @Param(value = "ts") long ts);
 
 
 

+ 2 - 1
gyee-sample-impala/src/main/java/com/gyee/impala/schdule/TaskCasefaultReplenish.java

@@ -117,7 +117,8 @@ public class TaskCasefaultReplenish {
                 }
             }
         }
-        casefaultService.updateBatchById(casefaultList,300);
+        casefaultService.updateBatchById(casefaultList, 300);
+        casefaultService.saveOrUpdateBatch(casefaultList, 300);
     }
 
     /**

+ 76 - 4
power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/NewPhotovoltaicController.java

@@ -10,7 +10,6 @@ import com.gyee.power.fitting.common.spring.InitialRunner;
 import com.gyee.power.fitting.model.ProBasicEquipment;
 import com.gyee.power.fitting.model.custom.FjjxbVo;
 import com.gyee.power.fitting.model.custom.PhotovoltaicInfo;
-import com.gyee.power.fitting.model.custom.PowerPointData;
 import com.gyee.power.fitting.model.custom.TableTitle;
 import com.gyee.power.fitting.service.ProBasicEquipmentService;
 import com.gyee.power.fitting.service.impl.NewIvPvCurveFittingService;
@@ -118,7 +117,6 @@ public class NewPhotovoltaicController {
         return JsonResult.successData(ResultCode.SUCCESS, voList);
     }
 
-
     //功率-光照-温度曲线
     @PostMapping("/analysis/powerbeam")
     private JSONObject powerBeamTemperature(@RequestParam("station") String station,
@@ -166,8 +164,6 @@ public class NewPhotovoltaicController {
         return JsonResult.successData(ResultCode.SUCCESS, list);
     }
 
-
-
     //文件删除
     @DeleteMapping("/delete/files")
     private JSONObject deleteFiles(@RequestBody JSONObject filename) {
@@ -199,4 +195,80 @@ public class NewPhotovoltaicController {
             return R.error(ResultMsg.error());
         }
     }
+
+    //功率-时间曲线,无文件
+    @GetMapping("/notfile/powertimefile")
+    private JSONObject getNotFile(
+            @RequestParam(value = "station", required = true) String station,
+            @RequestParam(value = "inverters", required = true) List<String> inverters,
+            @RequestParam(value = "startdate", required = true) long startdate,
+            @RequestParam("interval") int interval,
+            @RequestParam(value = "enddate", required = true) long enddate) {
+
+        Map<String, List<PhotovoltaicInfo>> datasInfos = curveFittingService.getDatas2File1(station, startdate, enddate, interval);
+        List<PhotovoltaicInfo> bzdList = curveFittingService.standardPointCalculate1(datasInfos);
+
+        Map<String, List<PhotovoltaicInfo>> infos = curveFittingService.calculatAnalysis1(bzdList, datasInfos);
+
+        List<TableTitle> collect = curveFittingService.getTheoryTitel();
+
+        Map<String, Object> table = new HashMap<>();
+
+        Set<String> keys = infos.keySet();
+        for (String key : keys) {
+            for (ProBasicEquipment c : InitialRunner.newgfwtList) {
+                if (key.equals(c.getId())) {
+                    table.put("name", c.getName());
+                }
+            }
+        }
+
+        table.put("title", collect);
+        table.put("data", infos);
+        return JsonResult.successData(ResultCode.SUCCESS, table);
+    }
+
+    //功率-光照-温度曲线,无文件
+    @PostMapping("/notfile/powerbeam")
+    private JSONObject powerBeamNotfile(@RequestParam("station") String station,
+                                        @RequestParam("inverters") List<String> inverters,
+                                        @RequestParam("startdate") long startdate,
+                                        @RequestParam("interval") int interval,
+                                        @RequestParam("enddate") long enddate) {
+
+        Map<String, List<PhotovoltaicInfo>> datasInfos = curveFittingService.getDatas2File1(station, startdate, enddate, interval);
+
+        List<PhotovoltaicInfo> infos = new ArrayList<>();
+        //单台拟合
+        if (inverters.size() == 1) {
+            infos = datasInfos.get(inverters.get(0));
+            //多台拟合
+        } else if (inverters.size() > 1) {
+            for (String inverter : inverters) {
+                infos.addAll(datasInfos.get(inverter));
+            }
+        } else {
+            return JsonResult.error(ResultCode.PARAM_NOT_COMPLETE);
+        }
+        List<double[]> b = curveFittingService.oneFileFitting(infos);
+        infos = infos.stream().filter(i -> i.getS() > 1).sorted(Comparator.comparing(PhotovoltaicInfo::getS)).collect(Collectors.toList());
+
+        List<double[]> a = new ArrayList<>();
+        for (PhotovoltaicInfo pi : infos) {
+
+            double[] scatter = new double[3];
+
+            scatter[0] = pi.getS();
+            scatter[1] = pi.getActualP();
+            scatter[2] = pi.getT();
+
+            a.add(scatter);
+        }
+
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("scatter", a);
+        map.put("curve", b);
+
+        return JsonResult.successData(ResultCode.SUCCESS, map);
+    }
 }

+ 26 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/dispersionanalysis/InverterData.java

@@ -0,0 +1,26 @@
+package com.gyee.power.fitting.dispersionanalysis;
+
+// 逆变器数据类,包含逆变器ID、时间戳和输出功率
+class InverterData {
+    private String inverterId;
+    private long timestamp;
+    private double outputPower;
+
+    public InverterData(String inverterId, long timestamp, double outputPower) {
+        this.inverterId = inverterId;
+        this.timestamp = timestamp;
+        this.outputPower = outputPower;
+    }
+
+    public String getInverterId() {
+        return inverterId;
+    }
+
+    public long getTimestamp() {
+        return timestamp;
+    }
+
+    public double getOutputPower() {
+        return outputPower;
+    }
+}

+ 112 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/dispersionanalysis/InverterPowerAnalysis.java

@@ -0,0 +1,112 @@
+package com.gyee.power.fitting.dispersionanalysis;
+
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.*;
+
+public class InverterPowerAnalysis {
+
+    public static void main(String[] args) {
+        List<InverterData> inverterDataList = generateInverterData();
+
+        // 使用Map来存储每个逆变器的历史功率数据
+        Map<String, List<Double>> historicalPowerData = new HashMap<>();
+
+        for (InverterData inverterData : inverterDataList) {
+            String inverterId = inverterData.getInverterId();
+            double outputPower = inverterData.getOutputPower();
+
+            // 更新历史功率数据
+            historicalPowerData.computeIfAbsent(inverterId, k -> new ArrayList<>()).add(outputPower);
+
+            // 更新历史数据并进行分析
+            analyzeInverterPerformance(historicalPowerData, inverterId);
+        }
+
+        // 将数据存储到CSV文件
+        saveDataToCSV(historicalPowerData, "historical_power_data.csv");
+    }
+
+    // 模拟生成逆变器数据
+    private static List<InverterData> generateInverterData() {
+        List<InverterData> data = new ArrayList<>();
+        Random rand = new Random();
+        for (int i = 1; i <= 10; i++) {
+            String inverterId = "Inverter" + i;
+            long timestamp = System.currentTimeMillis();
+            double outputPower = rand.nextDouble() * 1000;
+            data.add(new InverterData(inverterId, timestamp, outputPower));
+        }
+        return data;
+    }
+
+    // 分析逆变器性能,包括计算离散率和平均功率
+    private static void analyzeInverterPerformance(Map<String, List<Double>> historicalPowerData, String inverterId) {
+        List<Double> powerData = historicalPowerData.get(inverterId);
+
+        // 计算平均功率
+        double averagePower = calculateAveragePower(powerData);
+
+        // 计算功率离散率
+        double powerDeviation = calculatePowerDeviation(powerData, averagePower);
+
+        // 分析逆变器状态
+        String inverterStatus = analyzeInverterStatus(powerDeviation, averagePower);
+        System.out.println("逆变器ID: " + inverterId + ",离散率: " + powerDeviation + ",平均功率: " + averagePower + ",状态: " + inverterStatus);
+    }
+
+    // 计算功率离散率
+    private static double calculatePowerDeviation(List<Double> powerData, double averagePower) {
+        double sum = 0.0;
+
+        // 计算标准差
+        for (Double power : powerData) {
+            sum += Math.pow(power - averagePower, 2);
+        }
+        return Math.sqrt(sum / powerData.size());
+    }
+
+    // 计算平均功率
+    private static double calculateAveragePower(List<Double> powerData) {
+        double sum = 0.0;
+        for (Double power : powerData) {
+            sum += power;
+        }
+        return sum / powerData.size();
+    }
+
+    // 根据复杂规则分析逆变器状态
+    private static String analyzeInverterStatus(double powerDeviation, double averagePower) {
+        if (powerDeviation < 0.1 && averagePower > 800) {
+            return "运行稳定";
+        } else if (powerDeviation < 0.2 && averagePower > 600) {
+            return "运行良好";
+        } else if (powerDeviation < 0.3 && averagePower > 400) {
+            return "运行水平有待提高";
+        } else {
+            return "必须整改";
+        }
+    }
+
+    // 将数据存储到CSV文件
+    private static void saveDataToCSV(Map<String, List<Double>> historicalPowerData, String fileName) {
+        try {
+            FileWriter writer = new FileWriter(fileName);
+            writer.append("InverterId,PowerData\n");
+            for (Map.Entry<String, List<Double>> entry : historicalPowerData.entrySet()) {
+                String inverterId = entry.getKey();
+                List<Double> powerData = entry.getValue();
+                StringBuilder powerDataStr = new StringBuilder();
+                for (Double power : powerData) {
+                    powerDataStr.append(power).append(",");
+                }
+                writer.append(inverterId).append(",").append(powerDataStr.toString()).append("\n");
+            }
+            writer.flush();
+            writer.close();
+            System.out.println("数据已保存到 " + fileName);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 133 - 84
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/NewIvPvCurveFittingService.java

@@ -1,6 +1,5 @@
 package com.gyee.power.fitting.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.power.fitting.common.alg.CurrentVoltageCalc;
 import com.gyee.power.fitting.common.alg.PolynomialCurveFitting;
 import com.gyee.power.fitting.common.config.GyeeConfig;
@@ -14,8 +13,14 @@ import com.gyee.power.fitting.common.util.PowerFittingUtil;
 import com.gyee.power.fitting.model.*;
 import com.gyee.power.fitting.model.anno.AnnotationTool;
 import com.gyee.power.fitting.model.anno.FixedVo;
-import com.gyee.power.fitting.model.custom.*;
-import com.gyee.power.fitting.service.*;
+import com.gyee.power.fitting.model.custom.FjjxbVo;
+import com.gyee.power.fitting.model.custom.PhotovoltaicInfo;
+import com.gyee.power.fitting.model.custom.TableTitle;
+import com.gyee.power.fitting.model.custom.TsDoubleData;
+import com.gyee.power.fitting.service.IWindpowerstationtestingpoint2Service;
+import com.gyee.power.fitting.service.ProBasicEquipmentPointService;
+import com.gyee.power.fitting.service.ProBasicPowerstationPointService;
+import com.gyee.power.fitting.service.Windturbinetestingpointai2Service;
 import com.gyee.power.fitting.service.custom.curve.DataScangfService;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.math3.fitting.WeightedObservedPoints;
@@ -63,32 +68,35 @@ public class NewIvPvCurveFittingService {
     @Resource
     private DataScangfService dataScangfService;
 
-    public  void getDatas2File(String stationid, long start, long end ,int interval) {
+    public void getDatas2File(String stationid, long start, long end, int interval) {
 
         int daym = 24 * 60 * 60 * 1000;
 
         //按天
         for (long i = start; i < end; i += daym) {
 
-            List<List<PhotovoltaicInfo>> datas = getDatas(stationid, i, i + daym,interval);
+            List<List<PhotovoltaicInfo>> datas = getDatas(stationid, i, i + daym, interval);
             infos2File(datas);
-
         }
     }
-    public   List<List<List<PhotovoltaicInfo>>>  getDatas2File1(String stationid, long start, long end ,int interval) {
 
-        int daym = 24 * 60 * 60 * 1000;
+    public Map<String, List<PhotovoltaicInfo>> getDatas2File1(String stationid, long start, long end, int interval) {
 
-        List<List<List<PhotovoltaicInfo>>> wj = new ArrayList<>();
+        int daym = 24 * 60 * 60 * 1000;
+        Map<String, List<PhotovoltaicInfo>> wj = new HashMap<>();
         //按天
         for (long i = start; i < end; i += daym) {
 
-            List<List<PhotovoltaicInfo>> datas = getDatas(stationid, i, i + daym,interval);
-            wj.add(datas);
-//            infos2File(datas);
-
+            List<List<PhotovoltaicInfo>> datas = getDatas(stationid, i, i + daym, interval);
+            for (List<PhotovoltaicInfo> data : datas) {
+                List<PhotovoltaicInfo> infos = wj.get(data.get(0).getInverter());
+                if (infos == null) {
+                    wj.put(data.get(0).getInverter(), data);
+                } else {
+                    infos.addAll(data);
+                }
+            }
         }
-
         return wj;
     }
 
@@ -101,7 +109,7 @@ public class NewIvPvCurveFittingService {
         for (List<PhotovoltaicInfo> data : datas) {
             PhotovoltaicInfo info = data.get(0);
             String station = info.getStation();
-            String fileName = config.getFilePathPrepare() + "gf" +File.separator+ "一秒" +File.separator + station + "-" + info.getInverter() + "-" + DateUtils.date2StringS(new Date(info.getTime())) + ".csv";
+            String fileName = config.getFilePathPrepare() + "gf" + File.separator + "一秒" + File.separator + station + "-" + info.getInverter() + "-" + DateUtils.date2StringS(new Date(info.getTime())) + ".csv";
             File file = new File(fileName);
             if (file.exists()) continue;
             StringBuilder sb = new StringBuilder();
@@ -117,13 +125,13 @@ public class NewIvPvCurveFittingService {
         }
     }
 
-    public List<String> getFileList(String station, List<String> nbq, long startdate,int interval, long enddate, boolean isOffline) {
+    public List<String> getFileList(String station, List<String> nbq, long startdate, int interval, long enddate, boolean isOffline) {
         List<String> fileList = new ArrayList<>();
         File file = null;
-                //获取文件位置
+        //获取文件位置
         if (interval == 1) {
             file = new File(config.getFilePathPrepare() + "gf" + File.separator + "一秒" + File.separator);
-        }else if (interval == 1){
+        } else if (interval == 1) {
             file = new File(config.getFilePathPrepare() + "gf" + File.separator + "一秒" + File.separator);
         }
         //获取文件列表
@@ -152,7 +160,7 @@ public class NewIvPvCurveFittingService {
         List<FixedVo> fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
         List<TableTitle> collect = fixedVos.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
         Map<String, Object> tableMap = new HashMap<>();
-        String fs = config.getFilePathPrepare() + "gf"+File.separator + s;
+        String fs = config.getFilePathPrepare() + "gf" + File.separator + s;
         List<PhotovoltaicInfo> infos = file2Info(fs, false);
         tableMap.put("data", infos);
         tableMap.put("title", collect);
@@ -199,11 +207,11 @@ public class NewIvPvCurveFittingService {
      */
     public Map<String, List<PhotovoltaicInfo>> calculatAnalysis(List<String> fileList) {
 
-        String bzcldPath = config.getFilePathPrepare() + "bzd"+File.separator + "标准点.csv";
+        String bzcldPath = config.getFilePathPrepare() + "bzd" + File.separator + "标准点.csv";
         List<PhotovoltaicInfo> bzclds = file2Info(bzcldPath, true);
         Map<String, PhotovoltaicInfo> bzcldMap = bzclds.stream().collect(Collectors.toMap(PhotovoltaicInfo::getInverter, Function.identity()));
 
-        String fs = config.getFilePathPrepare() + "gf" +File.separator;
+        String fs = config.getFilePathPrepare() + "gf" + File.separator;
         Map<String, List<PhotovoltaicInfo>> stringListMap = new HashMap<>();
         for (String s : fileList) {
             //读取一个文件
@@ -225,33 +233,58 @@ public class NewIvPvCurveFittingService {
         return stringListMap;
     }
 
-//    public Map<String, List<PhotovoltaicInfo>> calculatAnalysis1(List<List<List<PhotovoltaicInfo>>> feill) {
-//
-//        String bzcldPath = config.getFilePathPrepare() + "bzd"+File.separator + "标准点.csv";
-//        List<PhotovoltaicInfo> bzclds = file2Info(bzcldPath, true);
-//        Map<String, PhotovoltaicInfo> bzcldMap = bzclds.stream().collect(Collectors.toMap(PhotovoltaicInfo::getInverter, Function.identity()));
-//
-//        String fs = config.getFilePathPrepare() + "gf" +File.separator;
-//        Map<String, List<PhotovoltaicInfo>> stringListMap = new HashMap<>();
-//        for (String s : fileList) {
-//            //读取一个文件
-//            List<PhotovoltaicInfo> infos = file2Info(fs + s, true);
-//            List<PhotovoltaicInfo> theoryInfos;
-//            if (s.contains("HZJ_GDC") || s.contains("AK_GDC")) {
-//                theoryInfos = CurrentVoltageCalc.CalcTheoryPowerHZJ(infos, bzcldMap);
-//            } else {
-//                theoryInfos = CurrentVoltageCalc.CalcTheoryPower(infos, bzcldMap);
-//            }
-//            //按逆变器聚合数据
-//            if (stringListMap.containsKey(theoryInfos.get(0).getInverter())) {
-//                stringListMap.get(theoryInfos.get(0).getInverter()).addAll(theoryInfos);
-//
-//            } else {
-//                stringListMap.put(theoryInfos.get(0).getInverter(), theoryInfos);
-//            }
-//        }
-//        return stringListMap;
-//    }
+    /**
+     * 计算理论功率加入原列表
+     *
+     * @return
+     */
+    public Map<String, List<PhotovoltaicInfo>> calculatAnalysis1(List<PhotovoltaicInfo> bzdList, Map<String, List<PhotovoltaicInfo>> datasInfos) {
+
+        Map<String, PhotovoltaicInfo> bzcldMap = bzdList.stream().collect(Collectors.toMap(PhotovoltaicInfo::getInverter, Function.identity()));
+
+        Map<String, List<PhotovoltaicInfo>> stringListMap = new HashMap<>();
+
+        String s;
+        for (Map.Entry<String, List<PhotovoltaicInfo>> entry : datasInfos.entrySet()) {
+            s = entry.getKey();
+            List<PhotovoltaicInfo> theoryInfos;
+            if (s.contains("HZJ_GDC") || s.contains("AK_GDC")) {
+                theoryInfos = CurrentVoltageCalc.CalcTheoryPowerHZJ(entry.getValue(), bzcldMap);
+            } else {
+                theoryInfos = CurrentVoltageCalc.CalcTheoryPower(entry.getValue(), bzcldMap);
+            }
+            stringListMap.put(s, theoryInfos);
+        }
+        return stringListMap;
+    }
+
+    //    public Map<String, List<PhotovoltaicInfo>> calculatAnalysis1(List<List<List<PhotovoltaicInfo>>> feill) {
+    //
+    //        String bzcldPath = config.getFilePathPrepare() + "bzd"+File.separator + "标准点.csv";
+    //        List<PhotovoltaicInfo> bzclds = file2Info(bzcldPath, true);
+    //        Map<String, PhotovoltaicInfo> bzcldMap = bzclds.stream().collect(Collectors.toMap(PhotovoltaicInfo::getInverter, Function.identity()));
+    //
+    //        String fs = config.getFilePathPrepare() + "gf" +File.separator;
+    //        Map<String, List<PhotovoltaicInfo>> stringListMap = new HashMap<>();
+    //        for (String s : fileList) {
+    //            //读取一个文件
+    //            List<PhotovoltaicInfo> infos = file2Info(fs + s, true);
+    //            List<PhotovoltaicInfo> theoryInfos;
+    //            if (s.contains("HZJ_GDC") || s.contains("AK_GDC")) {
+    //                theoryInfos = CurrentVoltageCalc.CalcTheoryPowerHZJ(infos, bzcldMap);
+    //            } else {
+    //                theoryInfos = CurrentVoltageCalc.CalcTheoryPower(infos, bzcldMap);
+    //            }
+    //            //按逆变器聚合数据
+    //            if (stringListMap.containsKey(theoryInfos.get(0).getInverter())) {
+    //                stringListMap.get(theoryInfos.get(0).getInverter()).addAll(theoryInfos);
+    //
+    //            } else {
+    //                stringListMap.put(theoryInfos.get(0).getInverter(), theoryInfos);
+    //            }
+    //        }
+    //        return stringListMap;
+    //    }
 
     /**
      * 合并同逆变器文件
@@ -261,7 +294,7 @@ public class NewIvPvCurveFittingService {
      */
     public Map<String, List<PhotovoltaicInfo>> mergeCalculat(List<String> fileList) {
 
-        String fs = config.getFilePathPrepare() + "gf" +File.separator;
+        String fs = config.getFilePathPrepare() + "gf" + File.separator;
         Map<String, List<PhotovoltaicInfo>> stringListMap = new HashMap<>();
         for (String s : fileList) {
             //读取一个文件
@@ -301,7 +334,7 @@ public class NewIvPvCurveFittingService {
 
     public List<String> getAllFileList() {
         //获取文件位置
-        File file = new File(config.getFilePathPrepare() + "gf" + "一秒"  );
+        File file = new File(config.getFilePathPrepare() + "gf" + "一秒");
         //获取文件列表
         File[] files = file.listFiles();
         List<String> fileList = Arrays.stream(files).map(f -> f.getName()).collect(Collectors.toList());
@@ -338,13 +371,29 @@ public class NewIvPvCurveFittingService {
                     .append(",").append(ptInfo.getCI()).append(",").append(ptInfo.getCV())
                     .append("\n");
         }
-        String fileName = config.getFilePathPrepare() + "bzd"+File.separator +"标准点.csv";
+        String fileName = config.getFilePathPrepare() + "bzd" + File.separator + "标准点.csv";
         File file = new File(fileName);
         file.delete();
         FileUtil.writeFile(fileName, sb.toString());
 
     }
 
+    /**
+     * 标准点计算
+     *
+     * @param stringListMap
+     */
+    public List<PhotovoltaicInfo> standardPointCalculate1(Map<String, List<PhotovoltaicInfo>> stringListMap) {
+
+        List<PhotovoltaicInfo> ptInfos = new ArrayList<>();
+        for (Map.Entry<String, List<PhotovoltaicInfo>> entry : stringListMap.entrySet()) {
+            List<PhotovoltaicInfo> value = entry.getValue();
+            Optional<PhotovoltaicInfo> first = value.stream().sorted(Comparator.comparing(PhotovoltaicInfo::getActualP).reversed()).findFirst();
+            ptInfos.add(first.get());
+        }
+        return ptInfos;
+    }
+
     public List<TableTitle> getTheoryTitel() {
 
         List<FixedVo> fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
@@ -368,7 +417,7 @@ public class NewIvPvCurveFittingService {
      */
     public List<PhotovoltaicInfo> calculatFitting(List<String> fileList) {
 
-        String fs = config.getFilePathPrepare() + "gf" +File.separator ;
+        String fs = config.getFilePathPrepare() + "gf" + File.separator;
         List<PhotovoltaicInfo> infoList = new ArrayList<>();
         for (String s : fileList) {
             List<PhotovoltaicInfo> infos = file2Info(fs + s, true);
@@ -411,10 +460,10 @@ public class NewIvPvCurveFittingService {
      * @param startdate
      * @param enddate
      */
-    public List<FjjxbVo> getPhotovoltaicPerformanceList(long startdate, long enddate,int interval) {
+    public List<FjjxbVo> getPhotovoltaicPerformanceList(long startdate, long enddate, int interval) {
         int oneday = 24 * 60 * 60;
 
-        String bzcldPath = config.getFilePathPrepare() + "bzd"+File.separator+"标准点.csv";
+        String bzcldPath = config.getFilePathPrepare() + "bzd" + File.separator + "标准点.csv";
         List<PhotovoltaicInfo> bzclds = file2Info(bzcldPath, true);
         Map<String, PhotovoltaicInfo> bzcldMap = bzclds.stream().collect(Collectors.toMap(PhotovoltaicInfo::getInverter, Function.identity()));
 
@@ -442,7 +491,7 @@ public class NewIvPvCurveFittingService {
             int i = 0;
             double t = 5 / 60;
 
-            List<List<PhotovoltaicInfo>> datas = getDatas(stationid, startdate, enddate,interval);
+            List<List<PhotovoltaicInfo>> datas = getDatas(stationid, startdate, enddate, interval);
             //遍历逆变器
             for (List<PhotovoltaicInfo> data : datas) {
 
@@ -471,9 +520,9 @@ public class NewIvPvCurveFittingService {
      *
      * @return 逆变器,列表
      */
-    public List<List<PhotovoltaicInfo>> getDatas(String stationid, long start, long end ,int interval) {
+    public List<List<PhotovoltaicInfo>> getDatas(String stationid, long start, long end, int interval) {
         //间隔
-         interval = 5 * 60; //5分钟-300
+        interval = 5 * 60; //5分钟-300
 
         //获得测点
         Map<String, String> zglpoints = getPoints(stationid, "zgl");
@@ -488,18 +537,18 @@ public class NewIvPvCurveFittingService {
         List<ProBasicWeatherStation> weatherStations = weatherStationService.getBaseMapper().selectList(null);
         List<ProBasicWeatherStation> collect = weatherStations.stream().filter(c -> stationid.equals(c.getWindpowerstationId())).collect(Collectors.toList());
 
-        String station= collect.get(0).getId();
+        String station = collect.get(0).getId();
 
         ProBasicPowerstationPoint zfsPoint = InitialRunner.newzfsMap.get(stationid);
         ProBasicPowerstationPoint zjwdPoint = InitialRunner.newzjwdMap.get(station);
 
         //总辐射
-//        List<TsDoubleData> zfsDatas = adpClient.getHistorySnap(zfsPoint.getNemCode(), start, end, interval);
+        //        List<TsDoubleData> zfsDatas = adpClient.getHistorySnap(zfsPoint.getNemCode(), start, end, interval);
 
         List<TsDoubleData> zfsDatas = remoteService.adapterfd().getHistorySnap(zfsPoint.getNemCode(), start, end, interval);
 
         //组件温度
-//        List<TsDoubleData> zjwdDatas = adpClient.getHistorySnap(zjwdPoint.getNemCode(), start, end, interval);
+        //        List<TsDoubleData> zjwdDatas = adpClient.getHistorySnap(zjwdPoint.getNemCode(), start, end, interval);
 
         List<TsDoubleData> zjwdDatas = remoteService.adaptergf().getHistorySnap(zjwdPoint.getNemCode(), start, end, interval);
 
@@ -508,15 +557,15 @@ public class NewIvPvCurveFittingService {
         for (String wtid : zglpoints.keySet()) {
 
             //总功率
-//            List<TsDoubleData> zglDatas = adpClient.getHistorySnap(zglpoints.get(wtid), start, end, interval);
+            //            List<TsDoubleData> zglDatas = adpClient.getHistorySnap(zglpoints.get(wtid), start, end, interval);
             List<TsDoubleData> zglDatas = remoteService.adaptergf().getHistorySnap(zglpoints.get(wtid), start, end, interval);
             List<TsDoubleData> llglDatas = remoteService.adapterfd().getHistorySnap(llglpoints.get(wtid), start, end, interval);
 
             //电网A相电压
-//            List<TsDoubleData> adyDatas = adpClient.getHistorySnap(adypoints.get(wtid), start, end, interval);
+            //            List<TsDoubleData> adyDatas = adpClient.getHistorySnap(adypoints.get(wtid), start, end, interval);
             List<TsDoubleData> adyDatas = remoteService.adaptergf().getHistorySnap(adypoints.get(wtid), start, end, interval);
             //电网A相电流
-//            List<TsDoubleData> adlDatas = adpClient.getHistorySnap(adlpoints.get(wtid), start, end, interval);
+            //            List<TsDoubleData> adlDatas = adpClient.getHistorySnap(adlpoints.get(wtid), start, end, interval);
             List<TsDoubleData> adlDatas = remoteService.adaptergf().getHistorySnap(adlpoints.get(wtid), start, end, interval);
 
             List<PhotovoltaicInfo> infos = new ArrayList<>();
@@ -551,25 +600,25 @@ public class NewIvPvCurveFittingService {
                     info.setBV(double3Decimal(bdyDatas.get(j).getDoubleValue(), true));
                     info.setCV(double3Decimal(cdyDatas.get(j).getDoubleValue(), true));
                 } else {
-                    if (adlDatas.size()>=1) {
+                    if (adlDatas.size() >= 1) {
                         info.setI(double3Decimal(adlDatas.get(j).getDoubleValue(), false));
-                    }else {
+                    } else {
                         info.setI(0);
                     }
-                    if (adyDatas.size()>=1) {
+                    if (adyDatas.size() >= 1) {
                         info.setV(double3Decimal(adyDatas.get(j).getDoubleValue(), true));
-                    }else {
+                    } else {
                         info.setV(0);
                     }
                 }
-                if (zglDatas.size()>=1) {
+                if (zglDatas.size() >= 1) {
                     info.setActualP(double3Decimal(zglDatas.get(j).getDoubleValue(), false));
-                }else {
+                } else {
                     info.setActualP(0);
                 }
-                if (llglDatas.size()>=1) {
+                if (llglDatas.size() >= 1) {
                     info.setIdeaP(double3Decimal(llglDatas.get(j).getDoubleValue(), false));
-                }else {
+                } else {
                     info.setIdeaP(0);
                 }
                 infos.add(info);
@@ -602,10 +651,10 @@ public class NewIvPvCurveFittingService {
         switch (key) {
             case "zgl":
                 //总功率
-                return InitialRunner.newzglMap.get(stationid).stream().filter(c->!c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                return InitialRunner.newzglMap.get(stationid).stream().filter(c -> !c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
             case "llgl":
                 //总功率
-                return InitialRunner.newllglMap.get(stationid).stream().filter(c->!c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                return InitialRunner.newllglMap.get(stationid).stream().filter(c -> !c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
 
             case "ady":
                 List<ProBasicEquipmentPoint> adyPoints = null;
@@ -617,22 +666,22 @@ public class NewIvPvCurveFittingService {
                     adyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG005");
                 }
 
-                return adyPoints.stream().filter(c->!c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                return adyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
             case "bdy":
                 List<ProBasicEquipmentPoint> bdyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG008");
-                return bdyPoints.stream().filter(c->!c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                return bdyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
             case "cdy":
                 List<ProBasicEquipmentPoint> cdyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG011");
-                return cdyPoints.stream().filter(c->!c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                return cdyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
             case "adl":
                 List<ProBasicEquipmentPoint> adlPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG004");
-                return adlPoints.stream().filter(c->!c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                return adlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
             case "bdl":
                 List<ProBasicEquipmentPoint> bdlPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG007");
-                return bdlPoints.stream().filter(c->!c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                return bdlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
             case "cdl":
                 List<ProBasicEquipmentPoint> cdlPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG010");
-                return cdlPoints.stream().filter(c->!c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                return cdlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
         }
         return new HashMap<>();
     }
@@ -677,7 +726,6 @@ public class NewIvPvCurveFittingService {
     }
 
 
-
     public List<ProBasicEquipment> wtByWplist(String wpids) {
         List<ProBasicEquipment> equipmentList = InitialRunner.newgfwtList.stream()
                 .filter(oe -> wpids.contains(oe.getWindpowerstationId()))
@@ -689,6 +737,7 @@ public class NewIvPvCurveFittingService {
 
     /**
      * 通过大点的key获取小散点
+     *
      * @param yk
      * @param wk
      * @return
@@ -696,15 +745,15 @@ public class NewIvPvCurveFittingService {
     public List<PhotovoltaicInfo> dataOrigin(String yk, String wk) {
         List<PhotovoltaicInfo> list = new ArrayList<>();
 
-        if (!StringUtils.isEmpty(yk)){
+        if (!StringUtils.isEmpty(yk)) {
             String[] key = yk.split(",");
-            for (String k : key){
+            for (String k : key) {
                 list.addAll(dataScangfService.getMapYY().get(k));
             }
         }
-        if (!StringUtils.isEmpty(wk)){
+        if (!StringUtils.isEmpty(wk)) {
             String[] kew = wk.split(",");
-            for (String k : kew){
+            for (String k : kew) {
                 list.addAll(dataScangfService.getMapWY().get(k));
             }
         }