Browse Source

Merge remote-tracking branch 'origin/master'

Koishi 1 năm trước cách đây
mục cha
commit
bfbcef7bfb
49 tập tin đã thay đổi với 5139 bổ sung635 xóa
  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. 6 0
      power-fitting-JN/pom.xml
  15. 4 4
      power-fitting-JN/src/main/java/com.gyee.power.fitting/MapperGenerator.java
  16. 87 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/CharsetKit.java
  17. 1015 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/Convert.java
  18. 2 1
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/GyeeConfig.java
  19. 36 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/R.java
  20. 16 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/ResultCode.java
  21. 96 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/ResultMsg.java
  22. 94 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/StrFormatter.java
  23. 478 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/StringUtils.java
  24. 11 2
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/feign/RemoteServiceBuilder.java
  25. 73 1
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/spring/InitialRunner.java
  26. 303 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/NewPhotovoltaicController.java
  27. 167 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/PhotovoltaicController.java
  28. 21 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/ProBasicWeatherStationController.java
  29. 26 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/dispersionanalysis/InverterData.java
  30. 112 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/dispersionanalysis/InverterPowerAnalysis.java
  31. 16 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/ProBasicWeatherStationMapper.java
  32. 87 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/ProBasicWeatherStation.java
  33. 13 11
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/custom/PhotovoltaicInfo.java
  34. 4 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicEquipmentPointService.java
  35. 3 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicEquipmentService.java
  36. 6 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicPowerstationPointService.java
  37. 4 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicPowerstationService.java
  38. 16 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicWeatherStationService.java
  39. 1 1
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/curve/DataPrepareService.java
  40. 21 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/curve/DataScangfService.java
  41. 1 1
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/curve/NewDataFittingService.java
  42. 561 561
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/IvPvCurveFittingService.java
  43. 763 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/NewIvPvCurveFittingService.java
  44. 22 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicEquipmentPointServiceImpl.java
  45. 18 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicEquipmentServiceImpl.java
  46. 32 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicPowerstationPointServiceImpl.java
  47. 19 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicPowerstationServiceImpl.java
  48. 20 0
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicWeatherStationServiceImpl.java
  49. 2 1
      power-fitting-JN/src/main/resources/application.yaml

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

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 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);
     }
 
     /**

+ 6 - 0
power-fitting-JN/pom.xml

@@ -122,6 +122,12 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>1.6.2</version>
+            <scope>compile</scope>
+        </dependency>
 
     </dependencies>
 

+ 4 - 4
power-fitting-JN/src/main/java/com.gyee.power.fitting/MapperGenerator.java

@@ -25,9 +25,9 @@ public class MapperGenerator {
     //基本包名
     private static String basePackage = "com.gyee.power.fitting";
     //作者
-    private static String authorName = "chenmh";
+    private static String authorName = "wang";
     //要生成的表名
-    private static String[] tables = {"windpowerstation", "windturbine", "windturbinetestingpointai"};
+    private static String[] tables = {"pro_basic_weather_station"};
     //table前缀
     private static String prefix = "";
 
@@ -40,8 +40,8 @@ public class MapperGenerator {
 //    private static String password = "";
 
     private static String driverName = "org.postgresql.Driver";
-    private static String url = "jdbc:postgresql://10.81.3.151:5432/wisdom";
-    private static String username = "gdprod";
+    private static String url = "jdbc:postgresql://10.81.3.151:5432/IMS_NEM_JN";
+    private static String username = "postgres";
     private static String password = "gd123";
 
 //    private static String driverName = "oracle.jdbc.driver.OracleDriver";

+ 87 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/CharsetKit.java

@@ -0,0 +1,87 @@
+package com.gyee.power.fitting.common.config;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 字符集工具类
+ * 
+ * @author fc
+ *
+ */
+public class CharsetKit
+{
+    /** ISO-8859-1 */
+    public static final String ISO_8859_1 = "ISO-8859-1";
+    /** UTF-8 */
+    public static final String UTF_8 = "UTF-8";
+    /** GBK */
+    public static final String GBK = "GBK";
+
+    /** ISO-8859-1 */
+    public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
+    /** UTF-8 */
+    public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
+    /** GBK */
+    public static final Charset CHARSET_GBK = Charset.forName(GBK);
+
+    /**
+     * 转换为Charset对象
+     * 
+     * @param charset 字符集,为空则返回默认字符集
+     * @return Charset
+     */
+    public static Charset charset(String charset)
+    {
+        return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     * 
+     * @param source 字符串
+     * @param srcCharset 源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, String srcCharset, String destCharset)
+    {
+        return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     * 
+     * @param source 字符串
+     * @param srcCharset 源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, Charset srcCharset, Charset destCharset)
+    {
+        if (null == srcCharset)
+        {
+            srcCharset = StandardCharsets.ISO_8859_1;
+        }
+
+        if (null == destCharset)
+        {
+            srcCharset = StandardCharsets.UTF_8;
+        }
+
+        if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
+        {
+            return source;
+        }
+        return new String(source.getBytes(srcCharset), destCharset);
+    }
+
+    /**
+     * @return 系统字符集编码
+     */
+    public static String systemCharset()
+    {
+        return Charset.defaultCharset().name();
+    }
+
+}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1015 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/Convert.java


+ 2 - 1
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/GyeeConfig.java

@@ -28,7 +28,8 @@ public class GyeeConfig {
     }
 
     /** 数据适配器网址 **/
-    private String adapterUrl;
+    private String adapterfdUrl;
+    private String adaptergfUrl;
     /** 数据准备保存路径(原始数据) **/
     private String filePathPrepare;
     /** 数据处理保存路径(处理后的数据) **/

+ 36 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/R.java

@@ -0,0 +1,36 @@
+package com.gyee.power.fitting.common.config;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @ClassName : R
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 16:59
+ * @Description : 结果集
+ */
+@Data
+public class R {
+
+    @ApiModelProperty(value = "返回码")
+    private Integer code;
+    @ApiModelProperty(value = "返回数据")
+    private ResultMsg data = new ResultMsg();
+
+    private R(){}
+
+    public static R error(ResultMsg error){
+        R r = new R();
+        r.setData(error);
+        r.setCode(ResultCode.ERROR1);
+        return r;
+    }
+
+    public static R data(ResultMsg ok) {
+
+        R r = new R();
+        r.setCode(ResultCode.SUCCESS0);
+        r.setData(ok);
+        return r;
+    }
+}

+ 16 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/ResultCode.java

@@ -0,0 +1,16 @@
+package com.gyee.power.fitting.common.config;
+
+/**
+ * @ClassName : ResultCode
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 17:01
+ * @Description : 结果状态
+ */
+public class ResultCode {
+    public static Integer SUCCESS = 200;
+    public static Integer ERROR = 500;
+
+    public static Integer SUCCESS0 = 0;
+    public static Integer ERROR1 = -1;
+
+}

+ 96 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/ResultMsg.java

@@ -0,0 +1,96 @@
+package com.gyee.power.fitting.common.config;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @ClassName : R
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 16:59
+ * @Description : 结果集
+ */
+@Data
+public class ResultMsg {
+    @ApiModelProperty(value = "是否成功")
+    private Boolean success;
+    @ApiModelProperty(value = "返回码")
+    private Integer code;
+    @ApiModelProperty(value = "返回消息")
+    private String message;
+    @ApiModelProperty(value = "总数量")
+    private Integer count;
+    @ApiModelProperty(value = "返回数据")
+    private Object data = new Object();
+
+    public ResultMsg(){}
+    public static ResultMsg ok(){
+        ResultMsg r = new ResultMsg();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setMessage("成功");
+        return r;
+    }
+
+
+    public static ResultMsg ok(Object data ){
+        ResultMsg r = new ResultMsg();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setData(data);
+        r.setMessage("成功");
+        return r;
+    }
+
+    public static ResultMsg ok(Object data,Integer count ){
+        ResultMsg r = new ResultMsg();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setData(data);
+        r.setMessage("成功");
+        r.setCount(count);
+        return r;
+    }
+
+
+    public static ResultMsg ok(Integer count){
+        ResultMsg r = new ResultMsg();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setMessage("成功");
+        r.setCount(count);
+        return r;
+    }
+    public static ResultMsg error(){
+        ResultMsg r = new ResultMsg();
+        r.setSuccess(false);
+        r.setCode(ResultCode.ERROR);
+        r.setMessage("失败");
+        return r;
+    }
+
+
+    public ResultMsg success(Boolean success){
+        this.setSuccess(success);
+        return this;
+    }
+    public ResultMsg message(String message){
+        this.setMessage(message);
+        return this;
+    }
+    public static ResultMsg errorMsg(String msg){
+        ResultMsg r = new ResultMsg();
+        r.setSuccess(false);
+        r.setCode(ResultCode.ERROR);
+        r.setMessage(msg);
+        return r;
+    }
+    public ResultMsg code(Integer code){
+        this.setCode(code);
+        return this;
+    }
+
+    public  ResultMsg data(Object value){
+        this.setData(value);
+        return this;
+    }
+}

+ 94 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/StrFormatter.java

