Pārlūkot izejas kodu

计算服务修改

xieshengjie 3 gadi atpakaļ
vecāks
revīzija
428f4ecc30
47 mainītis faili ar 2572 papildinājumiem un 327 dzēšanām
  1. 9 0
      common/src/main/java/com/gyee/common/contant/Contant.java
  2. 19 0
      common/src/main/java/com/gyee/common/vo/curve/CurveVo.java
  3. 8 2
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/config/GeneratorCodeConfig.java
  4. 20 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/controller/auto/EquipmentmodelController.java
  5. 20 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/controller/auto/Windturbinecurvefitting2Controller.java
  6. 20 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/controller/auto/Windturbineinfoday3Controller.java
  7. 20 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/controller/auto/WindturbineinfodayController.java
  8. 19 10
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/init/CacheContext.java
  9. 16 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/mapper/auto/EquipmentmodelMapper.java
  10. 16 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/mapper/auto/Windturbinecurvefitting2Mapper.java
  11. 16 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/mapper/auto/Windturbineinfoday3Mapper.java
  12. 16 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/mapper/auto/WindturbineinfodayMapper.java
  13. 48 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Equipmentmodel.java
  14. 2 1
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windpowerinfoday.java
  15. 2 1
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windpowerinfoday3.java
  16. 40 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windturbinecurvefitting2.java
  17. 180 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windturbineinfoday.java
  18. 118 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windturbineinfoday3.java
  19. 16 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/IEquipmentmodelService.java
  20. 16 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/IWindturbinecurvefitting2Service.java
  21. 16 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/IWindturbineinfoday3Service.java
  22. 16 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/IWindturbineinfodayService.java
  23. 20 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/impl/EquipmentmodelServiceImpl.java
  24. 20 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/impl/Windturbinecurvefitting2ServiceImpl.java
  25. 20 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/impl/Windturbineinfoday3ServiceImpl.java
  26. 20 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/impl/WindturbineinfodayServiceImpl.java
  27. 732 0
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/infoday/InfodayService.java
  28. 21 2
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/task/SaticScheduleTask.java
  29. 320 270
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/util/realtimesource/EdosUtil.java
  30. 36 6
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/util/realtimesource/IEdosUtil.java
  31. 8 2
      histroy/benchmarking-histroy-new/src/test/java/com/gyee/benchmarkinghistroy/BenchmarkingHistroyMainNewTest.java
  32. 181 23
      realtime/generation-service/src/main/java/com/gyee/generation/service/FiveLossesService.java
  33. 1 0
      realtime/generation-service/src/main/java/com/gyee/generation/service/StatusService.java
  34. 69 0
      realtime/generation-service/src/main/java/com/gyee/generation/service/UnderissuanceService.java
  35. 16 0
      web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/controller/benching/BenchmarkingController.java
  36. 41 0
      web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/controller/performance/PerformanceController.java
  37. 4 0
      web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/service/benching/BenchmarkingService.java
  38. 72 0
      web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/service/performance/PerformanceService.java
  39. 44 0
      web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/util/redis/RedisAutoConfiguration.java
  40. 47 0
      web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/util/redis/RedisConfig.java
  41. 49 0
      web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/util/redis/RedisService.java
  42. 124 0
      web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/util/redis/RedisServiceImpl.java
  43. 7 0
      web/consumer/src/main/java/com/gyee/consumer/api/benching/BenchmarkingApi.java
  44. 28 0
      web/consumer/src/main/java/com/gyee/consumer/api/performance/PerformanceApi.java
  45. 10 9
      web/consumer/src/main/java/com/gyee/consumer/controller/benching/BenchmarkingController.java
  46. 28 0
      web/consumer/src/main/java/com/gyee/consumer/controller/performance/PerformanceController.java
  47. 1 1
      web/consumer/src/main/resources/application.yml

+ 9 - 0
common/src/main/java/com/gyee/common/contant/Contant.java

@@ -70,6 +70,8 @@ public class Contant {
     public static final String FJ5T = "FJZT"; //五种状态
     public static final String AI422 = "AI422";  //AI状态码
 
+    public static final String RSSQFZT = "RSSQFZT";  //实时欠发状态
+
     //明细状态
     public static final String CNGZNUM = "CNGZNUM";  //场内受累故障台数(明细)
     public static final String CNJXNUM = "CNJXNUM";  //场内受累检修台数(明细)
@@ -190,6 +192,13 @@ public class Contant {
     public static final String NWZZSDL = "NWZZSDL";//电网受累
     public static final String NTZZSDL = "NTZZSDL";//天气受累
 
+    //欠发发电量
+    public static final String R0QFZT = "R0QFZT";
+    public static final String R1QFZT = "R1QFZT";
+    public static final String R2QFZT = "R2QFZT";
+    public static final String R3QFZT = "R3QFZT";
+    public static final String R4QFZT = "R4QFZT";
+
 
 
 

+ 19 - 0
common/src/main/java/com/gyee/common/vo/curve/CurveVo.java

@@ -0,0 +1,19 @@
+package com.gyee.common.vo.curve;
+
+import lombok.Data;
+
+/**
+ * @ClassName : CurveVo
+ * @Author : xieshengjie
+ * @Date: 2022/5/13 11:40
+ * @Description :
+ */
+@Data
+public class CurveVo {
+
+    private String wtid;
+    private Double speed;
+    private Double theorypower;
+    private Double ensurepower;
+
+}

+ 8 - 2
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/config/GeneratorCodeConfig.java

@@ -55,10 +55,16 @@ public class GeneratorCodeConfig {
 //        dsc.setPassword("root");
 //        mpg.setDataSource(dsc);
 
-        dsc.setDriverName("oracle.jdbc.driver.OracleDriver");
+//        dsc.setDriverName("oracle.jdbc.driver.OracleDriver");
+//        dsc.setUsername("gdprod");
+//        dsc.setPassword("gd123");
+//        dsc.setUrl("jdbc:oracle:thin:@10.83.68.165:1521:gdsj");
+//        mpg.setDataSource(dsc);
+
+        dsc.setDriverName("org.postgresql.Driver");
         dsc.setUsername("gdprod");
         dsc.setPassword("gd123");
-        dsc.setUrl("jdbc:oracle:thin:@10.83.68.165:1521:gdsj");
+        dsc.setUrl("jdbc:postgresql://10.81.3.151:5432/wisdom");
         mpg.setDataSource(dsc);
 
 //        dsc.setDriverName("com.cloudera.impala.jdbc41.Driver");

+ 20 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/controller/auto/EquipmentmodelController.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghistroy.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+@RestController
+@RequestMapping("//equipmentmodel")
+public class EquipmentmodelController {
+
+}

+ 20 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/controller/auto/Windturbinecurvefitting2Controller.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghistroy.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-13
+ */
+@RestController
+@RequestMapping("//windturbinecurvefitting2")
+public class Windturbinecurvefitting2Controller {
+
+}

+ 20 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/controller/auto/Windturbineinfoday3Controller.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghistroy.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-11
+ */
+@RestController
+@RequestMapping("//windturbineinfoday3")
+public class Windturbineinfoday3Controller {
+
+}

+ 20 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/controller/auto/WindturbineinfodayController.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghistroy.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+@RestController
+@RequestMapping("//windturbineinfoday")
+public class WindturbineinfodayController {
+
+}

+ 19 - 10
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/init/CacheContext.java

@@ -3,6 +3,7 @@ package com.gyee.benchmarkinghistroy.init;
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.benchmarkinghistroy.model.auto.*;
 import com.gyee.benchmarkinghistroy.service.auto.*;
 import com.gyee.benchmarkinghistroy.util.redis.RedisService;
@@ -13,10 +14,7 @@ import org.springframework.boot.CommandLineRunner;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @ClassName : CacheContext
@@ -44,6 +42,8 @@ public class CacheContext implements CommandLineRunner {
     private IWindpowerstationpointnewService windpowerstationpointnewService;
     @Resource
     private RedisService redisService;
+    @Resource
+    private IEquipmentmodelService equipmentmodelService;
 
     public static Map<String, List<Windturbine>> wtmap = new HashMap<>();
 
@@ -58,6 +58,9 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap = new HashMap<>();// 风电机测点AI表
 
     public static Map<String,Map<String, Windpowerstationpointnew>> wppointmap =new HashMap<>();
+    public static Map<String,Map<String, Windpowerstationpointnew>> pjPointmap =new HashMap<>();
+    public static Map<String,Map<String, Windpowerstationpointnew>> lnPointmap =new HashMap<>();
+    public static Map<String,Double> wtrlmap =new HashMap<>();
 
     public static List<Project> projects = new ArrayList<>();
 
@@ -88,17 +91,23 @@ public class CacheContext implements CommandLineRunner {
                 wts.add(wt);
                 wtmap.put(wt.getWindpowerstationid(),wts);
             }
+            QueryWrapper<Equipmentmodel> queryWrapper= new QueryWrapper<>();
+            queryWrapper.eq("id",wt.getModelid());
+            Optional<Equipmentmodel> first = equipmentmodelService.list(queryWrapper).stream().findFirst();
+            if (first.isPresent()){
+                wtrlmap.put(wt.getId(),first.get().getPowerproduction());
+            }
         });
 
         String wpString = redisService.get("PRODUCT-WP");
         wppointmap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
         });
-//        String pjString = JSON.toJSONString(redisService.get("PJ"));
-//        pjPointmap = JSONObject.parseObject(pjString, new TypeReference<Map<String, Map<String, WindPowerStationTestingPoint2>>>() {
-//        });
-//        String lnString = JSON.toJSONString(redisService.get("LN"));
-//        lnPointmap = JSONObject.parseObject(lnString, new TypeReference<Map<String, Map<String, WindPowerStationTestingPoint2>>>() {
-//        });
+        String pjString = redisService.get("PRODUCT-PJ");
+        pjPointmap = JSONObject.parseObject(pjString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
+        });
+        String lnString = redisService.get("PRODUCT-LN");
+        lnPointmap = JSONObject.parseObject(lnString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
+        });
 
         String wtString = redisService.get("PRODUCT-WT");
         wtpAimap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Map<String, Windturbinetestingpointnew>>>() {

+ 16 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/mapper/auto/EquipmentmodelMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkinghistroy.mapper.auto;
+
+import com.gyee.benchmarkinghistroy.model.auto.Equipmentmodel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+public interface EquipmentmodelMapper extends BaseMapper<Equipmentmodel> {
+
+}

+ 16 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/mapper/auto/Windturbinecurvefitting2Mapper.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkinghistroy.mapper.auto;
+
+import com.gyee.benchmarkinghistroy.model.auto.Windturbinecurvefitting2;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-13
+ */
+public interface Windturbinecurvefitting2Mapper extends BaseMapper<Windturbinecurvefitting2> {
+
+}

+ 16 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/mapper/auto/Windturbineinfoday3Mapper.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkinghistroy.mapper.auto;
+
+import com.gyee.benchmarkinghistroy.model.auto.Windturbineinfoday3;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-11
+ */
+public interface Windturbineinfoday3Mapper extends BaseMapper<Windturbineinfoday3> {
+
+}

+ 16 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/mapper/auto/WindturbineinfodayMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkinghistroy.mapper.auto;
+
+import com.gyee.benchmarkinghistroy.model.auto.Windturbineinfoday;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+public interface WindturbineinfodayMapper extends BaseMapper<Windturbineinfoday> {
+
+}

+ 48 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Equipmentmodel.java

@@ -0,0 +1,48 @@
+package com.gyee.benchmarkinghistroy.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Equipmentmodel extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String code;
+
+    private String name;
+
+    private String description;
+
+    private Double powerproduction;
+
+    private Double cutinwindspeed;
+
+    private Double ratedwindspeed;
+
+    private String cutoutwindspeed;
+
+    private String windturbinemanufacturerid;
+
+    private String photo;
+
+    private String unit;
+
+    private Double sweptarea;
+
+    private Double equipmentcategory;
+
+
+}

+ 2 - 1
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windpowerinfoday.java

@@ -1,5 +1,6 @@
 package com.gyee.benchmarkinghistroy.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;
