chenminghua 1 gadu atpakaļ
vecāks
revīzija
684a71941f
29 mainītis faili ar 444 papildinājumiem un 129 dzēšanām
  1. 5 1
      power-fitting/src/main/java/com/gyee/power/fitting/common/config/GyeeConfig.java
  2. 4 1
      power-fitting/src/main/java/com/gyee/power/fitting/common/exception/CustomException.java
  3. 1 0
      power-fitting/src/main/java/com/gyee/power/fitting/common/result/ResultCode.java
  4. 77 0
      power-fitting/src/main/java/com/gyee/power/fitting/common/spring/ConfigurationManager.java
  5. 8 9
      power-fitting/src/main/java/com/gyee/power/fitting/common/spring/InitialRunner.java
  6. 1 1
      power-fitting/src/main/java/com/gyee/power/fitting/common/util/FileUtil.java
  7. 0 23
      power-fitting/src/main/java/com/gyee/power/fitting/controller/base/CurveFittingController.java
  8. 45 4
      power-fitting/src/main/java/com/gyee/power/fitting/controller/base/WindInfoController.java
  9. 32 0
      power-fitting/src/main/java/com/gyee/power/fitting/controller/fj/BladeController.java
  10. 3 2
      power-fitting/src/main/java/com/gyee/power/fitting/controller/fj/DataPrepareController.java
  11. 3 2
      power-fitting/src/main/java/com/gyee/power/fitting/controller/fj/DataProcessController.java
  12. 4 5
      power-fitting/src/main/java/com/gyee/power/fitting/controller/fj/DateOptionController.java
  13. 3 1
      power-fitting/src/main/java/com/gyee/power/fitting/controller/gf/PhotovoltaicController.java
  14. 2 2
      power-fitting/src/main/java/com/gyee/power/fitting/model/Windturbine.java
  15. 14 3
      power-fitting/src/main/java/com/gyee/power/fitting/model/anno/AnnotationTool.java
  16. 26 14
      power-fitting/src/main/java/com/gyee/power/fitting/model/custom/PowerPointData.java
  17. 76 0
      power-fitting/src/main/java/com/gyee/power/fitting/service/custom/blade/BladeService.java
  18. 15 3
      power-fitting/src/main/java/com/gyee/power/fitting/service/custom/curve/DataFittingService.java
  19. 9 7
      power-fitting/src/main/java/com/gyee/power/fitting/service/custom/curve/DataPrepareService.java
  20. 8 7
      power-fitting/src/main/java/com/gyee/power/fitting/service/custom/curve/DataProcessService.java
  21. 9 7
      power-fitting/src/main/java/com/gyee/power/fitting/service/custom/fiveloss/FiveLossService.java
  22. 21 10
      power-fitting/src/main/java/com/gyee/power/fitting/service/custom/ratedpower/RatedPowerService.java
  23. 3 1
      power-fitting/src/main/java/com/gyee/power/fitting/service/custom/temperature/PowerTemperatureService.java
  24. 18 15
      power-fitting/src/main/java/com/gyee/power/fitting/service/impl/IvPvCurveFittingService.java
  25. 21 8
      power-fitting/src/main/resources/application.yaml
  26. BIN
      power-fitting/src/main/resources/image/img.png
  27. BIN
      power-fitting/src/main/resources/image/img_1.png
  28. BIN
      power-fitting/src/main/resources/image/img_2.png
  29. 36 3
      power-fitting/src/main/resources/readme.md

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