@@ -0,0 +1,94 @@
+package com.gyee.power.fitting.common.config;
+
+
+/**
+ * 字符串格式化
+ * 
+ * @author fc
+ */
+public class StrFormatter
+{
+
+    public static final String EMPTY_JSON = "{}";
+    public static final char C_BACKSLASH = '\\';
+    public static final char C_DELIM_START = '{';
+    public static final char C_DELIM_END = '}';
+
+    /**
+     * 格式化字符串<br>
+     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
+     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
+     * 例:<br>
+     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
+     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
+     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
+     * 
+     * @param strPattern 字符串模板
+     * @param argArray 参数列表
+     * @return 结果
+     */
+    public static String format(final String strPattern, final Object... argArray)
+    {
+        if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray))
+        {
+            return strPattern;
+        }
+        final int strPatternLength = strPattern.length();
+
+        // 初始化定义好的长度以获得更好的性能
+        StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
+
+        int handledPosition = 0;
+        int delimIndex;// 占位符所在位置
+        for (int argIndex = 0; argIndex < argArray.length; argIndex++)
+        {
+            delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
+            if (delimIndex == -1)
+            {
+                if (handledPosition == 0)
+                {
+                    return strPattern;
+                }
+                else
+                { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
+                    sbuf.append(strPattern, handledPosition, strPatternLength);
+                    return sbuf.toString();
+                }
+            }
+            else
+            {
+                if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
+                {
+                    if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
+                    {
+                        // 转义符之前还有一个转义符,占位符依旧有效
+                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
+                        sbuf.append(Convert.utf8Str(argArray[argIndex]));
+                        handledPosition = delimIndex + 2;
+                    }
+                    else
+                    {
+                        // 占位符被转义
+                        argIndex--;
+                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
+                        sbuf.append(C_DELIM_START);
+                        handledPosition = delimIndex + 1;
+                    }
+                }
+                else
+                {
+                    // 正常占位符
+                    sbuf.append(strPattern, handledPosition, delimIndex);
+                    sbuf.append(Convert.utf8Str(argArray[argIndex]));
+                    handledPosition = delimIndex + 2;
+                }
+            }
+        }
+        // append the characters following the last {} pair.
+        // 加入最后一个占位符后所有的字符
+        sbuf.append(strPattern, handledPosition, strPattern.length());
+
+        return sbuf.toString();
+    }
+
+}

+ 478 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/config/StringUtils.java