@@ -27,7 +28,7 @@ public class Windpowerinfoday extends Model {
     /**
      * 编号
      */
-    @TableId("ID")
+    @TableId(value = "ID",type = IdType.ASSIGN_ID)
     private Long id;
 
     /**

+ 2 - 1
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windpowerinfoday3.java

@@ -1,5 +1,6 @@
 package com.gyee.benchmarkinghistroy.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;
@@ -24,7 +25,7 @@ public class Windpowerinfoday3 extends Model {
 
     private static final long serialVersionUID = 1L;
 
-    @TableId("ID")
+    @TableId(value = "ID",type = IdType.ASSIGN_ID)
     private Long id;
 
     @TableField("WINDPOWERSTATIONID")

+ 40 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windturbinecurvefitting2.java

@@ -0,0 +1,40 @@
+package com.gyee.benchmarkinghistroy.model.auto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Windturbinecurvefitting2 extends Model {
+
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "ID",type = IdType.ASSIGN_ID)
+    private Long id;
+
+    private String windturbineid;
+
+    private Double speed;
+
+    private Double actualpower;
+
+    private Double theorypower;
+
+    private Double ensurepower;
+
+    private Date recorddate;
+
+
+}

+ 180 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windturbineinfoday.java

@@ -0,0 +1,180 @@
+package com.gyee.benchmarkinghistroy.model.auto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Windturbineinfoday extends Model {
+
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "ID",type = IdType.ASSIGN_ID)
+    private Long id;
+
+    private String windturbineid;
+
+    private Double runhours;
+
+    private Double stophours;
+
+    private Double faulthours;
+
+    private Double maintainhours;
+
+    private Double interrupthours;
+
+    private Double generatingcapacity;
+
+    private Double speed;
+
+    private Double power;
+
+    private Date recorddate;
+
+    private Double gridelectricity;
+
+    private Double buyelectricity;
+
+    private Double instop;
+
+    private Double outstop;
+
+    private Double runtime;
+
+    private Double stoptime;
+
+    private Double faulttime;
+
+    private Double maintaintime;
+
+    private Double interrupttime;
+
+    private Double monthgc;
+
+    private Double yeargc;
+
+    private Double theorygeneration;
+
+    private Double lossofpower;
+
+    private Double fieldelectricity;
+
+    private Double generatingcapacity2;
+
+    private String windpowerstationid;
+
+    private String projectid;
+
+    private String lineid;
+
+    private Double maxspeed;
+
+    private Double minspeed;
+
+    private Double totalgc;
+
+    private Double totalgc2;
+
+    private Double theorygenerationzs;
+
+    private Double windhours;
+
+    private Double maxpower;
+
+    private Double minpower;
+
+    private Double monthruntime;
+
+    private Double monhtstoptime;
+
+    private Double monthfaulttime;
+
+    private Double monthmaintaintime;
+
+    private Double monthinterrupttime;
+
+    private Double yearruntime;
+
+    private Double yearstoptime;
+
+    private Double yearfaulttime;
+
+    private Double yearmaintaintime;
+
+    private Double yearinterrupttime;
+
+    private Double monthspeed;
+
+    private Double yearspeed;
+
+    private Double daycalendarhours;
+
+    private Double monthcalendarhours;
+
+    private Double yearcalendarhours;
+
+    private Double lossofpower1;
+
+    private Double lossofpower2;
+
+    private Double lossofpower3;
+
+    private Double lossofpower4;
+
+    private Double dayzhcydl;
+
+    private Double monthzhcydl;
+
+    private Double yearzhcydl;
+
+    private Double daysbklyl;
+
+    private Double monthsbklyl;
+
+    private Double yearsbklyl;
+
+    private Double daydxkyxs;
+
+    private Double monthdxkyxs;
+
+    private Double yeardxkyxs;
+
+    private Double monthwindhours;
+
+    private Double yearwindhours;
+
+    private Double daylyxs;
+
+    private Double monthlyxs;
+
+    private Double yearlyxs;
+
+    private Double brownoutstime;
+
+    private Double monthbrownoutstime;
+
+    private Double yearbrownoutstime;
+
+    private Double mainlossin;
+
+    private Double faultlossin;
+
+    private Double electriclossout;
+
+    private Double weatherlossout;
+
+
+}

+ 118 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/model/auto/Windturbineinfoday3.java

@@ -0,0 +1,118 @@
+package com.gyee.benchmarkinghistroy.model.auto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Windturbineinfoday3 extends Model {
+
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "ID",type = IdType.ASSIGN_ID)
+    private Long id;
+
+    private String windpowerstationid;
+
+    private String projectid;
+
+    private String lineid;
+
+    private String windturbineid;
+
+    private Double daydl1;
+
+    private Double daydl2;
+
+    private Double daypower;
+
+    private Double dayspeed;
+
+    private Double daymaxpower;
+
+    private Double dayminpower;
+
+    private Double daymaxspeed;
+
+    private Double dayminspeed;
+
+    private Double daynhgl;
+
+    private Double daynhdl;
+
+    private Double daynhgzssdl;
+
+    private Double daynhwhssdl;
+
+    private Double daynhxdssdl;
+
+    private Double daynhqfdl;
+
+    private Double daynhcfdl;
+
+    private Double daynhpcl;
+
+    private Double daynhgl2;
+
+    private Double daynhdl2;
+
+    private Double daynhgzssdl2;
+
+    private Double daynhwhssdl2;
+
+    private Double daynhxdssdl2;
+
+    private Double daynhqfdl2;
+
+    private Double daynhcfdl2;
+
+    private Double daynhpcl2;
+
+    private Double daybzgl;
+
+    private Double daybzdl;
+
+    private Double daybzgzssdl;
+
+    private Double daybzwhssdl;
+
+    private Double daybzxdssdl;
+
+    private Double daybzqfdl;
+
+    private Double daybzcfdl;
+
+    private Double daybzpcl;
+
+    private Double dayllgl;
+
+    private Double daylldl;
+
+    private Double dayllgzssdl;
+
+    private Double dayllwhssdl;
+
+    private Double dayllxdssdl;
+
+    private Double dayllqfdl;
+
+    private Double dayllcfdl;
+
+    private Double dayllpcl;
+
+    private Date recorddate;
+
+
+}

+ 16 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/IEquipmentmodelService.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkinghistroy.service.auto;
+
+import com.gyee.benchmarkinghistroy.model.auto.Equipmentmodel;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+public interface IEquipmentmodelService extends IService<Equipmentmodel> {
+
+}

+ 16 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/IWindturbinecurvefitting2Service.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkinghistroy.service.auto;
+
+import com.gyee.benchmarkinghistroy.model.auto.Windturbinecurvefitting2;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-13
+ */
+public interface IWindturbinecurvefitting2Service extends IService<Windturbinecurvefitting2> {
+
+}

+ 16 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/IWindturbineinfoday3Service.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkinghistroy.service.auto;
+
+import com.gyee.benchmarkinghistroy.model.auto.Windturbineinfoday3;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-11
+ */
+public interface IWindturbineinfoday3Service extends IService<Windturbineinfoday3> {
+
+}

+ 16 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/IWindturbineinfodayService.java

@@ -0,0 +1,16 @@
+package com.gyee.benchmarkinghistroy.service.auto;
+
+import com.gyee.benchmarkinghistroy.model.auto.Windturbineinfoday;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+public interface IWindturbineinfodayService extends IService<Windturbineinfoday> {
+
+}

+ 20 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/impl/EquipmentmodelServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghistroy.service.auto.impl;
+
+import com.gyee.benchmarkinghistroy.model.auto.Equipmentmodel;
+import com.gyee.benchmarkinghistroy.mapper.auto.EquipmentmodelMapper;
+import com.gyee.benchmarkinghistroy.service.auto.IEquipmentmodelService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+@Service
+public class EquipmentmodelServiceImpl extends ServiceImpl<EquipmentmodelMapper, Equipmentmodel> implements IEquipmentmodelService {
+
+}

+ 20 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/impl/Windturbinecurvefitting2ServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghistroy.service.auto.impl;
+
+import com.gyee.benchmarkinghistroy.model.auto.Windturbinecurvefitting2;
+import com.gyee.benchmarkinghistroy.mapper.auto.Windturbinecurvefitting2Mapper;
+import com.gyee.benchmarkinghistroy.service.auto.IWindturbinecurvefitting2Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-13
+ */
+@Service
+public class Windturbinecurvefitting2ServiceImpl extends ServiceImpl<Windturbinecurvefitting2Mapper, Windturbinecurvefitting2> implements IWindturbinecurvefitting2Service {
+
+}

+ 20 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/impl/Windturbineinfoday3ServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghistroy.service.auto.impl;
+
+import com.gyee.benchmarkinghistroy.model.auto.Windturbineinfoday3;
+import com.gyee.benchmarkinghistroy.mapper.auto.Windturbineinfoday3Mapper;
+import com.gyee.benchmarkinghistroy.service.auto.IWindturbineinfoday3Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-11
+ */
+@Service
+public class Windturbineinfoday3ServiceImpl extends ServiceImpl<Windturbineinfoday3Mapper, Windturbineinfoday3> implements IWindturbineinfoday3Service {
+
+}

+ 20 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/auto/impl/WindturbineinfodayServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.benchmarkinghistroy.service.auto.impl;
+
+import com.gyee.benchmarkinghistroy.model.auto.Windturbineinfoday;
+import com.gyee.benchmarkinghistroy.mapper.auto.WindturbineinfodayMapper;
+import com.gyee.benchmarkinghistroy.service.auto.IWindturbineinfodayService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-05-10
+ */
+@Service
+public class WindturbineinfodayServiceImpl extends ServiceImpl<WindturbineinfodayMapper, Windturbineinfoday> implements IWindturbineinfodayService {
+
+}

+ 732 - 0
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/infoday/InfodayService.java

@@ -0,0 +1,732 @@
+package com.gyee.benchmarkinghistroy.service.infoday;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.benchmarkinghistroy.init.CacheContext;
+import com.gyee.benchmarkinghistroy.model.auto.*;
+import com.gyee.benchmarkinghistroy.service.auto.IWindpowerinfoday3Service;
+import com.gyee.benchmarkinghistroy.service.auto.IWindpowerinfodayService;
+import com.gyee.benchmarkinghistroy.service.auto.IWindturbineinfoday3Service;
+import com.gyee.benchmarkinghistroy.service.auto.IWindturbineinfodayService;
+import com.gyee.benchmarkinghistroy.util.realtimesource.IEdosUtil;
+import com.gyee.common.contant.Contant;
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.util.DateUtils;
+import com.gyee.common.util.DoubleUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : InfodayService
+ * @Author : xieshengjie
+ * @Date: 2022/5/10 14:14
+ * @Description : 存储信息表
+ */
+@Service
+public class InfodayService {
+    @Resource
+    private IWindturbineinfodayService windturbineinfodayService;
+    @Resource
+    private IWindturbineinfoday3Service windturbineinfoday3Service;
+    @Resource
+    private IWindpowerinfodayService windpowerinfodayService;
+    @Resource
+    private IWindpowerinfoday3Service windpowerinfoday3Service;
+    @Resource
+    private IEdosUtil edosUtil;
+
+
+    public void saveWindturbineinfoday(String beginDate,String endDate){
+        Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap = CacheContext.wtpAimap;
+        List<Windturbine> wtls = CacheContext.wtls;
+        Map<String, Double> wtrlmap = CacheContext.wtrlmap;
+        List<String> days = DateUtils.getDays(beginDate, endDate);
+
+        days.stream().forEach(day->{
+            List<Windturbineinfoday> resultList = new ArrayList<>();
+            Date samedayZero = DateUtils.getSamedayZero(day);
+            Date addDays = DateUtils.addDays(samedayZero, 1);
+            Date endOfDay = DateUtils.getEndOfDay(samedayZero);
+            QueryWrapper<Windturbineinfoday> delQW = new QueryWrapper<>();
+            delQW.eq("recorddate",DateUtils.parseDate(day));
+            windturbineinfodayService.remove(delQW);
+
+            wtls.stream().forEach(wt->{
+                Windturbineinfoday windturbineinfoday = new Windturbineinfoday();
+                Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
+                Windturbinetestingpointnew ztmxpoint = windturbinetestingpointnewMap.get(Contant.FJ5T);
+                Windturbinetestingpointnew fdlPoint = windturbinetestingpointnewMap.get(Contant.RFDL);
+                Windturbinetestingpointnew yfdlPoint = windturbinetestingpointnewMap.get(Contant.YFDL);
+                Windturbinetestingpointnew nfdlPoint = windturbinetestingpointnewMap.get(Contant.NFDL);
+                Windturbinetestingpointnew speedPoint = windturbinetestingpointnewMap.get(Contant.RPJFS);
+                Windturbinetestingpointnew powerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
+                Windturbinetestingpointnew ssfsPoint = windturbinetestingpointnewMap.get(Contant.AI022);
+                Windturbinetestingpointnew ssglPoint = windturbinetestingpointnewMap.get(Contant.AI130);
+                windturbineinfoday.setWindturbineid(wt.getId());
+
+                List<PointData> ztmxSnap = null;
+                List<PointData> ssfsSnap = null;
+                List<PointData> maxspeedStat = null;
+                List<PointData> minspeedtStat = null;
+                List<PointData> maxpowerStat = null;
+                List<PointData> minpowerStat = null;
+                double scadafdl = 0;
+                double scadayfdl = 0;
+                double scadanfdl = 0;
+                double speed = 0;
+                double power = 0;
+                double maxspeed = 0;
+                double minspeed = 0;
+                double windhour = 0;
+                double maxpower = 0;
+                double minpower = 0;
+                try {
+                    ztmxSnap = edosUtil.getHistoryDatasSnap(ztmxpoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, null, 60l);
+                    ssfsSnap = edosUtil.getHistoryDatasSnap(ssfsPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, null, 60l);
+                    scadafdl = edosUtil.getSectionData(fdlPoint, endOfDay.getTime()).getPointValueInDouble();
+                    scadayfdl = edosUtil.getSectionData(yfdlPoint, endOfDay.getTime()).getPointValueInDouble();
+                    scadanfdl = edosUtil.getSectionData(nfdlPoint, endOfDay.getTime()).getPointValueInDouble();
+                    speed = edosUtil.getSectionData(speedPoint,endOfDay.getTime()).getPointValueInDouble();
+                    power = edosUtil.getSectionData(powerPoint,endOfDay.getTime()).getPointValueInDouble();
+                    maxspeedStat = edosUtil.getHistStat(ssfsPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, 1l, null, 0);
+                    minspeedtStat = edosUtil.getHistStat(ssfsPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, 1l, null, 1);
+                    maxpowerStat = edosUtil.getHistStat(ssglPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, 1l, null, 0);
+                    minpowerStat = edosUtil.getHistStat(ssglPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, 1l, null, 1);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                double runSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 1).collect(Collectors.toList()).size();
+                windturbineinfoday.setRunhours(DoubleUtils.keepPrecision(runSize/60,2));
+                windturbineinfoday.setRuntime(DoubleUtils.keepPrecision(runSize/60,2));
+                double stopSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 0).collect(Collectors.toList()).size();
+                windturbineinfoday.setStophours(DoubleUtils.keepPrecision(stopSize/60,2));
+                windturbineinfoday.setStoptime(DoubleUtils.keepPrecision(stopSize/60,2));
+                double faultSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 2).collect(Collectors.toList()).size();
+                windturbineinfoday.setFaulthours(DoubleUtils.keepPrecision(faultSize/60,2));
+                windturbineinfoday.setFaulttime(DoubleUtils.keepPrecision(faultSize/60,2));
+                double mainSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 4).collect(Collectors.toList()).size();
+                windturbineinfoday.setMaintainhours(DoubleUtils.keepPrecision(mainSize/60,2));
+                windturbineinfoday.setMaintaintime(DoubleUtils.keepPrecision(mainSize/60,2));
+                double interruptSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 3).collect(Collectors.toList()).size();
+                windturbineinfoday.setInterrupthours(DoubleUtils.keepPrecision(interruptSize/60,2));
+                windturbineinfoday.setInterrupttime(DoubleUtils.keepPrecision(interruptSize/60,2));
+                windturbineinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(scadafdl,2));
+                windturbineinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(scadayfdl,2));
+                windturbineinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(scadanfdl,2));
+                windturbineinfoday.setSpeed(DoubleUtils.keepPrecision(speed,2));
+                windturbineinfoday.setPower(DoubleUtils.keepPrecision(power,2));
+                windturbineinfoday.setRecorddate(samedayZero);
+                windturbineinfoday.setWindpowerstationid(wt.getWindpowerstationid());
+                windturbineinfoday.setProjectid(wt.getProjectid());
+                windturbineinfoday.setLineid(wt.getLineid());
+                if (StringUtils.isNotEmpty(maxspeedStat)){
+                    maxspeed = maxspeedStat.get(0).getPointValueInDouble();
+                }
+                if (StringUtils.isNotEmpty(minspeedtStat)){
+                    minspeed = maxspeedStat.get(0).getPointValueInDouble();
+                }
+                windturbineinfoday.setMaxspeed(DoubleUtils.keepPrecision(maxspeed,2));
+                windturbineinfoday.setMaxspeed(DoubleUtils.keepPrecision(minspeed,2));
+                if (StringUtils.isNotEmpty(ssfsSnap)){
+                    windhour =  ssfsSnap.stream().filter(i->i.getPointValueInDouble()>=3 && i.getPointValueInDouble()<=25).collect(Collectors.toList()).size();
+                }
+                windturbineinfoday.setWindhours(DoubleUtils.keepPrecision(windhour,2));
+
+                if (StringUtils.isNotEmpty(maxpowerStat)){
+                    maxpower = maxpowerStat.get(0).getPointValueInDouble();
+                }
+                if (StringUtils.isNotEmpty(minpowerStat)){
+                    minpower = minpowerStat.get(0).getPointValueInDouble();
+                }
+                windturbineinfoday.setMaxpower(DoubleUtils.keepPrecision(maxpower,2));
+                windturbineinfoday.setMinpower(DoubleUtils.keepPrecision(minpower,2));
+                windturbineinfoday.setDaysbklyl(DoubleUtils.keepPrecision((24-faultSize/60)/24,2));
+                Double aDouble = wtrlmap.get(wt.getId());
+                windturbineinfoday.setDaylyxs(DoubleUtils.keepPrecision(scadafdl/aDouble,2));
+                windturbineinfoday.setDaydxkyxs((DoubleUtils.keepPrecision((24-faultSize/60-mainSize/60)/24,2)));
+                resultList.add(windturbineinfoday);
+            });
+            windturbineinfodayService.saveBatch(resultList);
+
+        });
+
+    }
+
+    public void saveWindturbineinfoday3(String beginDate,String endDate){
+        Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap = CacheContext.wtpAimap;
+        List<Windturbine> wtls = CacheContext.wtls;
+        List<String> days = DateUtils.getDays(beginDate, endDate);
+        days.stream().forEach(day->{
+            List<Windturbineinfoday3> resultList = new ArrayList<>();
+            Date samedayZero = DateUtils.getSamedayZero(day);
+            Date addDays = DateUtils.addDays(samedayZero, 1);
+            Date endOfDay = DateUtils.getEndOfDay(samedayZero);
+            QueryWrapper<Windturbineinfoday3> delQW = new QueryWrapper<>();
+            delQW.eq("recorddate",DateUtils.parseDate(day));
+            windturbineinfoday3Service.remove(delQW);
+
+            wtls.stream().forEach(wt->{
+                Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
+                Windturbinetestingpointnew xn1 = windturbinetestingpointnewMap.get(Contant.WTRDJSSDL);
+                Windturbinetestingpointnew xn2 = windturbinetestingpointnewMap.get(Contant.WTRSTSSDL);
+                Windturbinetestingpointnew xn3 = windturbinetestingpointnewMap.get(Contant.WTRXNSSDL);
+                Windturbinetestingpointnew xn4 = windturbinetestingpointnewMap.get(Contant.WTRQXSSDL);
+                Windturbinetestingpointnew gz1 = windturbinetestingpointnewMap.get(Contant.WTRGZSSDL);
+                Windturbinetestingpointnew gz2 = windturbinetestingpointnewMap.get(Contant.WTRSZSSDL);
+                Windturbinetestingpointnew wh1 = windturbinetestingpointnewMap.get(Contant.WTRJXSSDL);
+                Windturbinetestingpointnew wh2 = windturbinetestingpointnewMap.get(Contant.WTRLZSSDL);
+                Windturbinetestingpointnew xd1 = windturbinetestingpointnewMap.get(Contant.WTRQFSSDL);
+                Windturbinetestingpointnew xd2 = windturbinetestingpointnewMap.get(Contant.WTRXDSSDL);
+                Windturbinetestingpointnew sl1 = windturbinetestingpointnewMap.get(Contant.WTRWZSSDL);
+                Windturbinetestingpointnew sl2 = windturbinetestingpointnewMap.get(Contant.WTRTZSSDL);
+                double xnssdl1 = 0;
+                double xnssdl2 = 0;
+                double xnssdl3 = 0;
+                double xnssdl4 = 0;
+                double gzssdl1 = 0;
+                double gzssdl2 = 0;
+                double whssdl1 = 0;
+                double whssdl2 = 0;
+                double xdssdl1 = 0;
+                double xdssdl2 = 0;
+                double slssdl1 = 0;
+                double slssdl2 = 0;
+                try {
+                    xnssdl1 = edosUtil.getSectionData(xn1,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl2 = edosUtil.getSectionData(xn2,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl3 = edosUtil.getSectionData(xn3,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl4 = edosUtil.getSectionData(xn4,endOfDay.getTime()).getPointValueInDouble();
+                    gzssdl1 = edosUtil.getSectionData(gz1,endOfDay.getTime()).getPointValueInDouble();
+                    gzssdl2 = edosUtil.getSectionData(gz2,endOfDay.getTime()).getPointValueInDouble();
+                    whssdl1 = edosUtil.getSectionData(wh1,endOfDay.getTime()).getPointValueInDouble();
+                    whssdl2 = edosUtil.getSectionData(wh2,endOfDay.getTime()).getPointValueInDouble();
+                    xdssdl1 = edosUtil.getSectionData(xd1,endOfDay.getTime()).getPointValueInDouble();
+                    xdssdl2 = edosUtil.getSectionData(xd2,endOfDay.getTime()).getPointValueInDouble();
+                    slssdl1 = edosUtil.getSectionData(sl1,endOfDay.getTime()).getPointValueInDouble();
+                    slssdl2 = edosUtil.getSectionData(sl2,endOfDay.getTime()).getPointValueInDouble();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+
+
+                Windturbineinfoday3 windturbineinfoday3 = new Windturbineinfoday3();
+                windturbineinfoday3.setWindpowerstationid(wt.getWindpowerstationid());
+                windturbineinfoday3.setProjectid(wt.getProjectid());
+                windturbineinfoday3.setLineid(wt.getLineid());
+                windturbineinfoday3.setWindturbineid(wt.getId());
+                windturbineinfoday3.setRecorddate(samedayZero);
+
+                windturbineinfoday3.setDaynhgzssdl(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
+                windturbineinfoday3.setDaynhgzssdl2(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
+                windturbineinfoday3.setDaynhwhssdl(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
+                windturbineinfoday3.setDaynhwhssdl2(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
+                windturbineinfoday3.setDaynhxdssdl(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
+                windturbineinfoday3.setDaynhxdssdl2(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
+                windturbineinfoday3.setDaynhqfdl(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
+                windturbineinfoday3.setDaynhqfdl2(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
+                windturbineinfoday3.setDaynhcfdl(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
+                windturbineinfoday3.setDaynhcfdl2(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
+                resultList.add(windturbineinfoday3);
+            });
+            windturbineinfoday3Service.saveBatch(resultList);
+        });
+
+    }
+
+
+    public void saveWindpowerinfoday(String beginDate,String endDate){
+        List<String> days = DateUtils.getDays(beginDate, endDate);
+        List<Line> lines = CacheContext.lines;
+        List<Project> projects = CacheContext.projects;
+        List<Windpowerstation> wplist = CacheContext.wplist;
+        Map<String, Map<String, Windpowerstationpointnew>> lnPointmap = CacheContext.lnPointmap;
+        Map<String, Map<String, Windpowerstationpointnew>> pjPointmap = CacheContext.pjPointmap;
+        Map<String, Map<String, Windpowerstationpointnew>> wppointmap = CacheContext.wppointmap;
+        days.stream().forEach(day->{
+            List<Windpowerinfoday> resultList = new ArrayList<>();
+
+            Date samedayZero = DateUtils.getSamedayZero(day);
+            Date addDays = DateUtils.addDays(samedayZero, 1);
+            Date endOfDay = DateUtils.getEndOfDay(samedayZero);
+            QueryWrapper<Windpowerinfoday> delQW = new QueryWrapper<>();
+            delQW.eq("recorddate",DateUtils.parseDate(day));
+            windpowerinfodayService.remove(delQW);
+
+
+            lines.stream().forEach(line -> {
+                Map<String, Windpowerstationpointnew> linepointnewMap = lnPointmap.get(line.getId());
+                Windpowerinfoday windpowerinfoday = new Windpowerinfoday();
+                windpowerinfoday.setForeignkeyid(line.getId());
+                windpowerinfoday.setRecorddate(samedayZero);
+                Windpowerstationpointnew swdlpointnew = linepointnewMap.get(Contant.SWDLB);
+                Windpowerstationpointnew gwgwdlpointnew = linepointnewMap.get(Contant.GWGWB);
+                Windpowerstationpointnew nwgwdlpointnew = linepointnewMap.get(Contant.NWGWB);
+                Windpowerstationpointnew powerpointnew = linepointnewMap.get(Contant.RPJGL);
+                Windpowerstationpointnew speedpointnew = linepointnewMap.get(Contant.RPJFS);
+                Windpowerstationpointnew fdlpointnew = linepointnewMap.get(Contant.RFDL);
+                Windpowerstationpointnew yfdlpointnew = linepointnewMap.get(Contant.YFDL);
+                Windpowerstationpointnew nfdlpointnew = linepointnewMap.get(Contant.NFDL);
+                Windpowerstationpointnew cydlpointnew = linepointnewMap.get(Contant.CYDLB);
+                Windpowerstationpointnew fdlbpointnew = linepointnewMap.get(Contant.RFDLB);
+                Windpowerstationpointnew yfdlbpointnew = linepointnewMap.get(Contant.YFDLB);
+                Windpowerstationpointnew nfdlbpointnew = linepointnewMap.get(Contant.NFDLB);
+                Windpowerstationpointnew yswdlbpointnew = linepointnewMap.get(Contant.SWDLY);
+                Windpowerstationpointnew nswdlbpointnew = linepointnewMap.get(Contant.SWDLN);
+                Windpowerstationpointnew ygwgwdlpointnew = linepointnewMap.get(Contant.GWGWY);
+                Windpowerstationpointnew ngwgwdlpointnew = linepointnewMap.get(Contant.GWGWN);
+                Windpowerstationpointnew ynwgwdlpointnew = linepointnewMap.get(Contant.NWGWY);
+                Windpowerstationpointnew nnwgwdlpointnew = linepointnewMap.get(Contant.NWGWN);
+                double generatingcapacity = 0;
+                double swdl = 0;
+                double gwgwdl = 0;
+                double nwgwdl = 0;
+                double power = 0;
+                double speed = 0;
+                double yfdl = 0;
+                double nfdl = 0;
+                double cydl = 0;
+                double fdlb = 0;
+                double yfdlb = 0;
+                double nfdlb = 0;
+                double yswdl = 0;
+                double nswdl = 0;
+                double ygwgwdl = 0;
+                double ngwgwdl = 0;
+                double ynwgwdl = 0;
+                double nnwgwdl = 0;
+                try {
+                    generatingcapacity = edosUtil.getSectionData(fdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    swdl = edosUtil.getSectionData(swdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    gwgwdl = edosUtil.getSectionData(gwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nwgwdl = edosUtil.getSectionData(nwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    power = edosUtil.getSectionData(powerpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    speed = edosUtil.getSectionData(speedpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    yfdl = edosUtil.getSectionData(yfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nfdl = edosUtil.getSectionData(nfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    cydl = edosUtil.getSectionData(cydlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    fdlb = edosUtil.getSectionData(fdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    yfdlb = edosUtil.getSectionData(yfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nfdlb = edosUtil.getSectionData(nfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    yswdl = edosUtil.getSectionData(yswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nswdl = edosUtil.getSectionData(nswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    ygwgwdl = edosUtil.getSectionData(ygwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    ngwgwdl = edosUtil.getSectionData(ngwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    ynwgwdl = edosUtil.getSectionData(ynwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nnwgwdl = edosUtil.getSectionData(nnwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                windpowerinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(generatingcapacity,2));
+                windpowerinfoday.setPower(DoubleUtils.keepPrecision(power,2));
+                windpowerinfoday.setSpeed(DoubleUtils.keepPrecision(speed,2));
+                windpowerinfoday.setGridelectricity(DoubleUtils.keepPrecision(swdl,2));
+                windpowerinfoday.setBuyelectricity(DoubleUtils.keepPrecision(gwgwdl,2));
+                windpowerinfoday.setBuyagricultureelectricity(DoubleUtils.keepPrecision(nwgwdl,2));
+                windpowerinfoday.setMonthgc(DoubleUtils.keepPrecision(yfdl,2));
+                windpowerinfoday.setYeargc(DoubleUtils.keepPrecision(nfdl,2));
+                windpowerinfoday.setFieldelectricity(DoubleUtils.keepPrecision(cydl,2));
+                windpowerinfoday.setGeneratingcapacity2(DoubleUtils.keepPrecision(fdlb,2));
+                windpowerinfoday.setWindpowerstationid("");
+                windpowerinfoday.setProjectid(line.getProjectid());
+                windpowerinfoday.setLineid(line.getId());
+                windpowerinfoday.setMonthgc2(DoubleUtils.keepPrecision(yfdlb,2));
+                windpowerinfoday.setYeargc2(DoubleUtils.keepPrecision(nfdlb,2));
+                windpowerinfoday.setMonthge(DoubleUtils.keepPrecision(yswdl,2));
+                windpowerinfoday.setYearge(DoubleUtils.keepPrecision(nswdl,2));
+                windpowerinfoday.setMonthbe(DoubleUtils.keepPrecision(ygwgwdl,2));
+                windpowerinfoday.setYearbe(DoubleUtils.keepPrecision(ngwgwdl,2));
+                windpowerinfoday.setMonthae(DoubleUtils.keepPrecision(ynwgwdl,2));
+                windpowerinfoday.setYearae(DoubleUtils.keepPrecision(nnwgwdl,2));
+                resultList.add(windpowerinfoday);
+            });
+
+            projects.stream().forEach(project -> {
+                Map<String, Windpowerstationpointnew> propointnewMap = pjPointmap.get(project.getId());
+                Windpowerinfoday windpowerinfoday = new Windpowerinfoday();
+                windpowerinfoday.setForeignkeyid(project.getId());
+                windpowerinfoday.setRecorddate(samedayZero);
+                Windpowerstationpointnew swdlpointnew = propointnewMap.get(Contant.SWDLB);
+                Windpowerstationpointnew gwgwdlpointnew = propointnewMap.get(Contant.GWGWB);
+                Windpowerstationpointnew nwgwdlpointnew = propointnewMap.get(Contant.NWGWB);
+                Windpowerstationpointnew powerpointnew = propointnewMap.get(Contant.RPJGL);
+                Windpowerstationpointnew speedpointnew = propointnewMap.get(Contant.RPJFS);
+                Windpowerstationpointnew fdlpointnew = propointnewMap.get(Contant.RFDL);
+                Windpowerstationpointnew yfdlpointnew = propointnewMap.get(Contant.YFDL);
+                Windpowerstationpointnew nfdlpointnew = propointnewMap.get(Contant.NFDL);
+                Windpowerstationpointnew cydlpointnew = propointnewMap.get(Contant.CYDLB);
+                Windpowerstationpointnew fdlbpointnew = propointnewMap.get(Contant.RFDLB);
+                Windpowerstationpointnew yfdlbpointnew = propointnewMap.get(Contant.YFDLB);
+                Windpowerstationpointnew nfdlbpointnew = propointnewMap.get(Contant.NFDLB);
+                Windpowerstationpointnew yswdlbpointnew = propointnewMap.get(Contant.SWDLY);
+                Windpowerstationpointnew nswdlbpointnew = propointnewMap.get(Contant.SWDLN);
+                Windpowerstationpointnew ygwgwdlpointnew = propointnewMap.get(Contant.GWGWY);
+                Windpowerstationpointnew ngwgwdlpointnew = propointnewMap.get(Contant.GWGWN);
+                Windpowerstationpointnew ynwgwdlpointnew = propointnewMap.get(Contant.NWGWY);
+                Windpowerstationpointnew nnwgwdlpointnew = propointnewMap.get(Contant.NWGWN);
+                double generatingcapacity = 0;
+                double swdl = 0;
+                double gwgwdl = 0;
+                double nwgwdl = 0;
+                double power = 0;
+                double speed = 0;
+                double yfdl = 0;
+                double nfdl = 0;
+                double cydl = 0;
+                double fdlb = 0;
+                double yfdlb = 0;
+                double nfdlb = 0;
+                double yswdl = 0;
+                double nswdl = 0;
+                double ygwgwdl = 0;
+                double ngwgwdl = 0;
+                double ynwgwdl = 0;
+                double nnwgwdl = 0;
+                try {
+                    generatingcapacity = edosUtil.getSectionData(fdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    swdl = edosUtil.getSectionData(swdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    gwgwdl = edosUtil.getSectionData(gwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nwgwdl = edosUtil.getSectionData(nwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    power = edosUtil.getSectionData(powerpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    speed = edosUtil.getSectionData(speedpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    yfdl = edosUtil.getSectionData(yfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nfdl = edosUtil.getSectionData(nfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    cydl = edosUtil.getSectionData(cydlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    fdlb = edosUtil.getSectionData(fdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    yfdlb = edosUtil.getSectionData(yfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nfdlb = edosUtil.getSectionData(nfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    yswdl = edosUtil.getSectionData(yswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nswdl = edosUtil.getSectionData(nswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    ygwgwdl = edosUtil.getSectionData(ygwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    ngwgwdl = edosUtil.getSectionData(ngwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    ynwgwdl = edosUtil.getSectionData(ynwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nnwgwdl = edosUtil.getSectionData(nnwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                windpowerinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(generatingcapacity,2));
+                windpowerinfoday.setPower(DoubleUtils.keepPrecision(power,2));
+                windpowerinfoday.setSpeed(DoubleUtils.keepPrecision(speed,2));
+                windpowerinfoday.setGridelectricity(DoubleUtils.keepPrecision(swdl,2));
+                windpowerinfoday.setBuyelectricity(DoubleUtils.keepPrecision(gwgwdl,2));
+                windpowerinfoday.setBuyagricultureelectricity(DoubleUtils.keepPrecision(nwgwdl,2));
+                windpowerinfoday.setMonthgc(DoubleUtils.keepPrecision(yfdl,2));
+                windpowerinfoday.setYeargc(DoubleUtils.keepPrecision(nfdl,2));
+                windpowerinfoday.setFieldelectricity(DoubleUtils.keepPrecision(cydl,2));
+                windpowerinfoday.setGeneratingcapacity2(DoubleUtils.keepPrecision(fdlb,2));
+                windpowerinfoday.setWindpowerstationid(project.getWindpowerstationid());
+                windpowerinfoday.setProjectid(project.getId());
+                windpowerinfoday.setLineid("");
+                windpowerinfoday.setMonthgc2(DoubleUtils.keepPrecision(yfdlb,2));
+                windpowerinfoday.setYeargc2(DoubleUtils.keepPrecision(nfdlb,2));
+                windpowerinfoday.setMonthge(DoubleUtils.keepPrecision(yswdl,2));
+                windpowerinfoday.setYearge(DoubleUtils.keepPrecision(nswdl,2));
+                windpowerinfoday.setMonthbe(DoubleUtils.keepPrecision(ygwgwdl,2));
+                windpowerinfoday.setYearbe(DoubleUtils.keepPrecision(ngwgwdl,2));
+                windpowerinfoday.setMonthae(DoubleUtils.keepPrecision(ynwgwdl,2));
+                windpowerinfoday.setYearae(DoubleUtils.keepPrecision(nnwgwdl,2));
+                resultList.add(windpowerinfoday);
+            });
+            wplist.stream().forEach(wp -> {
+                Map<String, Windpowerstationpointnew> wppointnewMap = wppointmap.get(wp.getId());
+                Windpowerinfoday windpowerinfoday = new Windpowerinfoday();
+                windpowerinfoday.setForeignkeyid(wp.getId());
+                windpowerinfoday.setRecorddate(samedayZero);
+                Windpowerstationpointnew swdlpointnew = wppointnewMap.get(Contant.SWDLB);
+                Windpowerstationpointnew gwgwdlpointnew = wppointnewMap.get(Contant.GWGWB);
+                Windpowerstationpointnew nwgwdlpointnew = wppointnewMap.get(Contant.NWGWB);
+                Windpowerstationpointnew powerpointnew = wppointnewMap.get(Contant.RPJGL);
+                Windpowerstationpointnew speedpointnew = wppointnewMap.get(Contant.RPJFS);
+                Windpowerstationpointnew fdlpointnew = wppointnewMap.get(Contant.RFDL);
+                Windpowerstationpointnew yfdlpointnew = wppointnewMap.get(Contant.YFDL);
+                Windpowerstationpointnew nfdlpointnew = wppointnewMap.get(Contant.NFDL);
+                Windpowerstationpointnew cydlpointnew = wppointnewMap.get(Contant.CYDLB);
+                Windpowerstationpointnew fdlbpointnew = wppointnewMap.get(Contant.RFDLB);
+                Windpowerstationpointnew yfdlbpointnew = wppointnewMap.get(Contant.YFDLB);
+                Windpowerstationpointnew nfdlbpointnew = wppointnewMap.get(Contant.NFDLB);
+                Windpowerstationpointnew yswdlbpointnew = wppointnewMap.get(Contant.SWDLY);
+                Windpowerstationpointnew nswdlbpointnew = wppointnewMap.get(Contant.SWDLN);
+                Windpowerstationpointnew ygwgwdlpointnew = wppointnewMap.get(Contant.GWGWY);
+                Windpowerstationpointnew ngwgwdlpointnew = wppointnewMap.get(Contant.GWGWN);
+                Windpowerstationpointnew ynwgwdlpointnew = wppointnewMap.get(Contant.NWGWY);
+                Windpowerstationpointnew nnwgwdlpointnew = wppointnewMap.get(Contant.NWGWN);
+                double generatingcapacity = 0;
+                double swdl = 0;
+                double gwgwdl = 0;
+                double nwgwdl = 0;
+                double power = 0;
+                double speed = 0;
+                double yfdl = 0;
+                double nfdl = 0;
+                double cydl = 0;
+                double fdlb = 0;
+                double yfdlb = 0;
+                double nfdlb = 0;
+                double yswdl = 0;
+                double nswdl = 0;
+                double ygwgwdl = 0;
+                double ngwgwdl = 0;
+                double ynwgwdl = 0;
+                double nnwgwdl = 0;
+                try {
+                    generatingcapacity = edosUtil.getSectionData(fdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    swdl = edosUtil.getSectionData(swdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    gwgwdl = edosUtil.getSectionData(gwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nwgwdl = edosUtil.getSectionData(nwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    power = edosUtil.getSectionData(powerpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    speed = edosUtil.getSectionData(speedpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    yfdl = edosUtil.getSectionData(yfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nfdl = edosUtil.getSectionData(nfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    cydl = edosUtil.getSectionData(cydlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    fdlb = edosUtil.getSectionData(fdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    yfdlb = edosUtil.getSectionData(yfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nfdlb = edosUtil.getSectionData(nfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    yswdl = edosUtil.getSectionData(yswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nswdl = edosUtil.getSectionData(nswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    ygwgwdl = edosUtil.getSectionData(ygwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    ngwgwdl = edosUtil.getSectionData(ngwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    ynwgwdl = edosUtil.getSectionData(ynwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                    nnwgwdl = edosUtil.getSectionData(nnwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                windpowerinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(generatingcapacity,2));
+                windpowerinfoday.setPower(DoubleUtils.keepPrecision(power,2));
+                windpowerinfoday.setSpeed(DoubleUtils.keepPrecision(speed,2));
+                windpowerinfoday.setGridelectricity(DoubleUtils.keepPrecision(swdl,2));
+                windpowerinfoday.setBuyelectricity(DoubleUtils.keepPrecision(gwgwdl,2));
+                windpowerinfoday.setBuyagricultureelectricity(DoubleUtils.keepPrecision(nwgwdl,2));
+                windpowerinfoday.setMonthgc(DoubleUtils.keepPrecision(yfdl,2));
+                windpowerinfoday.setYeargc(DoubleUtils.keepPrecision(nfdl,2));
+                windpowerinfoday.setFieldelectricity(DoubleUtils.keepPrecision(cydl,2));
+                windpowerinfoday.setGeneratingcapacity2(DoubleUtils.keepPrecision(fdlb,2));
+                windpowerinfoday.setWindpowerstationid(wp.getId());
+                windpowerinfoday.setProjectid("");
+                windpowerinfoday.setLineid("");
+                windpowerinfoday.setMonthgc2(DoubleUtils.keepPrecision(yfdlb,2));
+                windpowerinfoday.setYeargc2(DoubleUtils.keepPrecision(nfdlb,2));
+                windpowerinfoday.setMonthge(DoubleUtils.keepPrecision(yswdl,2));
+                windpowerinfoday.setYearge(DoubleUtils.keepPrecision(nswdl,2));
+                windpowerinfoday.setMonthbe(DoubleUtils.keepPrecision(ygwgwdl,2));
+                windpowerinfoday.setYearbe(DoubleUtils.keepPrecision(ngwgwdl,2));
+                windpowerinfoday.setMonthae(DoubleUtils.keepPrecision(ynwgwdl,2));
+                windpowerinfoday.setYearae(DoubleUtils.keepPrecision(nnwgwdl,2));
+                resultList.add(windpowerinfoday);
+            });
+            windpowerinfodayService.saveBatch(resultList);
+        });
+    }
+
+
+    public void saveWindpowerinfoday3(String beginDate,String endDate){
+        List<String> days = DateUtils.getDays(beginDate, endDate);
+        List<Line> lines = CacheContext.lines;
+        List<Project> projects = CacheContext.projects;
+        List<Windpowerstation> wplist = CacheContext.wplist;
+        Map<String, Map<String, Windpowerstationpointnew>> lnPointmap = CacheContext.lnPointmap;
+        Map<String, Map<String, Windpowerstationpointnew>> pjPointmap = CacheContext.pjPointmap;
+        Map<String, Map<String, Windpowerstationpointnew>> wppointmap = CacheContext.wppointmap;
+        days.stream().forEach(day-> {
+            List<Windpowerinfoday3> resultList = new ArrayList<>();
+
+            Date samedayZero = DateUtils.getSamedayZero(day);
+            Date addDays = DateUtils.addDays(samedayZero, 1);
+            Date endOfDay = DateUtils.getEndOfDay(samedayZero);
+            QueryWrapper<Windpowerinfoday3> delQW = new QueryWrapper<>();
+            delQW.eq("recorddate", DateUtils.parseDate(day));
+            windpowerinfoday3Service.remove(delQW);
+
+            lines.stream().forEach(line -> {
+                Map<String, Windpowerstationpointnew> linepointnewMap = lnPointmap.get(line.getId());
+                Windpowerinfoday3 windpowerinfoday3 = new Windpowerinfoday3();
+                windpowerinfoday3.setForeignkeyid(line.getId());
+                windpowerinfoday3.setRecorddate(samedayZero);
+
+                Windpowerstationpointnew xn1 = linepointnewMap.get(Contant.RSDJZSDL);
+                Windpowerstationpointnew xn2 = linepointnewMap.get(Contant.RSSTZSDL);
+                Windpowerstationpointnew xn3 = linepointnewMap.get(Contant.RXNZSDL);
+                Windpowerstationpointnew xn4 = linepointnewMap.get(Contant.RSQXZSDL);
+
+                Windpowerstationpointnew gz1 = linepointnewMap.get(Contant.RGZZSDL);
+                Windpowerstationpointnew gz2 = linepointnewMap.get(Contant.RSZZSDL);
+
+                Windpowerstationpointnew wh1 = linepointnewMap.get(Contant.RJXZSDL);
+                Windpowerstationpointnew wh2 = linepointnewMap.get(Contant.RLZZSDL);
+
+                Windpowerstationpointnew xd1 = linepointnewMap.get(Contant.RQFZSDL);
+                Windpowerstationpointnew xd2 = linepointnewMap.get(Contant.RXDZSDL);
+
+                Windpowerstationpointnew sl1 = linepointnewMap.get(Contant.RWZZSDL);
+                Windpowerstationpointnew sl2 = linepointnewMap.get(Contant.RTZZSDL);
+                double xnssdl1 = 0;
+                double xnssdl2 = 0;
+                double xnssdl3 = 0;
+                double xnssdl4 = 0;
+                double gzssdl1 = 0;
+                double gzssdl2 = 0;
+                double whssdl1 = 0;
+                double whssdl2 = 0;
+                double xdssdl1 = 0;
+                double xdssdl2 = 0;
+                double slssdl1 = 0;
+                double slssdl2 = 0;
+                try {
+                    xnssdl1 = edosUtil.getSectionData(xn1,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl2 = edosUtil.getSectionData(xn2,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl3 = edosUtil.getSectionData(xn3,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl4 = edosUtil.getSectionData(xn4,endOfDay.getTime()).getPointValueInDouble();
+                    gzssdl1 = edosUtil.getSectionData(gz1,endOfDay.getTime()).getPointValueInDouble();
+                    gzssdl2 = edosUtil.getSectionData(gz2,endOfDay.getTime()).getPointValueInDouble();
+                    whssdl1 = edosUtil.getSectionData(wh1,endOfDay.getTime()).getPointValueInDouble();
+                    whssdl2 = edosUtil.getSectionData(wh2,endOfDay.getTime()).getPointValueInDouble();
+                    xdssdl1 = edosUtil.getSectionData(xd1,endOfDay.getTime()).getPointValueInDouble();
+                    xdssdl2 = edosUtil.getSectionData(xd2,endOfDay.getTime()).getPointValueInDouble();
+                    slssdl1 = edosUtil.getSectionData(sl1,endOfDay.getTime()).getPointValueInDouble();
+                    slssdl2 = edosUtil.getSectionData(sl2,endOfDay.getTime()).getPointValueInDouble();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                windpowerinfoday3.setDaynhgzssdl(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
+                windpowerinfoday3.setDaynhgzssdl2(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
+                windpowerinfoday3.setDaynhwhssdl(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
+                windpowerinfoday3.setDaynhwhssdl2(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
+                windpowerinfoday3.setDaynhxdssdl(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
+                windpowerinfoday3.setDaynhxdssdl2(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
+                windpowerinfoday3.setDaynhqfdl(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
+                windpowerinfoday3.setDaynhqfdl2(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
+                windpowerinfoday3.setDaynhcfdl(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
+                windpowerinfoday3.setDaynhcfdl2(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
+                resultList.add(windpowerinfoday3);
+            });
+
+            projects.stream().forEach(project -> {
+                Map<String, Windpowerstationpointnew> propointnewMap = pjPointmap.get(project.getId());
+                Windpowerinfoday3 windpowerinfoday3 = new Windpowerinfoday3();
+                windpowerinfoday3.setForeignkeyid(project.getId());
+                windpowerinfoday3.setRecorddate(samedayZero);
+
+                Windpowerstationpointnew xn1 = propointnewMap.get(Contant.RSDJZSDL);
+                Windpowerstationpointnew xn2 = propointnewMap.get(Contant.RSSTZSDL);
+                Windpowerstationpointnew xn3 = propointnewMap.get(Contant.RXNZSDL);
+                Windpowerstationpointnew xn4 = propointnewMap.get(Contant.RSQXZSDL);
+
+                Windpowerstationpointnew gz1 = propointnewMap.get(Contant.RGZZSDL);
+                Windpowerstationpointnew gz2 = propointnewMap.get(Contant.RSZZSDL);
+
+                Windpowerstationpointnew wh1 = propointnewMap.get(Contant.RJXZSDL);
+                Windpowerstationpointnew wh2 = propointnewMap.get(Contant.RLZZSDL);
+
+                Windpowerstationpointnew xd1 = propointnewMap.get(Contant.RQFZSDL);
+                Windpowerstationpointnew xd2 = propointnewMap.get(Contant.RXDZSDL);
+
+                Windpowerstationpointnew sl1 = propointnewMap.get(Contant.RWZZSDL);
+                Windpowerstationpointnew sl2 = propointnewMap.get(Contant.RTZZSDL);
+                double xnssdl1 = 0;
+                double xnssdl2 = 0;
+                double xnssdl3 = 0;
+                double xnssdl4 = 0;
+                double gzssdl1 = 0;
+                double gzssdl2 = 0;
+                double whssdl1 = 0;
+                double whssdl2 = 0;
+                double xdssdl1 = 0;
+                double xdssdl2 = 0;
+                double slssdl1 = 0;
+                double slssdl2 = 0;
+                try {
+                    xnssdl1 = edosUtil.getSectionData(xn1,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl2 = edosUtil.getSectionData(xn2,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl3 = edosUtil.getSectionData(xn3,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl4 = edosUtil.getSectionData(xn4,endOfDay.getTime()).getPointValueInDouble();
+                    gzssdl1 = edosUtil.getSectionData(gz1,endOfDay.getTime()).getPointValueInDouble();
+                    gzssdl2 = edosUtil.getSectionData(gz2,endOfDay.getTime()).getPointValueInDouble();
+                    whssdl1 = edosUtil.getSectionData(wh1,endOfDay.getTime()).getPointValueInDouble();
+                    whssdl2 = edosUtil.getSectionData(wh2,endOfDay.getTime()).getPointValueInDouble();
+                    xdssdl1 = edosUtil.getSectionData(xd1,endOfDay.getTime()).getPointValueInDouble();
+                    xdssdl2 = edosUtil.getSectionData(xd2,endOfDay.getTime()).getPointValueInDouble();
+                    slssdl1 = edosUtil.getSectionData(sl1,endOfDay.getTime()).getPointValueInDouble();
+                    slssdl2 = edosUtil.getSectionData(sl2,endOfDay.getTime()).getPointValueInDouble();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                windpowerinfoday3.setDaynhgzssdl(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
+                windpowerinfoday3.setDaynhgzssdl2(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
+                windpowerinfoday3.setDaynhwhssdl(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
+                windpowerinfoday3.setDaynhwhssdl2(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
+                windpowerinfoday3.setDaynhxdssdl(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
+                windpowerinfoday3.setDaynhxdssdl2(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
+                windpowerinfoday3.setDaynhqfdl(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
+                windpowerinfoday3.setDaynhqfdl2(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
+                windpowerinfoday3.setDaynhcfdl(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
+                windpowerinfoday3.setDaynhcfdl2(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
+                resultList.add(windpowerinfoday3);
+            });
+
+            wplist.stream().forEach(wp -> {
+                Map<String, Windpowerstationpointnew> wppointnewMap = wppointmap.get(wp.getId());
+                Windpowerinfoday3 windpowerinfoday3 = new Windpowerinfoday3();
+                windpowerinfoday3.setForeignkeyid(wp.getId());
+                windpowerinfoday3.setRecorddate(samedayZero);
+
+                Windpowerstationpointnew xn1 = wppointnewMap.get(Contant.RSDJZSDL);
+                Windpowerstationpointnew xn2 = wppointnewMap.get(Contant.RSSTZSDL);
+                Windpowerstationpointnew xn3 = wppointnewMap.get(Contant.RXNZSDL);
+                Windpowerstationpointnew xn4 = wppointnewMap.get(Contant.RSQXZSDL);
+
+                Windpowerstationpointnew gz1 = wppointnewMap.get(Contant.RGZZSDL);
+                Windpowerstationpointnew gz2 = wppointnewMap.get(Contant.RSZZSDL);
+
+                Windpowerstationpointnew wh1 = wppointnewMap.get(Contant.RJXZSDL);
+                Windpowerstationpointnew wh2 = wppointnewMap.get(Contant.RLZZSDL);
+
+                Windpowerstationpointnew xd1 = wppointnewMap.get(Contant.RQFZSDL);
+                Windpowerstationpointnew xd2 = wppointnewMap.get(Contant.RXDZSDL);
+
+                Windpowerstationpointnew sl1 = wppointnewMap.get(Contant.RWZZSDL);
+                Windpowerstationpointnew sl2 = wppointnewMap.get(Contant.RTZZSDL);
+                double xnssdl1 = 0;
+                double xnssdl2 = 0;
+                double xnssdl3 = 0;
+                double xnssdl4 = 0;
+                double gzssdl1 = 0;
+                double gzssdl2 = 0;
+                double whssdl1 = 0;
+                double whssdl2 = 0;
+                double xdssdl1 = 0;
+                double xdssdl2 = 0;
+                double slssdl1 = 0;
+                double slssdl2 = 0;
+                try {
+                    xnssdl1 = edosUtil.getSectionData(xn1,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl2 = edosUtil.getSectionData(xn2,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl3 = edosUtil.getSectionData(xn3,endOfDay.getTime()).getPointValueInDouble();
+                    xnssdl4 = edosUtil.getSectionData(xn4,endOfDay.getTime()).getPointValueInDouble();
+                    gzssdl1 = edosUtil.getSectionData(gz1,endOfDay.getTime()).getPointValueInDouble();
+                    gzssdl2 = edosUtil.getSectionData(gz2,endOfDay.getTime()).getPointValueInDouble();
+                    whssdl1 = edosUtil.getSectionData(wh1,endOfDay.getTime()).getPointValueInDouble();
+                    whssdl2 = edosUtil.getSectionData(wh2,endOfDay.getTime()).getPointValueInDouble();
+                    xdssdl1 = edosUtil.getSectionData(xd1,endOfDay.getTime()).getPointValueInDouble();
+                    xdssdl2 = edosUtil.getSectionData(xd2,endOfDay.getTime()).getPointValueInDouble();
+                    slssdl1 = edosUtil.getSectionData(sl1,endOfDay.getTime()).getPointValueInDouble();
+                    slssdl2 = edosUtil.getSectionData(sl2,endOfDay.getTime()).getPointValueInDouble();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                windpowerinfoday3.setDaynhgzssdl(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
+                windpowerinfoday3.setDaynhgzssdl2(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
+                windpowerinfoday3.setDaynhwhssdl(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
+                windpowerinfoday3.setDaynhwhssdl2(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
+                windpowerinfoday3.setDaynhxdssdl(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
+                windpowerinfoday3.setDaynhxdssdl2(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
+                windpowerinfoday3.setDaynhqfdl(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
+                windpowerinfoday3.setDaynhqfdl2(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
+                windpowerinfoday3.setDaynhcfdl(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
+                windpowerinfoday3.setDaynhcfdl2(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
+                resultList.add(windpowerinfoday3);
+            });
+            windpowerinfoday3Service.saveBatch(resultList);
+        });
+    }
+}

+ 21 - 2
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/task/SaticScheduleTask.java

@@ -2,10 +2,9 @@ package com.gyee.benchmarkinghistroy.task;
 
 
 import com.gyee.benchmarkinghistroy.service.benchmarking.BenchmarkingHistroyService;
-
+import com.gyee.benchmarkinghistroy.service.infoday.InfodayService;
 import com.gyee.benchmarkinghistroy.service.specific.SpecificService;
 import com.gyee.common.util.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -26,6 +25,8 @@ public class SaticScheduleTask {
     private BenchmarkingHistroyService benchmarkingHistroyService;
     @Resource
     private SpecificService specificService;
+    @Resource
+    private InfodayService infodayService;
 
     //3.添加定时任务
     /**
@@ -78,4 +79,22 @@ public class SaticScheduleTask {
         specificService.saveWindpowerspecificinfoday(date,date);
     }
 
+
+
+    /**
+     * 存储日信息表
+     * (原计算服务)
+     */
+    @Scheduled(cron = "0 30 0 * * ?")
+    //或直接指定时间间隔,例如:5秒
+    //@Scheduled(fixedRate=5000)
+    private void configureTasks4() {
+        Date yestday = DateUtils.getYestday(new Date());
+        String date = DateUtils.toDate1(yestday);
+        infodayService.saveWindturbineinfoday(date,date);
+        infodayService.saveWindturbineinfoday3(date,date);
+        infodayService.saveWindpowerinfoday(date,date);
+        infodayService.saveWindpowerinfoday3(date,date);
+    }
+
 }

+ 320 - 270
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/util/realtimesource/EdosUtil.java

@@ -31,42 +31,93 @@ public class EdosUtil implements IEdosUtil {
     private String baseURL;
 //    private static String baseURL = "http://10.155.32.4:8011/ts";
 //    private static String baseURL = "http://10.65.79.30:8019/ts";
-    @Override
-    public PointData getRealData(Windpowerstationpointnew point) throws Exception {
-        try {
-            Optional<String> keys = Optional.ofNullable(point.getCode());
-            Optional<String> thingType = Optional.ofNullable("station");
-            Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
-            Optional<String> uniformCodes = Optional.ofNullable(point.getUniformcode());
+@Override
+public PointData getRealData(Windpowerstationpointnew point) throws Exception {
+    try {
+        Optional<String> keys = Optional.ofNullable(point.getCode());
+        Optional<String> thingType = Optional.ofNullable("station");
+        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+        Optional<String> uniformCodes = Optional.ofNullable(point.getUniformcode());
 
-            String url = baseURL + "/latest?null=0";
-            if (keys.isPresent())
-                url = url + "&keys=" + keys.get();
-            if (thingType.isPresent())
-                url = url + "&thingType=" + thingType.get();
-            if (thingId.isPresent())
-                url = url + "&thingId=" + thingId.get();
-            if (uniformCodes.isPresent())
-                url = url + "&uniformCodes=" + uniformCodes.get();
+        String url = baseURL + "/latest?null=0";
+        if (keys.isPresent())
+            url = url + "&keys=" + keys.get();
+        if (thingType.isPresent())
+            url = url + "&thingType=" + thingType.get();
+        if (thingId.isPresent())
+            url = url + "&thingId=" + thingId.get();
+        if (uniformCodes.isPresent())
+            url = url + "&uniformCodes=" + uniformCodes.get();
+
+        ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
+        JSONObject jsonArray = resp.getBody();
+        if (StringUtils.isNotEmpty(jsonArray)){
+            List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
+            if (list.size() > 0)
+                return list.get(0);
+            else
+                return ErrorRequest.RequestError(point.getCode());
+        } else {
+            return ErrorRequest.RequestError(point.getCode());
+        }
+    } catch (HttpClientErrorException exception) {
+        if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+            System.out.println("404请求错误");
+            return ErrorRequest.RequestError(point.getCode());
+        } else {
+            throw exception;
+        }
+    }
+}
 
-            ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
-            JSONObject jsonArray = resp.getBody();
-             if (StringUtils.isNotEmpty(jsonArray)){
-                List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
-                if (list.size() > 0)
-                    return list.get(0);
-                else
-                    return ErrorRequest.RequestError(point.getCode());
-            } else {
+    @Override
+    public PointData getSectionData(String point, Long date) throws Exception {
+        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point + "&ts=" + date;
+
+        ResponseEntity<JSONObject> resp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+        JSONObject jsonArray = resp.getBody();
+        if (StringUtils.isNotEmpty(jsonArray)){
+            List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
+            if (list.size() > 0)
+                return list.get(0);
+            else
+                return ErrorRequest.RequestError(point);
+        } else {
+            return ErrorRequest.RequestError(point);
+        }
+    }
+
+    @Override
+    public PointData getSectionData(Windpowerstationpointnew point, Long date) throws Exception {
+        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + date;
+
+        ResponseEntity<JSONObject> resp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+        JSONObject jsonArray = resp.getBody();
+        if (StringUtils.isNotEmpty(jsonArray)){
+            List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
+            if (list.size() > 0)
+                return list.get(0);
+            else
                 return ErrorRequest.RequestError(point.getCode());
-            }
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
+        } else {
+            return ErrorRequest.RequestError(point.getCode());
+        }
+    }
+
+    @Override
+    public PointData getSectionData(Windturbinetestingpointnew point, Long date) throws Exception {
+        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + date;
+
+        ResponseEntity<JSONObject> resp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+        JSONObject jsonArray = resp.getBody();
+        if (StringUtils.isNotEmpty(jsonArray)){
+            List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
+            if (list.size() > 0)
+                return list.get(0);
+            else
                 return ErrorRequest.RequestError(point.getCode());
-            } else {
-                throw exception;
-            }
+        } else {
+            return ErrorRequest.RequestError(point.getCode());
         }
     }
 
@@ -118,53 +169,53 @@ public class EdosUtil implements IEdosUtil {
                 if(snapList.isEmpty())
                 {
 
-                	getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
+                    getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
                 }else
                 {
-                	 for (PointData snapItem : snapList) {
-
-                         long subTime = snapItem.getPointTime() - pried;
-                         //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-                         // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-                         // 则代表该时间节点快照有效,否则为0
-                         String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
-                         ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-                         JSONObject jsonObjectSection = sectionResp.getBody();
-
-                         if (jsonObjectSection != null) {
-                             List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-                             if (sectionlist.size() > 0) {
-                                 if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-                                     resultList.add(snapItem);
-                                 }
-                                 else{
-                                     PointData data = new PointData();
-                                     data.setEdnaId(point.getCode());
-                                     data.setPointTime(snapItem.getPointTime());
-                                     data.setPointValue("0");
-                                     data.setPointName("1");
-                                     data.setPointValueInDouble(0.0);
-                                     resultList.add(data);
-                                 }
-                             } else {
-                                 PointData data = new PointData();
-                                 data.setEdnaId(point.getCode());
-                                 data.setPointTime(snapItem.getPointTime());
-                                 data.setPointValue("0");
-                                 data.setPointName("1");
-                                 data.setPointValueInDouble(0.0);
-                                 resultList.add(data);
-                             }
-                         } else {
-                             PointData data = new PointData();
-                             data.setEdnaId(point.getCode());
-                             data.setPointTime(snapItem.getPointTime());
-                             data.setPointValue("0");
-                             data.setPointName("1");
-                             data.setPointValueInDouble(0.0);
-                             resultList.add(data);
-                         }
-                     }
+                    for (PointData snapItem : snapList) {
+
+                        long subTime = snapItem.getPointTime() - pried;
+                        //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+                        // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+                        // 则代表该时间节点快照有效,否则为0
+                        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
+                        ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+                        JSONObject jsonObjectSection = sectionResp.getBody();
+
+                        if (jsonObjectSection != null) {
+                            List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+                            if (sectionlist.size() > 0) {
+                                if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                    resultList.add(snapItem);
+                                }
+                                else{
+                                    PointData data = new PointData();
+                                    data.setEdnaId(point.getCode());
+                                    data.setPointTime(snapItem.getPointTime());
+                                    data.setPointValue("0");
+                                    data.setPointName("1");
+                                    data.setPointValueInDouble(0.0);
+                                    resultList.add(data);
+                                }
+                            } else {
+                                PointData data = new PointData();
+                                data.setEdnaId(point.getCode());
+                                data.setPointTime(snapItem.getPointTime());
+                                data.setPointValue("0");
+                                data.setPointName("1");
+                                data.setPointValueInDouble(0.0);
+                                resultList.add(data);
+                            }
+                        } else {
+                            PointData data = new PointData();
+                            data.setEdnaId(point.getCode());
+                            data.setPointTime(snapItem.getPointTime());
+                            data.setPointValue("0");
+                            data.setPointName("1");
+                            data.setPointValueInDouble(0.0);
+                            resultList.add(data);
+                        }
+                    }
                 }
 
 
@@ -187,48 +238,48 @@ public class EdosUtil implements IEdosUtil {
     }
 
 
-	private void getHistsnapSameTiem(String pointid, Long beginDate, Long pried,
-			List<PointData> resultList) {
-		long subTime =beginDate - pried;
-		  String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + beginDate + "000";
-		  ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-		  JSONObject jsonObjectSection = sectionResp.getBody();
-		  if (jsonObjectSection != null) {
-		      List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-		      if (sectionlist.size() > 0) {
-		          if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=beginDate){
-		              resultList.add(sectionlist.get(0));
-		          }
-		          else{
-		              PointData data = new PointData();
-		              data.setEdnaId(pointid);
-		              data.setPointTime(sectionlist.get(0).getPointTime());
-		              data.setPointValue("0");
-		              data.setPointName("1");
-		              data.setPointValueInDouble(0.0);
-		              resultList.add(data);
-		          }
-		      } else {
-		          PointData data = new PointData();
-		          data.setEdnaId(pointid);
-		          if (sectionlist!=null && sectionlist.size()>0){
-                      data.setPointTime(sectionlist.get(0).getPointTime());
-                  }
-		          data.setPointValue("0");
-		          data.setPointName("1");
-		          data.setPointValueInDouble(0.0);
-		          resultList.add(data);
-		      }
-		  } else {
-		      PointData data = new PointData();
-		      data.setEdnaId(pointid);
-		      data.setPointTime(beginDate);
-		      data.setPointValue("0");
-		      data.setPointName("1");
-		      data.setPointValueInDouble(0.0);
-		      resultList.add(data);
-		  }
-	}
+    private void getHistsnapSameTiem(String pointid, Long beginDate, Long pried,
+                                     List<PointData> resultList) {
+        long subTime =beginDate - pried;
+        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + beginDate + "000";
+        ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+        JSONObject jsonObjectSection = sectionResp.getBody();
+        if (jsonObjectSection != null) {
+            List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+            if (sectionlist.size() > 0) {
+                if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=beginDate){
+                    resultList.add(sectionlist.get(0));
+                }
+                else{
+                    PointData data = new PointData();
+                    data.setEdnaId(pointid);
+                    data.setPointTime(sectionlist.get(0).getPointTime());
+                    data.setPointValue("0");
+                    data.setPointName("1");
+                    data.setPointValueInDouble(0.0);
+                    resultList.add(data);
+                }
+            } else {
+                PointData data = new PointData();
+                data.setEdnaId(pointid);
+                if (sectionlist!=null && sectionlist.size()>0){
+                    data.setPointTime(sectionlist.get(0).getPointTime());
+                }
+                data.setPointValue("0");
+                data.setPointName("1");
+                data.setPointValueInDouble(0.0);
+                resultList.add(data);
+            }
+        } else {
+            PointData data = new PointData();
+            data.setEdnaId(pointid);
+            data.setPointTime(beginDate);
+            data.setPointValue("0");
+            data.setPointName("1");
+            data.setPointValueInDouble(0.0);
+            resultList.add(data);
+        }
+    }
 
 
     @Override
@@ -299,20 +350,20 @@ public class EdosUtil implements IEdosUtil {
             }
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
             JSONObject jsonArray = resp.getBody();
-             if (StringUtils.isNotEmpty(jsonArray)){
+            if (StringUtils.isNotEmpty(jsonArray)){
                 List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
                 if (list.size() > 0)
                     return list.get(0);
                 else
-                    return ErrorRequest.RequestError(point.getCode());
+                    return ErrorRequest.RequestError(point.getId());
             } else {
-                return ErrorRequest.RequestError(point.getCode());
+                return ErrorRequest.RequestError(point.getId());
             }
 
         } catch (HttpClientErrorException exception) {
             if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
                 System.out.println("404请求错误");
-                return ErrorRequest.RequestError(point.getCode());
+                return ErrorRequest.RequestError(point.getId());
             } else {
                 throw exception;
             }
@@ -324,7 +375,7 @@ public class EdosUtil implements IEdosUtil {
         if (point==null){
             System.out.println(1111);
 
-        }else if(point.getCode()==null){
+        }else if(point.getId()==null){
             System.out.println(222);
         }
         Optional<String> tagName = Optional.ofNullable(point.getCode());
@@ -340,7 +391,7 @@ public class EdosUtil implements IEdosUtil {
         else if (count != null)
             finalInterval = (endDate - beginDate) / count;
         else
-            return ErrorRequest.RequestListError(point.getCode());
+            return ErrorRequest.RequestListError(point.getId());
         Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
 
         try {
@@ -366,16 +417,16 @@ public class EdosUtil implements IEdosUtil {
             ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
             JSONArray jsonArray = resp.getBody();
             if (jsonArray != null) {
-                List<PointData> snapList = JsonObjectHelper.phrasePointData(jsonArray, point.getCode());
+                List<PointData> snapList = JsonObjectHelper.phrasePointData(jsonArray, point.getId());
                 List<PointData> resultList = new ArrayList<>();
 
                 if(snapList.isEmpty())
                 {
 
-                	getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
+                    getHistsnapSameTiem(point.getId(), beginDate, pried, resultList);
                 }else
                 {
-                	for (PointData snapItem : snapList) {
+                    for (PointData snapItem : snapList) {
                         long subTime = snapItem.getPointTime() - pried;
                         //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
                         // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
@@ -387,11 +438,11 @@ public class EdosUtil implements IEdosUtil {
                         if (jsonObjectSection != null) {
                             List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
                             if (sectionlist.size() > 0) {
-                                    resultList.add(snapItem);
+                                resultList.add(snapItem);
 
                             } else {
                                 PointData data = new PointData();
-                                data.setEdnaId(point.getCode());
+                                data.setEdnaId(point.getId());
                                 data.setPointTime(snapItem.getPointTime());
                                 data.setPointValue("0");
                                 data.setPointName("1");
@@ -400,7 +451,7 @@ public class EdosUtil implements IEdosUtil {
                             }
                         } else {
                             PointData data = new PointData();
-                            data.setEdnaId(point.getCode());
+                            data.setEdnaId(point.getId());
                             data.setPointTime(snapItem.getPointTime());
                             data.setPointValue("0");
                             data.setPointName("1");
@@ -413,12 +464,12 @@ public class EdosUtil implements IEdosUtil {
 
                 return resultList;
             } else {
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getId());
             }
         } catch (HttpClientErrorException exception) {
             if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
                 System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getId());
             } else {
                 throw exception;
             }
@@ -456,14 +507,14 @@ public class EdosUtil implements IEdosUtil {
             ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
             JSONArray jsonArray = resp.getBody();
             if (jsonArray != null)
-                return JsonObjectHelper.phrasePointData(jsonArray, point.getCode());
+                return JsonObjectHelper.phrasePointData(jsonArray, point.getId());
             else {
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getId());
             }
         } catch (HttpClientErrorException exception) {
             if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
                 System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getId());
             } else {
                 throw exception;
             }
@@ -482,7 +533,7 @@ public class EdosUtil implements IEdosUtil {
 
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
             JSONObject jsonArray = resp.getBody();
-             if (StringUtils.isNotEmpty(jsonArray)){
+            if (StringUtils.isNotEmpty(jsonArray)){
                 List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray);
                 if (list.size() > 0)
                     return list.get(0);
@@ -557,7 +608,7 @@ public class EdosUtil implements IEdosUtil {
                     }
                     pointData.setPointValue(pointValue);
                     pointData.setPointValueInDouble(Double.parseDouble(pointValue));
-                   // System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
+                    // System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
                 }
                 return result;
 
@@ -642,7 +693,7 @@ public class EdosUtil implements IEdosUtil {
                     pointData.setPointValue(pointValue);
 
                     pointData.setPointValueInDouble(Double.parseDouble(pointValue));
-                  //  System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
+                    //  System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
                 }
                 return result;
 
@@ -674,7 +725,7 @@ public class EdosUtil implements IEdosUtil {
                 return null;
             ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
             JSONObject jsonArray = resp.getBody();
-             if (StringUtils.isNotEmpty(jsonArray)){
+            if (StringUtils.isNotEmpty(jsonArray)){
                 Iterator<String> sIterator = jsonArray.keySet().iterator();
                 Map<String, Double> resultMap = new HashMap();
                 while (sIterator.hasNext()) {
@@ -710,108 +761,107 @@ public class EdosUtil implements IEdosUtil {
     }
 
 
-	  @Override
-	    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
-	        Optional<String> tagName = Optional.ofNullable(pointid);
-	        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
-	        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
-
-	        //通过时间区间和时间间隔获取点数
-	        Long finalInterval;
-	        if (pried != null)
-	            finalInterval = pried;
-	        else if (count != null)
-	            finalInterval = (endDate - beginDate) / count;
-	        else
-	            return ErrorRequest.RequestListError(pointid);
-	        Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
-
-	        try {
-	            String url = baseURL + "/history/snap?null=0";
-	            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-	            if (tagName.isPresent())
-	                url = url + "&tagName=" + tagName.get();
-
-	            if (startTs.isPresent())
-	                url = url + "&startTs=" + startTs.get();
-	            if (endTs.isPresent())
-	                url = url + "&endTs=" + endTs.get();
-	            if (interval.isPresent())
-	                url = url + "&interval=" + interval.get();
-
-	            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
-	            JSONArray jsonArray = resp.getBody();
-	            if (jsonArray != null) {
-	                List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray,tagName.get());
-	                List<PointData> resultList = new ArrayList<>();
-	                return list;
-//
-//	                if(list.isEmpty())
-//	                {
-//
-//	                	getHistsnapSameTiem(pointid, beginDate, pried, resultList);
-//	                }else
-//	                {
-//	                	 for (PointData snapItem : list) {
-//	 	                    long subTime = snapItem.getPointTime() - pried;
-//	 	                    //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-//	 	                    // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-//	 	                    // 则代表该时间节点快照有效,否则为0
-//	 	                    String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() + "000";
-//	 	                    ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-//	 	                    JSONObject jsonObjectSection = sectionResp.getBody();
-//
-//	 	                    if (jsonObjectSection != null) {
-//	 	                        List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-//	 	                        if (sectionlist.size() > 0) {
-//	 	                            if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-//	 	                                resultList.add(snapItem);
-//	 	                            }
-//	 	                            else{
-//	 	                                PointData data = new PointData();
-//	 	                                data.setEdnaId(pointid);
-//	 	                                data.setPointTime(snapItem.getPointTime());
-//	 	                                data.setPointValue("0");
-//	 	                                data.setPointName("1");
-//	 	                                data.setPointValueInDouble(0.0);
-//	 	                                resultList.add(data);
-//	 	                            }
-//	 	                        } else {
-//	 	                            PointData data = new PointData();
-//	 	                            data.setEdnaId(pointid);
-//	 	                            data.setPointTime(snapItem.getPointTime());
-//	 	                            data.setPointValue("0");
-//	 	                            data.setPointName("1");
-//	 	                            data.setPointValueInDouble(0.0);
-//	 	                            resultList.add(data);
-//	 	                        }
-//	 	                    } else {
-//	 	                        PointData data = new PointData();
-//	 	                        data.setEdnaId(pointid);
-//	 	                        data.setPointTime(snapItem.getPointTime());
-//	 	                        data.setPointValue("0");
-//	 	                        data.setPointName("1");
-//	 	                        data.setPointValueInDouble(0.0);
-//	 	                        resultList.add(data);
-//	 	                    }
-//	 	                }
-//	                }
-//
-//	                return resultList;
-	            } else {
-	                return ErrorRequest.RequestListError(pointid);
-	            }
-
-	        } catch (HttpClientErrorException exception) {
-	            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-	                System.out.println("404请求错误");
-	                return ErrorRequest.RequestListError(pointid);
-	            } else {
-	                throw exception;
-	            }
-	        }
-
-	    }
+    @Override
+    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(pointid);
+        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+
+        //通过时间区间和时间间隔获取点数
+        Long finalInterval;
+        if (pried != null)
+            finalInterval = pried;
+        else if (count != null)
+            finalInterval = (endDate - beginDate) / count;
+        else
+            return ErrorRequest.RequestListError(pointid);
+        Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
+
+        try {
+            String url = baseURL + "/history/snap?null=0";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "&tagName=" + tagName.get();
+
+            if (startTs.isPresent())
+                url = url + "&startTs=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&endTs=" + endTs.get();
+            if (interval.isPresent())
+                url = url + "&interval=" + interval.get();
+
+            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
+            JSONArray jsonArray = resp.getBody();
+            if (jsonArray != null) {
+                List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray,tagName.get());
+                List<PointData> resultList = new ArrayList<>();
+
+                if(list.isEmpty())
+                {
+
+                    getHistsnapSameTiem(pointid, beginDate, pried, resultList);
+                }else
+                {
+                    for (PointData snapItem : list) {
+                        long subTime = snapItem.getPointTime() - pried;
+                        //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+                        // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+                        // 则代表该时间节点快照有效,否则为0
+                        String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() + "000";
+                        ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+                        JSONObject jsonObjectSection = sectionResp.getBody();
+
+                        if (jsonObjectSection != null) {
+                            List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+                            if (sectionlist.size() > 0) {
+                                if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                    resultList.add(snapItem);
+                                }
+                                else{
+                                    PointData data = new PointData();
+                                    data.setEdnaId(pointid);
+                                    data.setPointTime(snapItem.getPointTime());
+                                    data.setPointValue("0");
+                                    data.setPointName("1");
+                                    data.setPointValueInDouble(0.0);
+                                    resultList.add(data);
+                                }
+                            } else {
+                                PointData data = new PointData();
+                                data.setEdnaId(pointid);
+                                data.setPointTime(snapItem.getPointTime());
+                                data.setPointValue("0");
+                                data.setPointName("1");
+                                data.setPointValueInDouble(0.0);
+                                resultList.add(data);
+                            }
+                        } else {
+                            PointData data = new PointData();
+                            data.setEdnaId(pointid);
+                            data.setPointTime(snapItem.getPointTime());
+                            data.setPointValue("0");
+                            data.setPointName("1");
+                            data.setPointValueInDouble(0.0);
+                            resultList.add(data);
+                        }
+                    }
+                }
+
+                return resultList;
+            } else {
+                return ErrorRequest.RequestListError(pointid);
+            }
+
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(pointid);
+            } else {
+                throw exception;
+            }
+        }
+
+    }
 
 
     @Override
@@ -870,7 +920,7 @@ public class EdosUtil implements IEdosUtil {
         else if (count != null)
             finalInterval = (endDate - beginDate) / count;
         else
-            return ErrorRequest.RequestListError(point.getCode());
+            return ErrorRequest.RequestListError(point.getId());
         Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
 
         try {
@@ -896,14 +946,14 @@ public class EdosUtil implements IEdosUtil {
             ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
             JSONArray jsonArray = resp.getBody();
             if (jsonArray != null)
-                return JsonObjectHelper.GeneralTsDataToPointDataByStat(jsonArray, point.getCode(), type);
+                return JsonObjectHelper.GeneralTsDataToPointDataByStat(jsonArray, point.getId(), type);
             else {
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getId());
             }
         } catch (HttpClientErrorException exception) {
             if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
                 System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getId());
             } else {
                 throw exception;
             }
@@ -1081,7 +1131,7 @@ public class EdosUtil implements IEdosUtil {
         JSONObject jo = new JSONObject();
         jo.put("tagName", pd.getEdnaId());
         JSONObject joo = new JSONObject();
-        joo.put("ts", pd.getPointTime()*1000);
+        joo.put("ts", pd.getPointTime());
         joo.put("status", 0);
         joo.put("doubleValue", pd.getPointValueInDouble());
         jo.put("tsData", joo);
@@ -1118,14 +1168,14 @@ public class EdosUtil implements IEdosUtil {
             if (StringUtils.isNotEmpty(jsonObject) && !jsonObject.isEmpty()){
                 return JsonObjectHelper.phraseDNAVal(jsonObject,tagNames);
             } else {
-            	  DNAVal[] errorResult = new DNAVal[tagNames.length];
-                  for(int i=0;i<tagNames.length;i++)
-                  {
-                  	 DNAVal val = new DNAVal();
-                       val.Status = 0;
-                       errorResult[i] = val;
-                  }
-                  return errorResult;
+                DNAVal[] errorResult = new DNAVal[tagNames.length];
+                for(int i=0;i<tagNames.length;i++)
+                {
+                    DNAVal val = new DNAVal();
+                    val.Status = 0;
+                    errorResult[i] = val;
+                }
+                return errorResult;
             }
 
         } catch (HttpClientErrorException exception) {
@@ -1134,9 +1184,9 @@ public class EdosUtil implements IEdosUtil {
                 DNAVal[] errorResult = new DNAVal[tagNames.length];
                 for(int i=0;i<tagNames.length;i++)
                 {
-                	 DNAVal val = new DNAVal();
-                     val.Status = 0;
-                     errorResult[i] = val;
+                    DNAVal val = new DNAVal();
+                    val.Status = 0;
+                    errorResult[i] = val;
                 }
                 return errorResult;
             } else {
@@ -1241,27 +1291,27 @@ public class EdosUtil implements IEdosUtil {
             JSONObject jsonObject = resp.getBody();
             if (StringUtils.isNotEmpty(jsonObject) && !jsonObject.isEmpty())
             {
-            	 return JsonObjectHelper.phraseDNAVal(jsonObject,nameList);
+                return JsonObjectHelper.phraseDNAVal(jsonObject,nameList);
             }
             else {
                 DNAVal[] errorResult = new DNAVal[nameList.length];
                 for(int i=0;i<nameList.length;i++)
                 {
-                	 DNAVal val = new DNAVal();
-                     val.Status = 0;
-                     errorResult[i] = val;
+                    DNAVal val = new DNAVal();
+                    val.Status = 0;
+                    errorResult[i] = val;
                 }
                 return errorResult;
             }
         } 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;
+            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;
         }
     }
 

+ 36 - 6
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/util/realtimesource/IEdosUtil.java

@@ -13,14 +13,43 @@ import java.util.Map;
 
 public interface IEdosUtil {
 
-	/**
-	 * 通过风场测点获得测点实时数据
-	 * @param point 只是用了code字段,作为唯一标识
-	 * @return
-	 * @throws Exception
-	 */
+    /**
+     * 通过风场测点获得测点实时数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @return
+     * @throws Exception
+     */
     public PointData getRealData(Windpowerstationpointnew point) throws Exception;
 
+
+    /**
+     * 通过风场测点获得测点切面数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param date 时间
+     * @return
+     * @throws Exception
+     */
+    public PointData getSectionData(String point,Long date) throws Exception;
+
+
+    /**
+     * 通过风场测点获得测点切面数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param date 时间
+     * @return
+     * @throws Exception
+     */
+    public PointData getSectionData(Windpowerstationpointnew point,Long date) throws Exception;
+
+    /**
+     * 通过风机测点获得测点切面数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param date 时间
+     * @return
+     * @throws Exception
+     */
+    public PointData getSectionData(Windturbinetestingpointnew point,Long date) throws Exception;
+
     /**
      * 通过风场测点获得测点历史快照数据
      * @param point 只是用了code字段,作为唯一标识
@@ -230,4 +259,5 @@ public interface IEdosUtil {
      */
     public DNAVal[] getHistMatrix(String[] nameList, int tTime) throws Exception;
 
+
 }

+ 8 - 2
histroy/benchmarking-histroy-new/src/test/java/com/gyee/benchmarkinghistroy/BenchmarkingHistroyMainNewTest.java

@@ -3,6 +3,7 @@ package com.gyee.benchmarkinghistroy;
 
 import com.gyee.benchmarkinghistroy.model.auto.Windpowerstationpointnew;
 import com.gyee.benchmarkinghistroy.service.benchmarking.BenchmarkingHistroyService;
+import com.gyee.benchmarkinghistroy.service.infoday.InfodayService;
 import com.gyee.benchmarkinghistroy.service.specific.SpecificService;
 import com.gyee.benchmarkinghistroy.util.realtimesource.IEdosUtil;
 import com.gyee.benchmarkinghistroy.util.realtimesource.MongoEdosUtil;
@@ -35,18 +36,23 @@ public  class BenchmarkingHistroyMainNewTest {
     private BenchmarkingHistroyService benchmarkingHistroyService;
     @Resource
     private SpecificService specificService;
+    @Resource
+    private InfodayService infodayService;
     Logger log = LoggerFactory.getLogger(BenchmarkingHistroyMainNewTest.class);
 
 
     @Test
     public void test1() throws Exception {
-        String date = "2022-04-23";
+        String date = "2022-05-02";
 //        benchmarkingHistroyService.saveEquipmentdayinfo(date,date);
 //        benchmarkingHistroyService.saveEquipmentdaydetailed(date,date);
 //        benchmarkingHistroyService.saveOperationrecord(date,date);
 //        benchmarkingHistroyService.saveBeanchmarkList(date,date);
 //        benchmarkingHistroyService.saveBenchmark(date,date);
-        specificService.saveWindpowerspecificinfoday(date,date);
+//        infodayService.saveWindturbineinfoday(date,date);
+        infodayService.saveWindturbineinfoday3(date,date);
+        infodayService.saveWindpowerinfoday(date,date);
+        infodayService.saveWindpowerinfoday3(date,date);
     }
 
     @Test

+ 181 - 23
realtime/generation-service/src/main/java/com/gyee/generation/service/FiveLossesService.java

@@ -2,7 +2,6 @@ package com.gyee.generation.service;
 
 import com.gyee.common.contant.Contant;
 import com.gyee.common.model.PointData;
-import com.gyee.common.model.StringUtils;
 import com.gyee.common.util.DateUtils;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
@@ -10,10 +9,7 @@ import com.gyee.generation.util.realtimesource.IEdosUtil;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
 
@@ -21,7 +17,7 @@ import java.util.stream.Collectors;
  * @ClassName : FiveLossesService
  * @Author : xieshengjie
  * @Date: 2022/5/2 16:13
- * @Description : 五项损失
+ * @Description : 五项损失,欠发状态,欠发发电量
  */
 @Service
 public class FiveLossesService {
@@ -64,7 +60,7 @@ public class FiveLossesService {
     }
 
     /**
-     * 场站五损
+     * 场站五损,欠发电量
      */
     private void wpDaylossesReal() throws Exception {
         List<PointData> resultList = new ArrayList<>();
@@ -107,6 +103,11 @@ public class FiveLossesService {
             AtomicReference<Double> wpdayhjslloss = new AtomicReference<>(0.0);
             AtomicReference<Double> wpmonthhjslloss = new AtomicReference<>(0.0);
             AtomicReference<Double> wpyearhjslloss = new AtomicReference<>(0.0);
+            AtomicReference<Double> wpdayqf0 = new AtomicReference<>(0.0);
+            AtomicReference<Double> wpdayqf1 = new AtomicReference<>(0.0);
+            AtomicReference<Double> wpdayqf2 = new AtomicReference<>(0.0);
+            AtomicReference<Double> wpdayqf3 = new AtomicReference<>(0.0);
+            AtomicReference<Double> wpdayqf4= new AtomicReference<>(0.0);
             projects.stream().forEach(project -> {
                 List<Line> lines = prolinemap.get(project.getId());
                 Map<String, Windpowerstationpointnew> projectpointnewMap = propointmap.get(project.getId());
@@ -146,6 +147,11 @@ public class FiveLossesService {
                 AtomicReference<Double> projectdayhjslloss = new AtomicReference<>(0.0);
                 AtomicReference<Double> projectmonthhjslloss = new AtomicReference<>(0.0);
                 AtomicReference<Double> projectyearhjslloss = new AtomicReference<>(0.0);
+                AtomicReference<Double> projectdayqf0 = new AtomicReference<>(0.0);
+                AtomicReference<Double> projectdayqf1 = new AtomicReference<>(0.0);
+                AtomicReference<Double> projectdayqf2 = new AtomicReference<>(0.0);
+                AtomicReference<Double> projectdayqf3 = new AtomicReference<>(0.0);
+                AtomicReference<Double> projectdayqf4 = new AtomicReference<>(0.0);
                 lines.stream().forEach(line -> {
                     List<Windturbine> windturbines = linewtmap.get(line.getId());
                     Map<String, Windpowerstationpointnew> linepointnewMap = linepointmap.get(line.getId());
@@ -185,6 +191,11 @@ public class FiveLossesService {
                     AtomicReference<Double> linedayhjslloss = new AtomicReference<>(0.0);
                     AtomicReference<Double> linemonthhjslloss = new AtomicReference<>(0.0);
                     AtomicReference<Double> lineyearhjslloss = new AtomicReference<>(0.0);
+                    AtomicReference<Double> linedayqf0 = new AtomicReference<>(0.0);
+                    AtomicReference<Double> linedayqf1 = new AtomicReference<>(0.0);
+                    AtomicReference<Double> linedayqf2 = new AtomicReference<>(0.0);
+                    AtomicReference<Double> linedayqf3 = new AtomicReference<>(0.0);
+                    AtomicReference<Double> linedayqf4 = new AtomicReference<>(0.0);
                     windturbines.stream().forEach(wt->{
                         Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
                         //待机
@@ -247,6 +258,13 @@ public class FiveLossesService {
                         Windturbinetestingpointnew monthHjslPoint = windturbinetestingpointnewMap.get(Contant.WTYTZSSDL);
                         Windturbinetestingpointnew yearHjslPoint = windturbinetestingpointnewMap.get(Contant.WTNTZSSDL);
                         geneLineloss(linedayhjslloss, linemonthhjslloss, lineyearhjslloss, dayHjslPoint, monthHjslPoint, yearHjslPoint);
+                        //欠发发电量
+                        Windturbinetestingpointnew dayqf0 = windturbinetestingpointnewMap.get(Contant.R0QFZT);
+                        Windturbinetestingpointnew dayqf1 = windturbinetestingpointnewMap.get(Contant.R1QFZT);
+                        Windturbinetestingpointnew dayqf2 = windturbinetestingpointnewMap.get(Contant.R2QFZT);
+                        Windturbinetestingpointnew dayqf3 = windturbinetestingpointnewMap.get(Contant.R3QFZT);
+                        Windturbinetestingpointnew dayqf4 = windturbinetestingpointnewMap.get(Contant.R4QFZT);
+                        geneLineQfloss(linedayqf0, linedayqf1, linedayqf2,linedayqf3,linedayqf4, dayqf0, dayqf1, dayqf2,dayqf3,dayqf4);
                     });
                     //待机
                     addWpPoint(resultList, linepointnewMap.get(Contant.RSDJZSDL), linedaydjloss);
@@ -332,6 +350,17 @@ public class FiveLossesService {
                     projectdayhjslloss.updateAndGet(v->new Double((double) (v + linedayhjslloss.get())));
                     projectmonthhjslloss.updateAndGet(v->new Double((double) (v + linemonthhjslloss.get())));
                     projectyearhjslloss.updateAndGet(v->new Double((double) (v + lineyearhjslloss.get())));
+                    //欠发发电量
+                    addWpPoint(resultList, linepointnewMap.get(Contant.R0QFZT), linedayqf0);
+                    addWpPoint(resultList, linepointnewMap.get(Contant.R1QFZT), linedayqf1);
+                    addWpPoint(resultList, linepointnewMap.get(Contant.R2QFZT), linedayqf2);
+                    addWpPoint(resultList, linepointnewMap.get(Contant.R3QFZT), linedayqf3);
+                    addWpPoint(resultList, linepointnewMap.get(Contant.R4QFZT), linedayqf4);
+                    projectdayqf0.updateAndGet(v->new Double((double) (v + linedayqf0.get())));
+                    projectdayqf1.updateAndGet(v->new Double((double) (v + linedayqf1.get())));
+                    projectdayqf2.updateAndGet(v->new Double((double) (v + linedayqf2.get())));
+                    projectdayqf3.updateAndGet(v->new Double((double) (v + linedayqf3.get())));
+                    projectdayqf4.updateAndGet(v->new Double((double) (v + linedayqf4.get())));
                 });
                 //待机
                 addWpPoint(resultList, projectpointnewMap.get(Contant.RSDJZSDL), projectdaydjloss);
@@ -417,6 +446,17 @@ public class FiveLossesService {
                 wpdayhjslloss.updateAndGet(v->new Double((double) (v + projectdayhjslloss.get())));
                 wpmonthhjslloss.updateAndGet(v->new Double((double) (v + projectmonthhjslloss.get())));
                 wpyearhjslloss.updateAndGet(v->new Double((double) (v + projectyearhjslloss.get())));
+                //欠发发电量
+                addWpPoint(resultList, projectpointnewMap.get(Contant.R0QFZT), projectdayqf0);
+                addWpPoint(resultList, projectpointnewMap.get(Contant.R1QFZT), projectdayqf1);
+                addWpPoint(resultList, projectpointnewMap.get(Contant.R2QFZT), projectdayqf2);
+                addWpPoint(resultList, projectpointnewMap.get(Contant.R3QFZT), projectdayqf3);
+                addWpPoint(resultList, projectpointnewMap.get(Contant.R4QFZT), projectdayqf4);
+                wpdayqf0.updateAndGet(v->new Double((double) (v + projectdayqf0.get())));
+                wpdayqf1.updateAndGet(v->new Double((double) (v + projectdayqf1.get())));
+                wpdayqf2.updateAndGet(v->new Double((double) (v + projectdayqf2.get())));
+                wpdayqf3.updateAndGet(v->new Double((double) (v + projectdayqf3.get())));
+                wpdayqf4.updateAndGet(v->new Double((double) (v + projectdayqf4.get())));
             });
             //待机
             addWpPoint(resultList, wppointnewMap.get(Contant.RSDJZSDL), wpdaydjloss);
@@ -467,10 +507,44 @@ public class FiveLossesService {
             addWpPoint(resultList, wppointnewMap.get(Contant.RTZZSDL), wpdayhjslloss);
             addWpPoint(resultList, wppointnewMap.get(Contant.YTZZSDL), wpmonthhjslloss);
             addWpPoint(resultList, wppointnewMap.get(Contant.NTZZSDL), wpyearhjslloss);
+            //欠发发电量
+            addWpPoint(resultList, wppointnewMap.get(Contant.R0QFZT), wpdayqf0);
+            addWpPoint(resultList, wppointnewMap.get(Contant.R1QFZT), wpdayqf1);
+            addWpPoint(resultList, wppointnewMap.get(Contant.R2QFZT), wpdayqf2);
+            addWpPoint(resultList, wppointnewMap.get(Contant.R3QFZT), wpdayqf3);
+            addWpPoint(resultList, wppointnewMap.get(Contant.R4QFZT), wpdayqf4);
         });
         edosUtil.sendMultiPoint(resultList);
     }
 
+    private void geneLineQfloss(AtomicReference<Double> linedayqf0, AtomicReference<Double> linedayqf1, AtomicReference<Double> linedayqf2, AtomicReference<Double> linedayqf3, AtomicReference<Double> linedayqf4, Windturbinetestingpointnew dayqf0, Windturbinetestingpointnew dayqf1, Windturbinetestingpointnew dayqf2, Windturbinetestingpointnew dayqf3, Windturbinetestingpointnew dayqf4) {
+        double wtdayqf0 = 0.0;
+        double wtdayqf1 = 0.0;
+        double wtdayqf2 = 0.0;
+        double wtdayqf3 = 0.0;
+        double wtdayqf4 = 0.0;
+        try {
+            wtdayqf0 = edosUtil.getSectionData(dayqf0,tomorrow.getTime()).getPointValueInDouble();
+            wtdayqf1 = edosUtil.getSectionData(dayqf1,tomorrow.getTime()).getPointValueInDouble();
+            wtdayqf2 = edosUtil.getSectionData(dayqf2,tomorrow.getTime()).getPointValueInDouble();
+            wtdayqf3 = edosUtil.getSectionData(dayqf3,tomorrow.getTime()).getPointValueInDouble();
+            wtdayqf4 = edosUtil.getSectionData(dayqf4,tomorrow.getTime()).getPointValueInDouble();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        double finalWtdayqf = wtdayqf0;
+        linedayqf0.updateAndGet(v -> new Double((double) (v + finalWtdayqf)));
+        double finalWtdayqf1 = wtdayqf1;
+        linedayqf1.updateAndGet(v -> new Double((double) (v + finalWtdayqf1)));
+        double finalWtdayqf2 = wtdayqf2;
+        linedayqf2.updateAndGet(v -> new Double((double) (v + finalWtdayqf2)));
+        double finalWtdayqf3 = wtdayqf3;
+        linedayqf3.updateAndGet(v -> new Double((double) (v + finalWtdayqf3)));
+        double finalWtdayqf4 = wtdayqf4;
+        linedayqf4.updateAndGet(v -> new Double((double) (v + finalWtdayqf4)));
+
+    }
+
     private void addWpPoint(List<PointData> resultList, Windpowerstationpointnew pointnew, AtomicReference<Double> linedaydjloss) {
         PointData wpPointData = createWpPointData(pointnew, linedaydjloss.get());
         resultList.add(wpPointData);
@@ -497,7 +571,7 @@ public class FiveLossesService {
     }
 
     /**
-     * 风机日五损
+     * 风机日五损,欠发状态,欠发电量
      * @throws Exception
      */
     private void wtDaylossesReal() throws Exception {
@@ -508,20 +582,25 @@ public class FiveLossesService {
             Windturbinetestingpointnew ztmxPoint = windturbinetestingpointnewMap.get(Contant.ZTMX);
             Windturbinetestingpointnew bzglPoint = windturbinetestingpointnewMap.get(Contant.BZGL);
             Windturbinetestingpointnew zsglPoint = windturbinetestingpointnewMap.get(Contant.ZSGL);
-            Windturbinetestingpointnew rfdlPoint = windturbinetestingpointnewMap.get(Contant.ZSGL);
+            Windturbinetestingpointnew qfztPoint = windturbinetestingpointnewMap.get(Contant.RSSQFZT);
             List<PointData> powerDatasSnap = null;
             List<PointData> ztmxDatasSnap = null;
             List<PointData> bzglDatasSnap = null;
             List<PointData> zsglDatasSnap = null;
+            List<PointData> qfztDatasSnap = null;
             try {
                 powerDatasSnap = edosUtil.getHistoryDatasSnap(powerPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
+                if (powerDatasSnap.size()==1){
+                    return;
+                }
                 ztmxDatasSnap = edosUtil.getHistoryDatasSnap(ztmxPoint,samedayZero.getTime()/1000,currentDate.getTime()/1000,null,60l);
                 bzglDatasSnap = edosUtil.getHistoryDatasSnap(bzglPoint,samedayZero.getTime()/1000,currentDate.getTime()/1000,null,60l);
                 zsglDatasSnap = edosUtil.getHistoryDatasSnap(zsglPoint,samedayZero.getTime()/1000,currentDate.getTime()/1000,null,60l);
+                qfztDatasSnap = edosUtil.getHistoryDatasSnap(qfztPoint,samedayZero.getTime()/1000,currentDate.getTime()/1000,null,60l);
             } catch (Exception e) {
                 e.printStackTrace();
             }
-            if (StringUtils.isNotEmpty(ztmxDatasSnap)){
+            if (ztmxDatasSnap.size() == powerDatasSnap.size()){
                 //待机损失
                 generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 0.0,resultList,windturbinetestingpointnewMap.get(Contant.WTRDJSSDL));
                 //手动停机
@@ -546,11 +625,81 @@ public class FiveLossesService {
                 generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 10.0,resultList,windturbinetestingpointnewMap.get(Contant.WTRWZSSDL));
                 //环境受累
                 generalLoss(ztmxDatasSnap, bzglDatasSnap, zsglDatasSnap, powerDatasSnap, 11.0,resultList,windturbinetestingpointnewMap.get(Contant.WTRTZSSDL));
+
+                //欠发状态
+                generalQfzt(powerDatasSnap, ztmxDatasSnap, zsglDatasSnap,qfztPoint,resultList);
+                //欠发电量
+                generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,0.0,resultList,windturbinetestingpointnewMap.get(Contant.R0QFZT));
+                generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,1.0,resultList,windturbinetestingpointnewMap.get(Contant.R1QFZT));
+                generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,2.0,resultList,windturbinetestingpointnewMap.get(Contant.R2QFZT));
+                generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,3.0,resultList,windturbinetestingpointnewMap.get(Contant.R3QFZT));
+                generalQfss(qfztDatasSnap,bzglDatasSnap,zsglDatasSnap,powerDatasSnap,4.0,resultList,windturbinetestingpointnewMap.get(Contant.R4QFZT));
             }
         });
         edosUtil.sendMultiPoint(resultList);
     }
 
+    private double generalQfss(List<PointData> ztmxDatasSnap, List<PointData> bzglDatasSnap, List<PointData> zsglDatasSnap, List<PointData> powerDatasSnap,Double statusValue,List<PointData> resultList,Windturbinetestingpointnew point) {
+        List<PointData> pointDataList = ztmxDatasSnap.stream().filter(zt -> zt.getPointValueInDouble() == statusValue).collect(Collectors.toList());
+        Double bzss = 0.0;
+        Double zsss = 0.0;
+        for(int i= 0;i<ztmxDatasSnap.size();i++){
+            for (int j=0;j<pointDataList.size();j++){
+                if (pointDataList.get(j).getPointTime().equals(ztmxDatasSnap.get(i).getPointTime())){
+                    double bzgl = bzglDatasSnap.get(i).getPointValueInDouble();
+                    double zsgl = zsglDatasSnap.get(i).getPointValueInDouble();
+                    double power = powerDatasSnap.get(i).getPointValueInDouble();
+                    bzss += (bzgl-power);
+                    zsss += (zsgl-power);
+                }
+            }
+        }
+
+
+        bzss = bzss /60;
+        zsss = zsss/60;
+        //待有历史改为用自算损失
+        PointData wtPointData = createWtPointData(point, zsss);
+        resultList.add(wtPointData);
+        return zsss;
+    }
+
+
+    private void generalQfzt(List<PointData> powerDatasSnap, List<PointData> ztmxDatasSnap, List<PointData> zsglDatasSnap,Windturbinetestingpointnew qfztPoint,List<PointData> resultList)  {
+        double zs = 0;
+        double pp = 0;
+        int i = 1;
+        for ( ; i <= 5; i++) {
+            zs += zsglDatasSnap.get(zsglDatasSnap.size()-i).getPointValueInDouble();
+            pp += powerDatasSnap.get(powerDatasSnap.size()-1).getPointValueInDouble();
+        }
+        zs /= i;
+        pp /= i;
+        double ztmx = ztmxDatasSnap.get(ztmxDatasSnap.size() - 1).getPointValueInDouble();
+        double[] underissuanceArray = {0,1,2,3,4,5,11};
+        double qfzt = 0;
+        if (Arrays.asList(underissuanceArray).contains(ztmx)){
+            double ratioll = 0;
+            if (zs != 0){
+                ratioll = (zs-pp)/zs;
+            }
+            if (ratioll<0.05){
+                qfzt = 0;
+            }else if (ratioll >= 0.05 && ratioll < 0.1){
+                qfzt = 1;
+            }else if (ratioll >= 0.1 && ratioll < 0.2){
+                qfzt = 2;
+            }else if (ratioll >= 0.2 && ratioll < 0.4) {
+                qfzt = 3;
+            }else {
+                qfzt = 4;
+            }
+        }
+        PointData wtPointData = createWtPointData(qfztPoint, qfzt);
+        resultList.add(wtPointData);
+
+    }
+
 
     private PointData createWpPointData(Windpowerstationpointnew linepointnew, double linespeed) {
         PointData pointData = new PointData();
@@ -665,31 +814,40 @@ public class FiveLossesService {
         resultList.add(createWtPointData(monthPoint,monthValue));
     }
 
-    private void generalLoss(List<PointData> ztmxDatasSnap, List<PointData> bzglDatasSnap, List<PointData> zsglDatasSnap, List<PointData> powerDatasSnap,Double statusValue,List<PointData> resultList,Windturbinetestingpointnew point) {
+    private double generalLoss(List<PointData> ztmxDatasSnap, List<PointData> bzglDatasSnap, List<PointData> zsglDatasSnap, List<PointData> powerDatasSnap,Double statusValue,List<PointData> resultList,Windturbinetestingpointnew point) {
         List<PointData> pointDataList = ztmxDatasSnap.stream().filter(zt -> zt.getPointValueInDouble() == statusValue).collect(Collectors.toList());
         Double bzss = 0.0;
         Double zsss = 0.0;
         if (statusValue == 2.0 || statusValue == 3.0 || statusValue == 4.0){
-            for (int i=0;i<pointDataList.size();i++){
-                double bzgl = bzglDatasSnap.get(i).getPointValueInDouble();
-                double zsgl = zsglDatasSnap.get(i).getPointValueInDouble();
-                double power = powerDatasSnap.get(i).getPointValueInDouble();
-                bzss += (bzgl-power);
-                zsss += (zsgl-power);
+            for(int i= 0;i<ztmxDatasSnap.size();i++){
+                for (int j=0;j<pointDataList.size();j++){
+                    if (pointDataList.get(j).getPointTime().equals(ztmxDatasSnap.get(i).getPointTime())){
+                        double bzgl = bzglDatasSnap.get(i).getPointValueInDouble();
+                        double zsgl = zsglDatasSnap.get(i).getPointValueInDouble();
+                        double power = powerDatasSnap.get(i).getPointValueInDouble();
+                        bzss += (bzgl-power);
+                        zsss += (zsgl-power);
+                    }
+                }
             }
         }else {
-            for (int i=0;i<pointDataList.size();i++){
-                double bzgl = bzglDatasSnap.get(i).getPointValueInDouble();
-                double zsgl = zsglDatasSnap.get(i).getPointValueInDouble();
-                bzss += bzgl;
-                zsss += zsgl;
+            for(int i= 0;i<ztmxDatasSnap.size();i++){
+                for (int j=0;j<pointDataList.size();j++){
+                    if (pointDataList.get(j).getPointTime().equals(ztmxDatasSnap.get(i).getPointTime())){
+                        double bzgl = bzglDatasSnap.get(i).getPointValueInDouble();
+                        double zsgl = zsglDatasSnap.get(i).getPointValueInDouble();
+                        bzss += bzgl;
+                        zsss += zsgl;
+                    }
+                }
             }
         }
         bzss = bzss /60;
         zsss = zsss/60;
         //待有历史改为用自算损失
-        PointData wtPointData = createWtPointData(point, bzss);
+        PointData wtPointData = createWtPointData(point, zsss);
         resultList.add(wtPointData);
+        return zsss;
     }
 
 

+ 1 - 0
realtime/generation-service/src/main/java/com/gyee/generation/service/StatusService.java

@@ -606,6 +606,7 @@ public class StatusService {
             PointData lxnumPoint = createWpPoint(wplxnum, lxnumPointNew);
             PointData txzdPoint = createWpPoint(wplxnum, txzdPointNew);
             resultList.add(lxnumPoint);
+            resultList.add(txzdPoint);
         });
         edosUtil.sendMultiPoint(resultList);
     }

+ 69 - 0
realtime/generation-service/src/main/java/com/gyee/generation/service/UnderissuanceService.java

@@ -0,0 +1,69 @@
+package com.gyee.generation.service;
+
+import com.gyee.common.contant.Contant;
+import com.gyee.common.util.DateUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.Windturbine;
+import com.gyee.generation.model.auto.Windturbinetestingpointnew;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : UnderissuanceService
+ * @Author : xieshengjie
+ * @Date: 2022/5/7 10:34
+ * @Description : 欠发
+ */
+@Service
+public class UnderissuanceService {
+    @Resource
+    private IEdosUtil edosUtil;
+    private List<Windturbine> wtls;
+    private Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap;
+    private Date samedayZero;
+    private Date currentDate;
+    private Date tomorrow;
+
+    private void init(){
+        wtls = CacheContext.wtls;
+        wtpAimap = CacheContext.wtpAimap;
+        samedayZero = DateUtils.getSamedayZero();
+        currentDate = DateUtils.getCurrentDate();
+        tomorrow = DateUtils.addDays(samedayZero,1);
+    }
+    /**
+     * 计算风机欠发状态
+     * //                if (zt == GdnxfdTarget.statusMx.待机 || zt == GdnxfdTarget.statusMx.手动停机 || zt == GdnxfdTarget.statusMx.发电降出力 || zt == GdnxfdTarget.statusMx.正常发电
+     * //                        || zt == GdnxfdTarget.statusMx.限电停机 || zt == GdnxfdTarget.statusMx.限电降出力 || zt == GdnxfdTarget.statusMx.环境受累)
+     */
+    public void underissuanceStatus(){
+        init();
+        wtls.stream().forEach(wt->{
+            Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
+            Windturbinetestingpointnew ztmxPoint = windturbinetestingpointnewMap.get(Contant.ZTMX);
+            Windturbinetestingpointnew zsglPoint = windturbinetestingpointnewMap.get(Contant.ZSGL);
+            Windturbinetestingpointnew powerPoint = windturbinetestingpointnewMap.get(Contant.AI130);
+            double ztmxValue = 0.0;
+            double zsglValue = 0.0;
+            double powerValue = 0.0;
+            try {
+                ztmxValue = edosUtil.getSectionData(ztmxPoint,tomorrow.getTime()).getPointValueInDouble();
+                zsglValue = edosUtil.getSectionData(zsglPoint,tomorrow.getTime()).getPointValueInDouble();
+                powerValue = edosUtil.getSectionData(powerPoint,tomorrow.getTime()).getPointValueInDouble();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            double[] underissuanceArray = {0,1,2,3,4,5,11};
+            if (Arrays.asList(underissuanceArray).contains(ztmxValue)){
+
+            }
+        });
+
+    }
+}

+ 16 - 0
web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/controller/benching/BenchmarkingController.java

@@ -65,6 +65,22 @@ public class BenchmarkingController {
             return R.error().message("访问失败");
         }
     }
+    /**
+     * 风场风机列表
+     * @return
+     */
+    @GetMapping("/wpwtlist")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R wpwtlist(){
+        Map<String,List<Windturbine>> resultMap = benchmarkingService.wpwtlist();
+
+        if (StringUtils.isNotNull(resultMap)) {
+            return R.ok(resultMap.size()).data(resultMap);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
 
     /**
      * 根据场站查询

+ 41 - 0
web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/controller/performance/PerformanceController.java

@@ -0,0 +1,41 @@
+package com.gyee.benchmarkingweb.controller.performance;
+
+import com.gyee.benchmarkingweb.config.R;
+import com.gyee.benchmarkingweb.service.performance.PerformanceService;
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.vo.curve.CurveVo;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : PerformanceController
+ * @Author : xieshengjie
+ * @Date: 2022/5/13 10:53
+ * @Description :
+ */
+@RestController
+@RequestMapping("//performance")
+public class PerformanceController {
+
+    @Resource
+    private PerformanceService performanceService;
+
+    @GetMapping("/curvefitting")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R curvefitting(@RequestParam(value = "wtids",required = true) String wtids,
+                          //单风机0,多风机1
+                          @RequestParam(value = "type",required = true) String type
+    ){
+        Map<String, List<CurveVo>> curvefitting = performanceService.curvefitting(wtids, type);
+
+        if (StringUtils.isNotNull(curvefitting)) {
+            return R.ok(curvefitting.size()).data(curvefitting);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+}

+ 4 - 0
web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/service/benching/BenchmarkingService.java

@@ -2070,4 +2070,8 @@ public class BenchmarkingService {
             isNullHandle(resultList, vo);
         }
     }
+
+    public Map<String, List<Windturbine>> wpwtlist() {
+        return CacheContext.wtmap;
+    }
 }

+ 72 - 0
web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/service/performance/PerformanceService.java

@@ -0,0 +1,72 @@
+package com.gyee.benchmarkingweb.service.performance;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import com.gyee.benchmarkingweb.init.CacheContext;
+import com.gyee.benchmarkingweb.model.auto.Windturbine;
+import com.gyee.benchmarkingweb.util.redis.RedisService;
+import com.gyee.common.util.SortUtils;
+import com.gyee.common.vo.curve.CurveVo;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+/**
+ * @ClassName : PerformanceService
+ * @Author : xieshengjie
+ * @Date: 2022/5/13 11:00
+ * @Description :
+ */
+@Service
+public class PerformanceService {
+    @Resource
+    private RedisService redisService;
+
+    public Map<String,List<CurveVo>> curvefitting(String wtids, String type) {
+        Map<String,List<CurveVo>> resultMap = new HashMap<>();
+        Map<String, Windturbine> wtmap = CacheContext.wmap;
+        String zbzgl = redisService.get("ZBZGL");
+        Map<String,Map<Double,Double>> zbzglMap = JSONObject.parseObject(zbzgl, new TypeReference<Map<String, Map<Double,Double>>>() {
+        });
+        String zzsgl = redisService.get("ZZSGL");
+        Map<String,Map<Double,Double>> zzsglMap = JSONObject.parseObject(zzsgl, new TypeReference<Map<String, Map<Double,Double>>>() {
+        });
+
+        if (type.equals("0")){
+            List<CurveVo> tempList = new ArrayList<>();
+            if (zzsglMap.containsKey(wtids)){
+                Map<Double, Double> zsglmap = zzsglMap.get(wtids);
+                Map<Double, Double> bzglmap = zbzglMap.get(wtmap.get(wtids).getModelid());
+                Set<Double> speeds = zsglmap.keySet();
+                speeds.stream().forEach(speed->{
+                    CurveVo vo = new CurveVo();
+                    vo.setWtid(wtids);
+                    vo.setSpeed(speed);
+                    vo.setTheorypower(zsglmap.get(speed));
+                    vo.setEnsurepower(bzglmap.containsKey(speed)?bzglmap.get(speed):zsglmap.get(speed));
+                    tempList.add(vo);
+                });
+                SortUtils.sort(tempList,"speed",SortUtils.ASC);
+                resultMap.put(wtids,tempList);
+            }
+        }else {
+            String[] wts = wtids.split(",");
+            Arrays.stream(wts).forEach(wt->{
+                List<CurveVo> tempList = new ArrayList<>();
+                Map<Double, Double> zsglmap = zzsglMap.get(wt);
+                Set<Double> speeds = zsglmap.keySet();
+                speeds.stream().forEach(speed->{
+                    CurveVo vo = new CurveVo();
+                    vo.setWtid(wt);
+                    vo.setSpeed(speed);
+                    vo.setTheorypower(zsglmap.get(speed));
+                    tempList.add(vo);
+                });
+                SortUtils.sort(tempList,"speed",SortUtils.ASC);
+                resultMap.put(wt,tempList);
+            });
+        }
+        return resultMap;
+    }
+}

+ 44 - 0
web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/util/redis/RedisAutoConfiguration.java

@@ -0,0 +1,44 @@
+package com.gyee.benchmarkingweb.util.redis;
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.StringRedisTemplate;
+
+import java.net.UnknownHostException;
+
+@Configuration
+@ConditionalOnClass(RedisOperations.class)
+@EnableConfigurationProperties(RedisProperties.class)
+public class RedisAutoConfiguration {
+
+
+    @Bean
+    @ConditionalOnMissingBean(name = "redisTemplate")
+    public RedisTemplate<Object, Object> redisTemplate(
+            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
+        RedisTemplate<Object, Object> template = new RedisTemplate<>();
+        template.setConnectionFactory(redisConnectionFactory);
+        return template;
+
+    }
+
+
+    @Bean
+    @ConditionalOnMissingBean
+    public StringRedisTemplate stringRedisTemplate(
+            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
+        StringRedisTemplate template = new StringRedisTemplate();
+        template.setConnectionFactory(redisConnectionFactory);
+        return template;
+
+    }
+
+
+}

+ 47 - 0
web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/util/redis/RedisConfig.java

@@ -0,0 +1,47 @@
+package com.gyee.benchmarkingweb.util.redis;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+
+/**
+
+/**
+ *@ClassName RedisConfig
+ *@Description TODO
+ *@Author 谢生杰
+ *@Date 2020/9/14 10:42
+ *@Version 1.0
+ **/
+@Configuration
+public class RedisConfig {
+    @Bean
+    @SuppressWarnings("all")
+    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
+        RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
+        template.setConnectionFactory(factory);
+        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+        ObjectMapper om = new ObjectMapper();
+        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        jackson2JsonRedisSerializer.setObjectMapper(om);
+        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+        // key采用String的序列化方式
+        template.setKeySerializer(stringRedisSerializer);
+        // hash的key也采用String的序列化方式
+        template.setHashKeySerializer(stringRedisSerializer);
+        // value序列化方式采用jackson
+        template.setValueSerializer(jackson2JsonRedisSerializer);
+        // hash的value序列化方式采用jackson
+        template.setHashValueSerializer(jackson2JsonRedisSerializer);
+        template.afterPropertiesSet();
+        return template;
+    }
+}

+ 49 - 0
web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/util/redis/RedisService.java

@@ -0,0 +1,49 @@
+package com.gyee.benchmarkingweb.util.redis;
+
+public interface RedisService {
+
+    /**
+     * set存数据
+     * @param key
+     * @param value
+     * @return
+     */
+    boolean set(String key, String value);
+
+    /**
+     * get获取数据
+     * @param key
+     * @return
+     */
+    String get(String key);
+
+//    void getList(String key,int start,int end);
+
+    /**
+     * 设置有效天数
+     * @param key
+     * @param expire
+     * @return
+     */
+    boolean expire(String key, long expire);
+
+    /**
+     * 移除数据
+     * @param key
+     * @return
+     */
+    boolean remove(String key);
+
+
+    /**
+     * 插入对象
+     */
+    void setObject(Object o);
+
+
+    boolean hasKey(String key);
+
+
+    void select(Integer dbIndex);
+
+}

+ 124 - 0
web/benchmarking-web-hb/src/main/java/com/gyee/benchmarkingweb/util/redis/RedisServiceImpl.java

@@ -0,0 +1,124 @@
+package com.gyee.benchmarkingweb.util.redis;
+
+import org.springframework.dao.DataAccessException;
+import org.springframework.data.redis.connection.RedisConnection;
+import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
+import org.springframework.data.redis.core.RedisCallback;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.lang.reflect.Field;
+import java.util.concurrent.TimeUnit;
+
+@Service("redisService")
+public class RedisServiceImpl implements RedisService {
+
+    @Resource
+    private RedisTemplate<String, ?> redisTemplate;
+
+    @Override
+    public boolean set(final String key, final String value) {
+        boolean result = redisTemplate.execute(new RedisCallback<Boolean>() {
+            @Override
+            public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
+                RedisSerializer<String> serializer = redisTemplate.getStringSerializer();
+                connection.set(serializer.serialize(key), serializer.serialize(value));
+                return true;
+            }
+        });
+        return result;
+    }
+
+    @Override
+    public String get(final String key) {
+        String result = redisTemplate.execute(new RedisCallback<String>() {
+            @Override
+            public String doInRedis(RedisConnection connection) throws DataAccessException {
+                RedisSerializer<String> serializer = redisTemplate.getStringSerializer();
+                byte[] value = connection.get(serializer.serialize(key));
+                return serializer.deserialize(value);
+            }
+        });
+        return result;
+    }
+
+
+
+    @Override
+    public boolean expire(final String key, long expire) {
+        return redisTemplate.expire(key, expire, TimeUnit.SECONDS);
+    }
+
+    @Override
+    public boolean remove(final String key) {
+        boolean result = redisTemplate.execute(new RedisCallback<Boolean>() {
+            @Override
+            public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
+                RedisSerializer<String> serializer = redisTemplate.getStringSerializer();
+                connection.del(key.getBytes());
+                return true;
+            }
+        });
+        return result;
+    }
+
+    @Override
+    public boolean hasKey(final String key) {
+        try {
+            return redisTemplate.hasKey(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public void setObject(Object obj) {
+        Field[] fields = obj.getClass().getDeclaredFields();
+        for(int i = 0 , len = fields.length; i < len; i++) {
+            // 对于每个属性,获取属性名
+            String varName = fields[i].getName();
+            try {
+                // 获取原来的访问控制权限
+                boolean accessFlag = fields[i].isAccessible();
+                // 修改访问控制权限
+                fields[i].setAccessible(true);
+                // 获取在对象f中属性fields[i]对应的对象中的变量
+                Object o;
+                try {
+                    o = fields[i].get(obj);
+                    if (o!=null){
+                        set(varName, String.valueOf(o));
+                    }else {
+                        set(varName,"");
+                    }
+
+                    //System.err.println("传入的对象中包含一个如下的变量:" + varName + " = " + o);
+                } catch (IllegalAccessException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                // 恢复访问控制权限
+                fields[i].setAccessible(accessFlag);
+            } catch (IllegalArgumentException ex) {
+                ex.printStackTrace();
+            }
+        }
+
+    }
+
+    public void select(Integer dbIndex) {
+        if (dbIndex == null || dbIndex > 15 || dbIndex < 0) {
+            dbIndex = 0;
+        }
+        LettuceConnectionFactory jedisConnectionFactory = (LettuceConnectionFactory) redisTemplate
+                .getConnectionFactory();
+        jedisConnectionFactory.setDatabase(dbIndex);
+        redisTemplate.setConnectionFactory(jedisConnectionFactory);
+        jedisConnectionFactory.afterPropertiesSet();
+//        jedisConnectionFactory.resetConnection();
+
+    }
+}

+ 7 - 0
web/consumer/src/main/java/com/gyee/consumer/api/benching/BenchmarkingApi.java

@@ -41,6 +41,13 @@ public interface BenchmarkingApi {
     public R lineList(@RequestParam(value = "projects",required = true) String projects);
 
     /**
+     * 风场风机列表
+     * @return
+     */
+    @GetMapping("/wpwtlist")
+    public R wpwtlist();
+
+    /**
      * 根据场站查询
      * 风机列表
      * @return

+ 28 - 0
web/consumer/src/main/java/com/gyee/consumer/api/performance/PerformanceApi.java

@@ -0,0 +1,28 @@
+package com.gyee.consumer.api.performance;
+
+import com.gyee.common.config.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * @ClassName : PerformanceApi
+ * @Author : xieshengjie
+ * @Date: 2022/5/13 14:29
+ * @Description :
+ */
+@FeignClient("benchmarking-provider")
+@RequestMapping("//performance")
+public interface PerformanceApi {
+
+    /**
+     * 根据项目查询
+     * 线路列表
+     * @return
+     */
+    @GetMapping("/curvefitting")
+    public R curvefitting(@RequestParam(value = "wtids",required = true) String wtids,
+                      //单风机0,多风机1
+                      @RequestParam(value = "type",required = true) String type);
+}

+ 10 - 9
web/consumer/src/main/java/com/gyee/consumer/controller/benching/BenchmarkingController.java

@@ -1,19 +1,10 @@
 package com.gyee.consumer.controller.benching;
 
 import com.gyee.common.config.R;
-import com.gyee.common.model.StringUtils;
-import com.gyee.common.util.RandomUtil;
-import com.gyee.common.util.SortUtils;
-import com.gyee.common.vo.algorithm.LineParameters;
-import com.gyee.common.vo.benchmark.Operation;
-import com.gyee.common.vo.benchmark.WxsslVo;
 import com.gyee.consumer.api.benching.BenchmarkingApi;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import java.util.List;
-import java.util.Map;
 
 /**
  * @ClassName : BenchmarkingController
@@ -54,6 +45,16 @@ public class BenchmarkingController {
         return benchmarkingApi.projectList(wpids);
     }
 
+
+    /**
+     * 风场风机列表
+     * @return
+     */
+    @GetMapping(value = "/consumer/benchmarking/wpwtlist")
+    public R wpwtlist(){
+        return benchmarkingApi.wpwtlist();
+    }
+
     /**
      * 根据期次查询线路
      * @param projects

+ 28 - 0
web/consumer/src/main/java/com/gyee/consumer/controller/performance/PerformanceController.java

@@ -0,0 +1,28 @@
+package com.gyee.consumer.controller.performance;
+
+import com.gyee.common.config.R;
+import com.gyee.consumer.api.performance.PerformanceApi;
+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;
+
+/**
+ * @ClassName : PerformanceController
+ * @Author : xieshengjie
+ * @Date: 2022/5/13 14:33
+ * @Description :
+ */
+@RestController
+public class PerformanceController {
+    @Resource
+    private PerformanceApi performanceApi;
+
+    @GetMapping(value = "/consumer/performance/curvefitting")
+    public R curvefitting(@RequestParam(value = "wtids",required = true) String wtids,
+                         //单风机0,多风机1
+                         @RequestParam(value = "type",required = true) String type){
+        return performanceApi.curvefitting(wtids,type);
+    }
+}

+ 1 - 1
web/consumer/src/main/resources/application.yml

@@ -1,5 +1,5 @@
 spring:
   profiles:
 #    active: hf
-    active: dev
+    active: jn
 #    active: test