@@ -10,6 +10,7 @@ import org.springframework.boot.system.ApplicationHome;
 import org.springframework.core.annotation.Order;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
 import java.io.File;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -20,6 +21,9 @@ import java.util.stream.Collectors;
 @ConfigurationProperties(prefix = "gyee")
 public class GyeeConfig {
 
+    @Resource
+    private AnnotationTool annotationTool;
+
     public File jarF = null;
     {
         ApplicationHome h = new ApplicationHome(getClass());
@@ -84,7 +88,7 @@ public class GyeeConfig {
 
 
     private List<String> getUniformCodes(){
-        List<FixedVo> fxList = AnnotationTool.getFixedVoList(PowerPointData.class);
+        List<FixedVo> fxList = annotationTool.getFixedVoList(PowerPointData.class);
         List<String> codes = fxList.stream().filter(f -> !StringUtils.isEmpty(f.getUniformCode()))
                 .map(d -> d.getUniformCode()).collect(Collectors.toList());
 

+ 4 - 1
power-fitting/src/main/java/com/gyee/power/fitting/common/exception/CustomException.java

@@ -9,7 +9,10 @@ public class CustomException extends RuntimeException {
     private Integer code;
     private String message;
 
-    public CustomException(){}
+    public CustomException(int code, String msg){
+        this.code = code;
+        this.message = msg;
+    }
 
     public CustomException(ResultCode result){
         super();

+ 1 - 0
power-fitting/src/main/java/com/gyee/power/fitting/common/result/ResultCode.java

@@ -22,6 +22,7 @@ public enum ResultCode {
     ERROR_DATA_REPEAT(4007, "数据已存在"),
     ERROR_SQL(4008, "sql语法不正确"),
     ERROR_MODEL(4009, "自算功率数据为空"),
+    ERROR_MODEL_TYPE(4010, "风机机型不一致,请重新选择"),
 
 
     /* 参数错误:1000~1999 */

+ 77 - 0
power-fitting/src/main/java/com/gyee/power/fitting/common/spring/ConfigurationManager.java

@@ -0,0 +1,77 @@
+package com.gyee.power.fitting.common.spring;
+
+import org.springframework.core.env.Environment;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Proxy;
+import java.util.Map;
+
+/**
+ * 配置文件操作
+ *
+ * @author xysn
+ */
+public class ConfigurationManager {
+    /**
+     * 获取配置文件中的值
+     *
+     * @param name        配置文件key
+     * @param environment 环境
+     * @return 值
+     */
+    public static String getConfigurationValue(String name, Environment environment) {
+        if (name == null) {
+            return "";
+        }
+        String nm = name.trim();
+        if ("".equals(nm)) {
+            return null;
+        }
+
+        if (nm.startsWith("${") && nm.endsWith("}")) {
+            nm = nm.substring(2, nm.length() - 1);
+            String[] nms = nm.split(":");
+            String nam = nms[0].trim();
+            if ("".equals(nam)) {
+                if (nms.length > 1) {
+                    return nms[1].trim();
+                }
+                return "";
+            }
+            String val = environment.getProperty(nam);
+            if (val == null || "".equals(val)) {
+                if (nms.length > 1) {
+                    return nms[1].trim();
+                }
+            }
+            return val;
+        }
+        return name;
+    }
+
+    /**
+     * 获取注解中的值
+     *
+     * @param c           注解类型
+     * @param f           被注解的方法
+     * @param environment 环境
+     * @param <T>         类型
+     */
+    public static <T extends Annotation> String getAnnotationValue(Class<T> c, Field f, Environment environment) throws NoSuchFieldException, IllegalAccessException {
+        T t = f.getAnnotation(c);
+        if (t == null) {
+            return null;
+        }
+        InvocationHandler ih = Proxy.getInvocationHandler(t);
+        Field tf = ih.getClass().getDeclaredField("memberValues");
+        tf.setAccessible(true);
+        Map vals = (Map) tf.get(ih);
+        if (vals == null || !vals.containsKey("uniformCode")) {
+            return null;
+        }
+        String val = (String) vals.get("uniformCode");
+        return getConfigurationValue(val, environment);
+    }
+}

+ 8 - 9
power-fitting/src/main/java/com/gyee/power/fitting/common/spring/InitialRunner.java

@@ -128,14 +128,10 @@ public class InitialRunner implements CommandLineRunner {
         cachePhotovoltaicInfo();
 
         // 耗时缓存
-        new Thread(){
-            @Override
-            public void run() {
-                super.run();
-                cacheModelPower();
-                cacheZSLLGL(null);
-            }
-        }.start();
+        new Thread(() -> {
+            cacheModelPower();
+            cacheZSLLGL(null);
+        }).start();
 
         System.out.println(">>>>>>>>>>>>>>>数据缓存完成<<<<<<<<<<<<<<");
     }
@@ -227,7 +223,10 @@ public class InitialRunner implements CommandLineRunner {
         }else{
             List<Powermodel> list = powermodelService.selectByWtId(wtId);
             Map<Double, Double> collect = list.stream().collect(Collectors.toMap(Powermodel::getSpeed, Powermodel::getPower));
-            zsllglMap.replace(wtId, collect);
+            if (zsllglMap.containsKey(wtId))
+                zsllglMap.replace(wtId, collect);
+            else
+                zsllglMap.put(wtId, collect);
         }
         log.info("自算功率数据缓存完成");
     }

+ 1 - 1
power-fitting/src/main/java/com/gyee/power/fitting/common/util/FileUtil.java

@@ -205,7 +205,7 @@ public class FileUtil {
         if (!zipFile.exists()) {
             try {
                 String fileName = zipFile.getAbsolutePath();
-                fileName = fileName.substring(0, fileName.lastIndexOf("\\"));
+                //fileName = fileName.substring(0, fileName.lastIndexOf("\\"));
                 File file1 = new File(fileName);
                 file1.mkdirs();
                 zipFile.createNewFile();

+ 0 - 23
power-fitting/src/main/java/com/gyee/power/fitting/controller/base/CurveFittingController.java

@@ -1,23 +0,0 @@
-package com.gyee.power.fitting.controller.base;
-
-import com.gyee.power.fitting.common.feign.IAdapterService;
-import com.gyee.power.fitting.service.Windturbinetestingpointai2Service;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-
-@RestController("curvefitting")
-public class CurveFittingController {
-    @Resource
-    private Windturbinetestingpointai2Service windturbinetestingpointai2Service;
-    @Resource
-    private IAdapterService iAdapterService;
-
-    @GetMapping("/")
-    private void get(@RequestParam("wtid") String wtid){
-        wtid = "HZJ01_01";
-        windturbinetestingpointai2Service.getZlTag(wtid);
-    }
-}

+ 45 - 4
power-fitting/src/main/java/com/gyee/power/fitting/controller/base/WindInfoController.java

@@ -4,15 +4,14 @@ 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.common.spring.InitialRunner;
-import com.gyee.power.fitting.model.Line;
-import com.gyee.power.fitting.model.Project;
-import com.gyee.power.fitting.model.Windpowerstation;
-import com.gyee.power.fitting.model.Windturbine;
+import com.gyee.power.fitting.model.*;
+import com.gyee.power.fitting.service.PowerfittinganalysisService;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -26,12 +25,24 @@ import java.util.stream.Collectors;
 @RequestMapping("/base")
 public class WindInfoController {
 
+    @Resource
+    private PowerfittinganalysisService powerService;
+
+    /**
+     * 查询场站
+     * @return
+     */
     @GetMapping("station")
     public JSONObject getStation() {
         List<Windpowerstation> list = InitialRunner.wpList;
         return JsonResult.successData(ResultCode.SUCCESS, list);
     }
 
+    /**
+     * 根据场站查风机
+     * @param stationId
+     * @return
+     */
     @GetMapping("windturbine")
     public JSONObject getWindTurbine(String stationId) {
         List<Windturbine> list = InitialRunner.wpMap.get(stationId);
@@ -50,12 +61,22 @@ public class WindInfoController {
         return JsonResult.successData(ResultCode.SUCCESS, list);
     }
 
+    /**
+     * 根据场站查期次
+     * @param stationId
+     * @return
+     */
     @GetMapping("project")
     public JSONObject getProject(String stationId) {
         List<Project> list = InitialRunner.projectList.stream().filter(f -> f.getWindpowerstationid().equals(stationId)).collect(Collectors.toList());
         return JsonResult.successData(ResultCode.SUCCESS, list);
     }
 
+    /**
+     * 根据期次查线路
+     * @param projectId
+     * @return
+     */
     @GetMapping("line")
     public JSONObject getLine(String projectId) {
         List<Line> list = new ArrayList<>();
@@ -67,4 +88,24 @@ public class WindInfoController {
         }
         return JsonResult.successData(ResultCode.SUCCESS, list);
     }
+
+    /**
+     * 获取风机经纬度信息
+     * @param ids
+     * @return
+     */
+    @GetMapping("location")
+    public JSONObject dataLocation(String ids){
+        List<Windturbine> result = new ArrayList<>();
+        List<Powerfittinganalysis> list = powerService.selectListByIds(ids);
+        for (Powerfittinganalysis obj : list){
+            String[] pids = obj.getProcessid().split(",");
+            for (String id : pids){
+                Powerfittinganalysis item = powerService.getById(id);
+                Windturbine wt = InitialRunner.wtMap.get(item.getWindturbine());
+                result.add(wt);
+            }
+        }
+        return JsonResult.successData(ResultCode.SUCCESS, result);
+    }
 }

+ 32 - 0
power-fitting/src/main/java/com/gyee/power/fitting/controller/fj/BladeController.java

@@ -0,0 +1,32 @@
+package com.gyee.power.fitting.controller.fj;
+
+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.service.custom.blade.BladeService;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RestController
+@CrossOrigin
+@RequestMapping("/blade")
+public class BladeController {
+
+    @Resource
+    private BladeService bladeService;
+
+    /**
+     * 叶片角度
+     * @param ids
+     * @return
+     */
+    @GetMapping("angle")
+    public JSONObject bladeAngle(String ids){
+        Object o = bladeService.bladeData(ids);
+        return JsonResult.successData(ResultCode.SUCCESS, o);
+    }
+}

+ 3 - 2
power-fitting/src/main/java/com/gyee/power/fitting/controller/fj/DataPrepareController.java

@@ -10,6 +10,7 @@ import com.gyee.power.fitting.service.custom.curve.DataPrepareService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.util.*;
 
@@ -22,9 +23,9 @@ import java.util.*;
 @RequestMapping("/power/prepare")
 public class DataPrepareController {
 
-    @Autowired
+    @Resource
     private DataPrepareService prepareService;
-    @Autowired
+    @Resource
     private PowerfittinganalysisService powerService;
 
 

+ 3 - 2
power-fitting/src/main/java/com/gyee/power/fitting/controller/fj/DataProcessController.java

@@ -10,6 +10,7 @@ import com.gyee.power.fitting.service.custom.curve.DataProcessService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Arrays;
 import java.util.List;
@@ -23,9 +24,9 @@ import java.util.Map;
 @RequestMapping("/power/process")
 public class DataProcessController {
 
-    @Autowired
+    @Resource
     private PowerfittinganalysisService powerService;
-    @Autowired
+    @Resource
     private DataProcessService processService;
 
 

+ 4 - 5
power-fitting/src/main/java/com/gyee/power/fitting/controller/fj/DateOptionController.java

@@ -7,9 +7,9 @@ import com.gyee.power.fitting.common.result.ResultCode;
 import com.gyee.power.fitting.common.util.FileUtil;
 import com.gyee.power.fitting.model.Powerfittinganalysis;
 import com.gyee.power.fitting.service.PowerfittinganalysisService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.File;;
 import java.util.List;
@@ -23,9 +23,9 @@ import java.util.stream.Collectors;
 @RequestMapping("/data/option")
 public class DateOptionController {
 
-    @Autowired
+    @Resource
     private GyeeConfig gyeeConfig;
-    @Autowired
+    @Resource
     private PowerfittinganalysisService powerfittinganalysisService;
 
 
@@ -52,10 +52,9 @@ public class DateOptionController {
         List<String> list = objs.stream().map(p -> p.getPath()).collect(Collectors.toList());
         List<File> files = list.stream().map(File::new).collect(Collectors.toList());
 
-        File zipFile = new File(gyeeConfig.getFilePathDownload()  + "\\" + objs.get(0).getStation() + "_" + System.currentTimeMillis() + ".zip");
+        File zipFile = new File(gyeeConfig.getFilePathDownload()  + File.separator + objs.get(0).getStation() + "_" + System.currentTimeMillis() + ".zip");
         // 调用压缩方法
         String ps = FileUtil.zipFiles(files, zipFile);
         FileUtil.download(ps, response);
     }
-
 }

+ 3 - 1
power-fitting/src/main/java/com/gyee/power/fitting/controller/gf/PhotovoltaicController.java

@@ -20,6 +20,8 @@ import java.util.stream.Collectors;
 public class PhotovoltaicController {
 
     @Resource
+    private AnnotationTool annotationTool;
+    @Resource
     private IvPvCurveFittingService curveFittingService;
 
     @GetMapping("/filelist")
@@ -73,7 +75,7 @@ public class PhotovoltaicController {
         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);
+        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());

+ 2 - 2
power-fitting/src/main/java/com/gyee/power/fitting/model/Windturbine.java

@@ -35,10 +35,10 @@ public class Windturbine extends Model<Windturbine> {
     private String windpowerstationid;
 
     @TableField("LONGITUDE")
-    private String longitude;
+    private Double longitude;
 
     @TableField("LATITUDE")
-    private String latitude;
+    private Double latitude;
 
     @TableField("MODELID")
     private String modelid;

+ 14 - 3
power-fitting/src/main/java/com/gyee/power/fitting/model/anno/AnnotationTool.java

@@ -1,5 +1,10 @@
 package com.gyee.power.fitting.model.anno;
 
+import com.gyee.power.fitting.common.spring.ConfigurationManager;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
 import java.lang.reflect.Field;
 import java.util.Collections;
 import java.util.LinkedList;
@@ -8,13 +13,18 @@ import java.util.List;
 /**
  * 注解工具类,提供解析注解的方法
  */
+@Component
 public class AnnotationTool {
 
+    @Resource
+    private Environment environment;
+
+
     /**
      * 获取打了Desc注解的字典属性列表
      * @return 字典属性列表
      */
-    public static <T> List<FixedVo> getFixedVoList(Class<T> c) {
+    public <T> List<FixedVo> getFixedVoList(Class<T> c) {
         if (c == null) {
             return Collections.emptyList();
         }
@@ -26,12 +36,13 @@ public class AnnotationTool {
                 //使私有对象可以访问
                 field.setAccessible(true);
                 Desc desc = field.getAnnotation(Desc.class);
+                String code = ConfigurationManager.getAnnotationValue(Desc.class, field, environment);
                 if (desc != null) {
                     FixedVo vo = new FixedVo();
                     vo.setKey(String.valueOf(field.get(cls)));
                     vo.setName(field.getName());
                     vo.setDes(desc.des());
-                    vo.setUniformCode(desc.uniformCode());
+                    vo.setUniformCode(code);
                     vo.setRemark(desc.remark());
                     fixedVoList.add(vo);
                 }
@@ -48,7 +59,7 @@ public class AnnotationTool {
      * @param object
      * @return
      */
-    public static List<FixedVo> getValueList(Object object) {
+    public List<FixedVo> getValueList(Object object) {
         if (object == null) {
             return Collections.emptyList();
         }

+ 26 - 14
power-fitting/src/main/java/com/gyee/power/fitting/model/custom/PowerPointData.java

@@ -16,7 +16,7 @@ public class PowerPointData {
 
     public PowerPointData(String[] str, boolean isFilter){
         DecimalFormat df = new DecimalFormat("0.00");
-        if (str.length >= 9){
+        try{
             this.time = str[0];
             this.power = Double.valueOf(df.format(Double.valueOf(str[1])));
             this.speed = Double.valueOf(df.format(Double.valueOf(str[2])));
@@ -28,9 +28,12 @@ public class PowerPointData {
             this.dfwc = Double.valueOf(df.format(Double.valueOf(str[8])));
             this.angle = Double.valueOf(df.format(Double.valueOf(str[9])));
             this.hjwd = Double.valueOf(df.format(Double.valueOf(str[10])));
-        }
-        if (isFilter)
-            this.filter = Integer.valueOf(str[str.length - 1]);
+            this.yp1 = Double.valueOf(df.format(Double.valueOf(str[11])));
+            this.yp2 = Double.valueOf(df.format(Double.valueOf(str[12])));
+            this.yp3 = Double.valueOf(df.format(Double.valueOf(str[13])));
+            if (isFilter)
+                this.filter = Integer.valueOf(str[str.length - 1]);
+        }catch (Exception e){}
     }
 
     //时间
@@ -38,46 +41,55 @@ public class PowerPointData {
     private String time = "1970-01-01 00:00:00";
 
     //功率
-    @Desc(des = "功率", uniformCode = "AI130", remark = "1")
+    @Desc(des = "功率", uniformCode = "${uniformcode.power:AI130}", remark = "1")
     private double power = 0;
 
     //风速
-    @Desc(des = "风速", uniformCode = "AI022", remark = "1")
+    @Desc(des = "风速", uniformCode = "${uniformcode.speed:AI022}", remark = "1")
     private double speed = 0;
 
     //转速
-    @Desc(des = "转速",  uniformCode = "AI128", remark = "1")
+    @Desc(des = "转速",  uniformCode = "${uniformcode.rr:AI128}", remark = "1")
     private double rr = 0;
 
     //明细状态
     // 0-待机  1-手动停机  2-正常发电  3-缺陷降出力  4-限电降出力  5-限电停机  6-故障停机
     // 7-场内受累停机  8-检修停机  9-场内受累检修  10-电网受累  11-环境受累  12-风机离线
-    @Desc(des = "风机状态",  uniformCode = "ZTMX", remark = "1")
+    @Desc(des = "风机状态",  uniformCode = "${uniformcode.mxzt:ZTMX}", remark = "1")
     private int mxzt = 0;
 
     //电量
-    @Desc(des = "电量",  uniformCode = "RFDL", remark = "1")
+    @Desc(des = "电量",  uniformCode = "${uniformcode.dl:RFDL}", remark = "1")
     private double dl = 0;
 
     //欠发状态
-    @Desc(des = "欠发状态",  uniformCode = "RSSQFZT", remark = "1")
+    @Desc(des = "欠发状态",  uniformCode = "${uniformcode.qfzt:RSSQFZT}", remark = "1")
     private int qfzt = 0;
 
     //风向
-    @Desc(des = "风向",  uniformCode = "AI008", remark = "1")
+    @Desc(des = "风向",  uniformCode = "${uniformcode.fx:AI008}", remark = "1")
     private double fx = 0;
 
     //对风误差
-    @Desc(des = "对风误差",  uniformCode = "AI036", remark = "1")
+    @Desc(des = "对风误差",  uniformCode = "${uniformcode.dfwc:AI036}", remark = "1")
     private double dfwc = 0;
 
     //偏航角度
-    @Desc(des = "偏航角度",  uniformCode = "AI034", remark = "1")
+    @Desc(des = "偏航角度",  uniformCode = "${uniformcode.angle:AI034}", remark = "1")
     private double angle = 0;
 
-    @Desc(des = "环境温度",  uniformCode = "AI056", remark = "1")
+    @Desc(des = "环境温度",  uniformCode = "${uniformcode.hjwd:AI056}", remark = "1")
     private double hjwd = 0;
 
+    @Desc(des = "叶片1",  uniformCode = "${uniformcode.yp1:AI085}", remark = "1")
+    private double yp1 = 0;
+
+    @Desc(des = "叶片2",  uniformCode = "${uniformcode.yp2:AI086}", remark = "1")
+    private double yp2 = 0;
+
+    @Desc(des = "叶片3",  uniformCode = "${uniformcode.yp3:AI087}", remark = "1")
+    private double yp3 = 0;
+
     //是否过滤  0:不过滤 1:过滤
     @Desc(des = "筛选", remark = "0")
     private int filter = 0;

+ 76 - 0
power-fitting/src/main/java/com/gyee/power/fitting/service/custom/blade/BladeService.java

@@ -0,0 +1,76 @@
+package com.gyee.power.fitting.service.custom.blade;
+
+import com.gyee.power.fitting.common.util.FileUtil;
+import com.gyee.power.fitting.model.Powerfittinganalysis;
+import com.gyee.power.fitting.model.custom.PowerPointData;
+import com.gyee.power.fitting.service.PowerfittinganalysisService;
+import lombok.val;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class BladeService {
+
+    @Resource
+    private PowerfittinganalysisService powerService;
+
+    /**
+     * 3个叶片的角度
+     * @param ids
+     * @return
+     */
+    public Object bladeData(String ids){
+        Map<String, Object> result = new HashMap<>();
+        List<Powerfittinganalysis> list = powerService.selectListByIds(ids);
+        if (list.size() == 0)
+            return result;
+
+        List<String> time = new ArrayList<>();
+        List<Object> temp = new ArrayList<>();
+        for (int i = 0; i < list.size(); i++){
+            Powerfittinganalysis obj = list.get(i);
+            TreeMap<String, Object> mp = new TreeMap<>();
+            List<Double> p1 = new ArrayList<>();
+            List<Double> p2 = new ArrayList<>();
+            List<Double> p3 = new ArrayList<>();
+            List<PowerPointData> ls = csvParse(obj);
+            for (PowerPointData item : ls){
+                p1.add(item.getYp1());
+                p2.add(item.getYp2());
+                p3.add(item.getYp3());
+            }
+            mp.put("yp1", p1);
+            mp.put("yp2", p2);
+            mp.put("yp3", p3);
+            mp.put("wt", obj.getWindturbine());
+            if (time.size() == 0)
+                time.addAll(ls.stream().map(m -> m.getTime()).collect(Collectors.toList()));
+            temp.add(mp);
+        }
+        result.put("time", time);
+        result.put("angle", temp);
+
+        return result;
+    }
+
+    /**
+     * csv 文件解析成对象
+     * @param obj
+     * @return
+     */
+    private List<PowerPointData> csvParse(Powerfittinganalysis obj){
+        List<PowerPointData> list = new ArrayList<>();
+        val content = FileUtil.readFile(obj.getPath(), true);
+        for (int i = 1; i < content.size(); i++){
+            String[] split = content.get(i).split(",");
+            PowerPointData data = new PowerPointData(split, false);
+            list.add(data);
+        }
+
+        return list;
+    }
+
+}

+ 15 - 3
power-fitting/src/main/java/com/gyee/power/fitting/service/custom/curve/DataFittingService.java

@@ -4,6 +4,8 @@ import com.gyee.power.fitting.common.alg.DBSCANPointALG;
 import com.gyee.power.fitting.common.alg.PowerFittingALG;
 import com.gyee.power.fitting.common.config.GyeeConfig;
 import com.gyee.power.fitting.common.constants.Constants;
+import com.gyee.power.fitting.common.exception.CustomException;
+import com.gyee.power.fitting.common.result.ResultCode;
 import com.gyee.power.fitting.common.spring.InitialRunner;
 import com.gyee.power.fitting.common.util.DateUtil;
 import com.gyee.power.fitting.common.util.FileUtil;
@@ -12,6 +14,7 @@ import com.gyee.power.fitting.common.util.SnowFlakeUtil;
 import com.gyee.power.fitting.model.Modelpowerdetails;
 import com.gyee.power.fitting.model.Powerfittinganalysis;
 import com.gyee.power.fitting.model.Powermodel;
+import com.gyee.power.fitting.model.Windturbine;
 import com.gyee.power.fitting.model.anno.AnnotationTool;
 import com.gyee.power.fitting.model.anno.FixedVo;
 import com.gyee.power.fitting.model.custom.*;
@@ -39,6 +42,8 @@ public class DataFittingService {
     @Resource
     private GyeeConfig config;
     @Resource
+    private AnnotationTool annotationTool;
+    @Resource
     private InitialRunner initialRunner;
     @Resource
     private PowermodelService modelService;
@@ -143,7 +148,7 @@ public class DataFittingService {
         Map<String, Object> map = new HashMap<>();
 
         /** 添加标题 **/
-        List<FixedVo> fxList = AnnotationTool.getFixedVoList(PowerFittingData.class);
+        List<FixedVo> fxList = annotationTool.getFixedVoList(PowerFittingData.class);
         List<TableTitle> lt = fxList.stream().filter(f -> f.getRemark().equals("1"))
                 .map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
 
@@ -254,7 +259,7 @@ public class DataFittingService {
 
     private StringBuilder setTitle(){
         val sb = new StringBuilder();
-        val list = AnnotationTool.getFixedVoList(PowerFittingData.class);
+        val list = annotationTool.getFixedVoList(PowerFittingData.class);
         String columnName = list.stream().filter(f -> f.getRemark().equals("1")).map(FixedVo::getDes).collect(Collectors.joining(","));
         sb.append(columnName).append("\n");
         return sb;
@@ -434,11 +439,17 @@ public class DataFittingService {
      */
     public Object dataFittingLine(String ids) {
         List<Object> result = new ArrayList<>();
+        Map<String, Windturbine> wtMap = InitialRunner.wtMap;
         List<Powerfittinganalysis> list = powerService.selectListByIds(ids);
         if (list.size() == 0)
             return result;
 
+        String model = wtMap.get(list.get(0).getWindturbine()).getModelid();
         list.forEach(item -> {
+            //机型不一致,额定功率计算不准确
+            if (!model.equals(wtMap.get(item.getWindturbine()).getModelid()))
+                throw new CustomException(4010, item.getWindturbine() + "机型不一致,请重新选择");
+
             //实际功率、风速
             Map<String, Object> map = new HashMap<>();
             List<Object> sjgl = new ArrayList<>();
@@ -453,7 +464,7 @@ public class DataFittingService {
         });
 
         //保证功率
-        List<Modelpowerdetails> modelPower = InitialRunner.modelPowerDetailMap.get(InitialRunner.wtMap.get(list.get(0).getWindturbine()).getModelid());
+        List<Modelpowerdetails> modelPower = InitialRunner.modelPowerDetailMap.get(wtMap.get(list.get(0).getWindturbine()).getModelid());
         List<Object> bzgl = modelPower.stream().sorted(Comparator.comparing(Modelpowerdetails::getSpeed)).map(m -> new double[]{m.getSpeed(), m.getEnsurepower()}).collect(Collectors.toList());
 
         Map<String, Object> map = new HashMap<>();
@@ -553,4 +564,5 @@ public class DataFittingService {
             }
         });
     }
+
 }

+ 9 - 7
power-fitting/src/main/java/com/gyee/power/fitting/service/custom/curve/DataPrepareService.java

@@ -21,10 +21,10 @@ import com.gyee.power.fitting.service.PowerfittinganalysisService;
 import com.gyee.power.fitting.service.custom.socket.WebSocketServer;
 import lombok.extern.slf4j.Slf4j;
 import lombok.val;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -37,13 +37,15 @@ import java.util.stream.Collectors;
 @Service
 public class DataPrepareService {
 
-    @Autowired
+    @Resource
     private GyeeConfig config;
-    @Autowired
+    @Resource
+    private AnnotationTool annotationTool;
+    @Resource
     WebSocketServer socketServer;
-    @Autowired
+    @Resource
     private PowerfittinganalysisService powerService;
-    @Autowired
+    @Resource
     private RemoteServiceBuilder remoteService;
 
     /**
@@ -123,7 +125,7 @@ public class DataPrepareService {
         val map = new HashMap<String, Object>();
 
         /** 添加标题 **/
-        List<FixedVo> fxList = AnnotationTool.getFixedVoList(PowerPointData.class);
+        List<FixedVo> fxList = annotationTool.getFixedVoList(PowerPointData.class);
         List<TableTitle> lt = fxList.stream().filter(f -> f.getRemark().equals("1"))
                 .map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
 
@@ -163,7 +165,7 @@ public class DataPrepareService {
 
     private StringBuilder setTitle(){
         StringBuilder sb = new StringBuilder();
-        val list = AnnotationTool.getFixedVoList(PowerPointData.class);
+        val list = annotationTool.getFixedVoList(PowerPointData.class);
         String columnName = list.stream().filter(f -> f.getRemark().equals("1")).map(FixedVo::getDes).collect(Collectors.joining(","));
         sb.append(columnName).append("\n");
         return sb;

+ 8 - 7
power-fitting/src/main/java/com/gyee/power/fitting/service/custom/curve/DataProcessService.java

@@ -1,6 +1,5 @@
 package com.gyee.power.fitting.service.custom.curve;
 
-import com.gyee.power.fitting.common.alg.PowerFittingALG;
 import com.gyee.power.fitting.common.alg.PowerProcessALG;
 import com.gyee.power.fitting.common.alg.WindDirectionALG;
 import com.gyee.power.fitting.common.config.GyeeConfig;
@@ -17,9 +16,9 @@ import com.gyee.power.fitting.model.custom.PowerPointData;
 import com.gyee.power.fitting.model.custom.TableTitle;
 import com.gyee.power.fitting.service.PowerfittinganalysisService;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -29,9 +28,11 @@ import java.util.stream.Collectors;
 @Service
 public class DataProcessService {
 
-    @Autowired
+    @Resource
     private GyeeConfig config;
-    @Autowired
+    @Resource
+    private AnnotationTool annotationTool;
+    @Resource
     private PowerfittinganalysisService powerService;
 
     /**
@@ -110,7 +111,7 @@ public class DataProcessService {
         Map<String, Object> map = new HashMap<>();
 
         /** 添加标题 **/
-        List<FixedVo> fxList = AnnotationTool.getFixedVoList(PowerPointData.class);
+        List<FixedVo> fxList = annotationTool.getFixedVoList(PowerPointData.class);
         List<TableTitle> lt = fxList.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
 
         /** 添加内容  读取前500行 **/
@@ -133,7 +134,7 @@ public class DataProcessService {
     private String assemble(List<PowerPointData> list) {
         StringBuilder sb = setTitle();
         for (PowerPointData obj : list){
-            List<FixedVo> ls = AnnotationTool.getValueList(obj);
+            List<FixedVo> ls = annotationTool.getValueList(obj);
             String data = ls.stream().filter(f -> !StringUtils.isEmpty(f.getRemark())).map(FixedVo::getKey).collect(Collectors.joining(","));
             sb.append(data).append("\n");
         }
@@ -143,7 +144,7 @@ public class DataProcessService {
 
     private StringBuilder setTitle() {
         StringBuilder sb = new StringBuilder();
-        List<FixedVo> list = AnnotationTool.getFixedVoList(PowerPointData.class);
+        List<FixedVo> list = annotationTool.getFixedVoList(PowerPointData.class);
         String columnName = list.stream().map(FixedVo::getDes).collect(Collectors.joining(","));
         sb.append(columnName).append("\n");
         return sb;

+ 9 - 7
power-fitting/src/main/java/com/gyee/power/fitting/service/custom/fiveloss/FiveLossService.java

@@ -35,6 +35,8 @@ import java.util.stream.Collectors;
 public class FiveLossService {
 
     @Resource
+    private AnnotationTool annotationTool;
+    @Resource
     private PowerfittinganalysisService analysisService;
     @Resource
     private PowerlossinfoService lossInfoService;
@@ -98,7 +100,7 @@ public class FiveLossService {
                 }).sorted(Comparator.comparing(FjjxbVo::getId)).collect(Collectors.toList());
 
         /** 添加标题 **/
-        List<FixedVo> fxList = AnnotationTool.getFixedVoList(FjjxbVo.class);
+        List<FixedVo> fxList = annotationTool.getFixedVoList(FjjxbVo.class);
         List<TableTitle> lt = fxList.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
 
         promise.put("title", lt);
@@ -116,7 +118,7 @@ public class FiveLossService {
     @Async
     @Transactional
     public void fiveLossCal() {
-        log.info("======风机绩效榜计算开始.............");
+        log.info("======损失电量计算开始.............");
         Map<String, Windturbine> wtmap = InitialRunner.wtMap;
         Map<String, Map<Double, Double>> zsglmap = InitialRunner.zsllglMap;
 
@@ -135,7 +137,7 @@ public class FiveLossService {
                 continue;
             }
 
-            log.info("======风机绩效榜计算:" + p.getWindturbine());
+            log.info("======损失电量计算:" + p.getWindturbine());
             content.remove(0); //去掉标题栏
             int count = 86400 / p.getInterp(); //一天86400s  一天的条数
             List<List<String>> coll = CollectUtil.groupListByQty(content, count);
@@ -353,7 +355,7 @@ public class FiveLossService {
      * @param ids  准备的数据ID
      */
     public Map<String, Object> fiveLossCalByZSGL(String ids) {
-        log.info("======风机绩效榜计算开始.............");
+        log.info("======损失电量计算开始.............");
         Map<String, Object> promise = new HashMap<>();
         List<FjjxbVo> result = new ArrayList<>();
         Map<String, Map<Double, Double>> zsglmap = InitialRunner.zsllglMap;
@@ -367,10 +369,10 @@ public class FiveLossService {
         for (Powerfittinganalysis p : analyses) {
             List<String> content = FileUtil.readFile(p.getPath(), true);
             if (content.size() == 0 || zsglmap.size() == 0 || zsglmap.get(p.getWindturbine()) == null){
-                log.info("======风机榜效帮计算结束," + p.getWindturbine() + "文件内容或当前风机的自算功率为空.............");
+                log.info(p.getWindturbine() + "文件内容或当前风机的自算功率为空.............");
                 continue;
             }
-            log.info("======风机绩效榜计算:" + p.getWindturbine());
+            log.info("======损失电量计算:" + p.getWindturbine());
             double llfdl = 0.0; //理论发电量
             double rfdl = 0.0; //日发电量
             double jhjxssdl = 0.0;//计划检修损失电量
@@ -424,7 +426,7 @@ public class FiveLossService {
         log.info("======风机榜效帮计算结束.............");
         result.stream().sorted(Comparator.comparing(FjjxbVo::getId));
         /** 添加标题 **/
-        List<FixedVo> fxList = AnnotationTool.getFixedVoList(FjjxbVo.class);
+        List<FixedVo> fxList = annotationTool.getFixedVoList(FjjxbVo.class);
         List<TableTitle> lt = fxList.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
         promise.put("title", lt);
         promise.put("data", result);

+ 21 - 10
power-fitting/src/main/java/com/gyee/power/fitting/service/custom/ratedpower/RatedPowerService.java

@@ -1,17 +1,19 @@
 package com.gyee.power.fitting.service.custom.ratedpower;
 
+import com.gyee.power.fitting.common.spring.InitialRunner;
 import com.gyee.power.fitting.common.util.FileUtil;
+import com.gyee.power.fitting.model.Equipmentmodel;
 import com.gyee.power.fitting.model.Powerfittinganalysis;
+import com.gyee.power.fitting.model.Windturbine;
 import com.gyee.power.fitting.model.custom.PowerPointData;
 import com.gyee.power.fitting.service.PowerfittinganalysisService;
 import lombok.val;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
 
 /**
  * 额定功率分析
@@ -25,21 +27,30 @@ public class RatedPowerService {
 
     public Object ratePowerAnalysis(String ids) {
         Map<String, Object> result = new HashMap<>();
+        Map<String, Equipmentmodel> eqMap = InitialRunner.equipmentMap;
+        Map<String, Windturbine> wtMap = InitialRunner.wtMap;
         List<Powerfittinganalysis> list = powerService.selectListByIds(ids);
-        if (list == null || list.size() == 0)
+        if (list.size() == 0)
             return result;
 
         List<PowerPointData> all = new ArrayList<>();
-        Map<String, Double> map = new HashMap<>();
+        TreeMap<String, Double> map = new TreeMap<>();
         for (Powerfittinganalysis obj : list){
-            List<PowerPointData> ls = csvParse(obj);
-            all.addAll(ls);
-            map.put(obj.getWindturbine(), ls.stream().mapToDouble(PowerPointData::getPower).average().getAsDouble());
+            String[] spid = obj.getProcessid().split(",");
+            for (String id : spid){
+                Powerfittinganalysis item = powerService.selectItemById(id);
+                List<PowerPointData> ls = csvParse(item);
+                all.addAll(ls);
+                double avg = ls.size() > 0 ? ls.stream().mapToDouble(PowerPointData::getPower).average().getAsDouble() : 0;
+                map.put(item.getWindturbine(), new BigDecimal(avg).setScale(0, RoundingMode.CEILING).doubleValue());
+            }
         }
-        double avgData = all.stream().mapToDouble(PowerPointData::getPower).average().getAsDouble();
+        double avg = all.size() > 0 ? all.stream().mapToDouble(PowerPointData::getPower).average().getAsDouble() : 0;
+        double avgData = new BigDecimal(avg).setScale(0, RoundingMode.CEILING).doubleValue();
 
         result.put("avg", avgData);
         result.put("data", map);
+        result.put("power", eqMap.get(wtMap.get(list.get(0).getWindturbine()).getModelid()).getPowerproduction());
 
         return result;
     }

+ 3 - 1
power-fitting/src/main/java/com/gyee/power/fitting/service/custom/temperature/PowerTemperatureService.java

@@ -20,6 +20,8 @@ import java.util.stream.Collectors;
 public class PowerTemperatureService {
 
     @Resource
+    private AnnotationTool annotationTool;
+    @Resource
     private PowerfittinganalysisService powerService;
 
     /**
@@ -142,7 +144,7 @@ public class PowerTemperatureService {
         Map<String, Object> map = new HashMap<>();
 
         /** 添加标题 **/
-        List<FixedVo> fxList = AnnotationTool.getFixedVoList(PowerTemperatureData.class);
+        List<FixedVo> fxList = annotationTool.getFixedVoList(PowerTemperatureData.class);
         List<TableTitle> lt = fxList.stream().filter(f -> f.getRemark().equals("1"))
                 .map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
 

+ 18 - 15
power-fitting/src/main/java/com/gyee/power/fitting/service/impl/IvPvCurveFittingService.java

@@ -36,15 +36,18 @@ import java.util.stream.Collectors;
 public class IvPvCurveFittingService {
 
     @Resource
-    private IWindpowerstationtestingpoint2Service windpowerstationtestingpoint2Service;
+    private IWindpowerstationtestingpoint2Service stationPointService;
     @Resource
-    private Windturbinetestingpointai2Service windturbinetestingpointai2Service;
+    private Windturbinetestingpointai2Service windPointService;
     @Resource
     private IAdapterService adpClient;
     @Resource
     private GyeeConfig config;
     @Resource
     private PolynomialCurveFitting pncf;
+    @Resource
+    private AnnotationTool annotationTool;
+
 
     public void getDatas2File(String stationid, long start, long end) {
 
@@ -63,7 +66,7 @@ public class IvPvCurveFittingService {
     private void infos2File(List<List<PhotovoltaicInfo>> datas) {
 
         //文件第一行
-        List<FixedVo> fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
+        List<FixedVo> fixedVos = annotationTool.getFixedVoList(PhotovoltaicInfo.class);
         String columnName = fixedVos.stream().map(FixedVo::getDes).collect(Collectors.joining(","));
         //遍历逆变器
         for (List<PhotovoltaicInfo> data : datas) {
@@ -112,7 +115,7 @@ public class IvPvCurveFittingService {
     }
 
     public Map<String, Object> getTable(String s) {
-        List<FixedVo> fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
+        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\\" + s;
@@ -162,7 +165,7 @@ public class IvPvCurveFittingService {
      */
     public Map<String, List<PhotovoltaicInfo>> calculatAnalysis(List<String> fileList) {
 
-        String bzcldPath = config.getFilePathPrepare() + "bzd\\标准点.csv";
+        String bzcldPath = config.getFilePathPrepare() + "bzd标准点.csv";
         List<PhotovoltaicInfo> bzclds = file2Info(bzcldPath, true);
         Map<String, PhotovoltaicInfo> bzcldMap = bzclds.stream().collect(Collectors.toMap(PhotovoltaicInfo::getInverter, Function.identity()));
 
@@ -257,7 +260,7 @@ public class IvPvCurveFittingService {
         }
 
         //文件第一行
-        List<FixedVo> fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
+        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");
@@ -281,7 +284,7 @@ public class IvPvCurveFittingService {
 
     public List<TableTitle> getTheoryTitel() {
 
-        List<FixedVo> fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
+        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());
@@ -353,7 +356,7 @@ public class IvPvCurveFittingService {
         Map<String, PhotovoltaicInfo> bzcldMap = bzclds.stream().collect(Collectors.toMap(PhotovoltaicInfo::getInverter, Function.identity()));
 
         //获取实际发电量
-        List<Windpowerstationtestingpoint2> rfdl = windpowerstationtestingpoint2Service.getPoints(null, "RFDL");
+        List<Windpowerstationtestingpoint2> rfdl = stationPointService.getPoints(null, "RFDL");
         List<FjjxbVo> infos = new ArrayList<>();
         //遍历逆变器
         for (Windpowerstationtestingpoint2 wstp : rfdl) {
@@ -508,26 +511,26 @@ public class IvPvCurveFittingService {
                 List<Windturbinetestingpointai2> adyPoints = null;
                 if ("HZJ_GDC".equals(stationid)) {
                     //电网A相电压
-                    adyPoints = windturbinetestingpointai2Service.getPoints(stationid, null, "AIG063");
+                    adyPoints = windPointService.getPoints(stationid, null, "AIG063");
                 } else {
                     //电网A相电压
-                    adyPoints = windturbinetestingpointai2Service.getPoints(stationid, null, "AIG061");
+                    adyPoints = windPointService.getPoints(stationid, null, "AIG061");
                 }
                 return adyPoints.stream().collect(Collectors.toMap(Windturbinetestingpointai2::getWindturbineid, Windturbinetestingpointai2::getCode));
             case "bdy":
-                List<Windturbinetestingpointai2> bdyPoints = windturbinetestingpointai2Service.getPoints(stationid, null, "AIG061A");
+                List<Windturbinetestingpointai2> bdyPoints = windPointService.getPoints(stationid, null, "AIG061A");
                 return bdyPoints.stream().collect(Collectors.toMap(Windturbinetestingpointai2::getWindturbineid, Windturbinetestingpointai2::getCode));
             case "cdy":
-                List<Windturbinetestingpointai2> cdyPoints = windturbinetestingpointai2Service.getPoints(stationid, null, "AIG065");
+                List<Windturbinetestingpointai2> cdyPoints = windPointService.getPoints(stationid, null, "AIG065");
                 return cdyPoints.stream().collect(Collectors.toMap(Windturbinetestingpointai2::getWindturbineid, Windturbinetestingpointai2::getCode));
             case "adl":
-                List<Windturbinetestingpointai2> adlPoints = windturbinetestingpointai2Service.getPoints(stationid, null, "AIG060");
+                List<Windturbinetestingpointai2> adlPoints = windPointService.getPoints(stationid, null, "AIG060");
                 return adlPoints.stream().collect(Collectors.toMap(Windturbinetestingpointai2::getWindturbineid, Windturbinetestingpointai2::getCode));
             case "bdl":
-                List<Windturbinetestingpointai2> bdlPoints = windturbinetestingpointai2Service.getPoints(stationid, null, "AIG062");
+                List<Windturbinetestingpointai2> bdlPoints = windPointService.getPoints(stationid, null, "AIG062");
                 return bdlPoints.stream().collect(Collectors.toMap(Windturbinetestingpointai2::getWindturbineid, Windturbinetestingpointai2::getCode));
             case "cdl":
-                List<Windturbinetestingpointai2> cdlPoints = windturbinetestingpointai2Service.getPoints(stationid, null, "AIG064");
+                List<Windturbinetestingpointai2> cdlPoints = windPointService.getPoints(stationid, null, "AIG064");
                 return cdlPoints.stream().collect(Collectors.toMap(Windturbinetestingpointai2::getWindturbineid, Windturbinetestingpointai2::getCode));
         }
         return new HashMap<>();

+ 21 - 8
power-fitting/src/main/resources/application.yaml

@@ -2,19 +2,19 @@ gyee:
   # 实时适配器的url
   adapter-url: http://10.155.32.4:8011
   # 数据准备保存路径(原始数据)
-  file-path-prepare: data\prepare\
+  file-path-prepare: data/prepare/
   # 数据处理保存路径(处理后的数据)
-  file-path-process: data\precess\
+  file-path-process: data/precess/
   # 数据拟合保存路径(拟合后的数据)
-  file-path-fitting: data\fitting\
+  file-path-fitting: data/fitting/
   # 数据压缩下载
-  file-path-download: data\zip\
+  file-path-download: data/zip/
   # 功率曲线离线数据保存路径
-  file-path-power: data\power\
+  file-path-power: data/power/
   # 数据准备时由于数据量太大,初始一个默认间隔,用于适配器取数
   interval: 20
   # 当前是否是离线环境
-  off-line: true
+  off-line: false
   # 是否实时计算五损数据   true:连接实时数据库按天计算   false:使用离线数据按月计算
   real-time-cal: false
 
@@ -73,7 +73,6 @@ spring:
       # 池中的连接空闲30分钟后被回收(默认30分钟)
       min-evictable-idle-time-millis: 1800000
 
-
 ####################Mybatis Plus配置####################
 mybatis-plus:
   configuration:
@@ -81,7 +80,6 @@ mybatis-plus:
     # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 ####################Mybatis Plus配置####################
 
-
 logging:
   level:
     root: info
@@ -89,4 +87,19 @@ logging:
   file:
     path: ./logs
 
+uniformcode:
+  power: AI130  #功率
+  speed: AI022  #风速
+  rr: AI128  #转速
+  mxzt: ZTMX  #风机状态
+  dl: RFDL  #电量
+  qfzt: RSSQFZT  #欠发状态
+  fx: AI008  #风向
+  dfwc: AI036  #对风误差
+  angle: AI034  #偏航角度
+  hjwd: AI056  #环境温度
+  yp1: AI085  #叶片1
+  yp2: AI086  #叶片2
+  yp3: AI087  #叶片3
+
 

BIN
power-fitting/src/main/resources/image/img.png


BIN
power-fitting/src/main/resources/image/img_1.png


BIN
power-fitting/src/main/resources/image/img_2.png


+ 36 - 3
power-fitting/src/main/resources/readme.md

@@ -1,4 +1,37 @@
-### 1.添加测点并保存文件
-1)application.yaml文件  gyee下的points增加测点统一编码
+### 一、使用的数据库表
+| 表名                            | 描述                |
+|-------------------------------|-------------------|
+| WINDPOWERSTATION              | 场站风机场站信息          |
+| WINDTURBINE                   | 风机基础信息            |
+| WINDTURBINETESTINGPOINTAI2    | 风机测点信息            |
+| EQUIPMENTMODEL                | 不同型号信息            |
+| MODELPOWERDETAILS             | 不同型号的保证功率         |
+| POWERFITTINGANALYSIS          | 数据准备              |
+| POWERMODEL                    | 单台风机自算功率          |
+| POWERWINDINFO                 | 毛容量系数             |
+
+### 二、使用的测点
+- WINDTURBINETESTINGPOINTAI2表:
+
+| 描述        | 统一编码(uniformcode)  |
+|-----------|--------------------|
+| 风速        | AI022              |
+| 转速        | AI128              |
+| 风机状态      | ZTMX               |
+| 电量        | RFDL               |
+| 欠发状态      | RSSQFZT            |
+| 风向        | AI008              |
+| 对风误差      | AI036              |
+| 偏航角度      | AI034              |
+| 环境温度      | AI056              |
+
+### 三、必须配置的数据
+- WINDPOWERSTATION覆盖所有场站
+- WINDTURBINE覆盖所有风机
+- EQUIPMENTMODEL中必须覆盖到全部机型:
+
+  ![img_1.png](image/img_1.png)
+- MODELPOWERDETAILS中必须覆盖到全部机型,风速从3-25米,间隔0.01:
+
+  ![img_2.png](image/img_2.png)
 
-2)model/custom包下的PowerPointData.java类增加对应的字段及描述