@@ -0,0 +1,478 @@
+package com.gyee.power.fitting.common.config;
+
+
+
+import org.apache.commons.lang3.text.StrBuilder;
+import org.apache.commons.lang3.text.WordUtils;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Collection;
+import java.util.Map;
+import java.util.UUID;
+
+
+/**
+ * 字符串工具类
+ * 
+ * @author fc
+ */
+public class StringUtils extends org.apache.commons.lang3.StringUtils
+{
+    /** 空字符串 */
+    private static final String NULLSTR = "";
+
+    /** 下划线 */
+    private static final char SEPARATOR = '_';
+
+    /**
+     * 获取参数不为空值
+     * 
+     * @param value defaultValue 要判断的value
+     * @return value 返回值
+     */
+    public static <T> T nvl(T value, T defaultValue)
+    {
+        return value != null ? value : defaultValue;
+    }
+
+    /**
+     * * 判断一个Collection是否为空, 包含List,Set,Queue
+     * 
+     * @param coll 要判断的Collection
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Collection<?> coll)
+    {
+        return isNull(coll) || coll.isEmpty();
+    }
+
+    /**
+     * * 判断一个Collection是否非空,包含List,Set,Queue
+     * 
+     * @param coll 要判断的Collection
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Collection<?> coll)
+    {
+        return !isEmpty(coll);
+    }
+
+    /**
+     * * 判断一个对象数组是否为空
+     * 
+     * @param objects 要判断的对象数组
+     ** @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Object[] objects)
+    {
+        return isNull(objects) || (objects.length == 0);
+    }
+
+    /**
+     * * 判断一个对象数组是否非空
+     * 
+     * @param objects 要判断的对象数组
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Object[] objects)
+    {
+        return !isEmpty(objects);
+    }
+
+    /**
+     * * 判断一个Map是否为空
+     * 
+     * @param map 要判断的Map
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Map<?, ?> map)
+    {
+        return isNull(map) || map.isEmpty();
+    }
+
+    /**
+     * * 判断一个Map是否为空
+     * 
+     * @param map 要判断的Map
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Map<?, ?> map)
+    {
+        return !isEmpty(map);
+    }
+
+    /**
+     * * 判断一个字符串是否为空串
+     * 
+     * @param str String
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(String str)
+    {
+        return isNull(str) || NULLSTR.equals(str.trim());
+    }
+
+    /**
+     * * 判断一个字符串是否为非空串
+     * 
+     * @param str String
+     * @return true:非空串 false:空串
+     */
+    public static boolean isNotEmpty(String str)
+    {
+        return !isEmpty(str);
+    }
+
+    /**
+     * * 判断一个对象是否为空
+     * 
+     * @param object Object
+     * @return true:为空 false:非空
+     */
+    public static boolean isNull(Object object)
+    {
+        return object == null;
+    }
+
+    /**
+     * * 判断一个对象是否非空
+     * 
+     * @param object Object
+     * @return true:非空 false:空
+     */
+    public static boolean isNotNull(Object object)
+    {
+        return !isNull(object);
+    }
+
+    /**
+     * * 判断一个对象是否是数组类型(Java基本型别的数组)
+     * 
+     * @param object 对象
+     * @return true:是数组 false:不是数组
+     */
+    public static boolean isArray(Object object)
+    {
+        return isNotNull(object) && object.getClass().isArray();
+    }
+
+    /**
+     * 去空格
+     */
+    public static String trim(String str)
+    {
+        return (str == null ? "" : str.trim());
+    }
+
+    /**
+     * 截取字符串
+     * 
+     * @param str 字符串
+     * @param start 开始
+     * @return 结果
+     */
+    public static String substring(final String str, int start)
+    {
+        if (str == null)
+        {
+            return NULLSTR;
+        }
+
+        if (start < 0)
+        {
+            start = str.length() + start;
+        }
+
+        if (start < 0)
+        {
+            start = 0;
+        }
+        if (start > str.length())
+        {
+            return NULLSTR;
+        }
+
+        return str.substring(start);
+    }
+
+    /**
+     * 截取字符串
+     * 
+     * @param str 字符串
+     * @param start 开始
+     * @param end 结束
+     * @return 结果
+     */
+    public static String substring(final String str, int start, int end)
+    {
+        if (str == null)
+        {
+            return NULLSTR;
+        }
+
+        if (end < 0)
+        {
+            end = str.length() + end;
+        }
+        if (start < 0)
+        {
+            start = str.length() + start;
+        }
+
+        if (end > str.length())
+        {
+            end = str.length();
+        }
+
+        if (start > end)
+        {
+            return NULLSTR;
+        }
+
+        if (start < 0)
+        {
+            start = 0;
+        }
+        if (end < 0)
+        {
+            end = 0;
+        }
+
+        return str.substring(start, end);
+    }
+
+    /**
+     * 格式化文本, {} 表示占位符<br>
+     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
+     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
+     * 例:<br>
+     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
+     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
+     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
+     * 
+     * @param template 文本模板,被替换的部分用 {} 表示
+     * @param params 参数值
+     * @return 格式化后的文本
+     */
+    public static String format(String template, Object... params)
+    {
+        if (isEmpty(params) || isEmpty(template))
+        {
+            return template;
+        }
+        return StrFormatter.format(template, params);
+    }
+
+    /**
+     * 驼峰首字符小写 NameVc>>nameVc
+     */
+    public static String uncapitalize(String str)
+    {
+        int strLen;
+        if (str == null || (strLen = str.length()) == 0)
+        {
+            return str;
+        }
+        return new StrBuilder(strLen).append(Character.toLowerCase(str.charAt(0))).append(str.substring(1)).toString();
+    }
+    
+
+    /**
+     * 下划线转驼峰命名 nameVc>>name_vc
+     */
+    public static String toUnderScoreCase(String s)
+    {
+        if (s == null)
+        {
+            return null;
+        }
+        StringBuilder sb = new StringBuilder();
+        boolean upperCase = false;
+        for (int i = 0; i < s.length(); i++)
+        {
+            char c = s.charAt(i);
+
+            boolean nextUpperCase = true;
+
+            if (i < (s.length() - 1))
+            {
+                nextUpperCase = Character.isUpperCase(s.charAt(i + 1));
+            }
+
+            if ((i > 0) && Character.isUpperCase(c))
+            {
+                if (!upperCase || !nextUpperCase)
+                {
+                    sb.append(SEPARATOR);
+                }
+                upperCase = true;
+            }
+            else
+            {
+                upperCase = false;
+            }
+
+            sb.append(Character.toLowerCase(c));
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * 是否包含字符串
+     * 
+     * @param str 验证字符串
+     * @param strs 字符串组
+     * @return 包含返回true
+     */
+    public static boolean inStringIgnoreCase(String str, String... strs)
+    {
+        if (str != null && strs != null)
+        {
+            for (String s : strs)
+            {
+                if (str.equalsIgnoreCase(trim(s)))
+                {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+    
+    /**
+     * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
+     * 
+     * @param name 转换前的下划线大写方式命名的字符串
+     * @return 转换后的驼峰式命名的字符串
+     */
+    public static String convertToCamelCase(String name)
+    {
+        StringBuilder result = new StringBuilder();
+        // 快速检查
+        if (name == null || name.isEmpty())
+        {
+            // 没必要转换
+            return "";
+        }
+        else if (!name.contains("_"))
+        {
+            // 不含下划线,仅将首字母大写
+            return name.substring(0, 1).toUpperCase() + name.substring(1);
+        }
+        // 用下划线将原始字符串分割
+        String[] camels = name.split("_");
+        for (String camel : camels)
+        {
+            // 跳过原始字符串中开头、结尾的下换线或双重下划线
+            if (camel.isEmpty())
+            {
+                continue;
+            }
+            // 首字母大写
+            result.append(camel.substring(0, 1).toUpperCase());
+            result.append(camel.substring(1).toLowerCase());
+        }
+        return result.toString();
+    }
+    /**
+     * 首字母大写
+     *
+     * @param name
+     * @return
+     */
+    public static String firstUpperCase(String name) {
+        name = name.substring(0, 1).toUpperCase() + name.substring(1);
+        return name;
+    }
+    /**
+     * 首字母小写
+     *
+     * @param name
+     * @return
+     */
+    public static String firstLowerCase(String name) {
+        name = name.substring(0, 1).toLowerCase() + name.substring(1);
+        return name;
+
+    }
+    
+    /**
+     * 将下划线转化为大写
+     *
+     * @param name
+     * @param firstCase 首字母是否大写 true:大写 false;小写
+     * @return
+     */
+    public static String upperCase_(String name, boolean firstCase) {
+        if(isEmpty(name)){
+            return "";
+        }
+        String[] s = name.split("_");
+        StringBuffer stringBuffer = new StringBuffer();
+        for (String s1 : s) {
+            stringBuffer.append(s1.substring(0, 1).toUpperCase() + s1.substring(1));
+        }
+        if(!firstCase){
+            return firstLowerCase(stringBuffer.toString());
+        }
+        return stringBuffer.toString();
+    }
+
+    
+
+    /**
+     * 列名转换成Java属性名
+     */
+    public static String columnToJava(String columnName) {
+        return WordUtils.capitalizeFully(columnName, new char[]{'_'}).replace("_", "" );
+    }
+    /**
+     * 表名转换成Java类名
+     */
+    public static String tableToJava(String tableName, String tablePrefix) {
+        if (StringUtils.isNotBlank(tablePrefix)) {
+            tableName = tableName.replaceFirst(tablePrefix, "" );
+        }
+        return columnToJava(tableName);
+    }
+
+    public static double round(double num, int digit) {
+
+        return new BigDecimal(num).setScale(digit, RoundingMode.HALF_UP).doubleValue();
+    }
+
+    public static String getUUID(){
+        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
+        return uuid;
+    }
+
+    /**
+     * 是否为空串
+     *
+     * @param obj
+     * @return
+     */
+    public static boolean empty(Object obj) {
+        if (obj == null)
+            return true;
+        String str;
+        if (obj instanceof String) {
+            str = (String) obj;
+        } else {
+            str = obj.toString();
+        }
+        return str.length() == 0;
+    }
+
+    /**
+     * 是否不为空串
+     *
+     * @param obj
+     * @return
+     */
+    public static boolean notEmp(Object obj) {
+        return !empty(obj);
+    }
+}

+ 11 - 2
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/feign/RemoteServiceBuilder.java

@@ -20,12 +20,21 @@ public class RemoteServiceBuilder {
     private GyeeConfig config;
 
     @Bean
-    public IAdapterService adapter() {
+    public IAdapterService adapterfd() {
         return Feign.builder()
                 .encoder(new JacksonEncoder())
                 .decoder(new JacksonDecoder())
                 .options(new Request.Options(5000, 600000))
                 .retryer(new Retryer.Default(10000, 10000, 3))
-                .target(IAdapterService.class, config.getAdapterUrl());
+                .target(IAdapterService.class, config.getAdapterfdUrl());
+    }
+
+    public IAdapterService adaptergf() {
+        return Feign.builder()
+                .encoder(new JacksonEncoder())
+                .decoder(new JacksonDecoder())
+                .options(new Request.Options(5000, 600000))
+                .retryer(new Retryer.Default(10000, 10000, 3))
+                .target(IAdapterService.class, config.getAdaptergfUrl());
     }
 }

+ 73 - 1
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/spring/InitialRunner.java

@@ -3,6 +3,7 @@ package com.gyee.power.fitting.common.spring;
 import com.gyee.power.fitting.common.config.GyeeConfig;
 import com.gyee.power.fitting.model.*;
 import com.gyee.power.fitting.service.*;
+import com.gyee.power.fitting.service.impl.NewIvPvCurveFittingService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.boot.CommandLineRunner;
@@ -35,6 +36,9 @@ public class InitialRunner implements CommandLineRunner {
     private WindpowerstationService windpowerstationService;
     @Resource
     private Windturbinetestingpointai2Service pointService;
+
+    @Resource
+    private ProBasicEquipmentPointService pointService1;
     @Resource
     private EquipmentmodelService equipmentmodelService;
     @Resource
@@ -42,6 +46,9 @@ public class InitialRunner implements CommandLineRunner {
     @Resource
     private PowermodelService powermodelService;
 
+    @Resource
+    private NewIvPvCurveFittingService ipcfService;
+
 
     /**
      * 场站所有信息
@@ -63,6 +70,7 @@ public class InitialRunner implements CommandLineRunner {
      **/
     public static Map<String, Windturbine> wtMap = new HashMap<>();
 
+
     /**场站的风机  key:NSS_FDC**/
     public static Map<String, List<Windturbine>> wpMap = new HashMap<>();
 
@@ -121,6 +129,9 @@ public class InitialRunner implements CommandLineRunner {
     @Resource
     private ProBasicEquipmentPointService proBasicEquipmentPointService;
 
+
+    @Resource
+    private ProBasicPowerstationPointService proBasicPowerstationPointService;
     @Resource
     private ProEconEquipmentmodelService proEconEquipmentmodelService;
 
@@ -191,7 +202,33 @@ public class InitialRunner implements CommandLineRunner {
     /** key: NG01_01, speed, power**/
     public static Map<String, Map<Double, Double>> zsllglNewMap = new HashMap<>();
 
+    /**
+     * 功率-场站
+     */
+    public static Map<String, List<ProBasicEquipmentPoint>> newzglMap = new HashMap<>();
+    public static Map<String, List<ProBasicEquipmentPoint>> newllglMap = new HashMap<>();
+
+    public static Map<String, ProBasicPowerstationPoint> newzjwdMap = new HashMap<>();
+
+    public static Map<String, ProBasicPowerstationPoint> newzfsMap = new HashMap<>();
+
+    public static Map<String, ProBasicEquipment> newwtMap = new HashMap<>();
+    public static List<ProBasicPowerstation> newwpList = new ArrayList<>();
+
+    public static List<ProBasicEquipment> newwtList = new ArrayList<>();
 
+    public static Map<String, List<ProBasicEquipment>> newwpMap = new HashMap<>();
+    public static List<ProBasicPowerstation> newgfwpList = new ArrayList<>();
+
+    public static Map<String, String> newstationMap = new HashMap<>();
+
+    public static Map<String, String> newgfstationMap = new HashMap<>();
+
+    public static Map<String, List<ProBasicEquipment>> newgfwpMap = new HashMap<>();
+
+    public static List<ProBasicEquipment> newgfwtList = new ArrayList<>();
+
+    public static Map<String, ProBasicEquipment> newgfwtMap = new HashMap<>();
     //---------------------------------------------------------------------------------
 
 
@@ -216,7 +253,8 @@ public class InitialRunner implements CommandLineRunner {
 //            }
 //        }.start();
 
-
+        newcacheStation();
+        cachePhotovoltaicInfo();
         cacheNewStation();
         cacheNewPoints();
         cacheNewEquipment();
@@ -229,6 +267,29 @@ public class InitialRunner implements CommandLineRunner {
      * 缓存场站、风机数据
      * 数据新增或删除后需要更新,故每次清空
      */
+    public void newcacheStation() {
+        List<ProBasicPowerstation> stations = proBasicPowerstationService.selectList();
+        newwpList = stations.stream().filter(f -> f.getId().contains("FDC_STA")).collect(Collectors.toList());
+        newgfwpList = stations.stream().filter(f -> f.getId().contains("GDC_STA")).collect(Collectors.toList());
+        newwpList.forEach(obj -> {
+            List<ProBasicEquipment> wts = proBasicEquipmentService.selectList(obj.getId());
+            newstationMap.put(obj.getId(), obj.getName());
+            newwpMap.put(obj.getId(), wts);
+            newwtList.addAll(wts);
+
+            wts.forEach(u -> newwtMap.put(u.getId(), u));
+        });
+        newgfwpList.stream().forEach(obj -> {
+            List<ProBasicEquipment> wts = proBasicEquipmentService.selectList(obj.getId());
+            newgfstationMap.put(obj.getId(), obj.getName());
+            newgfwpMap.put(obj.getId(), wts);
+            newgfwtList.addAll(wts);
+
+            wts.stream().forEach(u -> newgfwtMap.put(u.getId(), u));
+        });
+        log.info("场站数据缓存完成");
+    }
+
     public void cacheStation() {
         List<Windpowerstation> stations = windpowerstationService.selectList();
         wpList = stations.stream().filter(f -> f.getId().contains("FDC")).collect(Collectors.toList());
@@ -272,7 +333,18 @@ public class InitialRunner implements CommandLineRunner {
     }
 
 
+    private void cachePhotovoltaicInfo() {
+        List<ProBasicPowerstationPoint> zfsPoints = proBasicPowerstationPointService.getzfsPoints("GDC", ipcfService.getUniforcodes().get("光照强度"));
+        List<ProBasicPowerstationPoint> zjwdPoints = proBasicPowerstationPointService.getzjwdPoints("GDC", ipcfService.getUniforcodes().get("组件温度"));
+
+        newzfsMap = zfsPoints.stream().collect(Collectors.toMap(ProBasicPowerstationPoint::getWindpowerstationId, Function.identity()));
+        newzjwdMap = zjwdPoints.stream().collect(Collectors.toMap(ProBasicPowerstationPoint::getWindpowerstationId, Function.identity()));
+        List<ProBasicEquipmentPoint> zglPoints = pointService1.getPoints("GDC", null, ipcfService.getUniforcodes().get("功率"));
+        newzglMap = zglPoints.stream().collect(Collectors.groupingBy(ProBasicEquipmentPoint::getWindpowerstationId));
 
+        List<ProBasicEquipmentPoint> llglPoints = pointService1.getPoints("GDC", null, ipcfService.getUniforcodes().get("理论功率"));
+        newllglMap = llglPoints.stream().collect(Collectors.groupingBy(ProBasicEquipmentPoint::getWindpowerstationId));
+    }
 
     /**
      * 缓存测点数据

+ 303 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/NewPhotovoltaicController.java

@@ -0,0 +1,303 @@
+package com.gyee.power.fitting.controller.gf;
+
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.power.fitting.common.config.R;
+import com.gyee.power.fitting.common.config.ResultMsg;
+import com.gyee.power.fitting.common.config.StringUtils;
+import com.gyee.power.fitting.common.result.JsonResult;
+import com.gyee.power.fitting.common.result.ResultCode;
+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.TableTitle;
+import com.gyee.power.fitting.service.ProBasicEquipmentService;
+import com.gyee.power.fitting.service.impl.NewIvPvCurveFittingService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@RestController
+@CrossOrigin
+@RequestMapping("/photovol")
+public class NewPhotovoltaicController {
+
+
+    @Resource
+    private NewIvPvCurveFittingService curveFittingService;
+
+    @Resource
+    private ProBasicEquipmentService equipmentService;
+
+    @GetMapping("/filelist")
+    private JSONObject getFileList(
+            @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) {
+        List<String> fileList = curveFittingService.getFileList(station, inverters, startdate,interval, enddate, false);
+        if (fileList == null) {
+            try {
+                curveFittingService.getDatas2File(station, startdate, enddate,interval);
+                curveFittingService.standardPointCalculate2();
+            } catch (Exception e) {
+                return JsonResult.error(ResultCode.ERROR_FILE_NO);
+            }
+
+            fileList = curveFittingService.getFileList(station, inverters, startdate,interval, enddate, true);
+        }
+        //Map<String, Object> table = curveFittingService.getTable(fileList.get(0));
+        //table.put("filelist", fileList);
+
+        List<Object> fileLists = curveFittingService.str2FileList(fileList);
+        return JsonResult.successData(ResultCode.SUCCESS, fileLists);
+    }
+
+    @GetMapping("/allfilelist")
+    private JSONObject getFileList() {
+        List<String> fileList = curveFittingService.getAllFileList();
+        List<Object> objects = curveFittingService.str2FileList(fileList);
+        return JsonResult.successData(ResultCode.SUCCESS, objects);
+    }
+
+    /**
+     * 单文件表格显示
+     *
+     * @param filename
+     * @return
+     */
+    @GetMapping("/datas")
+    private JSONObject getDatas(@RequestParam("filename") String filename) {
+        Map<String, Object> table = curveFittingService.getTable(filename);
+        return JsonResult.successData(ResultCode.SUCCESS, table);
+    }
+
+    //功率-时间曲线,根据文件
+    @GetMapping("/analysis/powertimefile")
+    private JSONObject powerTimeFile(@RequestParam("station") String station,
+                                     @RequestParam("inverters") List<String> inverters,
+                                     @RequestParam("startdate") long startdate,
+                                     @RequestParam("interval") int interval,
+                                     @RequestParam("enddate") long enddate) {
+        List<String> fileList = curveFittingService.getFileList(station, inverters, startdate,interval, enddate, false);
+
+//        List<List<List<PhotovoltaicInfo>>> feill =   curveFittingService.getDatas2File(station, startdate, enddate,interval);
+
+        Map<String, List<PhotovoltaicInfo>> infos = curveFittingService.calculatAnalysis(fileList);
+
+        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);
+    }
+
+    @GetMapping("/gfjxb")
+    public JSONObject gfjxb(@RequestParam("startdate") long startdate,
+                            @RequestParam("enddate") long enddate,
+                            @RequestParam("interval") int interval) {
+        List<FjjxbVo> voList = curveFittingService.getPhotovoltaicPerformanceList(startdate, enddate,interval);
+        return JsonResult.successData(ResultCode.SUCCESS, voList);
+    }
+
+    //功率-光照-温度曲线
+    @PostMapping("/analysis/powerbeam")
+    private JSONObject powerBeamTemperature(@RequestParam("station") String station,
+                                            @RequestParam("inverters") List<String> inverters,
+                                            @RequestParam("startdate") long startdate,
+                                            @RequestParam("interval") int interval,
+                                            @RequestParam("enddate") long enddate) {
+
+//        List<String> strings = jsonObj2List(null);
+//        if (strings.size() > 450) return JsonResult.error(ResultCode.PARAM_NOT_VALID);
+        List<String> fileList = curveFittingService.getFileList(station, inverters, startdate,interval, enddate, false);
+        List<PhotovoltaicInfo> infos = curveFittingService.calculatFitting(fileList);
+        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);
+    }
+
+    /**
+     * 通过key获取原始数据
+     * 对应前端的圈选功能
+     * @param yk  有用点的key
+     * @param wk  无用点的key
+     * @return
+     */
+    @GetMapping("/filter")
+    public JSONObject dataFittingFilter(String yk, String wk){
+        List<PhotovoltaicInfo> list = curveFittingService.dataOrigin(yk, wk);
+        return JsonResult.successData(ResultCode.SUCCESS, list);
+    }
+
+    //文件删除
+    @DeleteMapping("/delete/files")
+    private JSONObject deleteFiles(@RequestBody JSONObject filename) {
+        List<String> strings = jsonObj2List(filename);
+        int i = curveFittingService.deleteFiles(strings);
+        return JsonResult.successData(ResultCode.SUCCESS, "共删除" + i + "个文件,删除失败" + (strings.size() - i) + "个!");
+    }
+
+    private List<String> jsonObj2List(JSONObject filename) {
+        String fn = filename.getString("filename");
+        String[] split = fn.split(",");
+        return Arrays.asList(split);
+    }
+
+    @GetMapping("/export/files")
+    private void exportFiles(HttpServletResponse response, @RequestParam("filename") String filename) {
+        String[] split = filename.split(",");
+        curveFittingService.downFiles(Arrays.asList(split), response);
+    }
+
+    @GetMapping(value = "/wtByWplist")
+    @ApiOperation(value = "风机列表", notes = "风机列表")
+    public R wtByWplist(@RequestParam(value = "wpids", required = true) String wpids) {
+
+        List<ProBasicEquipment> resultList = curveFittingService.wtByWplist(wpids);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            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) {
+
+       int interval = 300;
+        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,
+                                        @RequestParam("maxs") int maxs,
+                                        @RequestParam("mins") int mins,
+                                        @RequestParam("maxpower") int maxpower,
+                                        @RequestParam("minpower") int minpower) {
+
+        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<PhotovoltaicInfo> infosyy = infos.stream().filter(c -> c.getS() <= maxs && c.getS() >= mins &&
+                c.getActualP() <= maxpower && c.getActualP() >= minpower).collect(Collectors.toList());
+
+        List<PhotovoltaicInfo> infoswy = infos.stream()
+                .filter(c -> !(c.getS() <= maxs && c.getS() >= mins && c.getActualP() <= maxpower && c.getActualP() >= minpower))
+                .collect(Collectors.toList());
+
+        List<double[]> yyd = curveFittingService.oneFileFitting(infosyy);
+        List<double[]> wyd = curveFittingService.oneFileFitting(infoswy);
+        infosyy = infosyy.stream().filter(i -> i.getS() > 1).sorted(Comparator.comparing(PhotovoltaicInfo::getS)).collect(Collectors.toList());
+        infoswy = infoswy.stream().filter(i -> i.getS() > 1).sorted(Comparator.comparing(PhotovoltaicInfo::getS)).collect(Collectors.toList());
+
+        List<double[]> yy = new ArrayList<>();
+        for (PhotovoltaicInfo pi : infosyy) {
+
+            double[] scatter = new double[3];
+
+            scatter[0] = pi.getS();
+            scatter[1] = pi.getActualP();
+            scatter[2] = pi.getT();
+
+            yy.add(scatter);
+        }
+
+        List<double[]> wy = new ArrayList<>();
+        for (PhotovoltaicInfo pi : infoswy) {
+
+            double[] scatter = new double[3];
+
+            scatter[0] = pi.getS();
+            scatter[1] = pi.getActualP();
+            scatter[2] = pi.getT();
+
+            wy.add(scatter);
+        }
+
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("scatteryy", yy);
+        map.put("curveyy", yyd);
+        map.put("scatterwy", wy);
+        map.put("curvewy", wyd);
+
+        return JsonResult.successData(ResultCode.SUCCESS, map);
+    }
+}

+ 167 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/PhotovoltaicController.java

@@ -0,0 +1,167 @@
+//package com.gyee.power.fitting.controller.gf;
+//
+//import com.alibaba.fastjson.JSONObject;
+//import com.gyee.power.fitting.common.result.JsonResult;
+//import com.gyee.power.fitting.common.result.ResultCode;
+//import com.gyee.power.fitting.model.anno.AnnotationTool;
+//import com.gyee.power.fitting.model.anno.FixedVo;
+//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.service.impl.IvPvCurveFittingService;
+//import com.gyee.power.fitting.service.impl.NewIvPvCurveFittingService;
+//import org.springframework.web.bind.annotation.*;
+//
+//import javax.annotation.Resource;
+//import javax.servlet.http.HttpServletResponse;
+//import java.util.*;
+//import java.util.stream.Collectors;
+//
+//@RestController("/photovol")
+//public class PhotovoltaicController {
+//
+//    @Resource
+//    private AnnotationTool annotationTool;
+//    @Resource
+//    private NewIvPvCurveFittingService curveFittingService;
+//
+//    @GetMapping("/filelist")
+//    private JSONObject getFileList(@RequestParam("station") String station,
+//                                   @RequestParam("inverters") List<String> inverters,
+//                                   @RequestParam("startdate") long startdate,
+//                                   @RequestParam("enddate") long enddate) {
+//        List<String> fileList = curveFittingService.getFileList(station, inverters, startdate, enddate, false);
+//        if (fileList == null) {
+//            try {
+//                curveFittingService.getDatas2File(station, startdate, enddate);
+//                curveFittingService.standardPointCalculate2();
+//            } catch (Exception e) {
+//                return JsonResult.error(ResultCode.ERROR_FILE_NO);
+//            }
+//
+//            fileList = curveFittingService.getFileList(station, inverters, startdate, enddate, true);
+//        }
+//        //Map<String, Object> table = curveFittingService.getTable(fileList.get(0));
+//        //table.put("filelist", fileList);
+//
+//        List<Object> fileLists = curveFittingService.str2FileList(fileList);
+//        return JsonResult.successData(ResultCode.SUCCESS, fileLists);
+//    }
+//
+//    @GetMapping("/allfilelist")
+//    private JSONObject getFileList() {
+//        List<String> fileList = curveFittingService.getAllFileList();
+//        List<Object> objects = curveFittingService.str2FileList(fileList);
+//        return JsonResult.successData(ResultCode.SUCCESS, objects);
+//    }
+//
+//    /**
+//     * 单文件表格显示
+//     *
+//     * @param filename
+//     * @return
+//     */
+//    @GetMapping("/datas")
+//    private JSONObject getDatas(@RequestParam("filename") String filename) {
+//        Map<String, Object> table = curveFittingService.getTable(filename);
+//        return JsonResult.successData(ResultCode.SUCCESS, table);
+//    }
+//
+//    //功率-时间曲线,根据条件,暂时不用
+//    @GetMapping("/analysis/powertime")
+//    private JSONObject powerTimeAnalysis(@RequestParam("station") String station,
+//                                         @RequestParam("inverters") List<String> inverters,
+//                                         @RequestParam("startdate") long startdate,
+//                                         @RequestParam("enddate") long enddate) {
+//        List<String> fileList = curveFittingService.getFileList(station, inverters, startdate, enddate, true);
+//        Map<String, List<PhotovoltaicInfo>> infos = curveFittingService.calculatAnalysis(fileList);
+//
+//        List<FixedVo> fixedVos = annotationTool.getFixedVoList(PhotovoltaicInfo.class);
+//        String[] ss = {"station", "datetime", "T", "S", "actualP"};
+//        List<String> strings = Arrays.asList(ss);
+//        List<TableTitle> collect = fixedVos.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
+//        collect = collect.stream().filter(c -> strings.contains(c.getKey())).collect(Collectors.toList());
+//        TableTitle title = new TableTitle();
+//        title.setKey("ideaP");
+//        title.setDes("理论功率");
+//        collect.add(title);
+//
+//        Map<String, Object> table = new HashMap<>();
+//        table.put("title", collect);
+//        table.put("data", infos);
+//        return JsonResult.successData(ResultCode.SUCCESS, table);
+//    }
+//
+//    //功率-时间曲线,根据文件
+//    @GetMapping("/analysis/powertimefile")
+//    private JSONObject powerTimeFile(@RequestParam("filelist") List<String> fileList) {
+//        Map<String, List<PhotovoltaicInfo>> infos = curveFittingService.calculatAnalysis(fileList);
+//
+//        List<TableTitle> collect = curveFittingService.getTheoryTitel();
+//
+//        Map<String, Object> table = new HashMap<>();
+//        table.put("title", collect);
+//        table.put("data", infos);
+//        return JsonResult.successData(ResultCode.SUCCESS, table);
+//    }
+//
+//    @GetMapping("/test")
+//    private void test() {
+//        curveFittingService.standardPointCalculate2();
+//    }
+//
+//    @GetMapping("/gfjxb")
+//    public JSONObject gfjxb(@RequestParam("startdate") long startdate,
+//                            @RequestParam("enddate") long enddate) {
+//        List<FjjxbVo> voList = curveFittingService.getPhotovoltaicPerformanceList(startdate, enddate);
+//        return JsonResult.successData(ResultCode.SUCCESS, voList);
+//    }
+//
+//    //功率-光照-温度曲线
+//    @PostMapping("/analysis/powerbeam")
+//    private JSONObject powerBeamTemperature(@RequestBody JSONObject filename) {
+//        List<String> strings = jsonObj2List(filename);
+//        if (strings.size() > 450) return JsonResult.error(ResultCode.PARAM_NOT_VALID);
+//        List<PhotovoltaicInfo> infos = curveFittingService.calculatFitting(strings);
+//        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);
+//    }
+//
+//    //文件删除
+//    @DeleteMapping("/delete/files")
+//    private JSONObject deleteFiles(@RequestBody JSONObject filename) {
+//        List<String> strings = jsonObj2List(filename);
+//        int i = curveFittingService.deleteFiles(strings);
+//        return JsonResult.successData(ResultCode.SUCCESS, "共删除" + i + "个文件,删除失败" + (strings.size() - i) + "个!");
+//    }
+//
+//    private List<String> jsonObj2List(JSONObject filename) {
+//        String fn = filename.getString("filename");
+//        String[] split = fn.split(",");
+//        return Arrays.asList(split);
+//    }
+//
+//    @GetMapping("/export/files")
+//    private void exportFiles(HttpServletResponse response, @RequestParam("filename") String filename) {
+//        String[] split = filename.split(",");
+//        curveFittingService.downFiles(Arrays.asList(split), response);
+//    }
+//}

+ 21 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/ProBasicWeatherStationController.java

@@ -0,0 +1,21 @@
+package com.gyee.power.fitting.controller.gf;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 气象站名称 前端控制器
+ * </p>
+ *
+ * @author wang
+ * @since 2023-10-04
+ */
+@RestController
+@RequestMapping("/proBasicWeatherStation")
+public class ProBasicWeatherStationController {
+
+}
+

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

+ 16 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/ProBasicWeatherStationMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.power.fitting.mapper;
+
+import com.gyee.power.fitting.model.ProBasicWeatherStation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 气象站名称 Mapper 接口
+ * </p>
+ *
+ * @author wang
+ * @since 2023-10-04
+ */
+public interface ProBasicWeatherStationMapper extends BaseMapper<ProBasicWeatherStation> {
+
+}

+ 87 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/ProBasicWeatherStation.java

@@ -0,0 +1,87 @@
+package com.gyee.power.fitting.model;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 气象站名称
+ * </p>
+ *
+ * @author wang
+ * @since 2023-10-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("pro_basic_weather_station")
+public class ProBasicWeatherStation extends Model<ProBasicWeatherStation> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 编号
+     */
+    private String id;
+
+    /**
+     * 编码
+     */
+    private String nemCode;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 别名
+     */
+    private String aname;
+
+    /**
+     * 风场编号
+     */
+    private String windpowerstationId;
+
+    /**
+     * 顺序
+     */
+    private Integer orderNum;
+
+    /**
+     * 是否可用
+     */
+    private Integer isAble;
+
+    /**
+     * 备用1
+     */
+    private String spare1;
+
+    /**
+     * 备用2
+     */
+    private String spare2;
+
+    /**
+     * 备用3
+     */
+    private String spare3;
+
+    /**
+     * 备用4
+     */
+    private String spare4;
+
+    private String capacity;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 13 - 11
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/custom/PhotovoltaicInfo.java

@@ -15,41 +15,43 @@ public class PhotovoltaicInfo {
     private long time;//时间
     @Desc(des = "时间")
     private String datetime;
-    @Desc(des = "组件温度")
+    @Desc(des = "组件温度" ,uniformCode = "QXZZJWD")
     @JsonProperty("T")
     private double T;
-    @Desc(des = "光照强度")
+    @Desc(des = "光照强度",uniformCode = "RPJGZD")
     @JsonProperty("S")
     private double S;
 
-    @Desc(des = "电流")
+    @Desc(des = "电流" ,uniformCode = "AIG057")
     @JsonProperty("I")
     private double I;
-    @Desc(des = "电压")
+    @Desc(des = "电压",uniformCode = "AIG058")
     @JsonProperty("V")
     private double V;
     @JsonProperty("P")
     private double P;
-    @Desc(des = "功率")
+    @Desc(des = "功率" ,uniformCode = "AI114")
     private double actualP;
+
+    @Desc(des = "理论功率" ,uniformCode = "ZSGL")
     private double ideaP;
 
-    @Desc(des = "A相电流")
+    @Desc(des = "A相电流",uniformCode = "AIG004")
     @JsonProperty("aI")
     private double aI;
-    @Desc(des = "A相电压")
+    @Desc(des = "A相电压",uniformCode = "AIG005")
     @JsonProperty("aV")
     private double aV;
-    @Desc(des = "B相电流")
+    @Desc(des = "B相电流",uniformCode = "AIG007")
     @JsonProperty("bI")
     private double bI;
-    @Desc(des = "B相电压")
+    @Desc(des = "B相电压",uniformCode = "AIG008")
     @JsonProperty("bV")
     private double bV;
-    @Desc(des = "C相电流")
+    @Desc(des = "C相电流",uniformCode = "AIG010")
     @JsonProperty("cI")
     private double cI;
-    @Desc(des = "C相电压")
+    @Desc(des = "C相电压",uniformCode = "AIG011")
     @JsonProperty("cV")
     private double cV;
 

+ 4 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicEquipmentPointService.java

@@ -2,6 +2,8 @@ package com.gyee.power.fitting.service;
 
 import com.gyee.power.fitting.model.ProBasicEquipmentPoint;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.power.fitting.model.Windpowerstationtestingpoint2;
+import com.gyee.power.fitting.model.Windturbinetestingpointai2;
 
 import java.util.List;
 
@@ -17,4 +19,6 @@ public interface ProBasicEquipmentPointService extends IService<ProBasicEquipmen
 
     List<ProBasicEquipmentPoint> selectList(String station, List<String> points);
 
+    List<ProBasicEquipmentPoint> getPoints(String station, String windturbine, String uniformcode);
+
 }

+ 3 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicEquipmentService.java

@@ -2,6 +2,7 @@ package com.gyee.power.fitting.service;
 
 import com.gyee.power.fitting.model.ProBasicEquipment;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.power.fitting.model.Windturbine;
 
 import java.util.List;
 
@@ -17,4 +18,6 @@ public interface ProBasicEquipmentService extends IService<ProBasicEquipment> {
 
 
     List<ProBasicEquipment> getlist();
+
+    List<ProBasicEquipment> selectList(String station);
 }

+ 6 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicPowerstationPointService.java

@@ -1,8 +1,11 @@
 package com.gyee.power.fitting.service;
 
+import com.gyee.power.fitting.model.ProBasicEquipmentPoint;
 import com.gyee.power.fitting.model.ProBasicPowerstationPoint;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 场站测点,期次测点,线路测点,三级公司测点,区域测点
@@ -17,4 +20,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ProBasicPowerstationPointService extends IService<ProBasicPowerstationPoint> {
 
+    List<ProBasicPowerstationPoint> getzjwdPoints(String station, String uniformcode);
+    List<ProBasicPowerstationPoint> getzfsPoints(String station, String uniformcode);
+
 }

+ 4 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicPowerstationService.java

@@ -2,6 +2,9 @@ package com.gyee.power.fitting.service;
 
 import com.gyee.power.fitting.model.ProBasicPowerstation;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.power.fitting.model.Windpowerstation;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ProBasicPowerstationService extends IService<ProBasicPowerstation> {
 
+    List<ProBasicPowerstation> selectList();
 }

+ 16 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProBasicWeatherStationService.java

@@ -0,0 +1,16 @@
+package com.gyee.power.fitting.service;
+
+import com.gyee.power.fitting.model.ProBasicWeatherStation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 气象站名称 服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2023-10-04
+ */
+public interface ProBasicWeatherStationService extends IService<ProBasicWeatherStation> {
+
+}

+ 1 - 1
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/curve/DataPrepareService.java

@@ -67,7 +67,7 @@ public class DataPrepareService {
                 for (int i = 0; i < points.size(); i++){
                     Windturbinetestingpointai2 point = collect.get(points.get(i)).get(0);
                     log.info("测点:" + point.getId() + "----" + point.getName());
-                    List<TsDoubleData> data = remoteService.adapter().getHistorySnap(point.getId(), st, et, interval);
+                    List<TsDoubleData> data = remoteService.adapterfd().getHistorySnap(point.getId(), st, et, interval);
                     if (data == null || data.size() < 0)
                         break;
                     result.add(data);

+ 21 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/curve/DataScangfService.java

@@ -0,0 +1,21 @@
+package com.gyee.power.fitting.service.custom.curve;
+
+import com.gyee.power.fitting.model.custom.PhotovoltaicInfo;
+import com.gyee.power.fitting.model.custom.PowerPointData;
+import lombok.Data;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 散点聚合实例
+ */
+@Data
+@Component
+public class DataScangfService {
+
+    public Map<String, List<PhotovoltaicInfo>> mapYY;
+
+    public Map<String, List<PhotovoltaicInfo>> mapWY;
+}

+ 1 - 1
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/curve/NewDataFittingService.java

@@ -81,7 +81,7 @@ public class NewDataFittingService {
                 for (int i = 0; i < points.size(); i++) {
                     ProBasicEquipmentPoint point = collect.get(points.get(i)).get(0);
                     log.info("测点:" + point.getId() + "----" + point.getName());
-                    List<TsDoubleData> data = remoteService.adapter().getHistorySnap(point.getNemCode(), vo.getSt(), vo.getEt(), vo.getInterval());
+                    List<TsDoubleData> data = remoteService.adapterfd().getHistorySnap(point.getNemCode(), vo.getSt(), vo.getEt(), vo.getInterval());
                     if (data == null || data.size() < 0)
                         break;
                     result.add(data);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 561 - 561
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/IvPvCurveFittingService.java


+ 763 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/NewIvPvCurveFittingService.java

@@ -0,0 +1,763 @@
+package com.gyee.power.fitting.service.impl;
+
+import com.gyee.power.fitting.common.alg.CurrentVoltageCalc;
+import com.gyee.power.fitting.common.alg.PolynomialCurveFitting;
+import com.gyee.power.fitting.common.config.GyeeConfig;
+import com.gyee.power.fitting.common.constants.Constants;
+import com.gyee.power.fitting.common.feign.IAdapterService;
+import com.gyee.power.fitting.common.feign.RemoteServiceBuilder;
+import com.gyee.power.fitting.common.spring.InitialRunner;
+import com.gyee.power.fitting.common.util.DateUtils;
+import com.gyee.power.fitting.common.util.FileUtil;
+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.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;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+@Service
+public class NewIvPvCurveFittingService {
+
+    @Resource
+    private IWindpowerstationtestingpoint2Service windpowerstationtestingpoint2Service;
+    @Resource
+    private Windturbinetestingpointai2Service windturbinetestingpointai2Service;
+
+    @Resource
+    private ProBasicWeatherStationServiceImpl weatherStationService;
+
+    @Resource
+    private ProBasicEquipmentPointService proBasicEquipmentPointService;
+
+    @Resource
+    private ProBasicPowerstationPointService proBasicPowerstationPointService;
+    @Resource
+    private IAdapterService adpClient;
+
+    @Autowired
+    private RemoteServiceBuilder remoteService;
+
+    @Resource
+    private GyeeConfig config;
+    @Resource
+    private PolynomialCurveFitting pncf;
+
+    private List<FixedVo> fixedVos;
+    private Map<String, String> uniforcodes;
+
+    @Resource
+    private DataScangfService dataScangfService;
+
+    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);
+            infos2File(datas);
+        }
+    }
+
+    public Map<String, List<PhotovoltaicInfo>> getDatas2File1(String stationid, long start, long end, int interval) {
+
+        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);
+            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;
+    }
+
+    private void infos2File(List<List<PhotovoltaicInfo>> datas) {
+
+        //文件第一行
+        List<FixedVo> fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
+        String columnName = fixedVos.stream().map(FixedVo::getDes).collect(Collectors.joining(","));
+        //遍历逆变器
+        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";
+            File file = new File(fileName);
+            if (file.exists()) continue;
+            StringBuilder sb = new StringBuilder();
+            sb.append(columnName).append("\n");
+            for (PhotovoltaicInfo datum : data) {
+                sb.append(datum.getStation()).append(",").append(datum.getInverter()).append(",").append(DateUtils.date2StringL(new Date(datum.getTime())))
+                        .append(",").append(datum.getT()).append(",").append(datum.getS()).append(",").append(datum.getI()).append(",").append(datum.getV())
+                        .append(",").append(datum.getActualP()).append(",").append(datum.getAI()).append(",").append(datum.getAV()).append(",")
+                        .append(datum.getBI()).append(",").append(datum.getBV()).append(",").append(datum.getCI()).append(",").append(datum.getCV())
+                        .append("\n");
+            }
+            FileUtil.writeFile(fileName, sb.toString());
+        }
+    }
+
+    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) {
+            file = new File(config.getFilePathPrepare() + "gf" + File.separator + "一秒" + File.separator);
+        }
+        //获取文件列表
+        File[] files = file.listFiles();
+        //如果文件不够,返回null
+        for (long i = startdate; i < enddate; i += 24 * 60 * 60 * 1000) {
+            int size = fileList.size();
+            String s = DateUtils.date2StringS(new Date(i));
+            for (File f : files) {
+                if (f.getName().contains(station) && f.getName().contains(s) && jiancha(f.getName(), nbq))
+                    fileList.add(f.getName());
+            }
+            if (fileList.size() == size && !isOffline) return null;
+        }
+        return fileList;
+    }
+
+    private boolean jiancha(String name, List<String> nbq) {
+        for (String s : nbq) {
+            if (name.contains(s)) return true;
+        }
+        return false;
+    }
+
+    public Map<String, Object> getTable(String s) {
+        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;
+        List<PhotovoltaicInfo> infos = file2Info(fs, false);
+        tableMap.put("data", infos);
+        tableMap.put("title", collect);
+        return tableMap;
+    }
+
+    private List<PhotovoltaicInfo> file2Info(String path, boolean isAll) {
+        List<String> strings = FileUtil.readFile(path, isAll);
+        List<PhotovoltaicInfo> infos = new ArrayList<>();
+        for (int i = 1; i < strings.size(); i++) {
+            String[] split = strings.get(i).split(",");
+            PhotovoltaicInfo info = new PhotovoltaicInfo();
+            try {
+                info.setStation(split[0]);
+                info.setInverter(split[1]);
+                if (!"".equals(split[2])) {
+                    info.setTime(DateUtils.string2DateL(split[2]).getTime());
+                    info.setDatetime(split[2]);
+                }
+                info.setT(StringUtils.isBlank(split[3]) ? 0 : Double.parseDouble(split[3]));
+                info.setS(StringUtils.isBlank(split[4]) ? 0 : Double.parseDouble(split[4]));
+                info.setI(StringUtils.isBlank(split[5]) ? 0 : Double.parseDouble(split[5]));
+                info.setV(StringUtils.isBlank(split[6]) ? 0 : Double.parseDouble(split[6]));
+                info.setActualP(StringUtils.isBlank(split[7]) ? 0 : Double.parseDouble(split[7]));
+                info.setAI(StringUtils.isBlank(split[8]) ? 0 : Double.parseDouble(split[8]));
+                info.setAV(StringUtils.isBlank(split[9]) ? 0 : Double.parseDouble(split[9]));
+                info.setBI(StringUtils.isBlank(split[10]) ? 0 : Double.parseDouble(split[10]));
+                info.setBV(StringUtils.isBlank(split[11]) ? 0 : Double.parseDouble(split[11]));
+                info.setCI(StringUtils.isBlank(split[12]) ? 0 : Double.parseDouble(split[12]));
+                info.setCV(StringUtils.isBlank(split[13]) ? 0 : Double.parseDouble(split[13]));
+            } catch (Exception e) {
+                System.out.println();
+            }
+
+            infos.add(info);
+        }
+        return infos;
+    }
+
+    /**
+     * 计算理论功率加入原列表
+     *
+     * @return
+     */
+    public Map<String, List<PhotovoltaicInfo>> calculatAnalysis(List<String> fileList) {
+
+        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;
+    //    }
+
+    /**
+     * 合并同逆变器文件
+     *
+     * @param fileList
+     * @return
+     */
+    public Map<String, List<PhotovoltaicInfo>> mergeCalculat(List<String> fileList) {
+
+        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);
+            //按逆变器聚合数据
+            if (stringListMap.containsKey(infos.get(0).getInverter())) {
+                stringListMap.get(infos.get(0).getInverter()).addAll(infos);
+            } else {
+                stringListMap.put(infos.get(0).getInverter(), infos);
+            }
+        }
+        return stringListMap;
+    }
+
+    public List<Object> str2FileList(List<String> fileList) {
+        List<Powerfittinganalysis> fileLists = new ArrayList<>();
+        for (String s : fileList) {
+            String[] split = s.split("-");
+            Powerfittinganalysis fl = new Powerfittinganalysis();
+            /*fl.setPath(s);
+            fl.setStation(split[0]);
+            fl.setStationcn(InitialRunner.gfstationMap.get(split[0]));
+            fl.setWindturbine(split[1]);
+            fl.setTime(split[2]+"年"+split[3]+"月");
+            fl.setInterval("五分钟");*/
+            fl.setPath(s);
+            fl.setStation(split[0]);
+            fl.setStationcn(split[1]);
+            fl.setWindturbine(split[1]);
+            fl.setTime(InitialRunner.newgfstationMap.get(split[0]));
+            fl.setInterval(split[2] + "年" + split[3] + "月");
+            fileLists.add(fl);
+        }
+        List<Object> objects = PowerFittingUtil.powerDataTree(fileLists, Constants.DATA_FITTING);
+        return objects;
+    }
+
+    public List<String> getAllFileList() {
+        //获取文件位置
+        File file = new File(config.getFilePathPrepare() + "gf" + "一秒");
+        //获取文件列表
+        File[] files = file.listFiles();
+        List<String> fileList = Arrays.stream(files).map(f -> f.getName()).collect(Collectors.toList());
+        return fileList;
+    }
+
+    /**
+     * 标准点计算
+     */
+    public void standardPointCalculate2() {
+        List<String> allFileList = getAllFileList();
+        Map<String, List<PhotovoltaicInfo>> stringListMap = mergeCalculat(allFileList);
+
+        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());
+        }
+
+        //文件第一行
+        List<FixedVo> fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
+        StringBuilder sb = new StringBuilder();
+        String columnName = fixedVos.stream().map(FixedVo::getDes).collect(Collectors.joining(","));
+        sb.append(columnName).append("\n");
+        for (PhotovoltaicInfo ptInfo : ptInfos) {
+            sb.append(ptInfo.getStation()).append(",").append(ptInfo.getInverter()).append(",")
+                    .append(DateUtils.date2StringL(new Date(ptInfo.getTime()))).append(",")
+                    .append(ptInfo.getT()).append(",").append(ptInfo.getS()).append(",")
+                    .append(ptInfo.getI()).append(",").append(ptInfo.getV())
+                    .append(",").append(ptInfo.getActualP()).append(",")
+                    .append(ptInfo.getAI()).append(",").append(ptInfo.getAV())
+                    .append(",").append(ptInfo.getBI()).append(",").append(ptInfo.getBV())
+                    .append(",").append(ptInfo.getCI()).append(",").append(ptInfo.getCV())
+                    .append("\n");
+        }
+        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);
+        String[] ss = {"station", "datetime", "T", "S", "actualP"};
+        List<String> strings = Arrays.asList(ss);
+        List<TableTitle> collect = fixedVos.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
+        collect = collect.stream().filter(c -> strings.contains(c.getKey())).collect(Collectors.toList());
+        TableTitle title = new TableTitle();
+        title.setKey("ideaP");
+        title.setDes("理论功率");
+        collect.add(title);
+
+        return collect;
+    }
+
+    /**
+     * 获得所有文件的值
+     *
+     * @param fileList
+     * @return
+     */
+    public List<PhotovoltaicInfo> calculatFitting(List<String> fileList) {
+
+        String fs = config.getFilePathPrepare() + "gf" + File.separator;
+        List<PhotovoltaicInfo> infoList = new ArrayList<>();
+        for (String s : fileList) {
+            List<PhotovoltaicInfo> infos = file2Info(fs + s, true);
+            if (infoList.size() == 0 || Objects.equals(infos.get(0).getStation(), infoList.get(0).getStation())) {
+                infoList.addAll(infos);
+            }
+        }
+
+        return infoList;
+    }
+
+    public List<double[]> oneFileFitting(List<PhotovoltaicInfo> infos) {
+
+        WeightedObservedPoints points = new WeightedObservedPoints();
+        double max = 0;
+        for (PhotovoltaicInfo info : infos) {
+            if (info.getS() < 1) {
+                points.add(0, 0);
+            }
+            points.add(info.getS(), info.getActualP());
+            if (info.getS() > max) {
+                max = info.getS();
+            }
+        }
+        double[] result = pncf.run(points);
+
+        List<double[]> b = new ArrayList<>();
+        for (int i = 0; i < max; i += 5) {
+            double[] curve = new double[2];
+            curve[0] = i;
+            curve[1] = pncf.calcPoly(i, result);
+            b.add(curve);
+        }
+        return b;
+    }
+
+    /**
+     * 光伏绩效榜
+     *
+     * @param startdate
+     * @param enddate
+     */
+    public List<FjjxbVo> getPhotovoltaicPerformanceList(long startdate, long enddate, int interval) {
+        int oneday = 24 * 60 * 60;
+
+        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()));
+
+        //获取实际发电量
+        List<ProBasicPowerstationPoint> rfdl = proBasicPowerstationPointService.getzfsPoints(null, "RFDL");
+        List<FjjxbVo> infos = new ArrayList<>();
+        //遍历逆变器
+        for (ProBasicPowerstationPoint wstp : rfdl) {
+            //场站
+            String stationid = wstp.getWindpowerstationId();
+
+            List<TsDoubleData> history = remoteService.adapterfd().getHistorySnap(wstp.getNemCode(), startdate + oneday * 1000, enddate, oneday);
+            double d = 0;
+            for (TsDoubleData data : history) {
+                d += data.getDoubleValue();
+            }
+            FjjxbVo vo = new FjjxbVo();
+            vo.setName(InitialRunner.newgfstationMap.get(stationid));
+            vo.setSjfdl(d);
+
+            //理论发电量
+            double llfdl = 0;
+            //光照平均值
+            double gz = 0;
+            int i = 0;
+            double t = 5 / 60;
+
+            List<List<PhotovoltaicInfo>> datas = getDatas(stationid, startdate, enddate, interval);
+            //遍历逆变器
+            for (List<PhotovoltaicInfo> data : datas) {
+
+                if ("HZJ_GDC".equals(stationid) || "AK_GDC".equals(stationid)) {
+                    CurrentVoltageCalc.CalcTheoryPowerHZJ(data, bzcldMap);
+                } else {
+                    CurrentVoltageCalc.CalcTheoryPower(data, bzcldMap);
+                }
+
+                for (PhotovoltaicInfo datum : data) {
+                    llfdl += datum.getIdeaP() * t;
+                    gz += datum.getS();
+                    i++;
+                }
+            }
+            vo.setLlfdl(llfdl);
+            vo.setSpeed(gz / i);
+            vo.setFnlly(vo.getSjfdl() / vo.getLlfdl() * 100);
+            infos.add(vo);
+        }
+        return infos;
+    }
+
+    /**
+     * 获取数据
+     *
+     * @return 逆变器,列表
+     */
+    public List<List<PhotovoltaicInfo>> getDatas(String stationid, long start, long end, int interval) {
+        //间隔
+        interval = 5 * 60; //5分钟-300
+
+        //获得测点
+        Map<String, String> zglpoints = getPoints(stationid, "zgl");
+        Map<String, String> llglpoints = getPoints(stationid, "llgl");
+        Map<String, String> adypoints = getPoints(stationid, "ady");
+        Map<String, String> bdypoints = getPoints(stationid, "bdy");
+        Map<String, String> cdypoints = getPoints(stationid, "cdy");
+        Map<String, String> adlpoints = getPoints(stationid, "adl");
+        Map<String, String> bdlpoints = getPoints(stationid, "bdl");
+        Map<String, String> cdlpoints = getPoints(stationid, "cdl");
+
+        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();
+
+        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 = remoteService.adapterfd().getHistorySnap(zfsPoint.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);
+
+        List<List<PhotovoltaicInfo>> infosLit = new ArrayList<>();
+        //按逆变器
+        for (String wtid : zglpoints.keySet()) {
+
+            //总功率
+            //            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 = remoteService.adaptergf().getHistorySnap(adypoints.get(wtid), start, end, interval);
+            //电网A相电流
+            //            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<>();
+
+            List<TsDoubleData> bdyDatas = null, cdyDatas = null, bdlDatas = null, cdlDatas = null;
+            if ("HZJ_GDC".equals(stationid) || "AK_GDC".equals(stationid)) {
+                //电网B相电压
+                bdyDatas = adpClient.getHistorySnap(bdypoints.get(wtid), start, end, interval);
+                //电网C相电压
+                cdyDatas = adpClient.getHistorySnap(cdypoints.get(wtid), start, end, interval);
+                //电网B相电流
+                bdlDatas = adpClient.getHistorySnap(bdlpoints.get(wtid), start, end, interval);
+                //电网C相电流
+                cdlDatas = adpClient.getHistorySnap(cdlpoints.get(wtid), start, end, interval);
+            }
+
+            for (int j = 0; j < zfsDatas.size(); j++) {
+                PhotovoltaicInfo info = new PhotovoltaicInfo();
+                info.setStation(stationid);
+                info.setInverter(wtid);
+                long ts = zfsDatas.get(j).getTs();
+                info.setTime(ts);
+                info.setDatetime(DateUtils.date2StringL(new Date(ts)));
+
+                info.setT(double3Decimal(zjwdDatas.get(j).getDoubleValue()));
+                info.setS(double3Decimal(zfsDatas.get(j).getDoubleValue(), false));
+                if ("HZJ_GDC".equals(stationid) || "AK_GDC".equals(stationid)) {
+                    info.setAI(double3Decimal(adlDatas.get(j).getDoubleValue(), false));
+                    info.setBI(double3Decimal(bdlDatas.get(j).getDoubleValue(), false));
+                    info.setCI(double3Decimal(cdlDatas.get(j).getDoubleValue(), false));
+                    info.setAV(double3Decimal(adyDatas.get(j).getDoubleValue(), true));
+                    info.setBV(double3Decimal(bdyDatas.get(j).getDoubleValue(), true));
+                    info.setCV(double3Decimal(cdyDatas.get(j).getDoubleValue(), true));
+                } else {
+                    if (adlDatas.size() >= 1) {
+                        info.setI(double3Decimal(adlDatas.get(j).getDoubleValue(), false));
+                    } else {
+                        info.setI(0);
+                    }
+                    if (adyDatas.size() >= 1) {
+                        info.setV(double3Decimal(adyDatas.get(j).getDoubleValue(), true));
+                    } else {
+                        info.setV(0);
+                    }
+                }
+                if (zglDatas.size() >= 1) {
+                    info.setActualP(double3Decimal(zglDatas.get(j).getDoubleValue(), false));
+                } else {
+                    info.setActualP(0);
+                }
+                if (llglDatas.size() >= 1) {
+                    info.setIdeaP(double3Decimal(llglDatas.get(j).getDoubleValue(), false));
+                } else {
+                    info.setIdeaP(0);
+                }
+                infos.add(info);
+            }
+            infosLit.add(infos);
+        }
+
+        return infosLit;
+    }
+
+    private double double3Decimal(double d) {
+        BigDecimal bd = new BigDecimal(d);
+        return bd.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
+    }
+
+    private double double3Decimal(double d, boolean isMultFactor) {
+        d = d < 1 ? 0 : d;
+        if (isMultFactor) {
+            d = d * 0.001;
+        }
+        return double3Decimal(d);
+    }
+
+    /**
+     * 获得测点
+     * 逆变器,测点
+     */
+    private Map<String, String> getPoints(String stationid, String key) {
+
+        switch (key) {
+            case "zgl":
+                //总功率
+                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));
+
+            case "ady":
+                List<ProBasicEquipmentPoint> adyPoints = null;
+                if ("HZJ_GDC".equals(stationid)) {
+                    //电网A相电压
+                    adyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG005");
+                } else {
+                    //电网A相电压
+                    adyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG005");
+                }
+
+                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));
+            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));
+            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));
+            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));
+            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 new HashMap<>();
+    }
+
+    public int deleteFiles(List<String> fileList) {
+        String fs = config.getFilePathPrepare() + "gf";
+        List<PhotovoltaicInfo> infoList = new ArrayList<>();
+        int count = 0;
+        for (String s : fileList) {
+            File file = new File(fs + s);
+            if (file.delete()) count++;
+        }
+        return count;
+    }
+
+    public void downFiles(List<String> strings, HttpServletResponse response) {
+        List<File> files = path2File(strings);
+        String path = config.getFilePathPrepare() + "zip\\" + System.currentTimeMillis() + ".zip";
+        String s = FileUtil.zipFiles(files, new File(path));
+        FileUtil.download(s, response);
+    }
+
+    private List<File> path2File(List<String> strings) {
+        List<File> files = new ArrayList<>();
+        for (String string : strings) {
+            files.add(new File(config.getFilePathPrepare() + "gf" + string));
+        }
+        return files;
+    }
+
+    public List<FixedVo> getFixedVos() {
+        if (fixedVos == null) {
+            fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
+            uniforcodes = fixedVos.stream().filter(fv -> fv.getUniformCode() != null).collect(Collectors.toMap(FixedVo::getDes, FixedVo::getUniformCode));
+        }
+        return fixedVos;
+    }
+
+    public Map<String, String> getUniforcodes() {
+        getFixedVos();
+        return uniforcodes;
+    }
+
+
+    public List<ProBasicEquipment> wtByWplist(String wpids) {
+        List<ProBasicEquipment> equipmentList = InitialRunner.newgfwtList.stream()
+                .filter(oe -> wpids.contains(oe.getWindpowerstationId()))
+                .sorted(Comparator.comparingInt(ProBasicEquipment::getOrderNum)) // 根据order_num字段排序
+                .collect(Collectors.toList());
+
+        return equipmentList;
+    }
+
+    /**
+     * 通过大点的key获取小散点
+     *
+     * @param yk
+     * @param wk
+     * @return
+     */
+    public List<PhotovoltaicInfo> dataOrigin(String yk, String wk) {
+        List<PhotovoltaicInfo> list = new ArrayList<>();
+
+        if (!StringUtils.isEmpty(yk)) {
+            String[] key = yk.split(",");
+            for (String k : key) {
+                list.addAll(dataScangfService.getMapYY().get(k));
+            }
+        }
+        if (!StringUtils.isEmpty(wk)) {
+            String[] kew = wk.split(",");
+            for (String k : kew) {
+                list.addAll(dataScangfService.getMapWY().get(k));
+            }
+        }
+
+        return list;
+    }
+}

