Browse Source

离散率和光伏拟合无文件

xushili 1 year ago
parent
commit
4a9a316933
17 changed files with 1330 additions and 140 deletions
  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 +
+                "}";
+    }
+}

File diff suppressed because it is too large
+ 713 - 0
benchmarking-impala/src/main/java/com/gyee/benchmarkingimpala/service/EconomyAnalysisService.java


+ 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));
             }
         }