+ 22 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicEquipmentPointServiceImpl.java

@@ -1,10 +1,15 @@
 package com.gyee.power.fitting.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.power.fitting.common.base.ExcludeQueryWrapper;
 import com.gyee.power.fitting.model.ProBasicEquipmentPoint;
 import com.gyee.power.fitting.mapper.ProBasicEquipmentPointMapper;
+import com.gyee.power.fitting.model.Windpowerstationtestingpoint2;
+import com.gyee.power.fitting.model.Windturbinetestingpointai2;
 import com.gyee.power.fitting.service.ProBasicEquipmentPointService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -38,4 +43,21 @@ public class ProBasicEquipmentPointServiceImpl extends ServiceImpl<ProBasicEquip
 
         return list;
     }
+    @Override
+    @Cacheable("wtpoint")
+    public List<ProBasicEquipmentPoint> getPoints(String station, String windturbine, String uniformcode) {
+
+        QueryWrapper<ProBasicEquipmentPoint> wrapper = new QueryWrapper<>();
+        if ("GDC".equals(station)) {
+            wrapper.like("windpowerstation_id", "_GDC_STA");
+        } else if ("FDC".equals(station)) {
+            wrapper.like("windpowerstation_id", "_FDC_STA");
+        } else {
+            wrapper.eq(StringUtils.isNotEmpty(station), "windpowerstation_id", station);
+        }
+        wrapper.eq(StringUtils.isNotEmpty(windturbine), "windturbine_id", windturbine);
+        wrapper.eq("uniform_code", uniformcode).orderByAsc("windturbine_id");
+        return baseMapper.selectList(wrapper);
+    }
+
 }

+ 18 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicEquipmentServiceImpl.java

@@ -3,10 +3,12 @@ package com.gyee.power.fitting.service.impl;
 import com.gyee.power.fitting.common.base.ExcludeQueryWrapper;
 import com.gyee.power.fitting.model.ProBasicEquipment;
 import com.gyee.power.fitting.mapper.ProBasicEquipmentMapper;
+import com.gyee.power.fitting.model.Windturbine;
 import com.gyee.power.fitting.service.ProBasicEquipmentService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -27,4 +29,20 @@ public class ProBasicEquipmentServiceImpl extends ServiceImpl<ProBasicEquipmentM
         List<ProBasicEquipment> list = baseMapper.selectList(wrapper);
         return list;
     }
+
+    @Override
+    public List<ProBasicEquipment> selectList(String station) {
+        List<ProBasicEquipment> list = new ArrayList();
+
+        ExcludeQueryWrapper wrapper = new ExcludeQueryWrapper();
+        wrapper.eq("windpowerstation_id", station);
+
+        try{
+            list = baseMapper.selectList(wrapper);
+        }catch (Exception e){
+            log.error("WindturbineServiceImpl--selectList", e);
+        }
+
+        return list;
+    }
 }

+ 32 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicPowerstationPointServiceImpl.java

@@ -1,11 +1,16 @@
 package com.gyee.power.fitting.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.power.fitting.model.ProBasicEquipmentPoint;
 import com.gyee.power.fitting.model.ProBasicPowerstationPoint;
 import com.gyee.power.fitting.mapper.ProBasicPowerstationPointMapper;
 import com.gyee.power.fitting.service.ProBasicPowerstationPointService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 场站测点,期次测点,线路测点,三级公司测点,区域测点
@@ -20,5 +25,32 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class ProBasicPowerstationPointServiceImpl extends ServiceImpl<ProBasicPowerstationPointMapper, ProBasicPowerstationPoint> implements ProBasicPowerstationPointService {
+    @Override
+    public List<ProBasicPowerstationPoint> getzjwdPoints(String station, String uniformcode) {
+        QueryWrapper<ProBasicPowerstationPoint> wrapper = new QueryWrapper<>();
+        if ("GDC".equals(station)) {
+            wrapper.like("windpowerstation_id", "_WS");
+        } else if ("FDC".equals(station)) {
+            wrapper.like("windpowerstation_id", "_WS");
+        } else {
+            wrapper.eq(StringUtils.isNotEmpty(station), "windpowerstation_id", station);
+        }
+
+        wrapper.eq("uniform_code", uniformcode);
+        return baseMapper.selectList(wrapper);
+    }
+    @Override
+    public List<ProBasicPowerstationPoint> getzfsPoints(String station, String uniformcode) {
+        QueryWrapper<ProBasicPowerstationPoint> wrapper = new QueryWrapper<>();
+        if ("GDC".equals(station)) {
+            wrapper.like("windpowerstation_id", "_GDC_STA");
+        } else if ("FDC".equals(station)) {
+            wrapper.like("windpowerstation_id", "_FDC_STA");
+        } else {
+            wrapper.eq(StringUtils.isNotEmpty(station), "windpowerstation_id", station);
+        }
 
+        wrapper.eq("uniform_code", uniformcode);
+        return baseMapper.selectList(wrapper);
+    }
 }

+ 19 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicPowerstationServiceImpl.java

@@ -1,11 +1,16 @@
 package com.gyee.power.fitting.service.impl;
 
+import com.gyee.power.fitting.common.base.ExcludeQueryWrapper;
 import com.gyee.power.fitting.model.ProBasicPowerstation;
 import com.gyee.power.fitting.mapper.ProBasicPowerstationMapper;
+import com.gyee.power.fitting.model.Windpowerstation;
 import com.gyee.power.fitting.service.ProBasicPowerstationService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -17,4 +22,18 @@ import org.springframework.stereotype.Service;
 @Service
 public class ProBasicPowerstationServiceImpl extends ServiceImpl<ProBasicPowerstationMapper, ProBasicPowerstation> implements ProBasicPowerstationService {
 
+    @Override
+    public List<ProBasicPowerstation> selectList() {
+        List<ProBasicPowerstation> list = new ArrayList();
+
+        ExcludeQueryWrapper wrapper = new ExcludeQueryWrapper();
+
+        try{
+            list = baseMapper.selectList(wrapper);
+        }catch (Exception e){
+            log.error("WindpowerstationServiceImpl--selectList", e);
+        }
+
+        return list;
+    }
 }

+ 20 - 0
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProBasicWeatherStationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.power.fitting.service.impl;
+
+import com.gyee.power.fitting.model.ProBasicWeatherStation;
+import com.gyee.power.fitting.mapper.ProBasicWeatherStationMapper;
+import com.gyee.power.fitting.service.ProBasicWeatherStationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 气象站名称 服务实现类
+ * </p>
+ *
+ * @author wang
+ * @since 2023-10-04
+ */
+@Service
+public class ProBasicWeatherStationServiceImpl extends ServiceImpl<ProBasicWeatherStationMapper, ProBasicWeatherStation> implements ProBasicWeatherStationService {
+
+}

+ 2 - 1
power-fitting-JN/src/main/resources/application.yaml

@@ -1,6 +1,7 @@
 gyee:
   # 实时适配器的url
-  adapter-url: http://10.81.3.160:8011
+  adapterfd-url: http://10.81.3.160:8011
+  adaptergf-url: http://10.81.3.160:8012
   # 数据准备保存路径(原始数据)
   file-path-prepare: data/prepare/
   # 数据处理保存路径(处理后的数据)