瀏覽代碼

Merge remote-tracking branch 'origin/master'

wangchangsheng 2 年之前
父節點
當前提交
894bd1250d
共有 100 個文件被更改,包括 13275 次插入6842 次删除
  1. 9 0
      common/src/main/java/com/gyee/common/contant/Contant.java
  2. 16 0
      common/src/main/java/com/gyee/common/contant/ContantXk.java
  3. 10 0
      common/src/main/java/com/gyee/common/model/PointData.java
  4. 36 0
      common/src/main/java/com/gyee/common/util/algorithm/Underdelivery.java
  5. 10 0
      realtime/generationXK-service/pom.xml
  6. 16 6
      realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java
  7. 10 10
      realtime/generationXK-service/src/main/java/com/gyee/generation/config/GeneratorCodeConfig.java
  8. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProBasicModelPowerRdController.java
  9. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconEquipmentInfo15minuteController.java
  10. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconWt15minuteController.java
  11. 22 43
      realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java
  12. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProBasicModelPowerRdMapper.java
  13. 14 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconActivePowerDataMapper.java
  14. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconEquipmentInfo15minuteMapper.java
  15. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconEquipmentInfoDay2Mapper.java
  16. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconEquipmentInfoDay3Mapper.java
  17. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconPowerstationInfoDay2Mapper.java
  18. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconPowerstationInfoDay3Mapper.java
  19. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicCompany.java
  20. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicEnergyGroup.java
  21. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicEquipmentPoint.java
  22. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicLine.java
  23. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicMeterPoint.java
  24. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicModelPower.java
  25. 35 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicModelPowerRd.java
  26. 6 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicProject.java
  27. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicRegion.java
  28. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicSquare.java
  29. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicWindpowerstation.java
  30. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicWindsubStation.java
  31. 6 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicWindturbine.java
  32. 7 7
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicWppoint.java
  33. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconActivePowerData.java
  34. 3 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconCurveFittMonthSub.java
  35. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconElectricaltestPoint.java
  36. 184 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfo15minute.java
  37. 75 75
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay1.java
  38. 84 67
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay2.java
  39. 82 65
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay3.java
  40. 72 72
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay4.java
  41. 25 25
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay5.java
  42. 12 12
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay6.java
  43. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentmodel.java
  44. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconLogicalUnit.java
  45. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconManufacturer.java
  46. 83 76
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay1.java
  47. 89 67
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay2.java
  48. 92 70
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay3.java
  49. 27 22
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay4.java
  50. 27 22
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay5.java
  51. 27 22
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay6.java
  52. 18 13
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay7.java
  53. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconTestingPoint.java
  54. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconUniformCode.java
  55. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWindpowerStandardPoint.java
  56. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWindturbineStandardPoint.java
  57. 6 10
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/CureFittingVo.java
  58. 26 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/FitClassVo.java
  59. 152 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ActivePowerService.java
  60. 295 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/CoefficientService.java
  61. 524 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo15minuteService.java
  62. 940 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java
  63. 762 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo2Service.java
  64. 760 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo3Service.java
  65. 267 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/GoodnessOfFitService.java
  66. 26 26
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/InputOrOutPutService.java
  67. 16 16
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventService.java
  68. 31 31
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitService.java
  69. 462 670
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingService.java
  70. 11 11
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownService.java
  71. 1445 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java
  72. 1259 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo2Service.java
  73. 1259 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo3Service.java
  74. 786 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo5Service.java
  75. 694 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo6Service.java
  76. 0 2759
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindpowerInfoDayService.java
  77. 0 2468
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindpowerInfoMonthService.java
  78. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProBasicModelPowerRdService.java
  79. 8 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconActivePowerDataService.java
  80. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconEquipmentInfo15minuteService.java
  81. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconEquipmentInfoDay2Service.java
  82. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconEquipmentInfoDay3Service.java
  83. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconPowerstationInfoDay2Service.java
  84. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconPowerstationInfoDay3Service.java
  85. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProBasicModelPowerRdServiceImpl.java
  86. 14 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconActivePowerDataServiceImpl.java
  87. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconEquipmentInfo15minuteServiceImpl.java
  88. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconEquipmentInfoDay2ServiceImpl.java
  89. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconEquipmentInfoDay3ServiceImpl.java
  90. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconPowerstationInfoDay2ServiceImpl.java
  91. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconPowerstationInfoDay3ServiceImpl.java
  92. 176 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/initalcache/CacheService.java
  93. 895 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/initialpoint/InitialPointGoldenXkByEqService.java
  94. 133 93
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/initialpoint/InitialPointGoldenXkService.java
  95. 451 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/ElectricityMeteringService.java
  96. 433 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/RealtimeService.java
  97. 88 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/TheoreticalPowerService.java
  98. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/util/PointUtil.java
  99. 34 34
      realtime/generationXK-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java
  100. 0 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtilTd.java

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

@@ -262,4 +262,13 @@ public class Contant {
   public static final String DI11139 = "DI11139";
     public static final String DI10923 = "DI10923";
 
+    public static final String LLGL = "LLGL"; //理论功率
+
+
+    public static final String ZHGL = "ZHGL"; //最优功率
+
+    public static final String RKYDL = "RKYDL"; //日可用电量
+    public static final String RFDLC = "RFDLC"; //日理论发电量
+
+
 }

+ 16 - 0
common/src/main/java/com/gyee/common/contant/ContantXk.java

@@ -134,6 +134,8 @@ public class ContantXk {
     public static final String  YZHD= "YZHD";//月自耗电
     public static final String  NZHD= "NZHD";//年自耗电
     public static final String  ZHD15= "ZHD15";//15分钟自耗电
+
+
     public static final String  SBZT= "SBZT";//设备状态
     public static final String  MXZT= "MXZT";//设备明细状态
     public static final String  ZTCXSJ= "ZTCXSJ";//设备当前状态下持续时间
@@ -149,6 +151,20 @@ public class ContantXk {
     public static final String  KYGL= "KYGL";//设备可用功率
 
 
+    public static final String  CJ_SSFS= "AI066";//设备风速
+    public static final String  CJ_SSGL= "AI114";//设备有功功率
+    public static final String  CJ_FDZTXZSGD= "AI061";//发电状态下的转速给定
+    public static final String  CJ_SCADA_YGSD= "AI003";//scada有功设定值
+    public static final String  CJ_YLZSGD= "AI110";//叶轮转速给定
+
+
+    public static final String TPOINT_WP_AGC = "AGC002";// agc
+    public static final String TPOINT_WP_CXGL = "AGC001";// 出线功率SSFS
+
+    public static final String FCCFTFS70 = "FCCFTFS70";//测风塔70米风速
+
+
+
 
 
 

+ 10 - 0
common/src/main/java/com/gyee/common/model/PointData.java

@@ -4,6 +4,8 @@ public class PointData {
 
 	private double pointValueInDouble;
 
+	private double pointValueInDouble2;
+
 	private Long pointTime;
 
 	private String pointValue;
@@ -12,6 +14,14 @@ public class PointData {
 
 	private String ednaId;// edna全局id
 
+	public double getPointValueInDouble2() {
+		return pointValueInDouble2;
+	}
+
+	public void setPointValueInDouble2(double pointValueInDouble2) {
+		this.pointValueInDouble2 = pointValueInDouble2;
+	}
+
 	public String getEdnaId() {
 		return ednaId;
 	}

+ 36 - 0
common/src/main/java/com/gyee/common/util/algorithm/Underdelivery.java

@@ -0,0 +1,36 @@
+package com.gyee.common.util.algorithm;
+
+/*
+@author   谢生杰
+@date   2022/11/6-15:40
+欠发算法
+*/
+
+public class Underdelivery {
+
+    /**
+     *
+     * @param pp
+     * @param zs
+     * @return
+     */
+    public static double underdeliveryStatusReal(double pp,double zs){
+        double ratioll = 0;
+        double qfzt = 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;
+        }
+        return qfzt;
+    }
+}

+ 10 - 0
realtime/generationXK-service/pom.xml

@@ -29,6 +29,10 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
             <optional>true</optional>
@@ -96,6 +100,12 @@
             <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>3.17</version>
+            <scope>compile</scope>
+        </dependency>
 
 
     </dependencies>

+ 16 - 6
realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java

@@ -1,5 +1,6 @@
 package com.gyee.generation;
 
+import com.gyee.generation.service.initialpoint.InitialPointGoldenXkByEqService;
 import com.gyee.generation.service.initialpoint.InitialPointGoldenXkService;
 import com.gyee.generation.util.SpringUtils;
 import org.mybatis.spring.annotation.MapperScan;
@@ -21,15 +22,24 @@ public class GenerationMain {
         SpringApplication.run(GenerationMain.class,args);
 
 
-        InitialPointGoldenXkService InitialPointGoldenXkService= SpringUtils.getBean("initialPointGoldenXkService");
-
-//                System.out.println("开始导出风机测点。。。。。。");
+//        InitialPointGoldenXkService InitialPointGoldenXkService= SpringUtils.getBean("initialPointGoldenXkService");
+//
+//        System.out.println("开始导出风机测点。。。。。。");
 //        InitialPointGoldenXkService.initalFj();
 //        System.out.println("结束导出风机测点。。。。。。");
+//        System.out.println("开始导出风场测点。。。。。。");
+//        InitialPointGoldenXkService.initalFc();
+//        System.out.println("结束导出风场测点。。。。。。");
+
+//        InitialPointGoldenXkByEqService initialPointGoldenXkByEqService= SpringUtils.getBean("initialPointGoldenXkByEqService");
+//
+//        System.out.println("开始导出风机测点。。。。。。");
+//        initialPointGoldenXkByEqService.initalFj();
+//        System.out.println("结束导出风机测点。。。。。。");
 
-        System.out.println("开始导出风场测点。。。。。。");
-        InitialPointGoldenXkService.initalFc();
-        System.out.println("结束导出风场测点。。。。。。");
+//        System.out.println("开始导出风场测点。。。。。。");
+//        initialPointGoldenXkByEqService.initalFc();
+//        System.out.println("结束导出风场测点。。。。。。");
 
     }
 }

+ 10 - 10
realtime/generationXK-service/src/main/java/com/gyee/generation/config/GeneratorCodeConfig.java

@@ -48,24 +48,24 @@ public class GeneratorCodeConfig {
 
         // 数据源配置
         DataSourceConfig dsc = new DataSourceConfig();
-        /*dsc.setUrl("jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true");
+        dsc.setUrl("jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true");
         dsc.setDriverName("com.mysql.jdbc.Driver");
         dsc.setUsername("root");
         dsc.setPassword("root");
-        mpg.setDataSource(dsc);*/
+        mpg.setDataSource(dsc);
 //        dsc.setDriverName("oracle.jdbc.driver.OracleDriver");
 //        dsc.setUsername("gdprod");
 //        dsc.setPassword("gd123");
 //        dsc.setUrl("jdbc:oracle:thin:@10.83.68.165:1521:gdsj");
 
-        dsc.setDriverName("org.postgresql.Driver");
-//        dsc.setUsername("postgres");
-//        dsc.setPassword("postgres");
-//        dsc.setUrl("jdbc:postgresql://192.168.11.248:5432/eng_mctl");
-        dsc.setUrl("jdbc:postgresql://120.46.148.180:5432/wisdom");
-        dsc.setUsername("gdprod");
-        dsc.setPassword("gd123");
-        mpg.setDataSource(dsc);
+//        dsc.setDriverName("org.postgresql.Driver");
+////        dsc.setUsername("postgres");
+////        dsc.setPassword("postgres");
+////        dsc.setUrl("jdbc:postgresql://192.168.11.248:5432/eng_mctl");
+//        dsc.setUrl("jdbc:postgresql://120.46.148.180:5432/postgres");
+//        dsc.setUsername("gdprod");
+//        dsc.setPassword("gd123");
+//        mpg.setDataSource(dsc);
 
 
 

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProBasicModelPowerRdController.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-06
+ */
+@RestController
+@RequestMapping("//pro-basic-model-power-rd")
+public class ProBasicModelPowerRdController {
+
+}

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconEquipmentInfo15minuteController.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 电设备15分钟信息表 前端控制器
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+@RestController
+@RequestMapping("//pro-econ-equipment-info15-minute")
+public class ProEconEquipmentInfo15minuteController {
+
+}

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconWt15minuteController.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 风机15分钟信息表 前端控制器
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+@RestController
+@RequestMapping("//pro-econ-wt15-minute")
+public class ProEconWt15minuteController {
+
+}

+ 22 - 43
realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.TypeReference;
 import com.gyee.common.model.StringUtils;
 import com.gyee.generation.model.auto.*;
 import com.gyee.generation.service.auto.*;
+import com.gyee.generation.service.realtimelibrary.TheoreticalPowerService;
 import com.gyee.generation.util.redis.RedisService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,6 +54,8 @@ public class CacheContext implements CommandLineRunner {
     private IProBasicCompanyService proBasicCompanyService;
     @Resource
     private IProBasicRegionService proBasicRegionService;
+    @Resource
+    private TheoreticalPowerService theoreticalPowerService;
 
     @Value("${runWindpowerstation}")
     private String runWindpowerstation;
@@ -104,9 +107,14 @@ public class CacheContext implements CommandLineRunner {
     public static List<ProBasicModelPower> mpls=new ArrayList<>();
 
     public static List<ProEconEquipmentmodel> equipmentmodels=new ArrayList<>();
+
+    public static Map<String, Map<Double,ProBasicModelPowerRd>> theoreticalPowerMap = new HashMap<>(); //理论,保证功率
+    public static Map<String, Map<Double,ProEconWtPowerCurveFitting>> curveFittingPowerMap = new HashMap<>(); //自算,最优功率
     @Override
     public void run(String... args) throws Exception {
         logger.info("缓存开始------------------------------------------------------------");
+
+
         List<String> runWpids = Arrays.asList(runWindpowerstation.split(","));
         logger.info(runWpids.get(0)+"------------------"+runWpids.size());
 
@@ -134,9 +142,8 @@ public class CacheContext implements CommandLineRunner {
                 }
             }
         }
-        sqls=proBasicSquareService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId())).collect(Collectors.toList());
-        if
-      (!sqls.isEmpty())
+        sqls=proBasicSquareService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId()) && i.getIsAble()==1).collect(Collectors.toList());
+        if (!sqls.isEmpty())
         {
             for(ProBasicSquare sq:sqls)
             {
@@ -144,9 +151,8 @@ public class CacheContext implements CommandLineRunner {
             }
         }
 
-        cpls=proBasicCompanyService.list().stream().collect(Collectors.toList());
-        if
-        (!cpls.isEmpty())
+        cpls=proBasicCompanyService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
+        if (!cpls.isEmpty())
         {
             for(ProBasicCompany sq:cpls)
             {
@@ -155,9 +161,8 @@ public class CacheContext implements CommandLineRunner {
         }
 
 
-        rgls=proBasicRegionService.list().stream().collect(Collectors.toList());
-        if
-        (!rgls.isEmpty())
+        rgls=proBasicRegionService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
+        if  (!rgls.isEmpty())
         {
             for(ProBasicRegion sq:rgls)
             {
@@ -188,7 +193,7 @@ public class CacheContext implements CommandLineRunner {
             }
         }
 
-        wtls = proBasicWindturbineService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId())).collect(Collectors.toList());
+        wtls = proBasicWindturbineService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId()) && i.getIsable()==1).collect(Collectors.toList());
         logger.info(wtls.size()+"");
         wtls.forEach(wt->{
             if(modelMap.containsKey(wt.getModelId()))
@@ -282,7 +287,7 @@ public class CacheContext implements CommandLineRunner {
 
 
 
-        pjls = proBasicProjectService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId())).collect(Collectors.toList());
+        pjls = proBasicProjectService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId()) && i.getIsAble()==1).collect(Collectors.toList());
         pjls.stream().forEach(p->{
             pjmap.put(p.getId(),p);
             if (wppromap.containsKey(p.getWindpowerstationId())){
@@ -299,7 +304,7 @@ public class CacheContext implements CommandLineRunner {
 
         });
 
-        lnls = proBasicLineService.list().stream().filter(i-> StringUtils.isNotNull(pjmap.get(i.getProjectId())) && runWpids.contains(pjmap.get(i.getProjectId()).getWindpowerstationId())).collect(Collectors.toList());
+        lnls = proBasicLineService.list().stream().filter(i-> StringUtils.isNotNull(pjmap.get(i.getProjectId())) && runWpids.contains(pjmap.get(i.getProjectId()).getWindpowerstationId()) && i.getIsAble()==1).collect(Collectors.toList());
         lnls.stream().forEach(l->{
             lnmap.put(l.getId(),l);
             if (prolinemap.containsKey(l.getProjectId())){
@@ -315,8 +320,8 @@ public class CacheContext implements CommandLineRunner {
             linepointmap.put(l.getId(),stringWindpowerstationpointnewMap);
         });
 
-        wpls = proBasicWindpowerstationService.list().stream().filter(i->runWpids.contains(i.getId())).collect(Collectors.toList());;
-        meterpoints = proBasicMeterPointService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId())).collect(Collectors.toList());
+        wpls = proBasicWindpowerstationService.list().stream().filter(i->runWpids.contains(i.getId()) && i.getIsAble()==1).collect(Collectors.toList());;
+        meterpoints = proBasicMeterPointService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId()) && i.getIsAble()==1).collect(Collectors.toList());
         meterpoints.stream().forEach(meterpoint -> {
             meterpointMap.put(meterpoint.getId(),meterpoint);
         });
@@ -331,39 +336,13 @@ public class CacheContext implements CommandLineRunner {
             wppointmap.put(wp.getId(),stringMapMap);
         });
 
-        String sszzt = redisService.get("SSZZT");
 
+        String llglString = redisService.get("ZLLGL");
+        theoreticalPowerMap = JSONObject.parseObject(llglString, new TypeReference<Map<String, Map<Double,ProBasicModelPowerRd>>>() {
+        });
 
 
-        String zbzgl = redisService.get("ZBZGL");
-        zbzglMap = JSONObject.parseObject(zbzgl, new TypeReference<Map<String,Map<Double,Double>>>() {
-        });
 
-//        List<ProBasicWindturbinePower> windturbinepowerList = proBasicWindturbinePowerService.list().stream().filter(windturbinepower -> runWindpowerstation.contains(windturbinepower.getWindpowerstationId())).collect(Collectors.toList());
-//        windturbinepowerList.stream().forEach(w -> {
-//            if (zzsglMap.containsKey(w.getWindturbineId())){
-//                zzsglMap.get(w.getWindturbineId()).put(w.getSpeed(),w.getTheoryPower());
-//            }else {
-//                Map<Double,Double> tempMap = new HashMap<>();
-//                tempMap.put(w.getSpeed(),w.getTheoryPower());
-//                zzsglMap.put(w.getWindturbineId(),tempMap);
-//            }
-//
-//        });
-
-//        String wpString = redisService.get("PRODUCT-WP");
-//        wppointmap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Map<String, ProBasicWppoint>>>() {
-//        });
-//        String pjString = redisService.get("PRODUCT-PJ");
-//        propointmap = JSONObject.parseObject(pjString, new TypeReference<Map<String, Map<String, ProBasicWppoint>>>() {
-//        });
-//        String lnString = redisService.get("PRODUCT-LN");
-//        linepointmap = JSONObject.parseObject(lnString, new TypeReference<Map<String, Map<String, ProBasicWppoint>>>() {
-//        });
-
-//        String wtString = redisService.get("PRODUCT-WT");
-//        wtpAimap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Map<String, ProBasicEquipmentPoint>>>() {
-//        });
         logger.info("缓存结束------------------------------------------------------------");
     }
 }

+ 16 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProBasicModelPowerRdMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.generation.mapper.auto;
+
+import com.gyee.generation.model.auto.ProBasicModelPowerRd;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-06
+ */
+public interface ProBasicModelPowerRdMapper extends BaseMapper<ProBasicModelPowerRd> {
+
+}

+ 14 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconActivePowerDataMapper.java

@@ -2,6 +2,12 @@ package com.gyee.generation.mapper.auto;
 
 import com.gyee.generation.model.auto.ProEconActivePowerData;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.generation.model.vo.FitClassVo;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +19,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ProEconActivePowerDataMapper extends BaseMapper<ProEconActivePowerData> {
 
+    @Select(" SELECT windpowerstation_id windpowerstationId,windturbine_id windturbineId, " +
+            "model_id modelId,speed,avg(power) power " +
+            "FROM Pro_Econ_Active_Power_Data " +
+            "  where  windpowerstation_id=#{windpowerstationId} and record_date>=#{beginDate}  and record_date<=#{endDate} " +
+            "       group by windpowerstation_id,windturbine_id,model_id,speed order by speed ")
+    public List<FitClassVo> getFitList(@Param(value = "windpowerstationId")String windpowerstationId, @Param(value = "beginDate") Date beginDate, @Param(value = "endDate")Date endDate);
+
+
 }

+ 16 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconEquipmentInfo15minuteMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.generation.mapper.auto;
+
+import com.gyee.generation.model.auto.ProEconEquipmentInfo15minute;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 电设备15分钟信息表 Mapper 接口
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+public interface ProEconEquipmentInfo15minuteMapper extends BaseMapper<ProEconEquipmentInfo15minute> {
+
+}

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconEquipmentInfoDay2Mapper.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 public interface ProEconEquipmentInfoDay2Mapper extends BaseMapper<ProEconEquipmentInfoDay2> {
 

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconEquipmentInfoDay3Mapper.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 public interface ProEconEquipmentInfoDay3Mapper extends BaseMapper<ProEconEquipmentInfoDay3> {
 

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconPowerstationInfoDay2Mapper.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 public interface ProEconPowerstationInfoDay2Mapper extends BaseMapper<ProEconPowerstationInfoDay2> {
 

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconPowerstationInfoDay3Mapper.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 public interface ProEconPowerstationInfoDay3Mapper extends BaseMapper<ProEconPowerstationInfoDay3> {
 

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicCompany.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProBasicCompany extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicEnergyGroup.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProBasicEnergyGroup extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 父编号

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicEquipmentPoint.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProBasicEquipmentPoint extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicLine.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProBasicLine extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicMeterPoint.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProBasicMeterPoint extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 使用/排序

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicModelPower.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;

+ 35 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicModelPowerRd.java

@@ -0,0 +1,35 @@
+package com.gyee.generation.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProBasicModelPowerRd extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String modelId;
+
+    private Double speed;
+
+    private Double theoryPower;
+
+    private Double ensurePower;
+
+    private String windpowerstationId;
+
+
+}

+ 6 - 4
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicProject.java

@@ -1,8 +1,10 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
+import java.util.Date;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -28,7 +30,7 @@ public class ProBasicProject extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称
@@ -68,7 +70,7 @@ public class ProBasicProject extends Model {
     /**
      * 投产日期
      */
-    private LocalDate commissionDate;
+    private Date commissionDate;
 
     /**
      * 主控电话

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicRegion.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProBasicRegion extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicSquare.java

@@ -26,7 +26,7 @@ public class ProBasicSquare extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 风场编号(冗余)

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicWindpowerstation.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProBasicWindpowerstation extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicWindsubStation.java

@@ -26,7 +26,7 @@ public class ProBasicWindsubStation extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 6 - 4
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicWindturbine.java

@@ -1,8 +1,10 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
+import java.util.Date;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -28,7 +30,7 @@ public class ProBasicWindturbine extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 场站编号(冗余)
@@ -68,7 +70,7 @@ public class ProBasicWindturbine extends Model {
     /**
      * 首次并网时间
      */
-    private LocalDate firstIntegratedTime;
+    private Date firstIntegratedTime;
 
     /**
      * 图片

+ 7 - 7
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicWppoint.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -31,7 +31,7 @@ public class ProBasicWppoint extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称
@@ -71,22 +71,22 @@ public class ProBasicWppoint extends Model {
     /**
      * 最大值
      */
-    private BigDecimal maxval;
+    private Double maxval;
 
     /**
      * 最小值
      */
-    private BigDecimal minval;
+    private Double minval;
 
     /**
      * 合理最大值
      */
-    private BigDecimal reasonableMaxval;
+    private Double reasonableMaxval;
 
     /**
      * 合理最小值
      */
-    private BigDecimal reasonableMinval;
+    private Double reasonableMinval;
 
 
 
@@ -128,7 +128,7 @@ public class ProBasicWppoint extends Model {
     /**
      * 系数
      */
-    private BigDecimal coefficient;
+    private Double coefficient;
 
 
 }

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconActivePowerData.java

@@ -60,7 +60,7 @@ public class ProEconActivePowerData extends Model {
     /**
      * 频率
      */
-    private Double frequency;
+    private Integer frequency;
 
     /**
      * 风机编码

+ 3 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconCurveFittMonthSub.java

@@ -1,6 +1,8 @@
 package com.gyee.generation.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;
@@ -21,7 +23,7 @@ public class ProEconCurveFittMonthSub extends Model {
 
     /**
      * 编号
-
+     */
      @TableId(value = "ID",type = IdType.ASSIGN_ID)
     private String id;
 

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconElectricaltestPoint.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProEconElectricaltestPoint extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 184 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfo15minute.java

@@ -0,0 +1,184 @@
+package com.gyee.generation.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 电设备15分钟信息表
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProEconEquipmentInfo15minute extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    private String id;
+
+    /**
+     * 风机编号
+     */
+    private String windturbineId;
+
+    /**
+     * 日期
+     */
+    private Date recordDate;
+
+    /**
+     * 风场编号
+     */
+    private String windpowerstationId;
+
+    /**
+     * 项目编号
+     */
+    private String projectId;
+
+    /**
+     * 线路编号
+     */
+    private String lineId;
+
+    /**
+     * 公司编号
+     */
+    private String companyId;
+
+    /**
+     * 区域编号
+     */
+    private String regionId;
+
+    /**
+     * 15分钟故障小时(明细)
+     */
+    private Double fgzxsmx;
+
+    /**
+     * 15分钟场内受累故障小时(明细)
+     */
+    private Double fcnslgzxsmx;
+
+    /**
+     * 15分钟检修小时(明细)
+     */
+    private Double fjxxsmx;
+
+    /**
+     * 15分钟场内受累检修小时(明细)
+     */
+    private Double fcnsljxxsmx;
+
+    /**
+     * 15分钟待机小时(明细)
+     */
+    private Double fdjxsmx;
+
+    /**
+     * 15分钟缺陷降出力小时(明细)
+     */
+    private Double fqxjclxsmx;
+
+    /**
+     * 15分钟手动停机小时(明细)
+     */
+    private Double fsdtjxsmx;
+
+    /**
+     * 15分钟并网小时(明细)
+     */
+    private Double fbwxsmx;
+
+    /**
+     * 15分钟限电停机小时(明细)
+     */
+    private Double fxdtjxsmx;
+
+    /**
+     * 15分钟限电降出力小时(明细)
+     */
+    private Double fxdjclxsmx;
+
+    /**
+     * 15分钟场外受累电网小时(明细)
+     */
+    private Double fcwsldwxsmx;
+
+    /**
+     * 15分钟场外受累天气小时(明细)
+     */
+    private Double fcwsltqxsmx;
+
+    /**
+     * 15分钟离线小时(明细)
+     */
+    private Double flxxsmx;
+
+    /**
+     * 15分钟通讯中断小时(明细)
+     */
+    private Double ftxzdxsmx;
+
+    /**
+     * 15分钟待机小时
+     */
+    private Double fdjxs;
+
+    /**
+     * 15分钟故障停机小时
+     */
+    private Double fgztjxs;
+
+    /**
+     * 15分钟通讯中断小时
+     */
+    private Double ftxzdxs;
+
+    /**
+     * 15分钟维护停机小时
+     */
+    private Double fjxtjxs;
+
+    /**
+     * 15分钟限电小时
+     */
+    private Double fxdxs;
+
+    /**
+     * 15分钟运行小时
+     */
+    private Double fyxxs;
+
+    /**
+     * 15分钟受累小时
+     */
+    private Double fslxs;
+
+    /**
+     * 15分钟平均风速
+     */
+    private Double fpjfs;
+
+    /**
+     * 15分钟平均功率
+     */
+    private Double fpjgl;
+
+    /**
+     * 15分钟发电量
+     */
+    private Double ffdl;
+
+
+}

+ 75 - 75
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay1.java

@@ -1,8 +1,8 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -33,7 +33,7 @@ public class ProEconEquipmentInfoDay1 extends Model {
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 风场编号
@@ -63,362 +63,362 @@ public class ProEconEquipmentInfoDay1 extends Model {
     /**
      * 日最大风速
      */
-    private BigDecimal rzdfs;
+    private Double rzdfs;
 
     /**
      * 日最小风速
      */
-    private BigDecimal rzxfs;
+    private Double rzxfs;
 
     /**
      * 日最大功率
      */
-    private BigDecimal rzdgl;
+    private Double rzdgl;
 
     /**
      * 日最小功率
      */
-    private BigDecimal rzxgl;
+    private Double rzxgl;
 
     /**
      * 日平均功率
      */
-    private BigDecimal rpjgl;
+    private Double rpjgl;
 
     /**
      * 日平均风速
      */
-    private BigDecimal rpjfs;
+    private Double rpjfs;
 
     /**
      * 日发电量
      */
-    private BigDecimal rfdl;
+    private Double rfdl;
 
     /**
      * 日可用电量
      */
-    private BigDecimal rkydl;
+    private Double rkydl;
 
     /**
      * 日理论发电量
      */
-    private BigDecimal rllfdl;
+    private Double rllfdl;
 
     /**
      * 日故障损失电量
      */
-    private BigDecimal rgzssdl;
+    private Double rgzssdl;
 
     /**
      * 日场内受累故障损失电量
      */
-    private BigDecimal rcnslgzssdl;
+    private Double rcnslgzssdl;
 
     /**
      * 日检修损失电量
      */
-    private BigDecimal rjxssdl;
+    private Double rjxssdl;
 
     /**
      * 日场内受累检修损失电量
      */
-    private BigDecimal rcnsljxssdl;
+    private Double rcnsljxssdl;
 
     /**
      * 日待机损失电量
      */
-    private BigDecimal rdjssdl;
+    private Double rdjssdl;
 
     /**
      * 日缺陷降出力损失电量
      */
-    private BigDecimal rqxjclssdl;
+    private Double rqxjclssdl;
 
     /**
      * 日手动停机损失电量
      */
-    private BigDecimal rsdtjssdl;
+    private Double rsdtjssdl;
 
     /**
      * 日性能损失电量
      */
-    private BigDecimal rxnssdl;
+    private Double rxnssdl;
 
     /**
      * 日限电停机损失电量
      */
-    private BigDecimal rxdtjssdl;
+    private Double rxdtjssdl;
 
     /**
      * 日限电降出力损失电量
      */
-    private BigDecimal rxdjclssdl;
+    private Double rxdjclssdl;
 
     /**
      * 日场外受累电网损失电量
      */
-    private BigDecimal rcwsldwssdl;
+    private Double rcwsldwssdl;
 
     /**
      * 日场外受累天气损失电量
      */
-    private BigDecimal rcwsltqssdl;
+    private Double rcwsltqssdl;
 
     /**
      * 日增发电量
      */
-    private BigDecimal rzfdl;
+    private Double rzfdl;
 
     /**
      * 日欠发电量
      */
-    private BigDecimal rqfdl;
+    private Double rqfdl;
 
     /**
      * 月最大风速
      */
-    private BigDecimal yzdfs;
+    private Double yzdfs;
 
     /**
      * 月最小风速
      */
-    private BigDecimal yrzxfs;
+    private Double yzxfs;
 
     /**
      * 月最大功率
      */
-    private BigDecimal yzdgl;
+    private Double yzdgl;
 
     /**
      * 月最小功率
      */
-    private BigDecimal yzxgl;
+    private Double yzxgl;
 
     /**
      * 月平均功率
      */
-    private BigDecimal ypjgl;
+    private Double ypjgl;
 
     /**
      * 月平均风速
      */
-    private BigDecimal ypjfs;
+    private Double ypjfs;
 
     /**
      * 月发电量
      */
-    private BigDecimal yfdl;
+    private Double yfdl;
 
     /**
      * 月可用电量
      */
-    private BigDecimal ykydl;
+    private Double ykydl;
 
     /**
      * 月理论发电量
      */
-    private BigDecimal yllfdl;
+    private Double yllfdl;
 
     /**
      * 月故障损失电量
      */
-    private BigDecimal ygzssdl;
+    private Double ygzssdl;
 
     /**
      * 月场内受累故障损失电量
      */
-    private BigDecimal ycnslgzssdl;
+    private Double ycnslgzssdl;
 
     /**
      * 月检修损失电量
      */
-    private BigDecimal yjxssdl;
+    private Double yjxssdl;
 
     /**
      * 月场内受累检修损失电量
      */
-    private BigDecimal ycnsljxssdl;
+    private Double ycnsljxssdl;
 
     /**
      * 月待机损失电量
      */
-    private BigDecimal ydjssdl;
+    private Double ydjssdl;
 
     /**
      * 月缺陷降出力损失电量
      */
-    private BigDecimal yqxjclssdl;
+    private Double yqxjclssdl;
 
     /**
      * 月手动停机损失电量
      */
-    private BigDecimal ysdtjssdl;
+    private Double ysdtjssdl;
 
     /**
      * 月性能损失电量
      */
-    private BigDecimal yxnssdl;
+    private Double yxnssdl;
 
     /**
      * 月限电停机损失电量
      */
-    private BigDecimal yxdtjssdl;
+    private Double yxdtjssdl;
 
     /**
      * 月限电降出力损失电量
      */
-    private BigDecimal yxdjclssdl;
+    private Double yxdjclssdl;
 
     /**
      * 月场外受累电网损失电量
      */
-    private BigDecimal ycwsldwssdl;
+    private Double ycwsldwssdl;
 
     /**
      * 月场外受累天气损失电量
      */
-    private BigDecimal ycwsltqssdl;
+    private Double ycwsltqssdl;
 
     /**
      * 月增发电量
      */
-    private BigDecimal yzfdl;
+    private Double yzfdl;
 
     /**
      * 月欠发电量
      */
-    private BigDecimal yqfdl;
+    private Double yqfdl;
 
     /**
      * 年最大风速
      */
-    private BigDecimal nzdfs;
+    private Double nzdfs;
 
     /**
      * 年最小风速
      */
-    private BigDecimal nzxfs;
+    private Double nzxfs;
 
     /**
      * 年最大功率
      */
-    private BigDecimal nzdgl;
+    private Double nzdgl;
 
     /**
      * 年最小功率
      */
-    private BigDecimal nzxgl;
+    private Double nzxgl;
 
     /**
      * 年平均功率
      */
-    private BigDecimal npjgl;
+    private Double npjgl;
 
     /**
      * 年平均风速
      */
-    private BigDecimal npjfs;
+    private Double npjfs;
 
     /**
      * 年发电量
      */
-    private BigDecimal nfdl;
+    private Double nfdl;
 
     /**
      * 年可用电量
      */
-    private BigDecimal nkydl;
+    private Double nkydl;
 
     /**
      * 年理论发电量
      */
-    private BigDecimal nllfdl;
+    private Double nllfdl;
 
     /**
      * 年故障损失电量
      */
-    private BigDecimal ngzssdl;
+    private Double ngzssdl;
 
     /**
      * 年场内受累故障损失电量
      */
-    private BigDecimal ncnslgzssdl;
+    private Double ncnslgzssdl;
 
     /**
      * 年检修损失电量
      */
-    private BigDecimal njxssdl;
+    private Double njxssdl;
 
     /**
      * 年场内受累检修损失电量
      */
-    private BigDecimal ncnsljxssdl;
+    private Double ncnsljxssdl;
 
     /**
      * 年待机损失电量
      */
-    private BigDecimal ndjssdl;
+    private Double ndjssdl;
 
     /**
      * 年缺陷降出力损失电量
      */
-    private BigDecimal nqxjclssdl;
+    private Double nqxjclssdl;
 
     /**
      * 年手动停机损失电量
      */
-    private BigDecimal nsdtjssdl;
+    private Double nsdtjssdl;
 
     /**
      * 年性能损失电量
      */
-    private BigDecimal nxnssdl;
+    private Double nxnssdl;
 
     /**
      * 年限电停机损失电量
      */
-    private BigDecimal nxdtjssdl;
+    private Double nxdtjssdl;
 
     /**
      * 年限电降出力损失电量
      */
-    private BigDecimal nxdjclssdl;
+    private Double nxdjclssdl;
 
     /**
      * 年场外受累电网损失电量
      */
-    private BigDecimal ncwsldwssdl;
+    private Double ncwsldwssdl;
 
     /**
      * 年场外受累天气损失电量
      */
-    private BigDecimal ncwsltqssdl;
+    private Double ncwsltqssdl;
 
     /**
      * 年增发电量
      */
-    private BigDecimal nzfdl;
+    private Double nzfdl;
 
     /**
      * 年欠发电量
      */
-    private BigDecimal nqfdl;
+    private Double nqfdl;
 
     /**
      * 日自耗电
      */
-    private BigDecimal rzhd;
+    private Double rzhd;
 
     /**
      * 月自耗电
      */
-    private BigDecimal yzhd;
+    private Double yzhd;
 
     /**
      * 年自耗电
      */
-    private BigDecimal nzhd;
+    private Double nzhd;
 
 
 }

+ 84 - 67
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay2.java

@@ -1,8 +1,10 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+
+import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -12,7 +14,7 @@ import lombok.EqualsAndHashCode;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -33,7 +35,7 @@ public class ProEconEquipmentInfoDay2 extends Model {
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 风场编号
@@ -63,302 +65,317 @@ public class ProEconEquipmentInfoDay2 extends Model {
     /**
      * 日故障小时(明细)
      */
-    private BigDecimal rgzxsmx;
+    private Double rgzxsmx;
 
     /**
      * 日场内受累故障小时(明细)
      */
-    private BigDecimal rcnslgzxsmx;
+    private Double rcnslgzxsmx;
 
     /**
      * 日检修小时(明细)
      */
-    private BigDecimal rjxxsmx;
+    private Double rjxxsmx;
 
     /**
      * 日场内受累检修小时(明细)
      */
-    private BigDecimal rcnsljxxsmx;
+    private Double rcnsljxxsmx;
 
     /**
      * 日待机小时(明细)
      */
-    private BigDecimal rdjxsmx;
+    private Double rdjxsmx;
 
     /**
      * 日缺陷降出力小时(明细)
      */
-    private BigDecimal rqxjclxsmx;
+    private Double rqxjclxsmx;
 
     /**
      * 日手动停机小时(明细)
      */
-    private BigDecimal rsdtjxsmx;
+    private Double rsdtjxsmx;
 
     /**
-     * 日性能小时(明细)
+     * 日并网小时(明细)
      */
-    private BigDecimal rxnxsmx;
+    private Double rbwxsmx;
 
     /**
      * 日限电停机小时(明细)
      */
-    private BigDecimal rxdtjxsmx;
+    private Double rxdtjxsmx;
 
     /**
      * 日限电降出力小时(明细)
      */
-    private BigDecimal rxdjclxsmx;
+    private Double rxdjclxsmx;
 
     /**
      * 日场外受累电网小时(明细)
      */
-    private BigDecimal rcwsldwxsmx;
+    private Double rcwsldwxsmx;
 
     /**
      * 日场外受累天气小时(明细)
      */
-    private BigDecimal rcwsltqxsmx;
+    private Double rcwsltqxsmx;
 
     /**
      * 日离线小时(明细)
      */
-    private BigDecimal rlxxsmx;
+    private Double rlxxsmx;
 
     /**
      * 日通讯中断小时(明细)
      */
-    private BigDecimal rtxzdxsmx;
+    private Double rtxzdxsmx;
 
     /**
      * 日待机小时
      */
-    private BigDecimal rdjxs;
+    private Double rdjxs;
 
     /**
      * 日故障停机小时
      */
-    private BigDecimal rgztjxs;
+    private Double rgztjxs;
 
     /**
      * 日通讯中断小时
      */
-    private BigDecimal rtxzdxs;
+    private Double rtxzdxs;
 
     /**
      * 日维护停机小时
      */
-    private BigDecimal rjxtjxs;
+    private Double rjxtjxs;
 
     /**
      * 日限电小时
      */
-    private BigDecimal rxdxs;
+    private Double rxdxs;
 
     /**
      * 日运行小时
      */
-    private BigDecimal ryxxs;
+    private Double ryxxs;
 
     /**
      * 月故障小时(明细)
      */
-    private BigDecimal ygzxsmx;
+    private Double ygzxsmx;
 
     /**
      * 月场内受累故障小时(明细)
      */
-    private BigDecimal ycnslgzxsmx;
+    private Double ycnslgzxsmx;
 
     /**
      * 月检修小时(明细)
      */
-    private BigDecimal yjxxsmx;
+    private Double yjxxsmx;
 
     /**
      * 月场内受累检修小时(明细)
      */
-    private BigDecimal ycnsljxxsmx;
+    private Double ycnsljxxsmx;
 
     /**
      * 月待机小时(明细)
      */
-    private BigDecimal ydjxsmx;
+    private Double ydjxsmx;
 
     /**
      * 月缺陷降出力小时(明细)
      */
-    private BigDecimal yqxjclxsmx;
+    private Double yqxjclxsmx;
 
     /**
      * 月手动停机小时(明细)
      */
-    private BigDecimal ysdtjxsmx;
+    private Double ysdtjxsmx;
 
     /**
-     * 月性能小时(明细)
+     * 月并网小时(明细)
      */
-    private BigDecimal yxnxsmx;
+    private Double ybwxsmx;
 
     /**
      * 月限电停机小时(明细)
      */
-    private BigDecimal yxdtjxsmx;
+    private Double yxdtjxsmx;
 
     /**
      * 月限电降出力小时(明细)
      */
-    private BigDecimal yxdjclxsmx;
+    private Double yxdjclxsmx;
 
     /**
      * 月场外受累电网小时(明细)
      */
-    private BigDecimal ycwsldwxsmx;
+    private Double ycwsldwxsmx;
 
     /**
      * 月场外受累天气小时(明细)
      */
-    private BigDecimal ycwsltqxsmx;
+    private Double ycwsltqxsmx;
 
     /**
      * 月离线小时(明细)
      */
-    private BigDecimal ylxxsmx;
+    private Double ylxxsmx;
 
     /**
      * 月通讯中断小时(明细)
      */
-    private BigDecimal ytxzdxsmx;
+    private Double ytxzdxsmx;
 
     /**
      * 月待机小时
      */
-    private BigDecimal ydjxs;
+    private Double ydjxs;
 
     /**
      * 月故障停机小时
      */
-    private BigDecimal ygztjxs;
+    private Double ygztjxs;
 
     /**
      * 月通讯中断小时
      */
-    private BigDecimal ytxzdxs;
+    private Double ytxzdxs;
 
     /**
      * 月维护停机小时
      */
-    private BigDecimal yjxtjxs;
+    private Double yjxtjxs;
 
     /**
      * 月限电小时
      */
-    private BigDecimal yxdxs;
+    private Double yxdxs;
 
     /**
      * 月运行小时
      */
-    private BigDecimal yyxxs;
+    private Double yyxxs;
 
     /**
      * 年故障小时(明细)
      */
-    private BigDecimal ngzxsmx;
+    private Double ngzxsmx;
 
     /**
      * 年场内受累故障小时(明细)
      */
-    private BigDecimal ncnslgzxsmx;
+    private Double ncnslgzxsmx;
 
     /**
      * 年检修小时(明细)
      */
-    private BigDecimal njxxsmx;
+    private Double njxxsmx;
 
     /**
      * 年场内受累检修小时(明细)
      */
-    private BigDecimal ncnsljxxsmx;
+    private Double ncnsljxxsmx;
 
     /**
      * 年待机小时(明细)
      */
-    private BigDecimal ndjxsmx;
+    private Double ndjxsmx;
 
     /**
      * 年缺陷降出力小时(明细)
      */
-    private BigDecimal nqxjclxsmx;
+    private Double nqxjclxsmx;
 
     /**
      * 年手动停机小时(明细)
      */
-    private BigDecimal nsdtjxsmx;
+    private Double nsdtjxsmx;
 
     /**
-     * 年性能小时(明细)
+     * 年并网小时(明细)
      */
-    private BigDecimal nxnxsmx;
+    private Double nbwxsmx;
 
     /**
      * 年限电停机小时(明细)
      */
-    private BigDecimal nxdtjxsmx;
+    private Double nxdtjxsmx;
 
     /**
      * 年限电降出力小时(明细)
      */
-    private BigDecimal nxdjclxsmx;
+    private Double nxdjclxsmx;
 
     /**
      * 年场外受累电网小时(明细)
      */
-    private BigDecimal ncwsldwxsmx;
+    private Double ncwsldwxsmx;
 
     /**
      * 年场外受累天气小时(明细)
      */
-    private BigDecimal ncwsltqxsmx;
+    private Double ncwsltqxsmx;
 
     /**
      * 年离线小时(明细)
      */
-    private BigDecimal nlxxsmx;
+    private Double nlxxsmx;
 
     /**
      * 年通讯中断小时(明细)
      */
-    private BigDecimal ntxzdxsmx;
+    private Double ntxzdxsmx;
 
     /**
      * 年待机小时
      */
-    private BigDecimal ndjxs;
+    private Double ndjxs;
 
     /**
      * 年故障停机小时
      */
-    private BigDecimal ngztjxs;
+    private Double ngztjxs;
 
     /**
      * 年通讯中断小时
      */
-    private BigDecimal ntxzdxs;
+    private Double ntxzdxs;
 
     /**
      * 年维护停机小时
      */
-    private BigDecimal njxtjxs;
+    private Double njxtjxs;
 
     /**
      * 年限电小时
      */
-    private BigDecimal nxdxs;
+    private Double nxdxs;
 
     /**
      * 年运行小时
      */
-    private BigDecimal nyxxs;
+    private Double nyxxs;
+
+    /**
+     * 日受累小时
+     */
+    private Double rslxs;
+
+    /**
+     * 月受累小时
+     */
+    private Double yslxs;
+
+    /**
+     * 年受累小时
+     */
+    private Double nslxs;
 
 
 }

+ 82 - 65
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay3.java

@@ -3,6 +3,8 @@ package com.gyee.generation.model.auto;
 import java.math.BigDecimal;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import java.time.LocalDate;
+import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -12,7 +14,7 @@ import lombok.EqualsAndHashCode;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -33,7 +35,7 @@ public class ProEconEquipmentInfoDay3 extends Model {
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 风场编号
@@ -63,302 +65,317 @@ public class ProEconEquipmentInfoDay3 extends Model {
     /**
      * 日故障次数(明细)
      */
-    private BigDecimal rgzcsmx;
+    private Double rgzcsmx;
 
     /**
      * 日场内受累故障次数(明细)
      */
-    private BigDecimal rcnslgzcsmx;
+    private Double rcnslgzcsmx;
 
     /**
      * 日检修次数(明细)
      */
-    private BigDecimal rjxcsmx;
+    private Double rjxcsmx;
 
     /**
      * 日场内受累检修次数(明细)
      */
-    private BigDecimal rcnsljxcsmx;
+    private Double rcnsljxcsmx;
 
     /**
      * 日待机次数(明细)
      */
-    private BigDecimal rdjcsmx;
+    private Double rdjcsmx;
 
     /**
      * 日缺陷降出力次数(明细)
      */
-    private BigDecimal rqxjclcsmx;
+    private Double rqxjclcsmx;
 
     /**
      * 日手动停机次数(明细)
      */
-    private BigDecimal rsdtjcsmx;
+    private Double rsdtjcsmx;
 
     /**
-     * 日性能次数(明细)
+     * 日并网次数(明细)
      */
-    private BigDecimal rxncsmx;
+    private Double rbwcsmx;
 
     /**
      * 日限电停机次数(明细)
      */
-    private BigDecimal rxdtjcsmx;
+    private Double rxdtjcsmx;
 
     /**
      * 日限电降出力次数(明细)
      */
-    private BigDecimal rxdjclcsmx;
+    private Double rxdjclcsmx;
 
     /**
      * 日场外受累电网次数(明细)
      */
-    private BigDecimal rcwsldwcsmx;
+    private Double rcwsldwcsmx;
 
     /**
      * 日场外受累天气次数(明细)
      */
-    private BigDecimal rcwsltqcsmx;
+    private Double rcwsltqcsmx;
 
     /**
      * 日离线次数(明细)
      */
-    private BigDecimal rlxcsmx;
+    private Double rlxcsmx;
 
     /**
      * 日通讯中断次数(明细)
      */
-    private BigDecimal rtxzdcsmx;
+    private Double rtxzdcsmx;
 
     /**
      * 日待机次数
      */
-    private BigDecimal rdjcs;
+    private Double rdjcs;
 
     /**
      * 日故障停机次数
      */
-    private BigDecimal rgztjcs;
+    private Double rgztjcs;
 
     /**
      * 日通讯中断次数
      */
-    private BigDecimal rtxzdcs;
+    private Double rtxzdcs;
 
     /**
      * 日维护停机次数
      */
-    private BigDecimal rjxtjcs;
+    private Double rjxtjcs;
 
     /**
      * 日限电次数
      */
-    private BigDecimal rxdcs;
+    private Double rxdcs;
 
     /**
      * 日运行次数
      */
-    private BigDecimal ryxcs;
+    private Double ryxcs;
 
     /**
      * 月故障次数(明细)
      */
-    private BigDecimal ygzcsmx;
+    private Double ygzcsmx;
 
     /**
      * 月场内受累故障次数(明细)
      */
-    private BigDecimal ycnslgzcsmx;
+    private Double ycnslgzcsmx;
 
     /**
      * 月检修次数(明细)
      */
-    private BigDecimal yjxcsmx;
+    private Double yjxcsmx;
 
     /**
      * 月场内受累检修次数(明细)
      */
-    private BigDecimal ycnsljxcsmx;
+    private Double ycnsljxcsmx;
 
     /**
      * 月待机次数(明细)
      */
-    private BigDecimal ydjcsmx;
+    private Double ydjcsmx;
 
     /**
      * 月缺陷降出力次数(明细)
      */
-    private BigDecimal yqxjclcsmx;
+    private Double yqxjclcsmx;
 
     /**
      * 月手动停机次数(明细)
      */
-    private BigDecimal ysdtjcsmx;
+    private Double ysdtjcsmx;
 
     /**
-     * 月性能次数(明细)
+     * 月并网次数(明细)
      */
-    private BigDecimal yxncsmx;
+    private Double ybwcsmx;
 
     /**
      * 月限电停机次数(明细)
      */
-    private BigDecimal yxdtjcsmx;
+    private Double yxdtjcsmx;
 
     /**
      * 月限电降出力次数(明细)
      */
-    private BigDecimal yxdjclcsmx;
+    private Double yxdjclcsmx;
 
     /**
      * 月场外受累电网次数(明细)
      */
-    private BigDecimal ycwsldwcsmx;
+    private Double ycwsldwcsmx;
 
     /**
      * 月场外受累天气次数(明细)
      */
-    private BigDecimal ycwsltqcsmx;
+    private Double ycwsltqcsmx;
 
     /**
      * 月离线次数(明细)
      */
-    private BigDecimal ylxcsmx;
+    private Double ylxcsmx;
 
     /**
      * 月通讯中断次数(明细)
      */
-    private BigDecimal ytxzdcsmx;
+    private Double ytxzdcsmx;
 
     /**
      * 月待机次数
      */
-    private BigDecimal ydjcs;
+    private Double ydjcs;
 
     /**
      * 月故障停机次数
      */
-    private BigDecimal ygztjcs;
+    private Double ygztjcs;
 
     /**
      * 月通讯中断次数
      */
-    private BigDecimal ytxzdcs;
+    private Double ytxzdcs;
 
     /**
      * 月维护停机次数
      */
-    private BigDecimal yjxtjcs;
+    private Double yjxtjcs;
 
     /**
      * 月限电次数
      */
-    private BigDecimal yxdcs;
+    private Double yxdcs;
 
     /**
      * 月运行次数
      */
-    private BigDecimal yyxcs;
+    private Double yyxcs;
 
     /**
      * 年故障次数(明细)
      */
-    private BigDecimal ngzcsmx;
+    private Double ngzcsmx;
 
     /**
      * 年场内受累故障次数(明细)
      */
-    private BigDecimal ncnslgzcsmx;
+    private Double ncnslgzcsmx;
 
     /**
      * 年检修次数(明细)
      */
-    private BigDecimal njxcsmx;
+    private Double njxcsmx;
 
     /**
      * 年场内受累检修次数(明细)
      */
-    private BigDecimal ncnsljxcsmx;
+    private Double ncnsljxcsmx;
 
     /**
      * 年待机次数(明细)
      */
-    private BigDecimal ndjcsmx;
+    private Double ndjcsmx;
 
     /**
      * 年缺陷降出力次数(明细)
      */
-    private BigDecimal nqxjclcsmx;
+    private Double nqxjclcsmx;
 
     /**
      * 年手动停机次数(明细)
      */
-    private BigDecimal nsdtjcsmx;
+    private Double nsdtjcsmx;
 
     /**
-     * 年性能次数(明细)
+     * 年并网次数(明细)
      */
-    private BigDecimal nxncsmx;
+    private Double nbwcsmx;
 
     /**
      * 年限电停机次数(明细)
      */
-    private BigDecimal nxdtjcsmx;
+    private Double nxdtjcsmx;
 
     /**
      * 年限电降出力次数(明细)
      */
-    private BigDecimal nxdjclcsmx;
+    private Double nxdjclcsmx;
 
     /**
      * 年场外受累电网次数(明细)
      */
-    private BigDecimal ncwsldwcsmx;
+    private Double ncwsldwcsmx;
 
     /**
      * 年场外受累天气次数(明细)
      */
-    private BigDecimal ncwsltqcsmx;
+    private Double ncwsltqcsmx;
 
     /**
      * 年离线次数(明细)
      */
-    private BigDecimal nlxcsmx;
+    private Double nlxcsmx;
 
     /**
      * 年通讯中断次数(明细)
      */
-    private BigDecimal ntxzdcsmx;
+    private Double ntxzdcsmx;
 
     /**
      * 年待机次数
      */
-    private BigDecimal ndjcs;
+    private Double ndjcs;
 
     /**
      * 年故障停机次数
      */
-    private BigDecimal ngztjcs;
+    private Double ngztjcs;
 
     /**
      * 年通讯中断次数
      */
-    private BigDecimal ntxzdcs;
+    private Double ntxzdcs;
 
     /**
      * 年维护停机次数
      */
-    private BigDecimal njxtjcs;
+    private Double njxtjcs;
 
     /**
      * 年限电次数
      */
-    private BigDecimal nxdcs;
+    private Double nxdcs;
 
     /**
      * 年运行次数
      */
-    private BigDecimal nyxcs;
+    private Double nyxcs;
+
+    /**
+     * 日受累次数
+     */
+    private Double rslcs;
+
+    /**
+     * 月受累次数
+     */
+    private Double yslcs;
+
+    /**
+     * 年受累次数
+     */
+    private Double nslcs;
 
 
 }

+ 72 - 72
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay4.java

@@ -1,8 +1,8 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -33,7 +33,7 @@ public class ProEconEquipmentInfoDay4 extends Model {
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 风场编号
@@ -63,347 +63,347 @@ public class ProEconEquipmentInfoDay4 extends Model {
     /**
      * 日静风时长
      */
-    private BigDecimal rjfsc;
+    private Double rjfsc;
 
     /**
      * 日有效风时数
      */
-    private BigDecimal ryxfss;
+    private Double ryxfss;
 
     /**
      * 日小风切入风速
      */
-    private BigDecimal rxfqrfs;
+    private Double rxfqrfs;
 
     /**
      * 日大风切入风速
      */
-    private BigDecimal rdfqrfs;
+    private Double rdfqrfs;
 
     /**
      * 日小风切出风速
      */
-    private BigDecimal rxfqcfs;
+    private Double rxfqcfs;
 
     /**
      * 日大风切出风速
      */
-    private BigDecimal rdfqcfs;
+    private Double rdfqcfs;
 
     /**
      * 日额定风速
      */
-    private BigDecimal redfs;
+    private Double redfs;
 
     /**
      * 日功率一致性系数
      */
-    private BigDecimal rglyzxxs;
+    private Double rglyzxxs;
 
     /**
      * 日拟合优度
      */
-    private BigDecimal rnhyd;
+    private Double rnhyd;
 
     /**
      * 日曲线偏差率保证
      */
-    private BigDecimal rqxpcbbz;
+    private Double rqxpcbbz;
 
     /**
      * 日曲线偏差率同期
      */
-    private BigDecimal rqxpcbtq;
+    private Double rqxpcbtq;
 
     /**
      * 日曲线偏差率环比
      */
-    private BigDecimal rqxpcbhb;
+    private Double rqxpcbhb;
 
     /**
      * 日曲线偏差率标杆
      */
-    private BigDecimal rqxpcbbg;
+    private Double rqxpcbbg;
 
     /**
      * 日3-5米曲线偏差率
      */
-    private BigDecimal r35mqxpcl;
+    private Double r35mqxpcl;
 
     /**
      * 日5-11米曲线偏差率
      */
-    private BigDecimal r511mqxpcl;
+    private Double r511mqxpcl;
 
     /**
      * 日11米以上曲线偏差率
      */
-    private BigDecimal r11mycqxpcl;
+    private Double r11mycqxpcl;
 
     /**
      * 日对风偏差率(-50 +50之间)
      */
-    private BigDecimal rdfpcl;
+    private Double rdfpcl;
 
     /**
      * 日MTBF
      */
-    private BigDecimal rmtbf;
+    private Double rmtbf;
 
     /**
      * 日MTTR
      */
-    private BigDecimal rmttr;
+    private Double rmttr;
 
     /**
      * 日MTTF
      */
-    private BigDecimal rmttf;
+    private Double rmttf;
 
     /**
      * 日复位及时率
      */
-    private BigDecimal rfwjsl;
+    private Double rfwjsl;
 
     /**
      * 日状态转换及时率
      */
-    private BigDecimal rztzhjsl;
+    private Double rztzhjsl;
 
     /**
      * 日故障消缺及时率
      */
-    private BigDecimal rgzxqjsl;
+    private Double rgzxqjsl;
 
     /**
      * 月静风时长
      */
-    private BigDecimal yjfsc;
+    private Double yjfsc;
 
     /**
      * 月有效风时数
      */
-    private BigDecimal yyxfss;
+    private Double yyxfss;
 
     /**
      * 月小风切入风速
      */
-    private BigDecimal yxfqrfs;
+    private Double yxfqrfs;
 
     /**
      * 月大风切入风速
      */
-    private BigDecimal ydfqrfs;
+    private Double ydfqrfs;
 
     /**
      * 月小风切出风速
      */
-    private BigDecimal yxfqcfs;
+    private Double yxfqcfs;
 
     /**
      * 月大风切出风速
      */
-    private BigDecimal ydfqcfs;
+    private Double ydfqcfs;
 
     /**
      * 月额定风速
      */
-    private BigDecimal yedfs;
+    private Double yedfs;
 
     /**
      * 月功率一致性系数
      */
-    private BigDecimal yglyzxxs;
+    private Double yglyzxxs;
 
     /**
      * 月拟合优度
      */
-    private BigDecimal ynhyd;
+    private Double ynhyd;
 
     /**
      * 月曲线偏差率保证
      */
-    private BigDecimal yqxpcbbz;
+    private Double yqxpcbbz;
 
     /**
      * 月曲线偏差率同期
      */
-    private BigDecimal yqxpcbtq;
+    private Double yqxpcbtq;
 
     /**
      * 月曲线偏差率环比
      */
-    private BigDecimal yqxpcbhb;
+    private Double yqxpcbhb;
 
     /**
      * 月曲线偏差率标杆
      */
-    private BigDecimal yqxpcbbg;
+    private Double yqxpcbbg;
 
     /**
      * 月3-5米曲线偏差率
      */
-    private BigDecimal y35mqxpcl;
+    private Double y35mqxpcl;
 
     /**
      * 月5-11米曲线偏差率
      */
-    private BigDecimal y511mqxpcl;
+    private Double y511mqxpcl;
 
     /**
      * 月11米以上曲线偏差率
      */
-    private BigDecimal y11mycqxpcl;
+    private Double y11mycqxpcl;
 
     /**
      * 月对风偏差率(-50 +50之间)
      */
-    private BigDecimal ydfpcl;
+    private Double ydfpcl;
 
     /**
      * 月MTBF
      */
-    private BigDecimal ymtbf;
+    private Double ymtbf;
 
     /**
      * 月MTTR
      */
-    private BigDecimal ymttr;
+    private Double ymttr;
 
     /**
      * 月MTTF
      */
-    private BigDecimal ymttf;
+    private Double ymttf;
 
     /**
      * 月复位及时率
      */
-    private BigDecimal yfwjsl;
+    private Double yfwjsl;
 
     /**
      * 月状态转换及时率
      */
-    private BigDecimal yztzhjsl;
+    private Double yztzhjsl;
 
     /**
      * 月故障消缺及时率
      */
-    private BigDecimal ygzxqjsl;
+    private Double ygzxqjsl;
 
     /**
      * 年静风时长
      */
-    private BigDecimal njfsc;
+    private Double njfsc;
 
     /**
      * 年有效风时数
      */
-    private BigDecimal nyxfss;
+    private Double nyxfss;
 
     /**
      * 年小风切入风速
      */
-    private BigDecimal nxfqrfs;
+    private Double nxfqrfs;
 
     /**
      * 年大风切入风速
      */
-    private BigDecimal ndfqrfs;
+    private Double ndfqrfs;
 
     /**
      * 年小风切出风速
      */
-    private BigDecimal nxfqcfs;
+    private Double nxfqcfs;
 
     /**
      * 年大风切出风速
      */
-    private BigDecimal ndfqcfs;
+    private Double ndfqcfs;
 
     /**
      * 年额定风速
      */
-    private BigDecimal nedfs;
+    private Double nedfs;
 
     /**
      * 年功率一致性系数
      */
-    private BigDecimal nglyzxxs;
+    private Double nglyzxxs;
 
     /**
      * 年拟合优度
      */
-    private BigDecimal nnhyd;
+    private Double nnhyd;
 
     /**
      * 年曲线偏差率保证
      */
-    private BigDecimal nqxpcbbz;
+    private Double nqxpcbbz;
 
     /**
      * 年曲线偏差率同期
      */
-    private BigDecimal nqxpcbtq;
+    private Double nqxpcbtq;
 
     /**
      * 年曲线偏差率环比
      */
-    private BigDecimal nqxpcbhb;
+    private Double nqxpcbhb;
 
     /**
      * 年曲线偏差率标杆
      */
-    private BigDecimal nqxpcbbg;
+    private Double nqxpcbbg;
 
     /**
      * 年3-5米曲线偏差率
      */
-    private BigDecimal n35mqxpcl;
+    private Double n35mqxpcl;
 
     /**
      * 年5-11米曲线偏差率
      */
-    private BigDecimal n511mqxpcl;
+    private Double n511mqxpcl;
 
     /**
      * 年11米以上曲线偏差率
      */
-    private BigDecimal n11mycqxpcl;
+    private Double n11mycqxpcl;
 
     /**
      * 年对风偏差率(-50 +50之间)
      */
-    private BigDecimal ndfpcl;
+    private Double ndfpcl;
 
     /**
      * 年MTBF
      */
-    private BigDecimal nmtbf;
+    private Double nmtbf;
 
     /**
      * 年MTTR
      */
-    private BigDecimal nmttr;
+    private Double nmttr;
 
     /**
      * 年MTTF
      */
-    private BigDecimal nmttf;
+    private Double nmttf;
 
     /**
      * 年复位及时率
      */
-    private BigDecimal nfwjsl;
+    private Double nfwjsl;
 
     /**
      * 年状态转换及时率
      */
-    private BigDecimal nztzhjsl;
+    private Double nztzhjsl;
 
     /**
      * 年故障消缺及时率
      */
-    private BigDecimal ngzxqjsl;
+    private Double ngzxqjsl;
 
 
 }

+ 25 - 25
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay5.java

@@ -1,8 +1,8 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -33,7 +33,7 @@ public class ProEconEquipmentInfoDay5 extends Model {
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 风场编号
@@ -63,112 +63,112 @@ public class ProEconEquipmentInfoDay5 extends Model {
     /**
      * 小于3米5分钟转换及时次数
      */
-    private BigDecimal timerate1;
+    private Double timerate1;
 
     /**
      * 小于3米10分钟转换及时次数
      */
-    private BigDecimal timerate2;
+    private Double timerate2;
 
     /**
      * 小于3米15分钟转换及时次数
      */
-    private BigDecimal timerate3;
+    private Double timerate3;
 
     /**
      * 小于3米20分钟转换及时次数
      */
-    private BigDecimal timerate4;
+    private Double timerate4;
 
     /**
      * 大于3米5分钟转换及时次数
      */
-    private BigDecimal timerate5;
+    private Double timerate5;
 
     /**
      * 大于3米10分钟转换及时次数
      */
-    private BigDecimal timerate6;
+    private Double timerate6;
 
     /**
      * 大于3米15分钟转换及时次数
      */
-    private BigDecimal timerate7;
+    private Double timerate7;
 
     /**
      * 大于3米20分钟转换及时次数
      */
-    private BigDecimal timerate8;
+    private Double timerate8;
 
     /**
      * 大于4米5分钟转换及时次数
      */
-    private BigDecimal timerate9;
+    private Double timerate9;
 
     /**
      * 大于4米10分钟转换及时次数
      */
-    private BigDecimal timerate10;
+    private Double timerate10;
 
     /**
      * 大于4米15分钟转换及时次数
      */
-    private BigDecimal timerate11;
+    private Double timerate11;
 
     /**
      * 大于4米20分钟转换及时次数
      */
-    private BigDecimal timerate12;
+    private Double timerate12;
 
     /**
      * 小于3米状态转换总次数
      */
-    private BigDecimal timerate13;
+    private Double timerate13;
 
     /**
      * 大于3米状态转换总次数
      */
-    private BigDecimal timerate14;
+    private Double timerate14;
 
     /**
      * 大于4米状态转换总次数
      */
-    private BigDecimal timerate15;
+    private Double timerate15;
 
     /**
      * 5分钟复位及时次数
      */
-    private BigDecimal timerate16;
+    private Double timerate16;
 
     /**
      * 10分钟复位及时次数
      */
-    private BigDecimal timerate17;
+    private Double timerate17;
 
     /**
      * 15分钟复位及时次数
      */
-    private BigDecimal timerate18;
+    private Double timerate18;
 
     /**
      * 20分钟复位及时次数
      */
-    private BigDecimal timerate19;
+    private Double timerate19;
 
     /**
      * 总复位次数
      */
-    private BigDecimal timerate20;
+    private Double timerate20;
 
     /**
      * 故障消缺及时次数
      */
-    private BigDecimal timerate21;
+    private Double timerate21;
 
     /**
      * 故障消缺总次数
      */
-    private BigDecimal timerate22;
+    private Double timerate22;
 
 
 }

+ 12 - 12
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay6.java

@@ -1,8 +1,8 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -33,7 +33,7 @@ public class ProEconEquipmentInfoDay6 extends Model {
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 风场编号
@@ -63,47 +63,47 @@ public class ProEconEquipmentInfoDay6 extends Model {
     /**
      * 日系统效率(PR)
      */
-    private BigDecimal rxtxl;
+    private Double rxtxl;
 
     /**
      * 日离散率
      */
-    private BigDecimal rlsl;
+    private Double rlsl;
 
     /**
      * 日逆变器转换效率
      */
-    private BigDecimal rnbqzhxl;
+    private Double rnbqzhxl;
 
     /**
      * 月系统效率(PR)
      */
-    private BigDecimal yxtxl;
+    private Double yxtxl;
 
     /**
      * 月离散率
      */
-    private BigDecimal ylsl;
+    private Double ylsl;
 
     /**
      * 月逆变器转换效率
      */
-    private BigDecimal ynbqzhxl;
+    private Double ynbqzhxl;
 
     /**
      * 年系统效率(PR)
      */
-    private BigDecimal nxtxl;
+    private Double nxtxl;
 
     /**
      * 年离散率
      */
-    private BigDecimal nlsl;
+    private Double nlsl;
 
     /**
      * 年逆变器转换效率
      */
-    private BigDecimal nnbqzhxl;
+    private Double nnbqzhxl;
 
 
 }

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentmodel.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProEconEquipmentmodel extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconLogicalUnit.java

@@ -26,7 +26,7 @@ public class ProEconLogicalUnit extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconManufacturer.java

@@ -26,7 +26,7 @@ public class ProEconManufacturer extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 83 - 76
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay1.java

@@ -1,8 +1,10 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.Date;
+import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -28,12 +30,12 @@ public class ProEconPowerstationInfoDay1 extends Model {
     /**
      * 外键编号
      */
-    private String foreignkeyid;
+    private String foreignKeyId;
 
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 类型
@@ -66,364 +68,369 @@ public class ProEconPowerstationInfoDay1 extends Model {
     private String regionId;
 
     /**
+     * 所属位置(区域、区域风、区域光、公司、公司、公司风、公司光、场站、期次、线路)
+     */
+    private String location;
+
+    /**
      * 日最大风速
      */
-    private BigDecimal rzdfs;
+    private Double rzdfs;
 
     /**
      * 日最小风速
      */
-    private BigDecimal rzxfs;
+    private Double rzxfs;
 
     /**
      * 日最大功率
      */
-    private BigDecimal rzdgl;
+    private Double rzdgl;
 
     /**
      * 日最小功率
      */
-    private BigDecimal rzxgl;
+    private Double rzxgl;
 
     /**
      * 日平均功率
      */
-    private BigDecimal rpjgl;
+    private Double rpjgl;
 
     /**
      * 日平均风速
      */
-    private BigDecimal rpjfs;
+    private Double rpjfs;
 
     /**
      * 日发电量
      */
-    private BigDecimal rfdl;
+    private Double rfdl;
 
     /**
      * 日可用电量
      */
-    private BigDecimal rkydl;
+    private Double rkydl;
 
     /**
      * 日理论发电量
      */
-    private BigDecimal rllfdl;
+    private Double rllfdl;
 
     /**
      * 日故障损失电量
      */
-    private BigDecimal rgzssdl;
+    private Double rgzssdl;
 
     /**
      * 日场内受累故障损失电量
      */
-    private BigDecimal rcnslgzssdl;
+    private Double rcnslgzssdl;
 
     /**
      * 日检修损失电量
      */
-    private BigDecimal rjxssdl;
+    private Double rjxssdl;
 
     /**
      * 日场内受累检修损失电量
      */
-    private BigDecimal rcnsljxssdl;
+    private Double rcnsljxssdl;
 
     /**
      * 日待机损失电量
      */
-    private BigDecimal rdjssdl;
+    private Double rdjssdl;
 
     /**
      * 日缺陷降出力损失电量
      */
-    private BigDecimal rqxjclssdl;
+    private Double rqxjclssdl;
 
     /**
      * 日手动停机损失电量
      */
-    private BigDecimal rsdtjssdl;
+    private Double rsdtjssdl;
 
     /**
      * 日性能损失电量
      */
-    private BigDecimal rxnssdl;
+    private Double rxnssdl;
 
     /**
      * 日限电停机损失电量
      */
-    private BigDecimal rxdtjssdl;
+    private Double rxdtjssdl;
 
     /**
      * 日限电降出力损失电量
      */
-    private BigDecimal rxdjclssdl;
+    private Double rxdjclssdl;
 
     /**
      * 日场外受累电网损失电量
      */
-    private BigDecimal rcwsldwssdl;
+    private Double rcwsldwssdl;
 
     /**
      * 日场外受累天气损失电量
      */
-    private BigDecimal rcwsltqssdl;
+    private Double rcwsltqssdl;
 
     /**
      * 日增发电量
      */
-    private BigDecimal rzfdl;
+    private Double rzfdl;
 
     /**
      * 日欠发电量
      */
-    private BigDecimal rqfdl;
+    private Double rqfdl;
 
     /**
      * 月最大风速
      */
-    private BigDecimal yzdfs;
+    private Double yzdfs;
 
     /**
      * 月最小风速
      */
-    private BigDecimal yzxfs;
+    private Double yzxfs;
 
     /**
      * 月最大功率
      */
-    private BigDecimal yzdgl;
+    private Double yzdgl;
 
     /**
      * 月最小功率
      */
-    private BigDecimal yzxgl;
+    private Double yzxgl;
 
     /**
      * 月平均功率
      */
-    private BigDecimal ypjgl;
+    private Double ypjgl;
 
     /**
      * 月平均风速
      */
-    private BigDecimal ypjfs;
+    private Double ypjfs;
 
     /**
      * 月发电量
      */
-    private BigDecimal yfdl;
+    private Double yfdl;
 
     /**
      * 月可用电量
      */
-    private BigDecimal ykydl;
+    private Double ykydl;
 
     /**
      * 月理论发电量
      */
-    private BigDecimal yllfdl;
+    private Double yllfdl;
 
     /**
      * 月故障损失电量
      */
-    private BigDecimal ygzssdl;
+    private Double ygzssdl;
 
     /**
      * 月场内受累故障损失电量
      */
-    private BigDecimal ycnslgzssdl;
+    private Double ycnslgzssdl;
 
     /**
      * 月检修损失电量
      */
-    private BigDecimal yjxssdl;
+    private Double yjxssdl;
 
     /**
      * 月场内受累检修损失电量
      */
-    private BigDecimal ycnsljxssdl;
+    private Double ycnsljxssdl;
 
     /**
      * 月待机损失电量
      */
-    private BigDecimal ydjssdl;
+    private Double ydjssdl;
 
     /**
      * 月缺陷降出力损失电量
      */
-    private BigDecimal yqxjclssdl;
+    private Double yqxjclssdl;
 
     /**
      * 月手动停机损失电量
      */
-    private BigDecimal ysdtjssdl;
+    private Double ysdtjssdl;
 
     /**
      * 月性能损失电量
      */
-    private BigDecimal yxnssdl;
+    private Double yxnssdl;
 
     /**
      * 月限电停机损失电量
      */
-    private BigDecimal yxdtjssdl;
+    private Double yxdtjssdl;
 
     /**
      * 月限电降出力损失电量
      */
-    private BigDecimal yxdjclssdl;
+    private Double yxdjclssdl;
 
     /**
      * 月场外受累电网损失电量
      */
-    private BigDecimal ycwsldwssdl;
+    private Double ycwsldwssdl;
 
     /**
      * 月场外受累天气损失电量
      */
-    private BigDecimal ycwsltqssdl;
+    private Double ycwsltqssdl;
 
     /**
      * 月增发电量
      */
-    private BigDecimal yzfdl;
+    private Double yzfdl;
 
     /**
      * 月欠发电量
      */
-    private BigDecimal yqfdl;
+    private Double yqfdl;
 
     /**
      * 年最大风速
      */
-    private BigDecimal nzdfs;
+    private Double nzdfs;
 
     /**
      * 年最小风速
      */
-    private BigDecimal nzxfs;
+    private Double nzxfs;
 
     /**
      * 年最大功率
      */
-    private BigDecimal nzdgl;
+    private Double nzdgl;
 
     /**
      * 年最小功率
      */
-    private BigDecimal nzxgl;
+    private Double nzxgl;
 
     /**
      * 年平均功率
      */
-    private BigDecimal npjgl;
+    private Double npjgl;
 
     /**
      * 年平均风速
      */
-    private BigDecimal npjfs;
+    private Double npjfs;
 
     /**
      * 年发电量
      */
-    private BigDecimal nfdl;
+    private Double nfdl;
 
     /**
      * 年可用电量
      */
-    private BigDecimal nkydl;
+    private Double nkydl;
 
     /**
      * 年理论发电量
      */
-    private BigDecimal nllfdl;
+    private Double nllfdl;
 
     /**
      * 年故障损失电量
      */
-    private BigDecimal ngzssdl;
+    private Double ngzssdl;
 
     /**
      * 年场内受累故障损失电量
      */
-    private BigDecimal ncnslgzssdl;
+    private Double ncnslgzssdl;
 
     /**
      * 年检修损失电量
      */
-    private BigDecimal njxssdl;
+    private Double njxssdl;
 
     /**
      * 年场内受累检修损失电量
      */
-    private BigDecimal ncnsljxssdl;
+    private Double ncnsljxssdl;
 
     /**
      * 年待机损失电量
      */
-    private BigDecimal ndjssdl;
+    private Double ndjssdl;
 
     /**
      * 年缺陷降出力损失电量
      */
-    private BigDecimal nqxjclssdl;
+    private Double nqxjclssdl;
 
     /**
      * 年手动停机损失电量
      */
-    private BigDecimal nsdtjssdl;
+    private Double nsdtjssdl;
 
     /**
      * 年性能损失电量
      */
-    private BigDecimal nxnssdl;
+    private Double nxnssdl;
 
     /**
      * 年限电停机损失电量
      */
-    private BigDecimal nxdtjssdl;
+    private Double nxdtjssdl;
 
     /**
      * 年限电降出力损失电量
      */
-    private BigDecimal nxdjclssdl;
+    private Double nxdjclssdl;
 
     /**
      * 年场外受累电网损失电量
      */
-    private BigDecimal ncwsldwssdl;
+    private Double ncwsldwssdl;
 
     /**
      * 年场外受累天气损失电量
      */
-    private BigDecimal ncwsltqssdl;
+    private Double ncwsltqssdl;
 
     /**
      * 年增发电量
      */
-    private BigDecimal nzfdl;
+    private Double nzfdl;
 
     /**
      * 年欠发电量
      */
-    private BigDecimal nqfdl;
+    private Double nqfdl;
 
     /**
      * 日自耗电
      */
-    private BigDecimal rzhd;
+    private Double rzhd;
 
     /**
      * 月自耗电
      */
-    private BigDecimal yzhd;
+    private Double yzhd;
 
     /**
      * 年自耗电
      */
-    private BigDecimal nzhd;
+    private Double nzhd;
 
 
 }

+ 89 - 67
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay2.java

@@ -2,7 +2,9 @@ package com.gyee.generation.model.auto;
 
 import java.math.BigDecimal;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+
+import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -12,7 +14,7 @@ import lombok.EqualsAndHashCode;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -28,12 +30,12 @@ public class ProEconPowerstationInfoDay2 extends Model {
     /**
      * 外键编号
      */
-    private String foreignkeyid;
+    private String foreignKeyId;
 
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 类型
@@ -66,304 +68,324 @@ public class ProEconPowerstationInfoDay2 extends Model {
     private String regionId;
 
     /**
+     * 所属位置(区域、区域风、区域光、公司、公司、公司风、公司光、场站、期次、线路)
+     */
+    private String location;
+
+    /**
      * 日合计故障小时(明细)
      */
-    private BigDecimal rhjgzxsmx;
+    private Double rhjgzxsmx;
 
     /**
      * 日合计场内受累故障小时(明细)
      */
-    private BigDecimal rhjcnslgzxsmx;
+    private Double rhjcnslgzxsmx;
 
     /**
      * 日合计检修小时(明细)
      */
-    private BigDecimal rhjjxxsmx;
+    private Double rhjjxxsmx;
 
     /**
      * 日合计场内受累检修小时(明细)
      */
-    private BigDecimal rhjcnsljxxsmx;
+    private Double rhjcnsljxxsmx;
 
     /**
      * 日合计待机小时(明细)
      */
-    private BigDecimal rhjdjxsmx;
+    private Double rhjdjxsmx;
 
     /**
      * 日合计缺陷降出力小时(明细)
      */
-    private BigDecimal rhjqxjclxsmx;
+    private Double rhjqxjclxsmx;
 
     /**
      * 日合计手动停机小时(明细)
      */
-    private BigDecimal rhjsdtjxsmx;
+    private Double rhjsdtjxsmx;
 
     /**
-     * 日合计性能小时(明细)
+     * 日合计并网小时(明细)
      */
-    private BigDecimal rhjxnxsmx;
+    private Double rhjbwxsmx;
 
     /**
      * 日合计限电停机小时(明细)
      */
-    private BigDecimal rhjxdtjxsmx;
+    private Double rhjxdtjxsmx;
 
     /**
      * 日合计限电降出力小时(明细)
      */
-    private BigDecimal rhjxdjclxsmx;
+    private Double rhjxdjclxsmx;
 
     /**
      * 日合计场外受累电网小时(明细)
      */
-    private BigDecimal rhjcwsldwxsmx;
+    private Double rhjcwsldwxsmx;
 
     /**
      * 日合计场外受累天气小时(明细)
      */
-    private BigDecimal rhjcwsltqxsmx;
+    private Double rhjcwsltqxsmx;
 
     /**
      * 日合计离线小时(明细)
      */
-    private BigDecimal rhjlxxsmx;
+    private Double rhjlxxsmx;
 
     /**
      * 日合计通讯中断小时(明细)
      */
-    private BigDecimal rhjtxxsmx;
+    private Double rhjtxzdxsmx;
 
     /**
      * 日合计待机小时
      */
-    private BigDecimal rhjdjxs;
+    private Double rhjdjxs;
 
     /**
      * 日合计故障停机小时
      */
-    private BigDecimal rhjgztjxs;
+    private Double rhjgztjxs;
 
     /**
      * 日合计通讯中断小时
      */
-    private BigDecimal rhjtxzdxs;
+    private Double rhjtxzdxs;
 
     /**
      * 日合计维护停机小时
      */
-    private BigDecimal rhjjxtjxs;
+    private Double rhjjxtjxs;
 
     /**
      * 日合计限电小时
      */
-    private BigDecimal rhjxdxs;
+    private Double rhjxdxs;
 
     /**
      * 日合计运行小时
      */
-    private BigDecimal rhjyxxs;
+    private Double rhjyxxs;
 
     /**
      * 月合计故障小时(明细)
      */
-    private BigDecimal yhjgzxsmx;
+    private Double yhjgzxsmx;
 
     /**
      * 月合计场内受累故障小时(明细)
      */
-    private BigDecimal yhjcnslgzxsmx;
+    private Double yhjcnslgzxsmx;
 
     /**
      * 月合计检修小时(明细)
      */
-    private BigDecimal yhjjxxsmx;
+    private Double yhjjxxsmx;
 
     /**
      * 月合计场内受累检修小时(明细)
      */
-    private BigDecimal yhjcnsljxxsmx;
+    private Double yhjcnsljxxsmx;
 
     /**
      * 月合计待机小时(明细)
      */
-    private BigDecimal yhjdjxsmx;
+    private Double yhjdjxsmx;
 
     /**
      * 月合计缺陷降出力小时(明细)
      */
-    private BigDecimal yhjqxjclxsmx;
+    private Double yhjqxjclxsmx;
 
     /**
      * 月合计手动停机小时(明细)
      */
-    private BigDecimal yhjsdtjxsmx;
+    private Double yhjsdtjxsmx;
 
     /**
-     * 月合计性能小时(明细)
+     * 月合计并网小时(明细)
      */
-    private BigDecimal yhjxnxsmx;
+    private Double yhjbwxsmx;
 
     /**
      * 月合计限电停机小时(明细)
      */
-    private BigDecimal yhjxdtjxsmx;
+    private Double yhjxdtjxsmx;
 
     /**
      * 月合计限电降出力小时(明细)
      */
-    private BigDecimal yhjxdjclxsmx;
+    private Double yhjxdjclxsmx;
 
     /**
      * 月合计场外受累电网小时(明细)
      */
-    private BigDecimal yhjcwsldwxsmx;
+    private Double yhjcwsldwxsmx;
 
     /**
      * 月合计场外受累天气小时(明细)
      */
-    private BigDecimal yhjcwsltqxsmx;
+    private Double yhjcwsltqxsmx;
 
     /**
      * 月合计离线小时(明细)
      */
-    private BigDecimal yhjlxxsmx;
+    private Double yhjlxxsmx;
 
     /**
      * 月合计通讯中断小时(明细)
      */
-    private BigDecimal yhjtxxsmx;
+    private Double yhjtxzdxsmx;
 
     /**
      * 月合计待机小时
      */
-    private BigDecimal yhjdjxs;
+    private Double yhjdjxs;
 
     /**
      * 月合计故障停机小时
      */
-    private BigDecimal yhjgztjxs;
+    private Double yhjgztjxs;
 
     /**
      * 月合计通讯中断小时
      */
-    private BigDecimal yhjtxzdxs;
+    private Double yhjtxzdxs;
 
     /**
      * 月合计维护停机小时
      */
-    private BigDecimal yhjjxtjxs;
+    private Double yhjjxtjxs;
 
     /**
      * 月合计限电小时
      */
-    private BigDecimal yhjxdxs;
+    private Double yhjxdxs;
 
     /**
      * 月合计运行小时
      */
-    private BigDecimal yhjyxxs;
+    private Double yhjyxxs;
 
     /**
      * 年合计故障小时(明细)
      */
-    private BigDecimal nhjgzxsmx;
+    private Double nhjgzxsmx;
 
     /**
      * 年合计场内受累故障小时(明细)
      */
-    private BigDecimal nhjcnslgzxsmx;
+    private Double nhjcnslgzxsmx;
 
     /**
      * 年合计检修小时(明细)
      */
-    private BigDecimal nhjjxxsmx;
+    private Double nhjjxxsmx;
 
     /**
      * 年合计场内受累检修小时(明细)
      */
-    private BigDecimal nhjcnsljxxsmx;
+    private Double nhjcnsljxxsmx;
 
     /**
      * 年合计待机小时(明细)
      */
-    private BigDecimal nhjdjxsmx;
+    private Double nhjdjxsmx;
 
     /**
      * 年合计缺陷降出力小时(明细)
      */
-    private BigDecimal nhjqxjclxsmx;
+    private Double nhjqxjclxsmx;
 
     /**
      * 年合计手动停机小时(明细)
      */
-    private BigDecimal nhjsdtjxsmx;
+    private Double nhjsdtjxsmx;
 
     /**
-     * 年合计性能小时(明细)
+     * 年合计并网小时(明细)
      */
-    private BigDecimal nhjxnxsmx;
+    private Double nhjbwxsmx;
 
     /**
      * 年合计限电停机小时(明细)
      */
-    private BigDecimal nhjxdtjxsmx;
+    private Double nhjxdtjxsmx;
 
     /**
      * 年合计限电降出力小时(明细)
      */
-    private BigDecimal nhjxdjclxsmx;
+    private Double nhjxdjclxsmx;
 
     /**
      * 年合计场外受累电网小时(明细)
      */
-    private BigDecimal nhjcwsldwxsmx;
+    private Double nhjcwsldwxsmx;
 
     /**
      * 年合计场外受累天气小时(明细)
      */
-    private BigDecimal nhjcwsltqxsmx;
+    private Double nhjcwsltqxsmx;
 
     /**
      * 年合计离线小时(明细)
      */
-    private BigDecimal nhjlxxsmx;
+    private Double nhjlxxsmx;
 
     /**
      * 年合计通讯中断小时(明细)
      */
-    private BigDecimal nhjtxxsmx;
+    private Double nhjtxzdxsmx;
 
     /**
      * 年合计待机小时
      */
-    private BigDecimal nhjdjxs;
+    private Double nhjdjxs;
 
     /**
      * 年合计故障停机小时
      */
-    private BigDecimal nhjgztjxs;
+    private Double nhjgztjxs;
 
     /**
      * 年合计通讯中断小时
      */
-    private BigDecimal nhjtxzdxs;
+    private Double nhjtxzdxs;
 
     /**
      * 年合计维护停机小时
      */
-    private BigDecimal nhjjxtjxs;
+    private Double nhjjxtjxs;
 
     /**
      * 年合计限电小时
      */
-    private BigDecimal nhjxdxs;
+    private Double nhjxdxs;
 
     /**
      * 年合计运行小时
      */
-    private BigDecimal nhjyxxs;
+    private Double nhjyxxs;
+
+    /**
+     * 年合计受累小时
+     */
+    private Double nhjslxs;
+
+    /**
+     * 月合计受累小时
+     */
+    private Double yhjslxs;
+
+    /**
+     * 日合计受累小时
+     */
+    private Double rhjslxs;
 
 
 }

+ 92 - 70
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay3.java

@@ -2,7 +2,9 @@ package com.gyee.generation.model.auto;
 
 import java.math.BigDecimal;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+
+import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -12,7 +14,7 @@ import lombok.EqualsAndHashCode;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -28,12 +30,12 @@ public class ProEconPowerstationInfoDay3 extends Model {
     /**
      * 外键编号
      */
-    private String foreignkeyid;
+    private String foreignKeyId;
 
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 类型
@@ -66,304 +68,324 @@ public class ProEconPowerstationInfoDay3 extends Model {
     private String regionId;
 
     /**
+     * 所属位置(区域、区域风、区域光、公司、公司、公司风、公司光、场站、期次、线路)
+     */
+    private String location;
+
+    /**
      * 日合计故障次数(明细)
      */
-    private BigDecimal rhjgzcsmx;
+    private Double rhjgzcsmx;
 
     /**
      * 日合计场内受累故障次数(明细)
      */
-    private BigDecimal rhjcnslgzcsmx;
+    private Double rhjcnslgzcsmx;
 
     /**
      * 日合计检修次数(明细)
      */
-    private BigDecimal rhjjxcsmx;
+    private Double rhjjxcsmx;
 
     /**
      * 日合计场内受累检修次数(明细)
      */
-    private BigDecimal rhjcnsljxcsmx;
+    private Double rhjcnsljxcsmx;
 
     /**
      * 日合计待机次数(明细)
      */
-    private BigDecimal rhjdjcsmx;
+    private Double rhjdjcsmx;
 
     /**
      * 日合计缺陷降出力次数(明细)
      */
-    private BigDecimal rhjqxjclcsmx;
+    private Double rhjqxjclcsmx;
 
     /**
      * 日合计手动停机次数(明细)
      */
-    private BigDecimal rhjsdtjcsmx;
+    private Double rhjsdtjcsmx;
 
     /**
-     * 日合计性能次数(明细)
+     * 日合计并网次数(明细)
      */
-    private BigDecimal rhjxncsmx;
+    private Double rhjbwcsmx;
 
     /**
      * 日合计限电停机次数(明细)
      */
-    private BigDecimal rhjxdtjcsmx;
+    private Double rhjxdtjcsmx;
 
     /**
      * 日合计限电降出力次数(明细)
      */
-    private BigDecimal rhjxdjclcsmx;
+    private Double rhjxdjclcsmx;
 
     /**
      * 日合计场外受累电网次数(明细)
      */
-    private BigDecimal rhjcwsldwcsmx;
+    private Double rhjcwsldwcsmx;
 
     /**
      * 日合计场外受累天气次数(明细)
      */
-    private BigDecimal rhjcwsltqcsmx;
+    private Double rhjcwsltqcsmx;
 
     /**
      * 日合计离线次数(明细)
      */
-    private BigDecimal rhjlxcsmx;
+    private Double rhjlxcsmx;
 
     /**
      * 日合计通讯中断次数(明细)
      */
-    private BigDecimal rhjtxzdcsmx;
+    private Double rhjtxzdcsmx;
 
     /**
      * 日合计待机次数
      */
-    private BigDecimal rhjdjcs;
+    private Double rhjdjcs;
 
     /**
      * 日合计故障停机次数
      */
-    private BigDecimal rhjgztjcs;
+    private Double rhjgztjcs;
 
     /**
      * 日合计通讯中断次数
      */
-    private BigDecimal rhjtxzccs;
+    private Double rhjtxzdcs;
 
     /**
-     * 日合计维护停机次数
+     * 日合计检修停机次数
      */
-    private BigDecimal rhjwhtjcs;
+    private Double rhjjxtjcs;
 
     /**
      * 日合计限电次数
      */
-    private BigDecimal rhjxdcs;
+    private Double rhjxdcs;
 
     /**
      * 日合计运行次数
      */
-    private BigDecimal rhjyxcs;
+    private Double rhjyxcs;
 
     /**
      * 月合计故障次数(明细)
      */
-    private BigDecimal yhjgzcsmx;
+    private Double yhjgzcsmx;
 
     /**
      * 月合计场内受累故障次数(明细)
      */
-    private BigDecimal yhjcnslgzcsmx;
+    private Double yhjcnslgzcsmx;
 
     /**
      * 月合计检修次数(明细)
      */
-    private BigDecimal yhjjxcsmx;
+    private Double yhjjxcsmx;
 
     /**
      * 月合计场内受累检修次数(明细)
      */
-    private BigDecimal yhjcnsljxcsmx;
+    private Double yhjcnsljxcsmx;
 
     /**
      * 月合计待机次数(明细)
      */
-    private BigDecimal yhjdjcsmx;
+    private Double yhjdjcsmx;
 
     /**
      * 月合计缺陷降出力次数(明细)
      */
-    private BigDecimal yhjqxjclcsmx;
+    private Double yhjqxjclcsmx;
 
     /**
      * 月合计手动停机次数(明细)
      */
-    private BigDecimal yhjsdtjcsmx;
+    private Double yhjsdtjcsmx;
 
     /**
-     * 月合计性能次数(明细)
+     * 月合计并网次数(明细)
      */
-    private BigDecimal yhjxncsmx;
+    private Double yhjbwcsmx;
 
     /**
      * 月合计限电停机次数(明细)
      */
-    private BigDecimal yhjxdtjcsmx;
+    private Double yhjxdtjcsmx;
 
     /**
      * 月合计限电降出力次数(明细)
      */
-    private BigDecimal yhjxdjclcsmx;
+    private Double yhjxdjclcsmx;
 
     /**
      * 月合计场外受累电网次数(明细)
      */
-    private BigDecimal yhjcwsldwcsmx;
+    private Double yhjcwsldwcsmx;
 
     /**
      * 月合计场外受累天气次数(明细)
      */
-    private BigDecimal yhjcwsltqcsmx;
+    private Double yhjcwsltqcsmx;
 
     /**
      * 月合计离线次数(明细)
      */
-    private BigDecimal yhjlxcsmx;
+    private Double yhjlxcsmx;
 
     /**
      * 月合计通讯中断次数(明细)
      */
-    private BigDecimal yhjtxzdcsmx;
+    private Double yhjtxzdcsmx;
 
     /**
      * 月合计待机次数
      */
-    private BigDecimal yhjdjcs;
+    private Double yhjdjcs;
 
     /**
      * 月合计故障停机次数
      */
-    private BigDecimal yhjgztjcs;
+    private Double yhjgztjcs;
 
     /**
      * 月合计通讯中断次数
      */
-    private BigDecimal yhjtxzccs;
+    private Double yhjtxzdcs;
 
     /**
-     * 月合计维护停机次数
+     * 月合计检修停机次数
      */
-    private BigDecimal yhjwhtjcs;
+    private Double yhjjxtjcs;
 
     /**
      * 月合计限电次数
      */
-    private BigDecimal yhjxdcs;
+    private Double yhjxdcs;
 
     /**
      * 月合计运行次数
      */
-    private BigDecimal yhjyxcs;
+    private Double yhjyxcs;
 
     /**
      * 年合计故障次数(明细)
      */
-    private BigDecimal nhjgzcsmx;
+    private Double nhjgzcsmx;
 
     /**
      * 年合计场内受累故障次数(明细)
      */
-    private BigDecimal nhjcnslgzcsmx;
+    private Double nhjcnslgzcsmx;
 
     /**
      * 年合计检修次数(明细)
      */
-    private BigDecimal nhjjxcsmx;
+    private Double nhjjxcsmx;
 
     /**
      * 年合计场内受累检修次数(明细)
      */
-    private BigDecimal nhjcnsljxcsmx;
+    private Double nhjcnsljxcsmx;
 
     /**
      * 年合计待机次数(明细)
      */
-    private BigDecimal nhjdjcsmx;
+    private Double nhjdjcsmx;
 
     /**
      * 年合计缺陷降出力次数(明细)
      */
-    private BigDecimal nhjqxjclcsmx;
+    private Double nhjqxjclcsmx;
 
     /**
      * 年合计手动停机次数(明细)
      */
-    private BigDecimal nhjsdtjcsmx;
+    private Double nhjsdtjcsmx;
 
     /**
-     * 年合计性能次数(明细)
+     * 年合计并网次数(明细)
      */
-    private BigDecimal nhjxncsmx;
+    private Double nhjbwcsmx;
 
     /**
      * 年合计限电停机次数(明细)
      */
-    private BigDecimal nhjxdtjcsmx;
+    private Double nhjxdtjcsmx;
 
     /**
      * 年合计限电降出力次数(明细)
      */
-    private BigDecimal nhjxdjclcsmx;
+    private Double nhjxdjclcsmx;
 
     /**
      * 年合计场外受累电网次数(明细)
      */
-    private BigDecimal nhjcwsldwcsmx;
+    private Double nhjcwsldwcsmx;
 
     /**
      * 年合计场外受累天气次数(明细)
      */
-    private BigDecimal nhjcwsltqcsmx;
+    private Double nhjcwsltqcsmx;
 
     /**
      * 年合计离线次数(明细)
      */
-    private BigDecimal nhjlxcsmx;
+    private Double nhjlxcsmx;
 
     /**
      * 年合计通讯中断次数(明细)
      */
-    private BigDecimal nhjtxzdcsmx;
+    private Double nhjtxzdcsmx;
 
     /**
      * 年合计待机次数
      */
-    private BigDecimal nhjdjcs;
+    private Double nhjdjcs;
 
     /**
      * 年合计故障停机次数
      */
-    private BigDecimal nhjgztjcs;
+    private Double nhjgztjcs;
 
     /**
      * 年合计通讯中断次数
      */
-    private BigDecimal nhjtxzccs;
+    private Double nhjtxzdcs;
 
     /**
-     * 年合计维护停机次数
+     * 年合计检修停机次数
      */
-    private BigDecimal nhjwhtjcs;
+    private Double nhjjxtjcs;
 
     /**
      * 年合计限电次数
      */
-    private BigDecimal nhjxdcs;
+    private Double nhjxdcs;
 
     /**
      * 年合计运行次数
      */
-    private BigDecimal nhjyxcs;
+    private Double nhjyxcs;
+
+    /**
+     * 日合计受累次数
+     */
+    private Double rhjslcs;
+
+    /**
+     * 月合计受累次数
+     */
+    private Double yhjslcs;
+
+    /**
+     * 年合计受累次数
+     */
+    private Double nhjslcs;
 
 
 }

+ 27 - 22
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay4.java

@@ -1,8 +1,8 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -28,12 +28,12 @@ public class ProEconPowerstationInfoDay4 extends Model {
     /**
      * 外键编号
      */
-    private String foreignkeyid;
+    private String foreignKeyId;
 
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 类型
@@ -66,94 +66,99 @@ public class ProEconPowerstationInfoDay4 extends Model {
     private String regionId;
 
     /**
+     * 所属位置(区域、区域风、区域光、公司、公司、公司风、公司光、场站、期次、线路)
+     */
+    private String location;
+
+    /**
      * 日MTBF
      */
-    private BigDecimal rmtbf;
+    private Double rmtbf;
 
     /**
      * 日MTTR
      */
-    private BigDecimal rmttr;
+    private Double rmttr;
 
     /**
      * 日MTTF
      */
-    private BigDecimal rmttf;
+    private Double rmttf;
 
     /**
      * 日复位及时率
      */
-    private BigDecimal rfwjsl;
+    private Double rfwjsl;
 
     /**
      * 日状态转换及时率
      */
-    private BigDecimal rztzhjsl;
+    private Double rztzhjsl;
 
     /**
      * 日故障消缺及时率
      */
-    private BigDecimal rgzxqjsl;
+    private Double rgzxqjsl;
 
     /**
      * 月MTBF
      */
-    private BigDecimal ymtbf;
+    private Double ymtbf;
 
     /**
      * 月MTTR
      */
-    private BigDecimal ymttr;
+    private Double ymttr;
 
     /**
      * 月MTTF
      */
-    private BigDecimal ymttf;
+    private Double ymttf;
 
     /**
      * 月复位及时率
      */
-    private BigDecimal yfwjsl;
+    private Double yfwjsl;
 
     /**
      * 月状态转换及时率
      */
-    private BigDecimal yztzhjsl;
+    private Double yztzhjsl;
 
     /**
      * 月故障消缺及时率
      */
-    private BigDecimal ygzxqjsl;
+    private Double ygzxqjsl;
 
     /**
      * 年MTBF
      */
-    private BigDecimal nmtbf;
+    private Double nmtbf;
 
     /**
      * 年MTTR
      */
-    private BigDecimal nmttr;
+    private Double nmttr;
 
     /**
      * 年MTTF
      */
-    private BigDecimal nmttf;
+    private Double nmttf;
 
     /**
      * 年复位及时率
      */
-    private BigDecimal nfwjsl;
+    private Double nfwjsl;
 
     /**
      * 年状态转换及时率
      */
-    private BigDecimal nztzhjsl;
+    private Double nztzhjsl;
 
     /**
      * 年故障消缺及时率
      */
-    private BigDecimal ngzxqjsl;
+    private Double ngzxqjsl;
 
 
 }

+ 27 - 22
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay5.java

@@ -1,8 +1,8 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -28,12 +28,12 @@ public class ProEconPowerstationInfoDay5 extends Model {
     /**
      * 外键编号
      */
-    private String foreignkeyid;
+    private String foreignKeyId;
 
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 类型
@@ -66,94 +66,99 @@ public class ProEconPowerstationInfoDay5 extends Model {
     private String regionId;
 
     /**
+     * 所属位置(区域、区域风、区域光、公司、公司、公司风、公司光、场站、期次、线路)
+     */
+    private String location;
+
+    /**
      * 日发电量(电表)
      */
-    private BigDecimal rfdldb;
+    private Double rfdldb;
 
     /**
      * 日上网电量(电表)
      */
-    private BigDecimal rswdldb;
+    private Double rswdldb;
 
     /**
      * 日工网购网电量(电表)
      */
-    private BigDecimal rgwgwdldb;
+    private Double rgwgwdldb;
 
     /**
      * 日农网购网电量(电表)
      */
-    private BigDecimal rnwgwdldb;
+    private Double rnwgwdldb;
 
     /**
      * 日综合场用电量(电表)
      */
-    private BigDecimal rzhcydldb;
+    private Double rzhcydldb;
 
     /**
      * 日发电厂用电量(电表)
      */
-    private BigDecimal rfdcydldb;
+    private Double rfdcydldb;
 
     /**
      * 月发电量(电表)
      */
-    private BigDecimal yfdldb;
+    private Double yfdldb;
 
     /**
      * 月上网电量(电表)
      */
-    private BigDecimal yswdldb;
+    private Double yswdldb;
 
     /**
      * 月工网购网电量(电表)
      */
-    private BigDecimal ygwgwdldb;
+    private Double ygwgwdldb;
 
     /**
      * 月农网购网电量(电表)
      */
-    private BigDecimal ynwgwdldb;
+    private Double ynwgwdldb;
 
     /**
      * 月综合场用电量(电表)
      */
-    private BigDecimal yzhcydldb;
+    private Double yzhcydldb;
 
     /**
      * 月发电厂用电量(电表)
      */
-    private BigDecimal yfdcydldb;
+    private Double yfdcydldb;
 
     /**
      * 年发电量(电表)
      */
-    private BigDecimal nfdldb;
+    private Double nfdldb;
 
     /**
      * 年上网电量(电表)
      */
-    private BigDecimal nswdldb;
+    private Double nswdldb;
 
     /**
      * 年工网购网电量(电表)
      */
-    private BigDecimal ngwgwdldb;
+    private Double ngwgwdldb;
 
     /**
      * 年农网购网电量(电表)
      */
-    private BigDecimal nnwgwdldb;
+    private Double nnwgwdldb;
 
     /**
      * 年综合场用电量(电表)
      */
-    private BigDecimal nzhcydldb;
+    private Double nzhcydldb;
 
     /**
      * 年发电厂用电量(电表)
      */
-    private BigDecimal nfdcydldb;
+    private Double nfdcydldb;
 
 
 }

+ 27 - 22
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay6.java

@@ -1,8 +1,8 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -28,12 +28,12 @@ public class ProEconPowerstationInfoDay6 extends Model {
     /**
      * 外键编号
      */
-    private String foreignkeyid;
+    private String foreignKeyId;
 
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 类型
@@ -66,94 +66,99 @@ public class ProEconPowerstationInfoDay6 extends Model {
     private String regionId;
 
     /**
+     * 所属位置(区域、区域风、区域光、公司、公司、公司风、公司光、场站、期次、线路)
+     */
+    private String location;
+
+    /**
      * 日最大风速(测风塔)
      */
-    private BigDecimal rzdfscft;
+    private Double rzdfscft;
 
     /**
      * 日最小风速(测风塔)
      */
-    private BigDecimal rzxfdcft;
+    private Double rzxfscft;
 
     /**
      * 日最大功率(出线)
      */
-    private BigDecimal rzdglcx;
+    private Double rzdglcx;
 
     /**
      * 日最小功率(出线)
      */
-    private BigDecimal rzxglcx;
+    private Double rzxglcx;
 
     /**
      * 日平均功率(出线)
      */
-    private BigDecimal rpjglcx;
+    private Double rpjglcx;
 
     /**
      * 日平均风速(测风塔)
      */
-    private BigDecimal rpjfscft;
+    private Double rpjfscft;
 
     /**
      * 月最大风速(测风塔)
      */
-    private BigDecimal yzdfscft;
+    private Double yzdfscft;
 
     /**
      * 月最小风速(测风塔)
      */
-    private BigDecimal yzxfdcft;
+    private Double yzxfscft;
 
     /**
      * 月最大功率(出线)
      */
-    private BigDecimal yzdglcx;
+    private Double yzdglcx;
 
     /**
      * 月最小功率(出线)
      */
-    private BigDecimal yzxglcx;
+    private Double yzxglcx;
 
     /**
      * 月平均功率(出线)
      */
-    private BigDecimal ypjglcx;
+    private Double ypjglcx;
 
     /**
      * 月平均风速(测风塔)
      */
-    private BigDecimal ypjfscft;
+    private Double ypjfscft;
 
     /**
      * 年最大风速(测风塔)
      */
-    private BigDecimal nzdfscft;
+    private Double nzdfscft;
 
     /**
      * 年最小风速(测风塔)
      */
-    private BigDecimal nzxfdcft;
+    private Double nzxfscft;
 
     /**
      * 年最大功率(出线)
      */
-    private BigDecimal nzdglcx;
+    private Double nzdglcx;
 
     /**
      * 年最小功率(出线)
      */
-    private BigDecimal nzxglcx;
+    private Double nzxglcx;
 
     /**
      * 年平均功率(出线)
      */
-    private BigDecimal npjglcx;
+    private Double npjglcx;
 
     /**
      * 年平均风速(测风塔)
      */
-    private BigDecimal npjfscft;
+    private Double npjfscft;
 
 
 }

+ 18 - 13
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconPowerstationInfoDay7.java

@@ -1,8 +1,8 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -28,12 +28,12 @@ public class ProEconPowerstationInfoDay7 extends Model {
     /**
      * 外键编号
      */
-    private String foreignkeyid;
+    private String foreignKeyId;
 
     /**
      * 日期
      */
-    private LocalDate recorddate;
+    private Date recordDate;
 
     /**
      * 类型
@@ -66,49 +66,54 @@ public class ProEconPowerstationInfoDay7 extends Model {
     private String regionId;
 
     /**
+     * 所属位置(区域、区域风、区域光、公司、公司、公司风、公司光、场站、期次、线路)
+     */
+    private String location;
+
+    /**
      * 日系统效率(PR)
      */
-    private BigDecimal rxtxlpr;
+    private Double rxtxlpr;
 
     /**
      * 日离散率
      */
-    private BigDecimal rlsl;
+    private Double rlsl;
 
     /**
      * 日逆变器转换效率
      */
-    private BigDecimal rnbqzhxl;
+    private Double rnbqzhxl;
 
     /**
      * 月系统效率(PR)
      */
-    private BigDecimal yxtxlpr;
+    private Double yxtxlpr;
 
     /**
      * 月离散率
      */
-    private BigDecimal ylsl;
+    private Double ylsl;
 
     /**
      * 月逆变器转换效率
      */
-    private BigDecimal ynbqzhxl;
+    private Double ynbqzhxl;
 
     /**
      * 年系统效率(PR)
      */
-    private BigDecimal nxtxlpr;
+    private Double nxtxlpr;
 
     /**
      * 年离散率
      */
-    private BigDecimal nlsl;
+    private Double nlsl;
 
     /**
      * 年逆变器转换效率
      */
-    private BigDecimal nnbqzhxl;
+    private Double nnbqzhxl;
 
 
 }

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconTestingPoint.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.model.auto;
 
-import java.math.BigDecimal;
+
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -27,7 +27,7 @@ public class ProEconTestingPoint extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 名称

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconUniformCode.java

@@ -26,7 +26,7 @@ public class ProEconUniformCode extends Model {
     /**
      * 编码
      */
-    private String code;
+    private String nemCode;
 
     /**
      * 说明

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWindpowerStandardPoint.java

@@ -20,7 +20,7 @@ public class ProEconWindpowerStandardPoint extends Model {
 
     private String id;
 
-    private String code;
+    private String nemCode;
 
     private String name;
 

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWindturbineStandardPoint.java

@@ -20,7 +20,7 @@ public class ProEconWindturbineStandardPoint extends Model {
 
     private String id;
 
-    private String code;
+    private String nemCode;
 
     private String name;
 

+ 6 - 10
realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/CureFittingVo.java

@@ -13,19 +13,15 @@ public class CureFittingVo {
     private String pointIdFS;
     
     private String pointIdZT;
-   
-
-    private String pointIdZT2;
-    
 
     private String standardId;
     
-    private List<PointVo> myPoints1;
-    
-    private List<PointVo> myPointsFF1;
-   
-    private List<PointVo> myPoints2;
+    private List<PointVo> ysjglPoints;
     
-    private List<PointVo> myPointsFF2;
+    private List<PointVo> yzyglPoints;
+
+    private List<PointVo> rsjglPoints;
+
+    private List<PointVo> rzyglPoints;
     
 }

+ 26 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/FitClassVo.java

@@ -0,0 +1,26 @@
+package com.gyee.generation.model.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class FitClassVo {
+
+    //型号id
+    private String modelId;
+    //风场id
+    private String windpowerstationId;
+    //风机id
+    private String windturbineId;
+    //风速
+    private Double speed;
+    //功率
+    private Double power;
+    //排名
+    private Integer number;
+    //拟合优度
+    private Double epower;
+    
+
+}

+ 152 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/ActivePowerService.java

@@ -0,0 +1,152 @@
+package com.gyee.generation.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+
+import com.gyee.generation.service.auto.*;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.StringUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class ActivePowerService {
+
+
+    private static final Logger logger = LoggerFactory.getLogger(ActivePowerService.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconEquipmentInfo15minuteService proEconEquipmentInfo15minuteService;
+
+    @Resource
+    private IProEconActivePowerDataService proEconActivePowerDataService;
+
+    @Resource
+    private IProEconWtPowerCurveFittingService proEconWtPowerCurveFittingService;
+
+
+    public void calcActivePowerData(Date currentDate) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(currentDate);
+        Date beginDate = DateUtils.truncate(currentDate);
+        c.add(Calendar.DAY_OF_MONTH,1);
+        Date endDate=c.getTime();
+        for (ProBasicWindpowerstation station : CacheContext.wpls) {
+
+            List<ProEconEquipmentInfo15minute> ei15ls = proEconEquipmentInfo15minuteService.list().stream()
+                    .filter(i -> i.getWindpowerstationId().equals(station)
+                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
+                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+                    ).collect(Collectors.toList());
+
+
+
+            Map<String/*风机编号*/, Map<Double/*风速*/, List<Double>>> map =
+                    new HashMap<String, Map<Double, List<Double>>>();
+
+
+            Map<Double/*风速*/, List<Double>> speedMap;
+            for (ProEconEquipmentInfo15minute item : ei15ls) {
+
+                if (map.containsKey(item.getWindturbineId())) {
+                    speedMap = map.get(item.getWindturbineId());
+                } else {
+                    speedMap = new HashMap<Double, List<Double>>();
+                    map.put(item.getWindturbineId(), speedMap);
+                }
+                Double speed = StringUtils.round(item.getFpjfs(), 2);
+                if (speed > item.getFpjfs()) {
+
+                    if (speed - item.getFpjfs() > 0.25) {
+                        speed -= 0.5;
+                    } else if (speed - item.getFpjfs() > 0.175) {
+                        speed -= 0.25;
+                    }
+                } else if (speed < item.getFpjfs()) {
+                    if (item.getFpjfs() - speed > 0.25) {
+                        speed += 0.5;
+                    } else if (item.getFpjfs() - speed > 0.175) {
+                        speed += 0.25;
+                    }
+                }
+                if ((item.getFpjgl() > 0 && item.getFpjfs() >= 3) || (item.getFpjfs() <= 3)) {
+                    List<Double> powers;
+                    if (speedMap.containsKey(speed)) {
+                        powers = speedMap.get(speed);
+                    } else {
+                        powers = new ArrayList<>();
+                        speedMap.put(speed, powers);
+                    }
+                    powers.add(item.getFpjgl());
+                }
+
+            }
+            for (String windturbineId : map.keySet()) {
+                List<ProEconActivePowerData> dataList = new ArrayList<ProEconActivePowerData>();
+                Map<Double/*风速*/, List<Double>> intnalMap = map.get(windturbineId);
+                for (Double speed : intnalMap.keySet()) {
+                    List<Double> powers = intnalMap.get(speed);
+
+                    Optional<ProEconActivePowerData> data = proEconActivePowerDataService.list().stream()
+                            .filter(i -> i.getWindturbineId().equals(windturbineId)
+                                    && i.getRecordDate().compareTo(beginDate) == 0
+                                    && i.getSpeed() == speed
+                            ).findFirst();
+
+                    ProEconActivePowerData apdata = new ProEconActivePowerData();
+                    if (!data.isPresent()) {
+
+                        QueryWrapper<ProEconActivePowerData> wrapper = new QueryWrapper<>();
+                        wrapper.eq("id", data.get().getId());
+                        proEconActivePowerDataService.remove(wrapper);
+
+                    }
+
+                    apdata = new ProEconActivePowerData();
+                    buildActivePowerData(beginDate, station.getId(), windturbineId, speed, powers, apdata);
+                    proEconActivePowerDataService.save(apdata);
+
+                    dataList.add(apdata);
+                }
+            }
+
+        }
+    }
+
+    private void buildActivePowerData(Date beginDate, String station, String windturbineId, Double speed, List<Double> powers, ProEconActivePowerData data) {
+        data.setWindturbineId(windturbineId);
+        data.setWindpowerstationId(station);
+        DoubleSummaryStatistics summaryStatistics = powers.stream().mapToDouble(n -> n).summaryStatistics();
+        data.setPower(summaryStatistics.getAverage());
+        data.setSpeed(speed);
+        data.setFrequency(powers.size());
+        data.setRecordDate(beginDate);
+
+        if (CacheContext.wtmap.containsKey(windturbineId)) {
+            ProBasicWindturbine wt = CacheContext.wtmap.get(windturbineId);
+            data.setModelId(wt.getModelId());
+            data.setWindturbineCode(wt.getNemCode());
+
+        }
+
+        if (StringUtils.notEmp(data.getModelId()) && CacheContext.modelMap.containsKey(data.getModelId())) {
+            ProEconEquipmentmodel em = CacheContext.modelMap.get(data.getModelId());
+            data.setModelName(em.getName());
+
+        }
+
+    }
+
+
+}
+

+ 295 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/CoefficientService.java

@@ -0,0 +1,295 @@
+package com.gyee.generation.service;
+
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.service.auto.IProEconActivePowerDataService;
+import com.gyee.generation.service.auto.IProEconEquipmentInfoDay1Service;
+import com.gyee.generation.service.auto.IProEconEquipmentInfoDay2Service;
+import com.gyee.generation.service.auto.IProEconWtPowerCurveFittingService;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.StringUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class CoefficientService {
+
+
+        private static final Logger logger = LoggerFactory.getLogger(CoefficientService.class);
+        @Resource
+        private IEdosUtil edosUtil;
+
+        @Resource
+        private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
+        private IProEconEquipmentInfoDay2Service proEconEquipmentInfoDay2Service;
+
+        private IProEconActivePowerDataService proEconActivePowerDataService;
+
+
+        private IProEconWtPowerCurveFittingService proEconWtPowerCurveFittingService;
+
+
+
+
+    public  Map<String,Map<String,Double>>  coefficient(Date currentDate)
+    {
+        //调度时间是第二天,currentDate 是第一天
+
+        currentDate = DateUtils.truncDay(currentDate);
+
+        Calendar c= Calendar.getInstance();
+        c.setTime(currentDate);
+
+        c.set(Calendar.DAY_OF_MONTH,1);
+        Date monthbeginDate = c.getTime();
+        c.set(Calendar.MONTH,0);
+        Date yearbeginDate = c.getTime();
+
+        c.setTime(currentDate);
+        Date beginDate = c.getTime();
+        c.add(Calendar.DAY_OF_MONTH,1);
+        Date endDate = c.getTime();
+
+        Map<String,Map<String,Double>> resultmap =new HashMap<>();
+            //查询风机
+            List<ProBasicWindturbine> wtls = CacheContext.wtls;
+
+            //遍历所有风机ID
+            for (ProBasicWindturbine wt : wtls)
+            {
+
+                Map<String/*风机编号*/, Map<Double/*风速*/, List<Double>/*对应功率集合*/>> map =
+                        new HashMap<String, Map<Double, List<Double>>>();
+
+/**********************************************年功率一致性统计***************************************************************/
+
+                List<ProEconActivePowerData> yearList = new ArrayList<ProEconActivePowerData>();
+
+
+                List<ProEconActivePowerData> queryYear =proEconActivePowerDataService.list().stream().filter(i->i.getWindturbineId().equals(wt.getId())
+                        && ( i.getRecordDate().compareTo(yearbeginDate)==0 || i.getRecordDate().after(yearbeginDate))
+                        && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+                ).collect(Collectors.toList());
+
+                yearList=calCoefficient(queryYear,wt);
+
+/*****************************************月功率一致性统计********************************************************************/
+
+                List<ProEconActivePowerData> monthList = new ArrayList<ProEconActivePowerData>();
+                List<ProEconActivePowerData> queryMonth =queryYear.stream().filter(i->i.getWindturbineId().equals(wt.getId())
+                        && ( i.getRecordDate().compareTo(monthbeginDate)==0 || i.getRecordDate().after(monthbeginDate))
+                        && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+                ).collect(Collectors.toList());
+
+                monthList=calCoefficient(queryMonth,wt);
+
+
+
+/*****************************************日功率一致性统计********************************************************************/
+
+
+                List<ProEconActivePowerData> dayList = new ArrayList<ProEconActivePowerData>();
+
+
+                List<ProEconActivePowerData> queryDay =queryMonth.stream().filter(i->i.getWindturbineId().equals(wt.getId())
+                                && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
+                                && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+                        ).collect(Collectors.toList());
+
+                dayList=calCoefficient(queryDay,wt);
+
+
+
+                Double resultYear = coefficient(yearList, currentDate, wt.getId());
+                Double resultMonth = coefficient(monthList, currentDate, wt.getId());
+                Double resultDay = coefficient(dayList, currentDate, wt.getId());
+
+                Map<String,Double> tempmap=new HashMap<>();
+                tempmap.put("year",resultYear);
+                tempmap.put("month",resultMonth);
+                tempmap.put("day",resultDay);
+                resultmap.put(wt.getId(),tempmap);
+
+            }
+
+
+
+            return resultmap;
+    }
+
+
+    private List<ProEconActivePowerData> calCoefficient(List<ProEconActivePowerData> query,ProBasicWindturbine wt)
+    {
+
+
+        Map<Double, List<ProEconActivePowerData>> apdataYearMap = query.stream().collect(Collectors.groupingBy(ProEconActivePowerData::getSpeed));
+
+
+        Map<Double, Double> speedAndPowerYearMap=new HashMap<Double, Double>();
+        apdataYearMap.forEach((key,value)->{
+            DoubleSummaryStatistics summaryStatistics=value.stream().mapToDouble(n -> n.getPower()).summaryStatistics();
+            speedAndPowerYearMap.put(key,summaryStatistics.getAverage());
+        });
+
+        List<ProEconActivePowerData> yearList = new ArrayList<ProEconActivePowerData>();
+
+
+
+        speedAndPowerYearMap.forEach((key,value)->{
+
+            ProEconActivePowerData activepowerdata= new ProEconActivePowerData();
+            activepowerdata.setWindturbineId(wt.getId());
+            activepowerdata.setSpeed(key);
+            activepowerdata.setPower(value);
+            activepowerdata.setFrequency(1);
+            activepowerdata.setModelId(wt.getModelId());
+
+            yearList.add(activepowerdata);
+        });
+
+        return yearList;
+
+    }
+
+
+    //功率一致性系数
+    private Double coefficient(List<ProEconActivePowerData> dataList, Date currentDate, String windturbineId)
+    {
+        Double result=0.0;
+        Double count =0.0;
+
+        if (dataList != null && dataList.size() != 0)
+        {
+
+            List<ProEconWtPowerCurveFitting> powerList = null;
+  
+                Calendar c=Calendar.getInstance();
+                c.setTime(currentDate);
+                String year =String.valueOf(c.get(Calendar.YEAR));
+                String month = String.valueOf(c.get(Calendar.MONTH)+1);
+
+                powerList = proEconWtPowerCurveFittingService.list().stream()
+                        .filter(i->i.getWindturbineId().equals(windturbineId)).collect(Collectors.toList());
+
+      
+
+
+            for (ProEconActivePowerData data : dataList)
+            {
+                Double p1 = data.getPower();
+                Double speed = data.getSpeed();
+                if (speed < 3 || speed > 25)
+                {
+                    continue;
+                }
+                
+                if (CacheContext.wtmap.containsKey(windturbineId))
+                {
+                    ProBasicWindturbine wt=CacheContext.wtmap.get(windturbineId);
+
+                    if (wt.getWindpowerstationId().contains("GDC"))
+                    {
+                        speed /= 100;
+                        speed = StringUtils.round(speed, 2);
+                        speed *= 100;
+
+                        speed = StringUtils.round(speed, 2);
+                    }
+                    else
+                    {
+                        speed = StringUtils.round(speed, 2);
+                    }
+                }
+      
+
+
+
+                if (CacheContext.modelpowermap.containsKey(data.getModelId()))
+                {
+                    if (CacheContext.modelpowermap.get(data.getModelId()).size() > 0)
+                    {
+                        if (CacheContext.modelpowermap.get(data.getModelId()).containsKey(speed))
+                        {
+                            Double p = CacheContext.modelpowermap.get(data.getModelId()).get(speed).getEnsurePower();
+
+
+                            if (p != 0)
+                            {
+                                for (int i = 0; i < data.getFrequency(); i++)
+                                {
+                                    result += Math.abs((p - p1) / p);
+                                    count += 1;
+                                }
+                            }
+                        }
+                    }
+                    else
+                    {
+                        if (powerList != null && powerList.size() > 0)
+                        {
+                            Double finalSpeed = speed;
+                            OptionalDouble opd = powerList.stream().filter(i->i.getSpeed()== finalSpeed).mapToDouble(x->x.getOptimalPower()).findFirst();
+
+
+                            double p=0.0;
+                            if (opd.isPresent())
+                            {
+                                p=opd.getAsDouble();
+                                if (p != 0)
+                                {
+                                    for (int i = 0; i < data.getFrequency(); i++)
+                                    {
+                                        result += Math.abs((p- p1) / p);
+                                        count += 1;
+                                    }
+                                }
+                            }
+                            else
+                            {
+
+                                DoubleSummaryStatistics summaryStatistics=powerList.stream().mapToDouble(ProEconWtPowerCurveFitting::getSpeed).summaryStatistics();
+
+                                Double max = summaryStatistics.getMax();
+                                if (speed > max)
+                                {
+                                    summaryStatistics=powerList.stream().mapToDouble(ProEconWtPowerCurveFitting::getActualPower).summaryStatistics();
+                                    p = summaryStatistics.getMax();
+                                    if (p != 0.0)
+                                    {
+
+                                        if (p != 0)
+                                        {
+                                            for (int i = 0; i < data.getFrequency(); i++)
+                                            {
+                                                result += Math.abs((p - p1) / p);
+                                                count += 1;
+                                            }
+                                        }
+                                    }
+                                }
+
+                            }
+
+                        }
+                    }
+                }
+
+            }
+            if (count != 0)
+                result = result / count * 100;
+            else
+                result = 100.0;
+        }
+
+        return result;
+
+    }
+}
+
+

+ 524 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo15minuteService.java

@@ -0,0 +1,524 @@
+package com.gyee.generation.service;//package com.gyee.generation.service;
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
+import com.gyee.generation.model.auto.ProBasicWindturbine;
+import com.gyee.generation.model.auto.ProEconEquipmentInfo15minute;
+import com.gyee.generation.service.auto.IProEconEquipmentInfo15minuteService;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.statisticcs.Initial;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class EquipmentInfo15minuteService {
+
+    private static final Logger logger = LoggerFactory.getLogger(EquipmentInfo15minuteService.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconEquipmentInfo15minuteService proEconEquipmentInfo15minuteService;
+
+
+
+    /**
+     * 计算设备15分钟信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calLineInfoMinute15(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+        c.add(Calendar.MINUTE,-15);
+        Date begin= DateUtils.truncDay(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconEquipmentInfo15minuteService.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.wtmap.containsKey(i.getWindturbineId())
+           ).map(ProEconEquipmentInfo15minute::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconEquipmentInfo15minuteService.removeByIds(idls);
+
+        }
+        for(ProBasicWindturbine wt:CacheContext.wtls)
+        {
+            if(CacheContext.wppointmap.containsKey(wt.getId()))
+            {
+                Map<String, ProBasicEquipmentPoint> pointmap=CacheContext.wtpAimap.get(wt.getId());
+
+                ProEconEquipmentInfo15minute pewp=new ProEconEquipmentInfo15minute();
+                Initial.initial(pewp);
+                pewp.setCompanyId(wt.getCompanyId());
+                pewp.setWindpowerstationId(wt.getWindpowerstationId());
+                pewp.setLineId(wt.getLineId());
+                pewp.setProjectId(wt.getProjectId());
+                pewp.setRegionId(wt.getRegionId());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+
+
+
+                if(pointmap.containsKey(ContantXk.SSPJFS))
+                {
+                    ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSPJFS);
+                    List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                    if(!pointls.isEmpty())
+                    {
+                        DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
+                        //15分钟平均风速
+                        pewp.setFpjfs(summaryStatistics.getAverage());
+                    }
+
+                }
+
+                if(pointmap.containsKey(ContantXk.SSZGL))
+                {
+                    ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSZGL);
+                    List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                    if(!pointls.isEmpty())
+                    {
+                        DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
+                        //15分钟平均功率
+                        pewp.setFpjgl(summaryStatistics.getAverage());
+                    }
+                }
+
+
+                if(pointmap.containsKey(ContantXk.RFDL))
+                {
+                    ProBasicEquipmentPoint point= pointmap.get(ContantXk.RFDL);
+
+                    PointData beginValue=edosUtil.getHistMatrix(point.getNemCode(), begin.getTime()/1000);
+                    PointData endValue=edosUtil.getHistMatrix(point.getNemCode(), end.getTime()/1000);
+                    if(StringUtils.notEmp(beginValue)  && StringUtils.notEmp(endValue))
+                    {
+                        //15分钟发电量
+                        pewp.setFfdl(StringUtils.round(endValue.getPointValueInDouble()-beginValue.getPointValueInDouble(),2));
+
+                    }
+                }
+
+                calDetiall( pewp, end, begin, wt);
+                calSimple( pewp, end, begin, wt);
+                proEconEquipmentInfo15minuteService.save(pewp);
+
+            }
+
+
+        }
+
+    }
+
+    private void calDetiall(ProEconEquipmentInfo15minute pewp,Date end, Date begin,ProBasicWindturbine wt) throws Exception {
+        //        //                0	待机
+//                1	手动停机
+//                2	正常发电
+//                3	发电降出力
+//                4	故障
+//                5	故障受累
+//                6	检修
+//                7	检修受累
+//                8	限电降出力
+//                9	限电停机
+//                10	电网受累
+//                11	环境受累
+//                12	通讯中断
+//                13	设备离线
+
+        double lastState=-1;//上一分钟状态
+
+        double djsc=0;//待机时长
+        double sdtjsc=0;//手动停机时长
+        double zcfdsc=0;//正常发电时长
+        double fdjclsc=0;//发电降出力时长
+        double gzsc=0;//故障时长
+        double gzslsc=0;//故障受累时长
+        double jxsc=0;//检修时长
+        double jxslsc=0;//检修受累时长
+        double xdjclsc=0;//限电降出力时长
+        double xdtjsc=0;//限电停机时长
+        double dwslsc=0;//电网受累时长
+        double hjslsc=0;//环境受累时长
+        double txzdsc=0;//通讯中断时长
+        double sblxsc=0;//设备离线时长
+
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+
+
+            lastState=-1;//上一分钟状态
+            Map<String, ProBasicEquipmentPoint> aimap=wtpAimap.get(wt.getNemCode());
+            if(wtpAimap.containsKey(ContantXk.MXZT));
+            {
+
+                ProBasicEquipmentPoint point=aimap.get(ContantXk.MXZT);
+                 //按照分钟时间进行统计状态快照值
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    for(PointData po :pointls)
+                    {
+
+                        if(po.getPointValueInDouble()==0)
+                        {
+
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //待机时长加1分钟
+                            djsc++;
+                        }else  if(po.getPointValueInDouble()==1)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //手动停机时长加1分钟
+                            sdtjsc++;
+                        }else  if(po.getPointValueInDouble()==2)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //正常发电时长加1分钟
+                            zcfdsc++;
+                        }else  if(po.getPointValueInDouble()==3)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //发电降出力时长加1分钟
+                            fdjclsc++;
+                        }else  if(po.getPointValueInDouble()==4)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //故障时长加1分钟
+                            gzsc++;
+                        }else  if(po.getPointValueInDouble()==5)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //故障受累时长加1分钟
+                            gzslsc++;
+                        }else  if(po.getPointValueInDouble()==6)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //检修时长加1分钟
+                            jxsc++;
+                        }else  if(po.getPointValueInDouble()==7)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //检修受累时长加1分钟
+                            jxslsc++;
+                        }else  if(po.getPointValueInDouble()==8)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //限电降出力时长加1分钟
+                            xdjclsc++;
+                        }else  if(po.getPointValueInDouble()==9)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //限电停机时长加1分钟
+                            xdtjsc++;
+                        }else  if(po.getPointValueInDouble()==10)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //电网受累时长加1分钟
+                            dwslsc++;
+                        }else  if(po.getPointValueInDouble()==11)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //环境受累时长加1分钟
+                            hjslsc++;
+                        }else  if(po.getPointValueInDouble()==12)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //通讯中断时长加1分钟
+                            txzdsc++;
+                        }else  if(po.getPointValueInDouble()==13)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //设备离线时长加1分钟
+                            sblxsc++;
+                        }
+
+                    }
+
+
+
+                }
+
+            }
+   
+        //15分钟合计故障小时(明细)
+        pewp.setFgzxsmx(new BigDecimal(gzsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计场内受累故障小时(明细)
+        pewp.setFcnslgzxsmx(new BigDecimal(gzslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计检修小时(明细)
+        pewp.setFjxxsmx(new BigDecimal(jxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计场内受累检修小时(明细)
+        pewp.setFcnsljxxsmx(new BigDecimal(jxslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计待机小时(明细)
+        pewp.setFdjxsmx(new BigDecimal(djsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计缺陷降出力小时(明细)
+        pewp.setFqxjclxsmx(new BigDecimal(fdjclsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计手动停机小时(明细)
+        pewp.setFsdtjxsmx(new BigDecimal(sdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计性能小时(明细)
+        pewp.setFbwxsmx(new BigDecimal(zcfdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计限电停机小时(明细)
+        pewp.setFxdtjxsmx(new BigDecimal(xdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计限电降出力小时(明细)
+        pewp.setFxdjclxsmx(new BigDecimal(xdjclsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计场外受累电网小时(明细)
+        pewp.setFcwsldwxsmx(new BigDecimal(dwslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计场外受累电网小时(明细)
+        pewp.setFcwsltqxsmx(new BigDecimal(hjslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计通讯中断小时(明细)
+        pewp.setFtxzdxsmx(new BigDecimal(txzdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计离线小时(明细)
+        pewp.setFlxxsmx(new BigDecimal(sblxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+
+
+
+/*******************************************15分钟信息统计*********************************************************/
+
+
+
+
+
+    }
+
+
+
+        private void calSimple(ProEconEquipmentInfo15minute pewp,Date end, Date begin,ProBasicWindturbine wt) throws Exception {
+//        0	待机
+//        1	运行
+//        2	故障
+//        3	检修
+//        4	限电
+//        5	受累
+//        6	离线
+/*******************************************15分钟信息统计*********************************************************/
+
+            double lastState = -1;//上一分钟状态
+
+
+            double djsc = 0;//待机时长
+            double zcfdsc = 0;//正常发电时长
+            double gzsc = 0;//故障时长
+            double jxsc = 0;//检修时长
+            double xdtjsc = 0;//限电停机时长
+            double slsc = 0;//受累时长
+            double txzdsc = 0;//通讯中断时长
+
+
+            Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+
+
+            Map<String, ProBasicEquipmentPoint> aimap = wtpAimap.get(wt.getNemCode());
+            if (wtpAimap.containsKey(ContantXk.SBZT)) ;
+            {
+
+                ProBasicEquipmentPoint point = aimap.get(ContantXk.SBZT);
+                //按照分钟时间进行统计状态快照值
+                List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
+                if (!pointls.isEmpty()) {
+                    for (PointData po : pointls) {
+
+                        if (po.getPointValueInDouble() == 0) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //待机时长加1分钟
+                            djsc++;
+                        } else if (po.getPointValueInDouble() == 1) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //正常发电时长加1分钟
+                            zcfdsc++;
+                        } else if (po.getPointValueInDouble() == 2) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //故障时长加1分钟
+                            gzsc++;
+                        } else if (po.getPointValueInDouble() == 3) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //检修时长加1分钟
+                            jxsc++;
+
+                        } else if (po.getPointValueInDouble() == 4) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //限电停机时长加1分钟
+                            xdtjsc++;
+                        } else if (po.getPointValueInDouble() == 5) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //受累时长加1分钟
+                            slsc++;
+
+                        } else if (po.getPointValueInDouble() == 6) {
+                            if (lastState != po.getPointValueInDouble()) {
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //通讯中断时长加1分钟
+                            txzdsc++;
+                        }
+
+                    }
+
+                }
+
+
+            }
+
+
+            //15分钟合计待机小时
+            pewp.setFdjxs(new BigDecimal(gzsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计维护停机小时
+            pewp.setFjxtjxs(new BigDecimal(jxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            // 15分钟合计待机小时
+            pewp.setFdjxs(new BigDecimal(djsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计运行小时
+            pewp.setFyxxs(new BigDecimal(zcfdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计限电小时
+            pewp.setFxdxs(new BigDecimal(xdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计通讯中断小时
+            pewp.setFtxzdxs(new BigDecimal(txzdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计受累小时
+            pewp.setFslxs(new BigDecimal(slsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+
+
+            /*******************************************15分钟信息统计*********************************************************/
+        }
+
+
+}
+
+
+
+
+
+
+

+ 940 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java

@@ -0,0 +1,940 @@
+package com.gyee.generation.service;//package com.gyee.generation.service;
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.service.auto.IProEconEquipmentInfoDay1Service;
+
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.statisticcs.Initial;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class EquipmentInfo1Service {
+
+    private static final Logger logger = LoggerFactory.getLogger(EquipmentInfo1Service.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
+
+
+
+
+
+    /**
+     * 计算设备日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calEquipmentInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncDay(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconEquipmentInfoDay1Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconEquipmentInfoDay1::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconEquipmentInfoDay1Service.removeByIds(idls);
+
+        }
+        for(ProBasicWindturbine wt:CacheContext.wtls)
+        {
+            if(CacheContext.wtpAimap.containsKey(wt.getId()))
+            {
+                Map<String, ProBasicEquipmentPoint> pointmap=CacheContext.wtpAimap.get(wt.getId());
+
+                ProEconEquipmentInfoDay1 pewp=new ProEconEquipmentInfoDay1();
+                Initial.initial(pewp);
+                pewp.setCompanyId(wt.getCompanyId());
+                pewp.setWindpowerstationId(wt.getWindpowerstationId());
+                pewp.setLineId(wt.getLineId());
+                pewp.setProjectId(wt.getProjectId());
+                pewp.setRegionId(wt.getRegionId());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+
+                //昨日的统计结果
+                List<ProEconEquipmentInfoDay1> pepid1ls =new ArrayList<>();
+                Calendar cl=Calendar.getInstance();
+                cl.setTime(recordDate);
+                if(cl.get(Calendar.DAY_OF_MONTH)!=1)
+                {
+                    pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                                    && CacheContext.wtmap.containsKey(i.getWindturbineId())
+                            ).collect(Collectors.toList());
+                }
+                extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
+
+                proEconEquipmentInfoDay1Service.save(pewp);
+
+            }
+
+
+        }
+
+    }
+
+    private void extracted(Date recordDate, Date end, Date begin,Map<String, ProBasicEquipmentPoint> pointmap, ProEconEquipmentInfoDay1 pewp,List<ProEconEquipmentInfoDay1> pepid1ls) throws Exception {
+        /*******************************************日信息统计*********************************************************/
+        if(pointmap.containsKey(ContantXk.SSPJFS))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSPJFS);
+            List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+            if(!pointls.isEmpty())
+            {
+                DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
+                //日最大风速
+                pewp.setRzdfs(summaryStatistics.getMax());
+                //日最小风速
+                pewp.setRzxfs(summaryStatistics.getMin());
+                //日平均风速
+                pewp.setRpjfs(summaryStatistics.getAverage());
+            }
+
+        }
+
+        if(pointmap.containsKey(ContantXk.SSZGL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSZGL);
+            List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+            if(!pointls.isEmpty())
+            {
+                DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
+                //日最大功率
+                pewp.setRzdgl(summaryStatistics.getMax());
+                //日最小功率
+                pewp.setRzxgl(summaryStatistics.getMin());
+                //日平均功率
+                pewp.setRpjgl(summaryStatistics.getAverage());
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.RFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RFDL);
+
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日发电量
+                pewp.setRfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.RKYDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RKYDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日可用电量
+                pewp.setRkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.RLLFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RLLFDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日理论发电量
+                pewp.setRllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.RGZSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RGZSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日故障损失电量
+                pewp.setRgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.RCNSLGZSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RCNSLGZSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日场内受累故障损失电量
+                pewp.setRcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.RJXSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RJXSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日检修损失电量
+                pewp.setRjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.RCNSLJXSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RCNSLJXSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日场内受累检修损失电量
+                pewp.setRcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.RDJSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RDJSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日待机损失电量
+                pewp.setRdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.RQXJCLSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RQXJCLSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日缺陷降出力损失电量
+                pewp.setRqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.RSDTJSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RSDTJSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日手动停机损失电量
+                pewp.setRsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.RXNSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RXNSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日性能损失电量
+                pewp.setRxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.RXDTJSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RXDTJSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日限电停机损失电量
+                pewp.setRxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.RXDJCLSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RXDJCLSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日限电降出力损失电量
+                pewp.setRxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.RCWSLDWSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RCWSLDWSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日场外受累电网损失电量
+                pewp.setRcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.RCWSLTQSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RCWSLTQSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日场外受累天气损失电量
+                pewp.setRcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.RZFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RZFDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日增发电量
+                pewp.setRzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.RQFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RQFDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日欠发电量
+                pewp.setRqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.RZHD))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RZHD);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //日自耗电
+                pewp.setRzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+/*******************************************日信息统计*********************************************************/
+
+/*******************************************月信息统计*********************************************************/
+
+        if(pepid1ls.isEmpty())
+        {
+            setPowerandSpeedMonth(end, begin, pointmap, pewp);
+        }else
+        {
+
+
+            if(!pepid1ls.isEmpty())
+            {
+               ProEconEquipmentInfoDay1 pepid=pepid1ls.get(0);
+
+               //如果昨日大于今日最大功率
+                if(pepid.getYzdgl()> pewp.getRzdgl())
+                {
+                    pewp.setYzdgl(pepid.getRzdgl());
+                }else {
+                    pewp.setYzdgl(pewp.getRzdgl());
+                }
+                //如果昨日大于今日最大风速
+                if(pepid.getYzdfs()> pewp.getRzdfs())
+                {
+                    pewp.setYzdfs(pepid.getRzdfs());
+                }else
+                {
+                    pewp.setYzdfs(pewp.getRzdfs());
+                }
+
+                //如果昨日小于今日最小功率
+                if(pepid.getYzxgl()< pewp.getRzxgl())
+                {
+                    pewp.setYzxgl(pepid.getRzxgl());
+                }else
+                {
+                    pewp.setYzxgl(pewp.getRzxgl());
+                }
+                //如果昨日小于今日最小风速
+                if(pepid.getYzxfs()< pewp.getRzxfs())
+                {
+                    pewp.setYzxfs(pepid.getRzxfs());
+                }else
+                {
+                    pewp.setYzxfs(pewp.getRzxfs());
+                }
+                double   pjfs = new BigDecimal(pewp.getYpjfs()+pepid.getRpjfs()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
+
+                pewp.setYzxfs(pjfs);
+
+                double   pjgl = new BigDecimal(pewp.getYpjgl()+pepid.getRpjgl()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
+                pewp.setYzxgl(pjgl);
+
+            }else
+            {
+                setPowerandSpeedMonth(end, begin, pointmap, pewp);
+            }
+
+        }
+
+
+
+        if(pointmap.containsKey(ContantXk.YFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YFDL);
+
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月发电量
+                pewp.setYfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.YKYDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YKYDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月可用电量
+                pewp.setYkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.YLLFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YLLFDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月理论发电量
+                pewp.setYllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.YGZSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YGZSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月故障损失电量
+                pewp.setYgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.YCNSLGZSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YCNSLGZSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月场内受累故障损失电量
+                pewp.setYcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YJXSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YJXSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月检修损失电量
+                pewp.setYjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YCNSLJXSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YCNSLJXSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月场内受累检修损失电量
+                pewp.setYcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YDJSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YDJSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月待机损失电量
+                pewp.setYdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.YQXJCLSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YQXJCLSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月缺陷降出力损失电量
+                pewp.setYqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.YSDTJSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YSDTJSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月手动停机损失电量
+                pewp.setYsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.YXNSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YXNSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月性能损失电量
+                pewp.setYxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YXDTJSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YXDTJSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月限电停机损失电量
+                pewp.setYxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.YXDJCLSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YXDJCLSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月限电降出力损失电量
+                pewp.setYxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YCWSLDWSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YCWSLDWSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月场外受累电网损失电量
+                pewp.setYcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.YCWSLTQSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YCWSLTQSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月场外受累天气损失电量
+                pewp.setYcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YZFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YZFDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月增发电量
+                pewp.setYzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YQFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YQFDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月欠发电量
+                pewp.setYqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.YZHD))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.YZHD);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月自耗电
+                pewp.setYzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+/*******************************************月信息统计*********************************************************/
+
+/*******************************************年信息统计*********************************************************/
+        if(pepid1ls.isEmpty())
+        {
+            setPowerandSpeedYear(end, begin, pointmap, pewp);
+        }else
+        {
+
+            if(!pepid1ls.isEmpty())
+            {
+                ProEconEquipmentInfoDay1 pepid=pepid1ls.get(0);
+
+                //如果昨日大于今日最大功率
+                if(pepid.getNzdgl()> pewp.getRzdgl())
+                {
+                    pewp.setNzdgl(pepid.getRzdgl());
+                }else {
+                    pewp.setNzdgl(pewp.getRzdgl());
+                }
+                //如果昨日大于今日最大风速
+                if(pepid.getNzdfs()> pewp.getRzdfs())
+                {
+                    pewp.setNzdfs(pepid.getRzdfs());
+                }else
+                {
+                    pewp.setNzdfs(pewp.getRzdfs());
+                }
+
+                //如果昨日小于今日最小功率
+                if(pepid.getNzxgl()< pewp.getRzxgl())
+                {
+                    pewp.setNzxgl(pepid.getRzxgl());
+                }else
+                {
+                    pewp.setNzxgl(pewp.getRzxgl());
+                }
+                //如果昨日小于今日最小风速
+                if(pepid.getNzxfs()< pewp.getRzxfs())
+                {
+                    pewp.setNzxfs(pepid.getRzxfs());
+                }else
+                {
+                    pewp.setNzxfs(pewp.getRzxfs());
+                }
+                double   pjfs = new BigDecimal(pewp.getNpjfs()+pepid.getRpjfs()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
+
+                pewp.setNzxfs(pjfs);
+
+                double   pjgl = new BigDecimal(pewp.getNpjgl()+pepid.getRpjgl()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
+                pewp.setNzxgl(pjgl);
+
+            }else
+            {
+                setPowerandSpeedYear(end, begin, pointmap, pewp);
+            }
+
+        }
+
+        if(pointmap.containsKey(ContantXk.NFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NFDL);
+
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年发电量
+                pewp.setNfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.NKYDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NKYDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年可用电量
+                pewp.setNkydl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.NLLFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NLLFDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年理论发电量
+                pewp.setNllfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.NGZSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NGZSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年故障损失电量
+                pewp.setNgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.NCNSLGZSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NCNSLGZSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年场内受累故障损失电量
+                pewp.setNcnslgzssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NJXSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NJXSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年检修损失电量
+                pewp.setNjxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NCNSLJXSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NCNSLJXSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年场内受累检修损失电量
+                pewp.setNcnsljxssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NDJSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NDJSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年待机损失电量
+                pewp.setNdjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.NQXJCLSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NQXJCLSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年缺陷降出力损失电量
+                pewp.setNqxjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.NSDTJSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NSDTJSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年手动停机损失电量
+                pewp.setNsdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.NXNSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NXNSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年性能损失电量
+                pewp.setNxnssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NXDTJSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NXDTJSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年限电停机损失电量
+                pewp.setNxdtjssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+        if(pointmap.containsKey(ContantXk.NXDJCLSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NXDJCLSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年限电降出力损失电量
+                pewp.setNxdjclssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NCWSLDWSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NCWSLDWSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年场外受累电网损失电量
+                pewp.setNcwsldwssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.NCWSLTQSSDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NCWSLTQSSDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年场外受累天气损失电量
+                pewp.setNcwsltqssdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NZFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NZFDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年增发电量
+                pewp.setNzfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NQFDL))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NQFDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年欠发电量
+                pewp.setNqfdl(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+        if(pointmap.containsKey(ContantXk.NZHD))
+        {
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.NZHD);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(), recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年自耗电
+                pewp.setNzhd(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+    }
+
+    private void setPowerandSpeedYear(Date end, Date begin, Map<String, ProBasicEquipmentPoint> pointmap, ProEconEquipmentInfoDay1 pewp) throws Exception {
+        //年最大风速
+        pewp.setNzdfs(pewp.getRzdfs());
+        //年最小风速
+        pewp.setNzxfs(pewp.getRzxfs());
+        //年平均风速
+        pewp.setNpjfs(pewp.getRpjfs());
+
+        //年最大功率
+        pewp.setNzdgl(pewp.getRzdgl());
+        //年最小功率
+        pewp.setNzxgl(pewp.getRzxgl());
+        //年平均功率
+        pewp.setNpjgl(pewp.getRpjgl());
+
+    }
+
+    private void setPowerandSpeedMonth(Date end, Date begin, Map<String, ProBasicEquipmentPoint> pointmap, ProEconEquipmentInfoDay1 pewp) throws Exception {
+
+        //月最大风速
+        pewp.setYzdfs(pewp.getRzdfs());
+        //月最小风速
+        pewp.setYzxfs(pewp.getRzxfs());
+        //月平均风速
+        pewp.setYpjfs(pewp.getRpjfs());
+
+        //月最大功率
+        pewp.setYzdgl(pewp.getRzdgl());
+        //月最小功率
+        pewp.setYzxgl(pewp.getRzxgl());
+        //月平均功率
+        pewp.setYpjgl(pewp.getRpjgl());
+    }
+
+
+}
+
+
+
+
+
+
+

+ 762 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo2Service.java

@@ -0,0 +1,762 @@
+package com.gyee.generation.service;//package com.gyee.generation.service;
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.service.auto.IProEconEquipmentInfoDay2Service;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.statisticcs.Initial;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class EquipmentInfo2Service {
+
+    private static final Logger logger = LoggerFactory.getLogger(EquipmentInfo2Service.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconEquipmentInfoDay2Service proEconEquipmentInfoDay2Service;
+
+
+
+    /**
+     * 计算设备日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calLineInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncDay(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconEquipmentInfoDay2Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.wtmap.containsKey(i.getWindturbineId())
+           ).map(ProEconEquipmentInfoDay2::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconEquipmentInfoDay2Service.removeByIds(idls);
+
+        }
+        for(ProBasicWindturbine wt:CacheContext.wtls)
+        {
+            if(CacheContext.wtpAimap.containsKey(wt.getId()))
+            {
+
+
+                ProEconEquipmentInfoDay2 pewp=new ProEconEquipmentInfoDay2();
+                Initial.initial(pewp);
+                pewp.setCompanyId(wt.getCompanyId());
+                pewp.setWindpowerstationId(wt.getWindpowerstationId());
+                pewp.setLineId(wt.getLineId());
+                pewp.setProjectId(wt.getProjectId());
+                pewp.setRegionId(wt.getRegionId());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                //昨日的统计结果
+                List<ProEconEquipmentInfoDay2> pepidls =new ArrayList<>();
+                Calendar cl=Calendar.getInstance();
+                cl.setTime(recordDate);
+                if(cl.get(Calendar.DAY_OF_MONTH)!=1)
+
+                {
+                    pepidls = proEconEquipmentInfoDay2Service.list().stream()
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                                    && i.getWindturbineId().equals(wt.getId())
+                            )
+                            .collect(Collectors.toList());
+                }
+                calDetiall( pewp, end, begin, wt,pepidls);
+                calSimple( pewp, end, begin, wt,pepidls);
+                proEconEquipmentInfoDay2Service.save(pewp);
+
+            }
+
+
+        }
+
+    }
+
+    private void calDetiall(ProEconEquipmentInfoDay2 pewp,Date end, Date begin,ProBasicWindturbine wt,List<ProEconEquipmentInfoDay2> pepidls) throws Exception {
+        //        //                0	待机
+//                1	手动停机
+//                2	正常发电
+//                3	发电降出力
+//                4	故障
+//                5	故障受累
+//                6	检修
+//                7	检修受累
+//                8	限电降出力
+//                9	限电停机
+//                10	电网受累
+//                11	环境受累
+//                12	通讯中断
+//                13	设备离线
+
+        double lastState=-1;//上一分钟状态
+
+        double djsc=0;//待机时长
+        double sdtjsc=0;//手动停机时长
+        double zcfdsc=0;//正常发电时长
+        double fdjclsc=0;//发电降出力时长
+        double gzsc=0;//故障时长
+        double gzslsc=0;//故障受累时长
+        double jxsc=0;//检修时长
+        double jxslsc=0;//检修受累时长
+        double xdjclsc=0;//限电降出力时长
+        double xdtjsc=0;//限电停机时长
+        double dwslsc=0;//电网受累时长
+        double hjslsc=0;//环境受累时长
+        double txzdsc=0;//通讯中断时长
+        double sblxsc=0;//设备离线时长
+
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+
+
+            lastState=-1;//上一分钟状态
+            Map<String, ProBasicEquipmentPoint> aimap=wtpAimap.get(wt.getNemCode());
+            if(wtpAimap.containsKey(ContantXk.MXZT));
+            {
+
+                ProBasicEquipmentPoint point=aimap.get(ContantXk.MXZT);
+                 //按照分钟时间进行统计状态快照值
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    for(PointData po :pointls)
+                    {
+
+                        if(po.getPointValueInDouble()==0)
+                        {
+
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //待机时长加1分钟
+                            djsc++;
+                        }else  if(po.getPointValueInDouble()==1)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //手动停机时长加1分钟
+                            sdtjsc++;
+                        }else  if(po.getPointValueInDouble()==2)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //正常发电时长加1分钟
+                            zcfdsc++;
+                        }else  if(po.getPointValueInDouble()==3)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //发电降出力时长加1分钟
+                            fdjclsc++;
+                        }else  if(po.getPointValueInDouble()==4)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //故障时长加1分钟
+                            gzsc++;
+                        }else  if(po.getPointValueInDouble()==5)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //故障受累时长加1分钟
+                            gzslsc++;
+                        }else  if(po.getPointValueInDouble()==6)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //检修时长加1分钟
+                            jxsc++;
+                        }else  if(po.getPointValueInDouble()==7)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //检修受累时长加1分钟
+                            jxslsc++;
+                        }else  if(po.getPointValueInDouble()==8)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //限电降出力时长加1分钟
+                            xdjclsc++;
+                        }else  if(po.getPointValueInDouble()==9)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //限电停机时长加1分钟
+                            xdtjsc++;
+                        }else  if(po.getPointValueInDouble()==10)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //电网受累时长加1分钟
+                            dwslsc++;
+                        }else  if(po.getPointValueInDouble()==11)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //环境受累时长加1分钟
+                            hjslsc++;
+                        }else  if(po.getPointValueInDouble()==12)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //通讯中断时长加1分钟
+                            txzdsc++;
+                        }else  if(po.getPointValueInDouble()==13)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //设备离线时长加1分钟
+                            sblxsc++;
+                        }
+
+                    }
+
+
+
+                }
+
+            }
+   
+        //日合计故障小时(明细)
+        pewp.setRgzxsmx(new BigDecimal(gzsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计场内受累故障小时(明细)
+        pewp.setRcnslgzxsmx(new BigDecimal(gzslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计检修小时(明细)
+        pewp.setRjxxsmx(new BigDecimal(jxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计场内受累检修小时(明细)
+        pewp.setRcnsljxxsmx(new BigDecimal(jxslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计待机小时(明细)
+        pewp.setRdjxsmx(new BigDecimal(djsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计缺陷降出力小时(明细)
+        pewp.setRqxjclxsmx(new BigDecimal(fdjclsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计手动停机小时(明细)
+        pewp.setRsdtjxsmx(new BigDecimal(sdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计性能小时(明细)
+        pewp.setRbwxsmx(new BigDecimal(zcfdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计限电停机小时(明细)
+        pewp.setRxdtjxsmx(new BigDecimal(xdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计限电降出力小时(明细)
+        pewp.setRxdjclxsmx(new BigDecimal(xdjclsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计场外受累电网小时(明细)
+        pewp.setRcwsldwxsmx(new BigDecimal(dwslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计场外受累电网小时(明细)
+        pewp.setRcwsltqxsmx(new BigDecimal(hjslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计通讯中断小时(明细)
+        pewp.setRtxzdxsmx(new BigDecimal(txzdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计离线小时(明细)
+        pewp.setRlxxsmx(new BigDecimal(sblxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+
+
+
+/*******************************************日信息统计*********************************************************/
+
+/*******************************************月信息统计*********************************************************/
+
+        if(pepidls.isEmpty())
+        {
+            setLossHoursMonth(pewp);
+
+        }else
+        {
+
+
+            if(!pepidls.isEmpty())
+            {
+               ProEconEquipmentInfoDay2 pepid=pepidls.get(0);
+
+                //月合计故障小时(明细)
+                pewp.setYgzxsmx(StringUtils.round(pepid.getYgzxsmx()+pewp.getRgzxsmx(),2));
+                //月合计场内受累故障小时(明细)
+                pewp.setYcnslgzxsmx(StringUtils.round(pepid.getYcnslgzxsmx()+pewp.getRcnslgzxsmx(),2));
+                //月合计检修小时(明细)
+                pewp.setYjxxsmx(StringUtils.round(pepid.getYjxxsmx()+pewp.getRjxxsmx(),2));
+                //月合计场内受累检修小时(明细)
+                pewp.setYcnsljxxsmx(StringUtils.round( pepid.getYcnsljxxsmx()+pewp.getRcnsljxxsmx(),2));
+                //月合计待机小时(明细)
+                pewp.setYdjxsmx(StringUtils.round(pepid.getYdjxsmx()+pewp.getRdjxsmx(),2));
+                //月合计缺陷降出力小时(明细)
+                pewp.setYqxjclxsmx(StringUtils.round(pepid.getYqxjclxsmx()+pewp.getRqxjclxsmx(),2));
+                //月合计手动停机小时(明细)
+                pewp.setYsdtjxsmx(StringUtils.round(pepid.getYsdtjxsmx()+pewp.getRsdtjxsmx(),2));
+                //月合计性能小时(明细)
+                pewp.setYbwxsmx(StringUtils.round(pepid.getYbwxsmx()+pewp.getRbwxsmx(),2));
+                //月合计限电停机小时(明细)
+                pewp.setYxdtjxsmx(StringUtils.round(pepid.getYxdtjxsmx()+pewp.getRxdtjxsmx(),2));
+                //月合计限电降出力小时(明细)
+                pewp.setYxdjclxsmx(StringUtils.round(pepid.getYxdjclxsmx()+pewp.getRxdjclxsmx(),2));
+                //月合计场外受累电网小时(明细)
+                pewp.setYcwsldwxsmx(StringUtils.round(pepid.getYcwsldwxsmx()+pewp.getRcwsldwxsmx(),2));
+                //月合计场外受累电网小时(明细)
+                pewp.setYcwsltqxsmx(StringUtils.round(pepid.getYcwsltqxsmx()+pewp.getRcwsltqxsmx(),2));
+                //月合计通讯中断小时(明细)
+                pewp.setYtxzdxsmx(StringUtils.round(pepid.getYtxzdxsmx()+pewp.getRtxzdxsmx(),2));
+                //月合计离线小时(明细)
+                pewp.setYlxxsmx(StringUtils.round(pepid.getYlxxsmx()+pewp.getRlxxsmx(),2));
+            }else
+            {
+                setLossHoursMonth(pewp);
+            }
+
+        }
+
+
+
+/*******************************************月信息统计*********************************************************/
+
+/*******************************************年信息统计*********************************************************/
+        if(pepidls.isEmpty())
+        {
+            setLossHoursYear(pewp);
+        }else
+        {
+
+            if(!pepidls.isEmpty())
+            {
+                ProEconEquipmentInfoDay2 pepid=pepidls.get(0);
+
+                //年合计故障小时(明细)
+                pewp.setYgzxsmx(StringUtils.round(pepid.getNgzxsmx()+pewp.getRgzxsmx(),2));
+                //年合计场内受累故障小时(明细)
+                pewp.setYcnslgzxsmx(StringUtils.round(pepid.getNcnslgzxsmx()+pewp.getRcnslgzxsmx(),2));
+                //年合计检修小时(明细)
+                pewp.setYjxxsmx(StringUtils.round(pepid.getNjxxsmx()+pewp.getRjxxsmx(),2));
+                //年合计场内受累检修小时(明细)
+                pewp.setYcnsljxxsmx(StringUtils.round( pepid.getNcnsljxxsmx()+pewp.getRcnsljxxsmx(),2));
+                //年合计待机小时(明细)
+                pewp.setYdjxsmx(StringUtils.round(pepid.getNdjxsmx()+pewp.getRdjxsmx(),2));
+                //年合计缺陷降出力小时(明细)
+                pewp.setYqxjclxsmx(StringUtils.round(pepid.getNqxjclxsmx()+pewp.getRqxjclxsmx(),2));
+                //年合计手动停机小时(明细)
+                pewp.setYsdtjxsmx(StringUtils.round(pepid.getNsdtjxsmx()+pewp.getRsdtjxsmx(),2));
+                //年合计性能小时(明细)
+                pewp.setYbwxsmx(StringUtils.round(pepid.getNbwxsmx()+pewp.getRbwxsmx(),2));
+                //年合计限电停机小时(明细)
+                pewp.setYxdtjxsmx(StringUtils.round(pepid.getNxdtjxsmx()+pewp.getRxdtjxsmx(),2));
+                //年合计限电降出力小时(明细)
+                pewp.setYxdjclxsmx(StringUtils.round(pepid.getNxdjclxsmx()+pewp.getRxdjclxsmx(),2));
+                //年合计场外受累电网小时(明细)
+                pewp.setYcwsldwxsmx(StringUtils.round(pepid.getNcwsldwxsmx()+pewp.getRcwsldwxsmx(),2));
+                //年合计场外受累电网小时(明细)
+                pewp.setYcwsltqxsmx(StringUtils.round(pepid.getNcwsltqxsmx()+pewp.getRcwsltqxsmx(),2));
+                //年合计通讯中断小时(明细)
+                pewp.setYtxzdxsmx(StringUtils.round(pepid.getNtxzdxsmx()+pewp.getRtxzdxsmx(),2));
+                //年合计离线小时(明细)
+                pewp.setYlxxsmx(StringUtils.round(pepid.getNlxxsmx()+pewp.getRlxxsmx(),2));
+
+            }else
+            {
+                setLossHoursYear(pewp);
+            }
+
+        }
+
+
+    }
+
+    private static void setLossHoursYear(ProEconEquipmentInfoDay2 pewp) {
+        //年合计故障小时(明细)
+        pewp.setNgzxsmx(pewp.getRgzxsmx());
+        //年合计场内受累故障小时(明细)
+        pewp.setNcnslgzxsmx(pewp.getRcnslgzxsmx());
+        //年合计检修小时(明细)
+        pewp.setNjxxsmx(pewp.getRjxxsmx());
+        //年合计场内受累检修小时(明细)
+        pewp.setNcnsljxxsmx(pewp.getRcnsljxxsmx());
+        //年合计待机小时(明细)
+        pewp.setNdjxsmx(pewp.getRdjxsmx());
+        //年合计缺陷降出力小时(明细)
+        pewp.setNqxjclxsmx(pewp.getRqxjclxsmx());
+        //年合计手动停机小时(明细)
+        pewp.setNsdtjxsmx(pewp.getRsdtjxsmx());
+        //年合计性能小时(明细)
+        pewp.setNbwxsmx(pewp.getRbwxsmx());
+        //年合计限电停机小时(明细)
+        pewp.setNxdtjxsmx(pewp.getRxdtjxsmx());
+        //年合计限电降出力小时(明细)
+        pewp.setNxdjclxsmx(pewp.getRxdjclxsmx());
+        //年合计场外受累电网小时(明细)
+        pewp.setNcwsldwxsmx(pewp.getRcwsldwxsmx());
+        //年合计场外受累电网小时(明细)
+        pewp.setNcwsltqxsmx(pewp.getRcwsltqxsmx());
+        //年合计通讯中断小时(明细)
+        pewp.setNtxzdxsmx(pewp.getRtxzdxsmx());
+        //年合计离线小时(明细)
+        pewp.setNlxxsmx(pewp.getRlxxsmx());
+    }
+
+    private static void setLossHoursMonth(ProEconEquipmentInfoDay2 pewp) {
+        //月合计故障小时(明细)
+        pewp.setYgzxsmx(pewp.getRgzxsmx());
+        //月合计场内受累故障小时(明细)
+        pewp.setYcnslgzxsmx(pewp.getRcnslgzxsmx());
+        //月合计检修小时(明细)
+        pewp.setYjxxsmx(pewp.getRjxxsmx());
+        //月合计场内受累检修小时(明细)
+        pewp.setYcnsljxxsmx(pewp.getRcnsljxxsmx());
+        //月合计待机小时(明细)
+        pewp.setYdjxsmx(pewp.getRdjxsmx());
+        //月合计缺陷降出力小时(明细)
+        pewp.setYqxjclxsmx(pewp.getRqxjclxsmx());
+        //月合计手动停机小时(明细)
+        pewp.setYsdtjxsmx(pewp.getRsdtjxsmx());
+        //月合计性能小时(明细)
+        pewp.setYbwxsmx(pewp.getRbwxsmx());
+        //月合计限电停机小时(明细)
+        pewp.setYxdtjxsmx(pewp.getRxdtjxsmx());
+        //月合计限电降出力小时(明细)
+        pewp.setYxdjclxsmx(pewp.getRxdjclxsmx());
+        //月合计场外受累电网小时(明细)
+        pewp.setYcwsldwxsmx(pewp.getRcwsldwxsmx());
+        //月合计场外受累电网小时(明细)
+        pewp.setYcwsltqxsmx(pewp.getRcwsltqxsmx());
+        //月合计通讯中断小时(明细)
+        pewp.setYtxzdxsmx(pewp.getRtxzdxsmx());
+        //月合计离线小时(明细)
+        pewp.setYlxxsmx(pewp.getRlxxsmx());
+    }
+
+
+    private static void setLossHoursMonthSimple(ProEconEquipmentInfoDay2 pewp) {
+        //月合计待机小时
+        pewp.setYdjxs(pewp.getRdjxs());
+        //月合计维护停机小时
+        pewp.setYjxtjxs(pewp.getRjxtjxs());
+        // 月合计故障停机小时
+        pewp.setYgztjxs(pewp.getRgztjxs());
+        //月合计运行小时
+        pewp.setYyxxs(pewp.getRyxxs());
+        //月合计限电小时
+        pewp.setYxdxs(pewp.getRxdxs());
+        //月合计通讯中断小时
+        pewp.setYtxzdxs(pewp.getRtxzdxs());
+        //月合计受累小时
+        pewp.setYslxs(pewp.getRslxs());
+    }
+
+    private static void setLossHoursYearSimple(ProEconEquipmentInfoDay2 pewp) {
+        //年合计待机小时
+        pewp.setNdjxs(pewp.getRdjxs());
+        //年合计维护停机小时
+        pewp.setNjxtjxs(pewp.getRjxtjxs());
+        // 年合计故障小时
+        pewp.setNgztjxs(pewp.getRgztjxs());
+        //年合计运行小时
+        pewp.setNyxxs(pewp.getRyxxs());
+        //年合计限电小时
+        pewp.setNxdxs(pewp.getRxdxs());
+        //年合计通讯中断小时
+        pewp.setNtxzdxs(pewp.getRtxzdxs());
+        //年合计受累小时
+        pewp.setNslxs(pewp.getRslxs());
+    }
+
+        private void calSimple(ProEconEquipmentInfoDay2 pewp,Date end, Date begin,ProBasicWindturbine wt,List<ProEconEquipmentInfoDay2> pepidls) throws Exception {
+//        0	待机
+//        1	运行
+//        2	故障
+//        3	检修
+//        4	限电
+//        5	受累
+//        6	离线
+/*******************************************日信息统计*********************************************************/
+
+        double lastState=-1;//上一分钟状态
+
+
+        double djsc=0;//待机时长
+        double zcfdsc=0;//正常发电时长
+        double gzsc=0;//故障时长
+        double jxsc=0;//检修时长
+        double xdtjsc=0;//限电停机时长
+        double slsc=0;//受累时长
+        double txzdsc=0;//通讯中断时长
+
+
+
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+
+
+            Map<String, ProBasicEquipmentPoint> aimap=wtpAimap.get(wt.getNemCode());
+            if(wtpAimap.containsKey(ContantXk.SBZT));
+            {
+
+                ProBasicEquipmentPoint point=aimap.get(ContantXk.SBZT);
+                //按照分钟时间进行统计状态快照值
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty()) {
+                    for (PointData po : pointls) {
+
+                        if (po.getPointValueInDouble() == 0) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //待机时长加1分钟
+                            djsc++;
+                        } else if (po.getPointValueInDouble() == 1) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //正常发电时长加1分钟
+                            zcfdsc++;
+                        } else if (po.getPointValueInDouble() == 2) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //故障时长加1分钟
+                            gzsc++;
+                        } else if (po.getPointValueInDouble() == 3) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //检修时长加1分钟
+                            jxsc++;
+
+                        } else if (po.getPointValueInDouble() == 4) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //限电停机时长加1分钟
+                            xdtjsc++;
+                        } else if (po.getPointValueInDouble() == 5) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //受累时长加1分钟
+                            slsc++;
+
+                        } else if (po.getPointValueInDouble() == 6) {
+                            if (lastState != po.getPointValueInDouble()) {
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //通讯中断时长加1分钟
+                            txzdsc++;
+                        }
+
+                    }
+
+                }
+
+
+
+            }
+        
+
+
+    //日合计待机小时
+                    pewp.setRdjxs(new BigDecimal(gzsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+    //日合计维护停机小时
+                    pewp.setRjxtjxs(new BigDecimal(jxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+    // 日合计待机小时
+                    pewp.setRdjxs(new BigDecimal(djsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+    //日合计运行小时
+                    pewp.setRyxxs(new BigDecimal(zcfdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+    //日合计限电小时
+                    pewp.setRxdxs(new BigDecimal(xdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+    //日合计通讯中断小时
+                    pewp.setRtxzdxs(new BigDecimal(txzdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+    //日合计受累小时
+                    pewp.setRslxs(new BigDecimal(slsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+
+
+            /*******************************************日信息统计*********************************************************/
+
+            /*******************************************月信息统计*********************************************************/
+            if(pepidls.isEmpty())
+            {
+                setLossHoursMonthSimple(pewp);
+
+            }else
+            {
+
+
+                if(!pepidls.isEmpty())
+                {
+                    ProEconEquipmentInfoDay2 pepid=pepidls.get(0);
+
+
+
+
+                    //月合计待机小时
+                    pewp.setYdjxs(StringUtils.round(pepid.getYdjxs()+pewp.getRdjxs(),2));
+                    //月合计维护停机小时
+                    pewp.setYjxtjxs(StringUtils.round(pepid.getYjxtjxs()+pewp.getRjxtjxs(),2));
+                    // 月合计故障小时
+                    pewp.setYgztjxs(StringUtils.round(pepid.getYgztjxs()+pewp.getRgztjxs(),2));
+                    //月合计运行小时
+                    pewp.setYyxxs(StringUtils.round(pepid.getYyxxs()+pewp.getRyxxs(),2));
+                    //月合计限电小时
+                    pewp.setYxdxs(StringUtils.round(pepid.getYxdxs()+pewp.getRxdxs(),2));
+                    //月合计通讯中断小时
+                    pewp.setYtxzdxs(StringUtils.round(pepid.getYtxzdxs()+pewp.getRtxzdxs(),2));
+                    //月合计受累小时
+                    pewp.setYslxs(StringUtils.round(pepid.getYslxs()+pewp.getRslxs(),2));
+                }else
+                {
+                    setLossHoursMonthSimple(pewp);
+                }
+
+            }
+            /*******************************************月信息统计*********************************************************/
+
+            /*******************************************年信息统计*********************************************************/
+            if(pepidls.isEmpty())
+            {
+                setLossHoursYearSimple(pewp);
+
+            }else
+            {
+
+
+                if(!pepidls.isEmpty())
+                {
+                    ProEconEquipmentInfoDay2 pepid=pepidls.get(0);
+
+
+                    //年合计待机小时
+                    pewp.setNdjxs(StringUtils.round(pepid.getNdjxs()+pewp.getRdjxs(),2));
+                    //年合计维护停机小时
+                    pewp.setNjxtjxs(StringUtils.round(pepid.getNjxtjxs()+pewp.getRjxtjxs(),2));
+                    // 年合计故障小时
+                    pewp.setNgztjxs(StringUtils.round(pepid.getNgztjxs()+pewp.getRgztjxs(),2));
+                    //年合计运行小时
+                    pewp.setNyxxs(StringUtils.round(pepid.getNyxxs()+pewp.getRyxxs(),2));
+                    //年合计限电小时
+                    pewp.setNxdxs(StringUtils.round(pepid.getNxdxs()+pewp.getRxdxs(),2));
+                    //年合计通讯中断小时
+                    pewp.setNtxzdxs(StringUtils.round(pepid.getNtxzdxs()+pewp.getRtxzdxs(),2));
+                    //年合计受累小时
+                    pewp.setNslxs(StringUtils.round(pepid.getNslxs()+pewp.getRslxs(),2));
+                }else
+                {
+                    setLossHoursYearSimple(pewp);
+                }
+
+            }
+            /*******************************************年信息统计*********************************************************/
+    }
+
+
+}
+
+
+
+
+
+
+

+ 760 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo3Service.java

@@ -0,0 +1,760 @@
+package com.gyee.generation.service;//package com.gyee.generation.service;
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.service.auto.IProEconEquipmentInfoDay3Service;
+import com.gyee.generation.service.auto.IProEconPowerstationInfoDay3Service;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.statisticcs.Initial;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class EquipmentInfo3Service {
+
+    private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo2Service.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconEquipmentInfoDay3Service proEconEquipmentInfoDay3Service;
+
+
+
+
+    /**
+     * 计算设备日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calEquipmentInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncDay(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconEquipmentInfoDay3Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.wtmap.containsKey(i.getWindturbineId())
+                         ).map(ProEconEquipmentInfoDay3::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconEquipmentInfoDay3Service.removeByIds(idls);
+
+        }
+        for(ProBasicWindturbine wt:CacheContext.wtls)
+        {
+            if(CacheContext.wtpAimap.containsKey(wt.getId()))
+            {
+
+
+                ProEconEquipmentInfoDay3 pewp=new ProEconEquipmentInfoDay3();
+                Initial.initial(pewp);
+                pewp.setCompanyId(wt.getCompanyId());
+                pewp.setWindpowerstationId(wt.getWindpowerstationId());
+                pewp.setLineId(wt.getLineId());
+                pewp.setProjectId(wt.getProjectId());
+                pewp.setRegionId(wt.getRegionId());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+
+                //昨日的统计结果
+                List<ProEconEquipmentInfoDay3> pepidls =new ArrayList<>();
+                Calendar cl=Calendar.getInstance();
+                cl.setTime(recordDate);
+                if(cl.get(Calendar.DAY_OF_MONTH)!=1)
+
+                {
+                    pepidls = proEconEquipmentInfoDay3Service.list().stream()
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                                    && i.getWindturbineId().equals(wt.getId())
+                                  )
+                            .collect(Collectors.toList());
+                }
+                calDetiall( pewp, end, begin,wt,pepidls);
+                calSimple( pewp, end, begin, wt,pepidls);
+                proEconEquipmentInfoDay3Service.save(pewp);
+
+            }
+
+
+        }
+
+    }
+
+    private void calDetiall(ProEconEquipmentInfoDay3 pewp,Date end, Date begin,ProBasicWindturbine wt,List<ProEconEquipmentInfoDay3> pepidls) throws Exception {
+        //        //                0	待机
+//                1	手动停机
+//                2	正常发电
+//                3	发电降出力
+//                4	故障
+//                5	故障受累
+//                6	检修
+//                7	检修受累
+//                8	限电降出力
+//                9	限电停机
+//                10	电网受累
+//                11	环境受累
+//                12	通讯中断
+//                13	设备离线
+
+        double lastState=-1;//上一分钟状态
+
+        double djsc=0;//待机时长
+        double sdtjsc=0;//手动停机时长
+        double zcfdsc=0;//正常发电时长
+        double fdjclsc=0;//发电降出力时长
+        double gzsc=0;//故障时长
+        double gzslsc=0;//故障受累时长
+        double jxsc=0;//检修时长
+        double jxslsc=0;//检修受累时长
+        double xdjclsc=0;//限电降出力时长
+        double xdtjsc=0;//限电停机时长
+        double dwslsc=0;//电网受累时长
+        double hjslsc=0;//环境受累时长
+        double txzdsc=0;//通讯中断时长
+        double sblxsc=0;//设备离线时长
+
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+
+
+
+            lastState=-1;//上一分钟状态
+            Map<String, ProBasicEquipmentPoint> aimap=wtpAimap.get(wt.getNemCode());
+            if(wtpAimap.containsKey(ContantXk.MXZT));
+            {
+
+                ProBasicEquipmentPoint point=aimap.get(ContantXk.MXZT);
+                //按照分钟时间进行统计状态快照值
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    for(PointData po :pointls)
+                    {
+
+                        if(po.getPointValueInDouble()==0)
+                        {
+
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //待机时长加1分钟
+                            djsc++;
+                        }else  if(po.getPointValueInDouble()==1)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //手动停机时长加1分钟
+                            sdtjsc++;
+                        }else  if(po.getPointValueInDouble()==2)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //正常发电时长加1分钟
+                            zcfdsc++;
+                        }else  if(po.getPointValueInDouble()==3)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //发电降出力时长加1分钟
+                            fdjclsc++;
+                        }else  if(po.getPointValueInDouble()==4)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //故障时长加1分钟
+                            gzsc++;
+                        }else  if(po.getPointValueInDouble()==5)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //故障受累时长加1分钟
+                            gzslsc++;
+                        }else  if(po.getPointValueInDouble()==6)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //检修时长加1分钟
+                            jxsc++;
+                        }else  if(po.getPointValueInDouble()==7)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //检修受累时长加1分钟
+                            jxslsc++;
+                        }else  if(po.getPointValueInDouble()==8)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //限电降出力时长加1分钟
+                            xdjclsc++;
+                        }else  if(po.getPointValueInDouble()==9)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //限电停机时长加1分钟
+                            xdtjsc++;
+                        }else  if(po.getPointValueInDouble()==10)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //电网受累时长加1分钟
+                            dwslsc++;
+                        }else  if(po.getPointValueInDouble()==11)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //环境受累时长加1分钟
+                            hjslsc++;
+                        }else  if(po.getPointValueInDouble()==12)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //通讯中断时长加1分钟
+                            txzdsc++;
+                        }else  if(po.getPointValueInDouble()==13)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //设备离线时长加1分钟
+                            sblxsc++;
+                        }
+
+                    }
+
+                }
+
+            }
+        
+
+        //日合计故障小时(明细)
+        pewp.setRgzcsmx(new BigDecimal(gzsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计场内受累故障小时(明细)
+        pewp.setRcnslgzcsmx(new BigDecimal(gzslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计检修小时(明细)
+        pewp.setRjxcsmx(new BigDecimal(jxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计场内受累检修小时(明细)
+        pewp.setRcnsljxcsmx(new BigDecimal(jxslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计待机小时(明细)
+        pewp.setRdjcsmx(new BigDecimal(djsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计缺陷降出力小时(明细)
+        pewp.setRqxjclcsmx(new BigDecimal(fdjclsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计手动停机小时(明细)
+        pewp.setRsdtjcsmx(new BigDecimal(sdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计性能小时(明细)
+        pewp.setRbwcsmx(new BigDecimal(zcfdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计限电停机小时(明细)
+        pewp.setRxdtjcsmx(new BigDecimal(xdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计限电降出力小时(明细)
+        pewp.setRxdjclcsmx(new BigDecimal(xdjclsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计场外受累电网小时(明细)
+        pewp.setRcwsldwcsmx(new BigDecimal(dwslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计场外受累电网小时(明细)
+        pewp.setRcwsltqcsmx(new BigDecimal(hjslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计通讯中断小时(明细)
+        pewp.setRtxzdcsmx(new BigDecimal(txzdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计离线小时(明细)
+        pewp.setRlxcsmx(new BigDecimal(sblxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+
+/*******************************************日信息统计*********************************************************/
+
+/*******************************************月信息统计*********************************************************/
+
+        if(pepidls.isEmpty())
+        {
+            setLossHoursMonth(pewp);
+
+        }else
+        {
+
+
+            if(!pepidls.isEmpty())
+            {
+                ProEconEquipmentInfoDay3 pepid=pepidls.get(0);
+
+                //月合计故障小时(明细)
+                pewp.setYgzcsmx(StringUtils.round(pepid.getYgzcsmx()+pewp.getRgzcsmx(),2));
+                //月合计场内受累故障小时(明细)
+                pewp.setYcnslgzcsmx(StringUtils.round(pepid.getYcnslgzcsmx()+pewp.getRcnslgzcsmx(),2));
+                //月合计检修小时(明细)
+                pewp.setYjxcsmx(StringUtils.round(pepid.getYjxcsmx()+pewp.getRjxcsmx(),2));
+                //月合计场内受累检修小时(明细)
+                pewp.setYcnsljxcsmx(StringUtils.round( pepid.getYcnsljxcsmx()+pewp.getRcnsljxcsmx(),2));
+                //月合计待机小时(明细)
+                pewp.setYdjcsmx(StringUtils.round(pepid.getYdjcsmx()+pewp.getRdjcsmx(),2));
+                //月合计缺陷降出力小时(明细)
+                pewp.setYqxjclcsmx(StringUtils.round(pepid.getYqxjclcsmx()+pewp.getRqxjclcsmx(),2));
+                //月合计手动停机小时(明细)
+                pewp.setYsdtjcsmx(StringUtils.round(pepid.getYsdtjcsmx()+pewp.getRsdtjcsmx(),2));
+                //月合计性能小时(明细)
+                pewp.setYbwcsmx(StringUtils.round(pepid.getYbwcsmx()+pewp.getRbwcsmx(),2));
+                //月合计限电停机小时(明细)
+                pewp.setYxdtjcsmx(StringUtils.round(pepid.getYxdtjcsmx()+pewp.getRxdtjcsmx(),2));
+                //月合计限电降出力小时(明细)
+                pewp.setYxdjclcsmx(StringUtils.round(pepid.getYxdjclcsmx()+pewp.getRxdjclcsmx(),2));
+                //月合计场外受累电网小时(明细)
+                pewp.setYcwsldwcsmx(StringUtils.round(pepid.getYcwsldwcsmx()+pewp.getRcwsldwcsmx(),2));
+                //月合计场外受累电网小时(明细)
+                pewp.setYcwsltqcsmx(StringUtils.round(pepid.getYcwsltqcsmx()+pewp.getRcwsltqcsmx(),2));
+                //月合计通讯中断小时(明细)
+                pewp.setYtxzdcsmx(StringUtils.round(pepid.getYtxzdcsmx()+pewp.getRtxzdcsmx(),2));
+                //月合计离线小时(明细)
+                pewp.setYlxcsmx(StringUtils.round(pepid.getYlxcsmx()+pewp.getRlxcsmx(),2));
+            }else
+            {
+                setLossHoursMonth(pewp);
+            }
+
+        }
+
+
+
+/*******************************************月信息统计*********************************************************/
+
+/*******************************************年信息统计*********************************************************/
+        if(pepidls.isEmpty())
+        {
+            setLossHoursYear(pewp);
+        }else
+        {
+
+            if(!pepidls.isEmpty())
+            {
+                ProEconEquipmentInfoDay3 pepid=pepidls.get(0);
+
+                //年合计故障小时(明细)
+                pewp.setYgzcsmx(StringUtils.round(pepid.getNgzcsmx()+pewp.getRgzcsmx(),2));
+                //年合计场内受累故障小时(明细)
+                pewp.setYcnslgzcsmx(StringUtils.round(pepid.getNcnslgzcsmx()+pewp.getRcnslgzcsmx(),2));
+                //年合计检修小时(明细)
+                pewp.setYjxcsmx(StringUtils.round(pepid.getNjxcsmx()+pewp.getRjxcsmx(),2));
+                //年合计场内受累检修小时(明细)
+                pewp.setYcnsljxcsmx(StringUtils.round( pepid.getNcnsljxcsmx()+pewp.getRcnsljxcsmx(),2));
+                //年合计待机小时(明细)
+                pewp.setYdjcsmx(StringUtils.round(pepid.getNdjcsmx()+pewp.getRdjcsmx(),2));
+                //年合计缺陷降出力小时(明细)
+                pewp.setYqxjclcsmx(StringUtils.round(pepid.getNqxjclcsmx()+pewp.getRqxjclcsmx(),2));
+                //年合计手动停机小时(明细)
+                pewp.setYsdtjcsmx(StringUtils.round(pepid.getNsdtjcsmx()+pewp.getRsdtjcsmx(),2));
+                //年合计性能小时(明细)
+                pewp.setYbwcsmx(StringUtils.round(pepid.getNbwcsmx()+pewp.getRbwcsmx(),2));
+                //年合计限电停机小时(明细)
+                pewp.setYxdtjcsmx(StringUtils.round(pepid.getNxdtjcsmx()+pewp.getRxdtjcsmx(),2));
+                //年合计限电降出力小时(明细)
+                pewp.setYxdjclcsmx(StringUtils.round(pepid.getNxdjclcsmx()+pewp.getRxdjclcsmx(),2));
+                //年合计场外受累电网小时(明细)
+                pewp.setYcwsldwcsmx(StringUtils.round(pepid.getNcwsldwcsmx()+pewp.getRcwsldwcsmx(),2));
+                //年合计场外受累电网小时(明细)
+                pewp.setYcwsltqcsmx(StringUtils.round(pepid.getNcwsltqcsmx()+pewp.getRcwsltqcsmx(),2));
+                //年合计通讯中断小时(明细)
+                pewp.setYtxzdcsmx(StringUtils.round(pepid.getNtxzdcsmx()+pewp.getRtxzdcsmx(),2));
+                //年合计离线小时(明细)
+                pewp.setYlxcsmx(StringUtils.round(pepid.getNlxcsmx()+pewp.getRlxcsmx(),2));
+
+            }else
+            {
+                setLossHoursYear(pewp);
+            }
+
+        }
+
+
+    }
+
+    private static void setLossHoursYear(ProEconEquipmentInfoDay3 pewp) {
+        //年合计故障小时(明细)
+        pewp.setNgzcsmx(pewp.getRgzcsmx());
+        //年合计场内受累故障小时(明细)
+        pewp.setNcnslgzcsmx(pewp.getRcnslgzcsmx());
+        //年合计检修小时(明细)
+        pewp.setNjxcsmx(pewp.getRjxcsmx());
+        //年合计场内受累检修小时(明细)
+        pewp.setNcnsljxcsmx(pewp.getRcnsljxcsmx());
+        //年合计待机小时(明细)
+        pewp.setNdjcsmx(pewp.getRdjcsmx());
+        //年合计缺陷降出力小时(明细)
+        pewp.setNqxjclcsmx(pewp.getRqxjclcsmx());
+        //年合计手动停机小时(明细)
+        pewp.setNsdtjcsmx(pewp.getRsdtjcsmx());
+        //年合计性能小时(明细)
+        pewp.setNbwcsmx(pewp.getRbwcsmx());
+        //年合计限电停机小时(明细)
+        pewp.setNxdtjcsmx(pewp.getRxdtjcsmx());
+        //年合计限电降出力小时(明细)
+        pewp.setNxdjclcsmx(pewp.getRxdjclcsmx());
+        //年合计场外受累电网小时(明细)
+        pewp.setNcwsldwcsmx(pewp.getRcwsldwcsmx());
+        //年合计场外受累电网小时(明细)
+        pewp.setNcwsltqcsmx(pewp.getRcwsltqcsmx());
+        //年合计通讯中断小时(明细)
+        pewp.setNtxzdcsmx(pewp.getRtxzdcsmx());
+        //年合计离线小时(明细)
+        pewp.setNlxcsmx(pewp.getRlxcsmx());
+    }
+
+    private static void setLossHoursMonth(ProEconEquipmentInfoDay3 pewp) {
+        //月合计故障小时(明细)
+        pewp.setYgzcsmx(pewp.getRgzcsmx());
+        //月合计场内受累故障小时(明细)
+        pewp.setYcnslgzcsmx(pewp.getRcnslgzcsmx());
+        //月合计检修小时(明细)
+        pewp.setYjxcsmx(pewp.getRjxcsmx());
+        //月合计场内受累检修小时(明细)
+        pewp.setYcnsljxcsmx(pewp.getRcnsljxcsmx());
+        //月合计待机小时(明细)
+        pewp.setYdjcsmx(pewp.getRdjcsmx());
+        //月合计缺陷降出力小时(明细)
+        pewp.setYqxjclcsmx(pewp.getRqxjclcsmx());
+        //月合计手动停机小时(明细)
+        pewp.setYsdtjcsmx(pewp.getRsdtjcsmx());
+        //月合计性能小时(明细)
+        pewp.setYbwcsmx(pewp.getRbwcsmx());
+        //月合计限电停机小时(明细)
+        pewp.setYxdtjcsmx(pewp.getRxdtjcsmx());
+        //月合计限电降出力小时(明细)
+        pewp.setYxdjclcsmx(pewp.getRxdjclcsmx());
+        //月合计场外受累电网小时(明细)
+        pewp.setYcwsldwcsmx(pewp.getRcwsldwcsmx());
+        //月合计场外受累电网小时(明细)
+        pewp.setYcwsltqcsmx(pewp.getRcwsltqcsmx());
+        //月合计通讯中断小时(明细)
+        pewp.setYtxzdcsmx(pewp.getRtxzdcsmx());
+        //月合计离线小时(明细)
+        pewp.setYlxcsmx(pewp.getRlxcsmx());
+    }
+
+
+    private static void setLossHoursMonthSimple(ProEconEquipmentInfoDay3 pewp) {
+        //月合计待机小时
+        pewp.setYdjcs(pewp.getRdjcs());
+        //月合计维护停机小时
+        pewp.setYjxtjcs(pewp.getRjxtjcs());
+        // 月合计故障停机小时
+        pewp.setYgztjcs(pewp.getRgztjcs());
+        //月合计运行小时
+        pewp.setYyxcs(pewp.getRyxcs());
+        //月合计限电小时
+        pewp.setYxdcs(pewp.getRxdcs());
+        //月合计通讯中断小时
+        pewp.setYtxzdcs(pewp.getRtxzdcs());
+        //月合计受累小时
+        pewp.setYslcs(pewp.getRslcs());
+    }
+
+    private static void setLossHoursYearSimple(ProEconEquipmentInfoDay3 pewp) {
+        //年合计待机小时
+        pewp.setNdjcs(pewp.getRdjcs());
+        //年合计维护停机小时
+        pewp.setNjxtjcs(pewp.getRjxtjcs());
+        // 年合计故障小时
+        pewp.setNgztjcs(pewp.getRgztjcs());
+        //年合计运行小时
+        pewp.setNyxcs(pewp.getRyxcs());
+        //年合计限电小时
+        pewp.setNxdcs(pewp.getRxdcs());
+        //年合计通讯中断小时
+        pewp.setNtxzdcs(pewp.getRtxzdcs());
+        //年合计受累小时
+        pewp.setNslcs(pewp.getRslcs());
+    }
+
+    private void calSimple(ProEconEquipmentInfoDay3 pewp,Date end, Date begin,ProBasicWindturbine wt,List<ProEconEquipmentInfoDay3> pepidls) throws Exception {
+//        0	待机
+//        1	运行
+//        2	故障
+//        3	检修
+//        4	限电
+//        5	受累
+//        6	离线
+/*******************************************日信息统计*********************************************************/
+
+        double lastState=-1;//上一分钟状态
+
+
+        double djsc=0;//待机时长
+        double zcfdsc=0;//正常发电时长
+        double gzsc=0;//故障时长
+        double jxsc=0;//检修时长
+        double xdtjsc=0;//限电停机时长
+        double slsc=0;//受累时长
+        double txzdsc=0;//通讯中断时长
+
+
+
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+
+
+            Map<String, ProBasicEquipmentPoint> aimap=wtpAimap.get(wt.getNemCode());
+            if(wtpAimap.containsKey(ContantXk.SBZT));
+            {
+
+                ProBasicEquipmentPoint point=aimap.get(ContantXk.SBZT);
+                //按照分钟时间进行统计状态快照值
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty()) {
+                    for (PointData po : pointls) {
+
+                        if (po.getPointValueInDouble() == 0) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //待机时长加1分钟
+                            djsc++;
+                        } else if (po.getPointValueInDouble() == 1) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //正常发电时长加1分钟
+                            zcfdsc++;
+                        } else if (po.getPointValueInDouble() == 2) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //故障时长加1分钟
+                            gzsc++;
+                        } else if (po.getPointValueInDouble() == 3) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //检修时长加1分钟
+                            jxsc++;
+
+                        } else if (po.getPointValueInDouble() == 4) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //限电停机时长加1分钟
+                            xdtjsc++;
+                        } else if (po.getPointValueInDouble() == 5) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //受累时长加1分钟
+                            slsc++;
+
+                        } else if (po.getPointValueInDouble() == 6) {
+                            if (lastState != po.getPointValueInDouble()) {
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //通讯中断时长加1分钟
+                            txzdsc++;
+                        }
+
+                    }
+
+                }
+
+            }
+        
+
+
+        //日合计待机小时
+        pewp.setRdjcs(new BigDecimal(gzsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计维护停机小时
+        pewp.setRjxtjcs(new BigDecimal(jxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        // 日合计待机小时
+        pewp.setRdjcs(new BigDecimal(djsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计运行小时
+        pewp.setRyxcs(new BigDecimal(zcfdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计限电小时
+        pewp.setRxdcs(new BigDecimal(xdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计通讯中断小时
+        pewp.setRtxzdcs(new BigDecimal(txzdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //日合计受累小时
+        pewp.setRslcs(new BigDecimal(slsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+
+
+        /*******************************************日信息统计*********************************************************/
+
+        /*******************************************月信息统计*********************************************************/
+        if(pepidls.isEmpty())
+        {
+            setLossHoursMonthSimple(pewp);
+
+        }else
+        {
+
+
+            if(!pepidls.isEmpty())
+            {
+                ProEconEquipmentInfoDay3 pepid=pepidls.get(0);
+
+
+                //月合计待机小时
+                pewp.setYdjcs(StringUtils.round(pepid.getYdjcs()+pewp.getRdjcs(),2));
+                //月合计维护停机小时
+                pewp.setYjxtjcs(StringUtils.round(pepid.getYjxtjcs()+pewp.getRjxtjcs(),2));
+                // 月合计故障小时
+                pewp.setYgztjcs(StringUtils.round(pepid.getYgztjcs()+pewp.getRgztjcs(),2));
+                //月合计运行小时
+                pewp.setYyxcs(StringUtils.round(pepid.getYyxcs()+pewp.getRyxcs(),2));
+                //月合计限电小时
+                pewp.setYxdcs(StringUtils.round(pepid.getYxdcs()+pewp.getRxdcs(),2));
+                //月合计通讯中断小时
+                pewp.setYtxzdcs(StringUtils.round(pepid.getYtxzdcs()+pewp.getRtxzdcs(),2));
+                //月合计受累小时
+                pewp.setYslcs(StringUtils.round(pepid.getYslcs()+pewp.getRslcs(),2));
+            }else
+            {
+                setLossHoursMonthSimple(pewp);
+            }
+
+        }
+        /*******************************************月信息统计*********************************************************/
+
+        /*******************************************年信息统计*********************************************************/
+        if(pepidls.isEmpty())
+        {
+            setLossHoursYearSimple(pewp);
+
+        }else
+        {
+
+
+            if(!pepidls.isEmpty())
+            {
+                ProEconEquipmentInfoDay3 pepid=pepidls.get(0);
+
+
+                //年合计待机小时
+                pewp.setNdjcs(StringUtils.round(pepid.getNdjcs()+pewp.getRdjcs(),2));
+                //年合计维护停机小时
+                pewp.setNjxtjcs(StringUtils.round(pepid.getNjxtjcs()+pewp.getRjxtjcs(),2));
+                // 年合计故障小时
+                pewp.setNgztjcs(StringUtils.round(pepid.getNgztjcs()+pewp.getRgztjcs(),2));
+                //年合计运行小时
+                pewp.setNyxcs(StringUtils.round(pepid.getNyxcs()+pewp.getRyxcs(),2));
+                //年合计限电小时
+                pewp.setNxdcs(StringUtils.round(pepid.getNxdcs()+pewp.getRxdcs(),2));
+                //年合计通讯中断小时
+                pewp.setNtxzdcs(StringUtils.round(pepid.getNtxzdcs()+pewp.getRtxzdcs(),2));
+                //年合计受累小时
+                pewp.setNslcs(StringUtils.round(pepid.getNslcs()+pewp.getRslcs(),2));
+            }else
+            {
+                setLossHoursYearSimple(pewp);
+            }
+
+        }
+        /*******************************************年信息统计*********************************************************/
+    }
+
+
+
+}
+
+
+
+
+
+
+

+ 267 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/GoodnessOfFitService.java

@@ -0,0 +1,267 @@
+package com.gyee.generation.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.FitClassVo;
+import com.gyee.generation.service.auto.*;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.StringUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class GoodnessOfFitService {
+
+
+        private static final Logger logger = LoggerFactory.getLogger(GoodnessOfFitService.class);
+        @Resource
+        private IEdosUtil edosUtil;
+
+        @Resource
+       private IProEconActivePowerDataService proEconActivePowerDataService;
+
+        @Resource
+        private IProEconWtCurveFittingMonthService proEconWtCurveFittingMonthService;
+
+
+
+    public Map<String,Map<String,Double>> goodnessOfFit(Date nowDate)
+    {
+        Date current = DateUtils.addDays(nowDate,-1);
+        Date startDate = current;
+        Date endDate =new Date();
+
+
+        Calendar c= Calendar.getInstance();
+        c.setTime(startDate);
+        String  year =String.valueOf(c.get(Calendar.YEAR));
+        String month = String.valueOf(c.get(Calendar.MONTH)+1);
+
+        c.setTime(nowDate);
+
+        c.set(Calendar.DAY_OF_MONTH,1);
+        Date startDateM = c.getTime();
+        c.set(Calendar.MONTH,0);
+        Date startDateY = c.getTime();
+
+        Map<String,Map<String,Double>> resultmap =new HashMap<>();
+
+        Map<String, FitClassVo> theMapY = new HashMap<String, FitClassVo>();
+        Map<String, FitClassVo> theMapM = new HashMap<String, FitClassVo>();
+        Map<String, FitClassVo> theMapD = new HashMap<String, FitClassVo>();
+        List<FitClassVo> theList = new ArrayList<FitClassVo>();
+
+
+            List<ProEconWtCurveFittingMonth> powerList = null;
+
+
+            powerList = proEconWtCurveFittingMonthService.list().stream().filter(i->i.getMonth().equals(month)
+                && i.getYear().equals(year)).collect(Collectors.toList());
+
+
+            for (ProBasicWindpowerstation wp : CacheContext.wpls)
+            {
+
+                List<FitClassVo> fitsD=  proEconActivePowerDataService.getFitList(wp.getId(),startDate,endDate);
+                List<FitClassVo> fitsM=  proEconActivePowerDataService.getFitList(wp.getId(),startDateM,endDate);
+                List<FitClassVo> fitsY=  proEconActivePowerDataService.getFitList(wp.getId(),startDateY,endDate);
+
+                buildList(theMapY, theList, wp.getId(), fitsY, powerList);
+                buildList(theMapM, theList, wp.getId(), fitsM, powerList);
+                buildList(theMapD, theList, wp.getId(), fitsD, powerList);
+
+
+                theMapD.forEach((key,value)->{
+                    if(resultmap.containsKey(key))
+                    {
+                        Map<String,Double> tempmap=resultmap.get(key);
+                        tempmap.put("day",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }else
+                    {
+                        Map<String,Double> tempmap=new HashMap<>();
+                        tempmap.put("day",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }
+
+                });
+
+                theMapM.forEach((key,value)->{
+                    if(resultmap.containsKey(key))
+                    {
+                        Map<String,Double> tempmap=resultmap.get(key);
+                        tempmap.put("month",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }else
+                    {
+                        Map<String,Double> tempmap=new HashMap<>();
+                        tempmap.put("month",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }
+
+                });
+
+                theMapY.forEach((key,value)->{
+                    if(resultmap.containsKey(key))
+                    {
+                        Map<String,Double> tempmap=resultmap.get(key);
+                        tempmap.put("year",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }else
+                    {
+                        Map<String,Double> tempmap=new HashMap<>();
+                        tempmap.put("year",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }
+
+                });
+            }
+
+
+//
+//            for (FitClassVo item : theList)
+//            {
+//                Double rnew = 0.0;
+//                Double speed = 0.0;
+//
+//                if (item.getEpower() != 0)
+//                {
+//                    rnew = (Double)Math.sqrt((double)(item.getPower() / item.getEpower()));
+//                }
+//                if (item.getNumber() != 0)
+//                {
+//                    speed = item.getSpeed() / item.getNumber();
+//                }
+//                item.setSpeed(speed);
+//                item.setPower(rnew);
+//
+//            }
+
+        return resultmap;
+    }
+
+
+
+    private void buildList(Map<String, FitClassVo> theMap, List<FitClassVo> theList, String windpowerstationId, List<FitClassVo> fitsY, List<ProEconWtCurveFittingMonth> powerList)
+    {
+
+
+
+        for (FitClassVo item : fitsY)
+        {
+            Double speed = 0.0;
+            if (windpowerstationId.contains("GDC"))
+            {
+                speed = item.getSpeed();
+                speed /= 100;
+
+                speed = StringUtils.round(speed, 1);
+                speed *= 100;
+
+                speed = speed;
+            }
+            else
+            {
+                speed = StringUtils.round(item.getSpeed(), 1);
+            }
+            String windturbineId = item.getWindturbineId();
+            if (CacheContext.modelpowermap.containsKey(item.getModelId()))
+            {
+                if (CacheContext.modelpowermap.get(item.getModelId()).size() > 0)
+                {
+
+
+                    if (CacheContext.modelpowermap.get(item.getModelId()).containsKey(speed))
+                    {
+                        Double epower = CacheContext.modelpowermap.get(item.getModelId()).get(speed).getEnsurePower();
+
+
+                        buildtheMap(theMap, theList, windpowerstationId, item, speed, epower);
+
+
+                    }
+                }
+                else
+                {
+                    if (powerList != null && powerList.size()>0)
+                    {
+                        Double finalSpeed = speed;
+                        OptionalDouble tempp=powerList.stream().filter(i-> i.getSpeed()== finalSpeed &&  i.getWindturbineId().equals(windturbineId)).mapToDouble(x->x.getOptimalPower()).findFirst();
+                        Double  p =0.0;
+
+                        if (tempp.isPresent())
+                        {
+                            Double epower = tempp.getAsDouble();
+
+                            buildtheMap(theMap, theList, windpowerstationId, item, speed, epower);
+                        }
+                        else
+                        {
+                            DoubleSummaryStatistics summaryStatistics=powerList.stream().mapToDouble(ProEconWtCurveFittingMonth::getSpeed).summaryStatistics();
+
+                            Double max = summaryStatistics.getMax();
+                            if (speed > max)
+                            {
+                                summaryStatistics=powerList.stream().mapToDouble(ProEconWtCurveFittingMonth::getActualPower).summaryStatistics();
+                                p = summaryStatistics.getMax();
+
+                                if (p != null)
+                                {
+                                    Double epower = p.doubleValue();
+
+                                    buildtheMap(theMap, theList, windpowerstationId, item, speed, epower);
+                                }
+                            }
+
+                        }
+
+                    }
+                }
+
+            }
+        }
+    }
+
+    private static void buildtheMap(Map<String, FitClassVo> theMap, List<FitClassVo> theList, String windpowerstationId, FitClassVo item, Double speed, Double epower)
+    {
+        Double value1 = item.getPower() - epower;
+        value1 *= value1;
+        Double value2 = item.getPower();
+        value2 *= value2;
+
+
+
+        if (theMap.containsKey(item.getWindturbineId()))
+        {
+            FitClassVo vo= theMap.get(item.getWindturbineId());
+            int number=vo.getNumber();
+            vo.setSpeed(item.getSpeed()+speed);
+            vo.setPower(item.getPower()+value1);
+            vo.setEpower(item.getEpower()+value2);
+            vo.setNumber(number++);
+            theMap.put(item.getWindturbineId(),vo);
+        }
+        else
+        {
+            FitClassVo fit = new FitClassVo();
+            fit.setWindturbineId(item.getWindturbineId());
+            fit.setWindpowerstationId(windpowerstationId);
+            fit.setModelId(item.getModelId());
+            fit.setSpeed(speed);
+            fit.setPower(value1);
+            fit.setEpower(value2);
+            fit.setNumber(1);
+            theList.add(fit);
+            theMap.put(item.getWindturbineId(), fit);
+        }
+    }
+
+}
+

+ 26 - 26
realtime/generationXK-service/src/main/java/com/gyee/generation/service/InputOrOutPutService.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
 import com.gyee.generation.service.auto.IProEconInOrOutSpeedTotal2Service;
@@ -73,34 +74,41 @@ public class InputOrOutPutService {
                         {
                             total2=total2o.get();
                         }
-                        if (total1 == null)
+                        if (total1 != null)
                         {
-                            total1 = new ProEconInOrOutSpeedTotal();
-                            total1.setWindturbineId(wt.getId());
-                            total1.setWindpowerstationId(wt.getWindpowerstationId());
-                            total1.setProjectId(wt.getProjectId());
-                            total1.setLineId(wt.getLineId());
-                            total1.setRecordDate(daybegin);
-
-                            proEconInOrOutSpeedTotalService.save(total1);
+
+                            QueryWrapper<ProEconInOrOutSpeedTotal> wrapper = new QueryWrapper<>();
+                            wrapper.eq("id",total1.getId());
+                            proEconInOrOutSpeedTotalService.remove(wrapper);
+
                         }
-                        if (total2 == null)
+                        if (total2 != null)
                         {
+                            QueryWrapper<ProEconInOrOutSpeedTotal2> wrapper = new QueryWrapper<>();
+                            wrapper.eq("id",total2.getId());
+                            proEconInOrOutSpeedTotal2Service.remove(wrapper);
 
-                            total2 = new ProEconInOrOutSpeedTotal2();
-                            total2.setWindturbineId(wt.getId());
-                            total2.setWindpowerstationId(wt.getWindpowerstationId());
-                            total2.setProjectId(wt.getProjectId());
-                            total2.setLineId(wt.getLineId());
-                            total2.setRecordDate(daybegin);
-                            proEconInOrOutSpeedTotal2Service.save(total2);
                         }
 
+                        total1 = new ProEconInOrOutSpeedTotal();
+                        total1.setWindturbineId(wt.getId());
+                        total1.setWindpowerstationId(wt.getWindpowerstationId());
+                        total1.setProjectId(wt.getProjectId());
+                        total1.setLineId(wt.getLineId());
+                        total1.setRecordDate(daybegin);
 
+                        total2 = new ProEconInOrOutSpeedTotal2();
+                        total2.setWindturbineId(wt.getId());
+                        total2.setWindpowerstationId(wt.getWindpowerstationId());
+                        total2.setProjectId(wt.getProjectId());
+                        total2.setLineId(wt.getLineId());
+                        total2.setRecordDate(daybegin);
 
-                        newMethod(end, daybegin, monthbegin, yearbegin,  wt.getId(), total1, total2);
 
+                        newMethod(end, daybegin, monthbegin, yearbegin,  wt.getId(), total1, total2);
 
+                        proEconInOrOutSpeedTotalService.save(total1);
+                        proEconInOrOutSpeedTotal2Service.save(total2);
                     }
             
                 }
@@ -154,14 +162,6 @@ public class InputOrOutPutService {
         
 
 
-
-        //total1.INPUTSMALLRATIO = items.Where(it => it.DAYINPUTSMALL > 0 && it.DAYINPUTSMALL != null).Average(it => it.DAYINPUTSMALL);
-        //total1.INPUTBIGRATIO = items.Where(it => it.DAYINPUTSMALL > 0 && it.DAYINPUTSMALL != null).Average(it => it.DAYINPUTSMALL);
-        //total1.OUTPUTSMALLRATIO = items.Where(it => it.DAYINPUTSMALL > 0 && it.DAYINPUTSMALL != null).Average(it => it.DAYINPUTSMALL);
-        //total1.OUTPUTBIGMAXRATIO = items.Where(it => it.DAYINPUTSMALL > 0 && it.DAYINPUTSMALL != null).Average(it => it.DAYINPUTSMALL);
-
-
-
         Integer count = 0;
         
         List<ProEconInputOrOutputSpeed> recordList =proEconInputOrOutputSpeedService.list().stream()

+ 16 - 16
realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventService.java

@@ -122,7 +122,7 @@ public class LimitEventService {
         Map<String, Map<String, ProBasicWppoint>> wppointmap = CacheContext.wppointmap;
         CacheContext.wpls.forEach(wp -> {
             Map<String, ProBasicWppoint> wppmap = wppointmap.get(wp.getId());
-            if (wp.getId().indexOf("FDC")>=0) {
+            if (wp.getId().contains("FDC")) {
 
                 if (wppmap.containsKey(ContantXk.SBZT)) {
                     ProBasicWppoint point = wppmap.get(ContantXk.SBZT);
@@ -154,7 +154,7 @@ public class LimitEventService {
         List<ProBasicWindturbine> wtls = CacheContext.wtls;
         Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
         wtls.stream().forEach(wt -> {
-            if (wt.getWindpowerstationId().indexOf("FDC")>=0) {
+            if (wt.getWindpowerstationId().contains("FDC")) {
                 //风机状态
                 Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
                 if (windturbinetestingpointnewMap.containsKey(ContantXk.SBZT)) {
@@ -192,28 +192,28 @@ public class LimitEventService {
 
 
         for (String key : tempWindPowerSpeed.keySet()) {
-            wSpeedDictionary.put(key, tempWindPowerSpeed.get(key).getCode());
+            wSpeedDictionary.put(key, tempWindPowerSpeed.get(key).getNemCode());
             if (tempWindPowerPower.containsKey(key)) {
-                wPowerDictionary.put(key, tempWindPowerPower.get(key).getCode());
+                wPowerDictionary.put(key, tempWindPowerPower.get(key).getNemCode());
             }
         }
 
         for (String key : tempSpeed.keySet()) {
-            speedDictionary.put(key, tempSpeed.get(key).getCode());
+            speedDictionary.put(key, tempSpeed.get(key).getNemCode());
             if (tempPower.containsKey(key)) {
-                powerDictionary.put(key, tempPower.get(key).getCode());
+                powerDictionary.put(key, tempPower.get(key).getNemCode());
             }
 
             if (tempbzglDictionary.containsKey(key)) {
-                bzglDictionary.put(key, tempbzglDictionary.get(key).getCode());
+                bzglDictionary.put(key, tempbzglDictionary.get(key).getNemCode());
             }
 
             if (tempnh.containsKey(key)) {
-                nhDictionary.put(key, tempnh.get(key).getCode());
+                nhDictionary.put(key, tempnh.get(key).getNemCode());
             }
 
             if (tempxd.containsKey(key)) {
-                nhxdDictionary.put(key, tempxd.get(key).getCode());
+                nhxdDictionary.put(key, tempxd.get(key).getNemCode());
             }
         }
 
@@ -223,7 +223,7 @@ public class LimitEventService {
 
 
         for (String key : tempWindPower.keySet()) {
-            windPowerDictionary.put(key, tempWindPower.get(key).getCode());
+            windPowerDictionary.put(key, tempWindPower.get(key).getNemCode());
 
             List<ProEconMainBrownouts> tempMain = proEconMainBrownoutsService.list().stream().filter(i -> StringUtils.empty(i.getStartTime())
                             && i.getWindpowerstationId().equals(key))
@@ -923,7 +923,7 @@ public class LimitEventService {
 
 
                 List<String> pointid=new ArrayList<>();
-                pointid.add(wtpointmap.get(ContantXk.NXDTJSSDL).getCode());
+                pointid.add(wtpointmap.get(ContantXk.NXDTJSSDL).getNemCode());
                 List<PointData> xdbegin=edosUtil.getHistMatrix(pointid,startDate.getTime()/1000);
                 List<PointData> xdend=edosUtil.getHistMatrix(pointid,endDate.getTime()/1000);
 
@@ -946,7 +946,7 @@ public class LimitEventService {
                 double endvalue=0.0;
 
                 List<String> pointid=new ArrayList<>();
-                pointid.add(wtpointmap.get(ContantXk.NXDJCLSSDL).getCode());
+                pointid.add(wtpointmap.get(ContantXk.NXDJCLSSDL).getNemCode());
                 List<PointData> xdbegin=edosUtil.getHistMatrix(pointid,startDate.getTime()/1000);
                 List<PointData> xdend=edosUtil.getHistMatrix(pointid,endDate.getTime()/1000);
 
@@ -975,7 +975,7 @@ public class LimitEventService {
                 double endvalue=0.0;
 
                 List<String> pointid=new ArrayList<>();
-                pointid.add(wtpointmap.get(ContantXk.NXDTJSSDL).getCode());
+                pointid.add(wtpointmap.get(ContantXk.NXDTJSSDL).getNemCode());
                 List<PointData> xdbegin=edosUtil.getHistMatrix(pointid,startDate.getTime()/1000);
                 List<PointData> xdend=edosUtil.getHistMatrix(pointid,endDate.getTime()/1000);
 
@@ -998,7 +998,7 @@ public class LimitEventService {
                 double endvalue=0.0;
 
                 List<String> pointid=new ArrayList<>();
-                pointid.add(wtpointmap.get(ContantXk.NXDJCLSSDL).getCode());
+                pointid.add(wtpointmap.get(ContantXk.NXDJCLSSDL).getNemCode());
                 List<PointData> xdbegin=edosUtil.getHistMatrix(pointid,startDate.getTime()/1000);
                 List<PointData> xdend=edosUtil.getHistMatrix(pointid,endDate.getTime()/1000);
 
@@ -1025,7 +1025,7 @@ public class LimitEventService {
 
 
                 List<String> pointid=new ArrayList<>();
-                pointid.add(wtpointmap.get(ContantXk.NXDTJSSDL).getCode());
+                pointid.add(wtpointmap.get(ContantXk.NXDTJSSDL).getNemCode());
 
                 List<PointData> xdend=edosUtil.getHistMatrix(pointid,endDate.getTime()/1000);
 
@@ -1049,7 +1049,7 @@ public class LimitEventService {
 
 
                 List<String> pointid=new ArrayList<>();
-                pointid.add(wtpointmap.get(ContantXk.NXDJCLSSDL).getCode());
+                pointid.add(wtpointmap.get(ContantXk.NXDJCLSSDL).getNemCode());
 
                 List<PointData> xdend=edosUtil.getHistMatrix(pointid,endDate.getTime()/1000);
 

+ 31 - 31
realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitService.java

@@ -208,7 +208,7 @@ public  class LimitService {
             for (String key : windSL.keySet())
             {
 
-                double t =edosUtil.getRealData(windSL.get(key).getCode()).getPointValueInDouble();
+                double t =edosUtil.getRealData(windSL.get(key).getNemCode()).getPointValueInDouble();
                 if (!slv.containsKey(key))
                 {
 
@@ -220,7 +220,7 @@ public  class LimitService {
                         {
                             RealTimeParameterVo rt = new RealTimeParameterVo();
 
-                            rt.setPoint(windSL.get(key).getCode());
+                            rt.setPoint(windSL.get(key).getNemCode());
                             rt.setTime(dt);
                             rt.setInsertValue(0.0);
                             rList.put(key, rt);
@@ -260,7 +260,7 @@ public  class LimitService {
                         if (slvalue.get(windturbineid) != i)
                         {
                             RealTimeParameterVo rt = new RealTimeParameterVo();
-                            rt.setPoint(windSL.get(windturbineid).getCode());
+                            rt.setPoint(windSL.get(windturbineid).getNemCode());
                             rt.setTime(dt);
                             rt.setInsertValue(i);
 
@@ -291,7 +291,7 @@ public  class LimitService {
                     if (slvalue.get(windturbineid) != i)
                     {
                         RealTimeParameterVo rt = new RealTimeParameterVo();
-                        rt.setPoint(windSL.get(windturbineid).getCode());
+                        rt.setPoint(windSL.get(windturbineid).getNemCode());
                         rt.setTime(dt);
                         rt.setInsertValue(i);
 
@@ -320,7 +320,7 @@ public  class LimitService {
         Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap=CacheContext.wtpAimap;
         Map<String, ProEconLineElectrical> electrical = proEconLineElectricalService.list().stream().collect(Collectors.toMap(ProEconLineElectrical::getLineId, Function.identity()));
         wtls.stream().forEach(wt->{
-            if(wt.getWindpowerstationId().indexOf("FDC")>=0)
+            if(wt.getWindpowerstationId().contains("FDC"))
             {
                 Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
                 if(windturbinetestingpointnewMap.containsKey(ContantXk.GPZT))
@@ -534,7 +534,7 @@ public  class LimitService {
             Map<String,Map<String, ProBasicWppoint>> wppointmap =CacheContext.wppointmap;
             CacheContext.wpls.forEach(wp->{
             Map<String, ProBasicWppoint> wppMap = wppointmap.get(wp.getId());
-            if(wp.getId().indexOf("FDC")>=0)
+            if(wp.getId().contains("FDC"))
             {
                 if(wppMap.containsKey(ContantXk.TPOINT_WP_AGC))
                 {
@@ -586,7 +586,7 @@ public  class LimitService {
                 //风机转速限值1.5MV && 有功控制给定值2MV
 
             wtls.stream().forEach(wt->{
-                if(wt.getWindpowerstationId().indexOf("FDC")>=0)
+                if(wt.getWindpowerstationId().contains("FDC"))
                 {
                     Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
                     if(windturbinetestingpointnewMap.containsKey(ContantXk.XDZT))
@@ -627,20 +627,20 @@ public  class LimitService {
                 Double windpoweragc = 0.0;
                 if (WindPowerAGC.containsKey(item))
                 {
-                    windpoweragc =edosUtil.getRealData(WindPowerAGC.get(item).getCode()).getPointValueInDouble(); ;
+                    windpoweragc =edosUtil.getRealData(WindPowerAGC.get(item).getNemCode()).getPointValueInDouble(); ;
                 }
                 //读取出线有功实时数据
                 Double windpowercxyg = 0.0;
                 if (WindPowerCXYG.containsKey(item))
                 {
-                    windpowercxyg = edosUtil.getRealData(WindPowerCXYG.get(item).getCode()).getPointValueInDouble();
+                    windpowercxyg = edosUtil.getRealData(WindPowerCXYG.get(item).getNemCode()).getPointValueInDouble();
                 }
 
                  //   #region 读取历史数据
                 Double windpoweragcHis = 0.0;
                 if (WindPowerAGC.containsKey(item))
                 {
-                    DNAStatVal[] hsls= edosUtil.getHistStat(WindPowerAGC.get(item).getCode(), begin.getTime()/1000, time.getTime()/1000,1);
+                    DNAStatVal[] hsls= edosUtil.getHistStat(WindPowerAGC.get(item).getNemCode(), begin.getTime()/1000, time.getTime()/1000,1);
                     if(StringUtils.notEmp(hsls) && hsls.length>0)
                     {
                         windpoweragcHis =hsls[0].avg.DValue;
@@ -652,7 +652,7 @@ public  class LimitService {
                 if (WindPowerCXYG.containsKey(item))
                 {
 
-                    DNAStatVal[] hsls= edosUtil.getHistStat(WindPowerCXYG.get(item).getCode(), begin.getTime()/1000, time.getTime()/1000,1);
+                    DNAStatVal[] hsls= edosUtil.getHistStat(WindPowerCXYG.get(item).getNemCode(), begin.getTime()/1000, time.getTime()/1000,1);
                     if(StringUtils.notEmp(hsls) && hsls.length>0)
                     {
                         windpoweragcHis =hsls[0].avg.DValue;
@@ -662,7 +662,7 @@ public  class LimitService {
                 Double windpowerzsglHis = 0.0;
                 if (WindPowerZSGL.containsKey(item))
                 {
-                    DNAStatVal[] hsls= edosUtil.getHistStat(WindPowerZSGL.get(item).getCode(), begin.getTime()/1000, time.getTime()/1000,1);
+                    DNAStatVal[] hsls= edosUtil.getHistStat(WindPowerZSGL.get(item).getNemCode(), begin.getTime()/1000, time.getTime()/1000,1);
                     if(StringUtils.notEmp(hsls) && hsls.length>0)
                     {
                         windpoweragcHis =hsls[0].avg.DValue;
@@ -721,7 +721,7 @@ public  class LimitService {
                         //{
 
                         //限电受累
-                        String id2 = WindturbineXDSL.get(key).getCode();
+                        String id2 = WindturbineXDSL.get(key).getNemCode();
                         Double xdsl = edosUtil.getRealData(id2).getPointValueInDouble();
                         Double val = 0.0;
                         if (xdsl == 1)
@@ -730,7 +730,7 @@ public  class LimitService {
                         }
                         RealTimeParameterVo rt = new RealTimeParameterVo();
 
-                        rt.setPoint(WindTurbineD.get(item).get(key).getCode());
+                        rt.setPoint(WindTurbineD.get(item).get(key).getNemCode());
                         rt.setTime(time);
                         rt.setInsertValue(val);
                         projectRT.add(rt);
@@ -740,7 +740,7 @@ public  class LimitService {
 
                     RealTimeParameterVo fcrt = new RealTimeParameterVo();
 
-                    fcrt.setPoint(WindPowerXDZT.get(item).getCode());
+                    fcrt.setPoint(WindPowerXDZT.get(item).getNemCode());
                     fcrt.setTime(time);
                     fcrt.setInsertValue(0.0);
                     projectRT.add(fcrt);
@@ -826,7 +826,7 @@ public  class LimitService {
                             //if (d == 1d)
                             //{
                             //限电受累
-                            String id2 = WindturbineXDSL.get(key).getCode();
+                            String id2 = WindturbineXDSL.get(key).getNemCode();
                             Double xdsl = edosUtil.getRealData(id2).getPointValueInDouble();
                             Double val = 0.0;
                             if (xdsl == 1)
@@ -835,7 +835,7 @@ public  class LimitService {
                             }
                             RealTimeParameterVo rt = new RealTimeParameterVo();
 
-                            rt.setPoint(WindTurbineD.get(item).get(key).getCode());
+                            rt.setPoint(WindTurbineD.get(item).get(key).getNemCode());
                             rt.setTime(time);
                             rt.setInsertValue(val);
                             projectRT.add(rt);
@@ -846,7 +846,7 @@ public  class LimitService {
                         }
                         RealTimeParameterVo fcrt = new RealTimeParameterVo();
   
-                        fcrt.setPoint(WindPowerXDZT.get(item).getCode());
+                        fcrt.setPoint(WindPowerXDZT.get(item).getNemCode());
                         fcrt.setTime(time);
                         fcrt.setInsertValue(0.0);
                         projectRT.add(fcrt);
@@ -854,7 +854,7 @@ public  class LimitService {
                     else
                     {
                         RealTimeParameterVo fcrt = new RealTimeParameterVo();
-                        fcrt.setPoint(WindPowerXDZT.get(item).getCode());
+                        fcrt.setPoint(WindPowerXDZT.get(item).getNemCode());
                         fcrt.setTime(time);
                         fcrt.setInsertValue(1.0);
                         projectRT.add(fcrt);
@@ -892,7 +892,7 @@ public  class LimitService {
 
                                 if (WindturbineQXDic4.containsKey(key))
                                 {
-                                    Double tempk = edosUtil.getRealData(WindturbineQXDic4.get(key).getCode()).getPointValueInDouble();
+                                    Double tempk = edosUtil.getRealData(WindturbineQXDic4.get(key).getNemCode()).getPointValueInDouble();
 
                                     if (tempk >= 3)
                                     {
@@ -910,7 +910,7 @@ public  class LimitService {
                                 if(windturbinetestingpointnewMap.containsKey(ContantXk.CJ_SSFS))
                                 {
                                     ProBasicEquipmentPoint xdztPoint = windturbinetestingpointnewMap.get(ContantXk.CJ_SSFS);
-                                    Double rtbbb = edosUtil.getRealData(xdztPoint.getCode()).getPointValueInDouble();
+                                    Double rtbbb = edosUtil.getRealData(xdztPoint.getNemCode()).getPointValueInDouble();
                                     if (rtbbb >= xz2 * 0.9)
                                     {
                                         tempb = false;
@@ -922,7 +922,7 @@ public  class LimitService {
 
 
                             //限出力状态
-                            String id1 = WindTurbineE.get(key).getCode();
+                            String id1 = WindTurbineE.get(key).getNemCode();
                             Double xcl = edosUtil.getRealData(id1).getPointValueInDouble();
 
 
@@ -931,7 +931,7 @@ public  class LimitService {
 
 
                             //限电受累
-                            String id2 = WindturbineXDSL.get(key).getCode();
+                            String id2 = WindturbineXDSL.get(key).getNemCode();
                             Double xdsl = edosUtil.getRealData(id2).getPointValueInDouble();
                             Double val = 0.0;
                             if (xdsl == 1 || xcl == 1 || tempb)
@@ -940,7 +940,7 @@ public  class LimitService {
                             }
                             RealTimeParameterVo rt = new RealTimeParameterVo();
 
-                            rt.setPoint(WindTurbineD.get(item).get(key).getCode());
+                            rt.setPoint(WindTurbineD.get(item).get(key).getNemCode());
                             rt.setTime(time);
                             rt.setInsertValue(val);
                             projectRT.add(rt);
@@ -1058,12 +1058,12 @@ public  class LimitService {
 //                {
 //                    Console.WriteLine("1");
 //                }
-                String point = xd.getCode();//重点注意!!!!
+                String point = xd.getNemCode();//重点注意!!!!
                 Double val = 0.0;
 
                 if (WindturbineXDSL.containsKey(key))
                 {
-                    Double ret = edosUtil.getRealData(WindturbineXDSL.get(key).getCode()).getPointValueInDouble();
+                    Double ret = edosUtil.getRealData(WindturbineXDSL.get(key).getNemCode()).getPointValueInDouble();
 
                     if (ret == 1)
                     {
@@ -1144,12 +1144,12 @@ public  class LimitService {
 //                if(windturbinetestingpointnewMap.containsKey(ContantXk.DI11139))
 //                {
 //                    ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.DI11139);
-//                    WindturbineQXDic2.put(wt.getCode(),point);
+//                    WindturbineQXDic2.put(wt.getNemCode(),point);
 //                }
 //                if(windturbinetestingpointnewMap.containsKey(ContantXk.DI10923))
 //                {
 //                    ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.DI10923);
-//                    WindturbineQXDic2.put(wt.getCode(),point);
+//                    WindturbineQXDic2.put(wt.getNemCode(),point);
 //                }
 
                 if(windturbinetestingpointnewMap.containsKey(ContantXk.XDZT))
@@ -1166,7 +1166,7 @@ public  class LimitService {
                     {
                         WindturbineQXDic.put(dis.getWindturbineId(), new ArrayList<String>());
                     }
-                    WindturbineQXDic.get(dis.getWindturbineId()).add(dis.getCode());
+                    WindturbineQXDic.get(dis.getWindturbineId()).add(dis.getNemCode());
                 }
 
         }
@@ -1188,7 +1188,7 @@ public  class LimitService {
 //                    Console.WriteLine(key);
 //
 //                }
-                String point = item.getCode();//重点注意!!!!
+                String point = item.getNemCode();//重点注意!!!!
                 Double val = 0.0;
                 if (CacheContext.wtmap.containsKey(key) && WindturbineQXDic.containsKey(key))
                 {
@@ -1226,7 +1226,7 @@ public  class LimitService {
 
                     if (WindturbineQXDic2.containsKey(key))
                     {
-                        PointData k = edosUtil.getRealData(WindturbineQXDic2.get(key).getCode());
+                        PointData k = edosUtil.getRealData(WindturbineQXDic2.get(key).getNemCode());
 
                         b = b && (k.getPointValueInDouble() == 0);
                     }

文件差異過大導致無法顯示
+ 462 - 670
realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingService.java


+ 11 - 11
realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownService.java

@@ -161,7 +161,7 @@ public class ShutdownService {
             {
                 ProBasicEquipmentPoint ygglPoint = windturbinetestingpointnewMap.get(ContantXk.CJ_SSGL);
 
-                powerPoints.put(ygglPoint.getCode(),ygglPoint);
+                powerPoints.put(ygglPoint.getNemCode(),ygglPoint);
                 powerpointList.add(ygglPoint);
             }
 
@@ -279,10 +279,10 @@ public class ShutdownService {
             double power = 0;
             if (powerPoints.containsKey(key))
             {
-                power = StringUtils.round(edosUtil.getRealData(powerPoints.get(key).getCode()).getPointValueInDouble(),4);
+                power = StringUtils.round(edosUtil.getRealData(powerPoints.get(key).getNemCode()).getPointValueInDouble(),4);
 
             }
-            Double value = StringUtils.round(edosUtil.getRealData(statusPoints.get(key).getCode()).getPointValueInDouble(),4);
+            Double value = StringUtils.round(edosUtil.getRealData(statusPoints.get(key).getNemCode()).getPointValueInDouble(),4);
 
             if (power > 1)
             {
@@ -456,7 +456,7 @@ public class ShutdownService {
 
                         if (speedpointMap.containsKey(s))
                         {
-                            double value =edosUtil.getRealData(speedpointMap.get(s).getCode()).getPointValueInDouble();
+                            double value =edosUtil.getRealData(speedpointMap.get(s).getNemCode()).getPointValueInDouble();
                             input.setSpeed(value);
                         }
 
@@ -474,7 +474,7 @@ public class ShutdownService {
                         input.setInputOrOutput(0);
                         if (speedpointMap.containsKey(s))
                         {
-                            double value =edosUtil.getRealData(speedpointMap.get(s).getCode()).getPointValueInDouble();
+                            double value =edosUtil.getRealData(speedpointMap.get(s).getNemCode()).getPointValueInDouble();
                             input.setSpeed(value);
                         }
 
@@ -531,15 +531,15 @@ public class ShutdownService {
         List<PointData> speedDataList1;
         String type1;
 
-        if (windTurbines.get(status.getWindturbineId()).getWindpowerstationId().indexOf("GDC") >= 0)
+        if (windTurbines.get(status.getWindturbineId()).getWindpowerstationId().contains("GDC"))
         {
-            String point=gzdpointMap.get(windTurbines.get(status.getWindturbineId()).getWindpowerstationId()).getCode();
+            String point=gzdpointMap.get(windTurbines.get(status.getWindturbineId()).getWindpowerstationId()).getNemCode();
             speedDataList1 =edosUtil.getHistoryDatasSnap(point,status.getStopTime().getTime()/1000,status.getStartTime().getTime()/1000);
             type1 = "GDC";
         }
         else
         {
-            String point=speedpointMap.get(status.getWindturbineId()).getCode();
+            String point=speedpointMap.get(status.getWindturbineId()).getNemCode();
             speedDataList1 =edosUtil.getHistoryDatasSnap(point,status.getStopTime().getTime()/1000,status.getStartTime().getTime()/1000);
 
             type1 = "FDC";
@@ -727,7 +727,7 @@ public class ShutdownService {
                 double endvalue=0.0;
 
                 List<String> pointid=new ArrayList<>();
-                pointid.add(wtpointmap.get(ContantXk.NGZSSDL).getCode());
+                pointid.add(wtpointmap.get(ContantXk.NGZSSDL).getNemCode());
                 List<PointData> xdbegin=edosUtil.getHistMatrix(pointid,startDate.getTime()/1000);
                 List<PointData> xdend=edosUtil.getHistMatrix(pointid,endDate.getTime()/1000);
 
@@ -760,7 +760,7 @@ public class ShutdownService {
 
 
                 List<String> pointid=new ArrayList<>();
-                pointid.add(wtpointmap.get(ContantXk.NGZSSDL).getCode());
+                pointid.add(wtpointmap.get(ContantXk.NGZSSDL).getNemCode());
                 List<PointData> xdbegin=edosUtil.getHistMatrix(pointid,startDate.getTime()/1000);
                 List<PointData> xdend=edosUtil.getHistMatrix(pointid,endDate.getTime()/1000);
 
@@ -787,7 +787,7 @@ public class ShutdownService {
 
 
                 List<String> pointid=new ArrayList<>();
-                pointid.add(wtpointmap.get(ContantXk.NGZSSDL).getCode());
+                pointid.add(wtpointmap.get(ContantXk.NGZSSDL).getNemCode());
                 List<PointData> xdend=edosUtil.getHistMatrix(pointid,startDate.getTime()/1000);
 
 

文件差異過大導致無法顯示
+ 1445 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java


文件差異過大導致無法顯示
+ 1259 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo2Service.java


文件差異過大導致無法顯示
+ 1259 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo3Service.java


+ 786 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo5Service.java

@@ -0,0 +1,786 @@
+package com.gyee.generation.service;//package com.gyee.generation.service;
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.service.auto.*;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.statisticcs.Initial;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class WindPowerInfo5Service {
+
+    private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo1Service.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconPowerstationInfoDay5Service proEconPowerstationInfoDay5Service;
+
+
+
+
+    /**
+     * 计算区域日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calRegionInfoDay(Date recordDate) throws Exception {
+
+        List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                        && i.getLocation().equals(Location.cp.getValue()))
+                .collect(Collectors.toList());
+        if(!wpinfodayls.isEmpty())
+        {
+
+            Map<String, Map<String, List<ProEconPowerstationInfoDay5>>>rgmap=new HashMap<>();
+
+
+
+
+            for(ProEconPowerstationInfoDay5 wpinfo:wpinfodayls)
+            {
+
+                if(rgmap.containsKey(wpinfo.getCompanyId()))
+                {
+                    Map<String, List<ProEconPowerstationInfoDay5>> map=rgmap.get(wpinfo.getCompanyId());
+                    List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
+                    List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
+                    List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
+
+                    if(wpinfo.getForeignKeyId().equals("-1"))
+                    {
+                        fdls.add(wpinfo);
+                    }else if(wpinfo.getForeignKeyId().equals("-2")){
+                        gfls.add(wpinfo);
+                    }
+                    qbls.add(wpinfo);
+                }else
+                {
+                    Map<String, List<ProEconPowerstationInfoDay5>> map=new HashMap<>();
+
+                    List<ProEconPowerstationInfoDay5> qbls=new ArrayList<>();
+                    List<ProEconPowerstationInfoDay5> gfls=new ArrayList<>();
+                    List<ProEconPowerstationInfoDay5> fdls=new ArrayList<>();
+
+                    if(wpinfo.getForeignKeyId().equals("-1"))
+                    {
+                        fdls.add(wpinfo);
+                    }else if(wpinfo.getForeignKeyId().equals("-2")){
+                        gfls.add(wpinfo);
+                    }
+                    qbls.add(wpinfo);
+                    map.put("qb",qbls);
+                    map.put("fd",fdls);
+                    map.put("gf",gfls);
+                }
+            }
+
+
+            //判断是否有重复记录,先删除重复记录
+            List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
+                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                            && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay5::getId)
+                    .collect(Collectors.toList());
+
+            if (idls != null && idls.size() > 0) {
+
+                proEconPowerstationInfoDay5Service.removeByIds(idls);
+
+            }
+            for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay5>>> entry:rgmap.entrySet()){
+                Map<String, List<ProEconPowerstationInfoDay5>> map=entry.getValue();
+                List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
+                List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
+                List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
+//                if(CacheContext.cpwpmap.size()==qbls.size())
+//                {
+
+                ProEconPowerstationInfoDay5 qb=new ProEconPowerstationInfoDay5();
+                ProEconPowerstationInfoDay5 fd=new ProEconPowerstationInfoDay5();
+                ProEconPowerstationInfoDay5 gf=new ProEconPowerstationInfoDay5();
+
+                if(CacheContext.rgmap.containsKey(entry.getKey()))
+                {
+                    ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
+                    gf.setRegionId(cp.getId());
+
+                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setForeignKeyId("-2");
+                    gf.setLocation(Location.rg.getValue());
+
+                    fd.setRegionId(cp.getId());
+
+                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setForeignKeyId("-1");
+                    fd.setLocation(Location.rg.getValue());
+
+                    qb.setRegionId(cp.getId());
+
+                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setForeignKeyId("0");
+                    qb.setLocation(Location.rg.getValue());
+
+                    //计算区域级全部
+                    calCp(qb,qbls);
+                    //计算公司级风电场站
+                    calCp(fd,fdls);
+                    //计算公司级光电场站
+                    calCp(gf,gfls);
+
+                    proEconPowerstationInfoDay5Service.save(qb);
+                    proEconPowerstationInfoDay5Service.save(fd);
+                    proEconPowerstationInfoDay5Service.save(gf);
+                }
+
+
+//                }else
+//                {
+//                    logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
+//
+//                }
+
+
+
+
+
+            };
+        }
+
+    }
+
+    /**
+     * 计算公司日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calCompanyInfoDay(Date recordDate) throws Exception {
+
+        List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                        && i.getLocation().equals(Location.wp.getValue()))
+                .collect(Collectors.toList());
+        if(!wpinfodayls.isEmpty())
+        {
+
+            Map<String, Map<String, List<ProEconPowerstationInfoDay5>>>cpmap=new HashMap<>();
+
+
+
+
+            for(ProEconPowerstationInfoDay5 wpinfo:wpinfodayls)
+            {
+
+                if(cpmap.containsKey(wpinfo.getCompanyId()))
+                {
+                    Map<String, List<ProEconPowerstationInfoDay5>> map=cpmap.get(wpinfo.getCompanyId());
+                    List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
+                    List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
+                    List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
+
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
+                    {
+                        fdls.add(wpinfo);
+                    }else {
+                        gfls.add(wpinfo);
+                    }
+                    qbls.add(wpinfo);
+                }else
+                {
+                    Map<String, List<ProEconPowerstationInfoDay5>> map=new HashMap<>();
+
+                    List<ProEconPowerstationInfoDay5> qbls=new ArrayList<>();
+                    List<ProEconPowerstationInfoDay5> gfls=new ArrayList<>();
+                    List<ProEconPowerstationInfoDay5> fdls=new ArrayList<>();
+
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
+                    {
+                        fdls.add(wpinfo);
+                    }else {
+                        gfls.add(wpinfo);
+                    }
+                    qbls.add(wpinfo);
+                    map.put("qb",qbls);
+                    map.put("fd",fdls);
+                    map.put("gf",gfls);
+                }
+            }
+
+
+            //判断是否有重复记录,先删除重复记录
+            List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
+                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                            && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay5::getId)
+                    .collect(Collectors.toList());
+
+            if (idls != null && idls.size() > 0) {
+
+                proEconPowerstationInfoDay5Service.removeByIds(idls);
+
+            }
+            for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay5>>> entry:cpmap.entrySet()){
+                Map<String, List<ProEconPowerstationInfoDay5>> map=entry.getValue();
+                List<ProEconPowerstationInfoDay5> qbls=map.get("qb");
+                List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
+                List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
+//                if(CacheContext.cpwpmap.size()==qbls.size())
+//                {
+
+                ProEconPowerstationInfoDay5 qb=new ProEconPowerstationInfoDay5();
+                ProEconPowerstationInfoDay5 fd=new ProEconPowerstationInfoDay5();
+                ProEconPowerstationInfoDay5 gf=new ProEconPowerstationInfoDay5();
+
+                if(CacheContext.cpmap.containsKey(entry.getKey()))
+                {
+                    ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
+                    gf.setRegionId(cp.getRegionId());
+                    gf.setCompanyId(cp.getId());
+                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setForeignKeyId("-2");
+                    gf.setLocation(Location.cp.getValue());
+
+
+
+                    fd.setRegionId(cp.getRegionId());
+                    fd.setCompanyId(cp.getId());
+                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setForeignKeyId("-1");
+                    fd.setLocation(Location.cp.getValue());
+
+                    qb.setRegionId(cp.getRegionId());
+                    qb.setCompanyId(cp.getId());
+                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setForeignKeyId("0");
+                    qb.setLocation(Location.cp.getValue());
+
+                    //计算公司级全部场站
+                    calCp(qb,qbls);
+                    //计算公司级风电场站
+                    calCp(fd,fdls);
+                    //计算公司级光电场站
+                    calCp(gf,gfls);
+
+                    proEconPowerstationInfoDay5Service.save(qb);
+                    proEconPowerstationInfoDay5Service.save(fd);
+                    proEconPowerstationInfoDay5Service.save(gf);
+                }
+
+
+//                }else
+//                {
+//                    logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
+//
+//                }
+
+
+
+
+
+            };
+        }
+
+    }
+
+    private void calCp(ProEconPowerstationInfoDay5 pewp,List<ProEconPowerstationInfoDay5> ls) throws Exception {
+
+        if(!ls.isEmpty())
+        {
+
+            for(ProEconPowerstationInfoDay5 pepid:ls)
+            {
+                //日发电量(升压站)
+                pewp.setRfdldb(StringUtils.round(pewp.getRfdldb()+pepid.getRfdldb(),2));
+                //日上网电量
+                pewp.setRswdldb(StringUtils.round(pewp.getRswdldb()+pepid.getRswdldb(),2));
+                //日工网购网电量
+                pewp.setRgwgwdldb(StringUtils.round(pewp.getRgwgwdldb()+pepid.getRgwgwdldb(),2));
+                //日农网购网电量
+                pewp.setRnwgwdldb(StringUtils.round(pewp.getRnwgwdldb()+pepid.getRnwgwdldb(),2));
+                //日综合场用电量(电表)
+                pewp.setRzhcydldb(StringUtils.round(pewp.getRzhcydldb()+pepid.getRzhcydldb(),2));
+                //日厂用电量
+                pewp.setRfdcydldb(StringUtils.round(pewp.getRfdcydldb()+pepid.getRfdcydldb(),2));
+
+                //月发电量(升压站)
+                pewp.setYfdldb(StringUtils.round(pewp.getYfdldb()+pepid.getYfdldb(),2));
+                //月上网电量
+                pewp.setYswdldb(StringUtils.round(pewp.getYswdldb()+pepid.getYswdldb(),2));
+                //月工网购网电量
+                pewp.setYgwgwdldb(StringUtils.round(pewp.getYgwgwdldb()+pepid.getYgwgwdldb(),2));
+                //月农网购网电量
+                pewp.setYnwgwdldb(StringUtils.round(pewp.getYnwgwdldb()+pepid.getYnwgwdldb(),2));
+                //月综合场用电量(电表)
+                pewp.setYzhcydldb(StringUtils.round(pewp.getYzhcydldb()+pepid.getYzhcydldb(),2));
+                //月厂用电量
+                pewp.setYfdcydldb(StringUtils.round(pewp.getYfdcydldb()+pepid.getYfdcydldb(),2));
+
+                //年发电量(升压站)
+                pewp.setNfdldb(StringUtils.round(pewp.getNfdldb()+pepid.getNfdldb(),2));
+                //年上网电量
+                pewp.setNswdldb(StringUtils.round(pewp.getNswdldb()+pepid.getNswdldb(),2));
+                //年工网购网电量
+                pewp.setNgwgwdldb(StringUtils.round(pewp.getNgwgwdldb()+pepid.getNgwgwdldb(),2));
+                //年农网购网电量
+                pewp.setNnwgwdldb(StringUtils.round(pewp.getNnwgwdldb()+pepid.getNnwgwdldb(),2));
+                //年综合场用电量(电表)
+                pewp.setNzhcydldb(StringUtils.round(pewp.getNzhcydldb()+pepid.getNzhcydldb(),2));
+                //年厂用电量
+                pewp.setNfdcydldb(StringUtils.round(pewp.getNfdcydldb()+pepid.getNfdcydldb(),2));
+
+            }
+
+        }
+    }
+    /**
+     * 计算场站日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calWindpowerInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncDay(c.getTime());
+
+
+        List<ProEconPowerstationInfoDay5> wpinfodayls=new ArrayList<>();
+
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                        && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay5::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconPowerstationInfoDay5Service.removeByIds(idls);
+
+        }
+        for(ProBasicWindpowerstation wp:CacheContext.wpls)
+        {
+            if(CacheContext.wppointmap.containsKey(wp.getId()))
+            {
+                Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(wp.getId());
+
+                ProEconPowerstationInfoDay5 pewp=new ProEconPowerstationInfoDay5();
+                Initial.initial(pewp);
+                pewp.setRegionId(wp.getRegionId());
+                pewp.setCompanyId(wp.getCompanyId());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setForeignKeyId("0");
+                pewp.setWindpowerstationId(wp.getId());
+                pewp.setLocation(Location.wp.getValue());
+
+                //昨日的统计结果
+                List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
+                Calendar cl=Calendar.getInstance();
+                cl.setTime(recordDate);
+                if(cl.get(Calendar.DAY_OF_MONTH)!=1)
+
+                {
+                    pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                                    && i.getWindpowerstationId().equals(wp.getId())
+                                    && i.getLocation().equals(Location.wp.getValue()))
+                            .collect(Collectors.toList());
+                }
+                extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
+/*******************************************年信息统计*********************************************************/
+//                wpinfodayls.add(pewp);
+                proEconPowerstationInfoDay5Service.save(pewp);
+
+            }
+
+
+        }
+
+    }
+
+    /**
+     * 计算项目日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calProjectInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncDay(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.pjmap.containsKey(i.getProjectId())
+                        && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay5::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconPowerstationInfoDay5Service.removeByIds(idls);
+
+        }
+        for(ProBasicProject pj:CacheContext.pjls)
+        {
+            if(CacheContext.wppointmap.containsKey(pj.getId()))
+            {
+                Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(pj.getId());
+
+                ProEconPowerstationInfoDay5 pewp=new ProEconPowerstationInfoDay5();
+                Initial.initial(pewp);
+                pewp.setForeignKeyId("0");
+                pewp.setWindpowerstationId(pj.getWindpowerstationId());
+                pewp.setProjectId(pj.getId());
+                pewp.setLocation(Location.pj.getValue());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+
+                //昨日的统计结果
+                List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
+                Calendar cl=Calendar.getInstance();
+                cl.setTime(recordDate);
+                if(cl.get(Calendar.DAY_OF_MONTH)!=1)
+
+                {
+                    pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                                    && i.getProjectId().equals(pj.getId())
+                                    && i.getLocation().equals(Location.pj.getValue()))
+                            .collect(Collectors.toList());
+                }
+                extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
+
+
+                proEconPowerstationInfoDay5Service.save(pewp);
+
+            }
+
+
+        }
+
+    }
+    /**
+     * 计算线路日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calLineInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncDay(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.lnmap.containsKey(i.getLineId())
+                        && i.getLocation().equals(Location.ln.getValue()) ).map(ProEconPowerstationInfoDay5::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconPowerstationInfoDay5Service.removeByIds(idls);
+
+        }
+        for(ProBasicLine ln:CacheContext.lnls)
+        {
+            if(CacheContext.wppointmap.containsKey(ln.getId()))
+            {
+                Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(ln.getId());
+
+                ProEconPowerstationInfoDay5 pewp=new ProEconPowerstationInfoDay5();
+                Initial.initial(pewp);
+                pewp.setForeignKeyId("0");
+                pewp.setLineId(ln.getId());
+                pewp.setLocation(Location.ln.getValue());
+                pewp.setProjectId(ln.getProjectId());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+
+                //昨日的统计结果
+                List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
+                Calendar cl=Calendar.getInstance();
+                cl.setTime(recordDate);
+                if(cl.get(Calendar.DAY_OF_MONTH)!=1)
+
+                {
+                    pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                                    && i.getLineId().equals(ln.getId())
+                                    && i.getLocation().equals(Location.ln.getValue()))
+                            .collect(Collectors.toList());
+                }
+                extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
+
+                proEconPowerstationInfoDay5Service.save(pewp);
+
+            }
+
+
+        }
+
+    }
+
+    private void extracted(Date recordDate, Date end, Date begin,Map<String, ProBasicWppoint> pointmap, ProEconPowerstationInfoDay5 pewp,List<ProEconPowerstationInfoDay5> pepid1ls) throws Exception {
+        /*******************************************日信息统计*********************************************************/
+
+                double rfdlsyz=0.0;
+                double rswdlsyz=0.0;
+                double rgwgwdlsyz=0.0;
+                double rnwgwdlsyz=0.0;
+                if(pointmap.containsKey(ContantXk.RFDLSYZ));
+                {
+                    ProBasicWppoint point=pointmap.get(ContantXk.RFDLSYZ);
+                    PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+                    if(StringUtils.notEmp(pointValue))
+                    {
+                        //日发电量(升压站)
+                        rfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                        pewp.setRfdldb(rfdlsyz);
+
+                    }
+                }
+
+                if(pointmap.containsKey(ContantXk.RSWDL));
+                {
+                    ProBasicWppoint point=pointmap.get(ContantXk.RSWDL);
+                    PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+                    if(StringUtils.notEmp(pointValue))
+                    {
+                        //日上网电量
+                        rswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                        pewp.setRswdldb(rswdlsyz);
+
+                    }
+                }
+
+                if(pointmap.containsKey(ContantXk.RGWGWDL));
+                {
+                    ProBasicWppoint point=pointmap.get(ContantXk.RGWGWDL);
+                    PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+                    if(StringUtils.notEmp(pointValue))
+                    {
+                        //日工网购网电量
+                        rgwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                        pewp.setRgwgwdldb(rgwgwdlsyz);
+
+                    }
+                }
+
+                if(pointmap.containsKey(ContantXk.RNWGWDL));
+                {
+                    ProBasicWppoint point=pointmap.get(ContantXk.RNWGWDL);
+                    PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+                    if(StringUtils.notEmp(pointValue))
+                    {
+                        //日农网购网电量
+                        rnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                        pewp.setRnwgwdldb(rnwgwdlsyz);
+
+                    }
+                }
+
+                //日综合场用电量(电表)
+                pewp.setRzhcydldb(StringUtils.round(rfdlsyz-rswdlsyz+rgwgwdlsyz+rnwgwdlsyz,2));
+
+
+                if(pointmap.containsKey(ContantXk.RCYDL));
+                {
+                    ProBasicWppoint point=pointmap.get(ContantXk.RCYDL);
+                    PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+                    if(StringUtils.notEmp(pointValue))
+                    {
+                        //日厂用电量
+                        pewp.setRfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+                    }
+                }
+
+
+/*******************************************日信息统计*********************************************************/
+
+/*******************************************月信息统计*********************************************************/
+
+        double yfdlsyz=0.0;
+        double yswdlsyz=0.0;
+        double ygwgwdlsyz=0.0;
+        double ynwgwdlsyz=0.0;
+        if(pointmap.containsKey(ContantXk.YFDLSYZ));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.YFDLSYZ);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月发电量(升压站)
+                yfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                pewp.setYfdldb(yfdlsyz);
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YSWDL));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.YSWDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月上网电量
+                yswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                pewp.setYswdldb(yswdlsyz);
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YGWGWDL));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.YGWGWDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月工网购网电量
+                ygwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                pewp.setYgwgwdldb(ygwgwdlsyz);
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.YNWGWDL));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.YNWGWDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月农网购网电量
+                ynwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                pewp.setYnwgwdldb(ynwgwdlsyz);
+
+            }
+        }
+
+        //月综合场用电量(电表)
+        pewp.setYzhcydldb(StringUtils.round(yfdlsyz-yswdlsyz+ygwgwdlsyz+ynwgwdlsyz,2));
+
+
+        if(pointmap.containsKey(ContantXk.YCYDL));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.YCYDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //月厂用电量
+                pewp.setYfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+
+
+/*******************************************月信息统计*********************************************************/
+
+/*******************************************年信息统计*********************************************************/
+        double nfdlsyz=0.0;
+        double nswdlsyz=0.0;
+        double ngwgwdlsyz=0.0;
+        double nnwgwdlsyz=0.0;
+        if(pointmap.containsKey(ContantXk.NFDLSYZ));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.NFDLSYZ);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年发电量(升压站)
+                nfdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                pewp.setNfdldb(nfdlsyz);
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NSWDL));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.NSWDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年上网电量
+                nswdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                pewp.setNswdldb(nswdlsyz);
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NGWGWDL));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.NGWGWDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年工网购网电量
+                ngwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                pewp.setNgwgwdldb(ngwgwdlsyz);
+
+            }
+        }
+
+        if(pointmap.containsKey(ContantXk.NNWGWDL));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.NNWGWDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年农网购网电量
+                nnwgwdlsyz=StringUtils.round(pointValue.getPointValueInDouble(),2);
+                pewp.setNnwgwdldb(nnwgwdlsyz);
+
+            }
+        }
+
+        //年综合场用电量(电表)
+        pewp.setNzhcydldb(StringUtils.round(nfdlsyz-nswdlsyz+ngwgwdlsyz+nnwgwdlsyz,2));
+
+
+        if(pointmap.containsKey(ContantXk.NCYDL));
+        {
+            ProBasicWppoint point=pointmap.get(ContantXk.NCYDL);
+            PointData pointValue=edosUtil.getHistMatrix(point.getNemCode(),recordDate.getTime()/1000);
+            if(StringUtils.notEmp(pointValue))
+            {
+                //年厂用电量
+                pewp.setNfdcydldb(StringUtils.round(pointValue.getPointValueInDouble(),2));
+
+            }
+        }
+    }
+
+
+
+
+}
+
+
+
+
+
+
+

+ 694 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo6Service.java

@@ -0,0 +1,694 @@
+package com.gyee.generation.service;//package com.gyee.generation.service;
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.service.auto.*;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.statisticcs.Initial;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class WindPowerInfo6Service {
+
+    private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo1Service.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconPowerstationInfoDay6Service proEconPowerstationInfoDay6Service;
+
+
+
+
+    /**
+     * 计算区域日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calRegionInfoDay(Date recordDate) throws Exception {
+
+        List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                        && i.getLocation().equals(Location.cp.getValue()))
+                .collect(Collectors.toList());
+        if(!wpinfodayls.isEmpty())
+        {
+
+            Map<String, Map<String, List<ProEconPowerstationInfoDay6>>>rgmap=new HashMap<>();
+
+
+
+
+            for(ProEconPowerstationInfoDay6 wpinfo:wpinfodayls)
+            {
+
+                if(rgmap.containsKey(wpinfo.getCompanyId()))
+                {
+                    Map<String, List<ProEconPowerstationInfoDay6>> map=rgmap.get(wpinfo.getCompanyId());
+                    List<ProEconPowerstationInfoDay6> qbls=map.get("qb");
+                    List<ProEconPowerstationInfoDay6> gfls=map.get("fd");
+                    List<ProEconPowerstationInfoDay6> fdls=map.get("gf");
+
+                    if(wpinfo.getForeignKeyId().equals("-1"))
+                    {
+                        fdls.add(wpinfo);
+                    }else if(wpinfo.getForeignKeyId().equals("-2")){
+                        gfls.add(wpinfo);
+                    }
+                    qbls.add(wpinfo);
+                }else
+                {
+                    Map<String, List<ProEconPowerstationInfoDay6>> map=new HashMap<>();
+
+                    List<ProEconPowerstationInfoDay6> qbls=new ArrayList<>();
+                    List<ProEconPowerstationInfoDay6> gfls=new ArrayList<>();
+                    List<ProEconPowerstationInfoDay6> fdls=new ArrayList<>();
+
+                    if(wpinfo.getForeignKeyId().equals("-1"))
+                    {
+                        fdls.add(wpinfo);
+                    }else if(wpinfo.getForeignKeyId().equals("-2")){
+                        gfls.add(wpinfo);
+                    }
+                    qbls.add(wpinfo);
+                    map.put("qb",qbls);
+                    map.put("fd",fdls);
+                    map.put("gf",gfls);
+                }
+            }
+
+
+            //判断是否有重复记录,先删除重复记录
+            List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
+                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                            && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay6::getId)
+                    .collect(Collectors.toList());
+
+            if (idls != null && idls.size() > 0) {
+
+                proEconPowerstationInfoDay6Service.removeByIds(idls);
+
+            }
+            for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay6>>> entry:rgmap.entrySet()){
+                Map<String, List<ProEconPowerstationInfoDay6>> map=entry.getValue();
+                List<ProEconPowerstationInfoDay6> qbls=map.get("qb");
+                List<ProEconPowerstationInfoDay6> gfls=map.get("fd");
+                List<ProEconPowerstationInfoDay6> fdls=map.get("gf");
+//                if(CacheContext.cpwpmap.size()==qbls.size())
+//                {
+
+                ProEconPowerstationInfoDay6 qb=new ProEconPowerstationInfoDay6();
+                ProEconPowerstationInfoDay6 fd=new ProEconPowerstationInfoDay6();
+                ProEconPowerstationInfoDay6 gf=new ProEconPowerstationInfoDay6();
+
+                if(CacheContext.rgmap.containsKey(entry.getKey()))
+                {
+                    ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
+                    gf.setRegionId(cp.getId());
+
+                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setForeignKeyId("-2");
+                    gf.setLocation(Location.rg.getValue());
+
+                    fd.setRegionId(cp.getId());
+
+                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setForeignKeyId("-1");
+                    fd.setLocation(Location.rg.getValue());
+
+                    qb.setRegionId(cp.getId());
+
+                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setForeignKeyId("0");
+                    qb.setLocation(Location.rg.getValue());
+
+                    //计算区域级全部
+                    calCp(qb,qbls);
+                    //计算公司级风电场站
+                    calCp(fd,fdls);
+                    //计算公司级光电场站
+                    calCp(gf,gfls);
+
+                    proEconPowerstationInfoDay6Service.save(qb);
+                    proEconPowerstationInfoDay6Service.save(fd);
+                    proEconPowerstationInfoDay6Service.save(gf);
+                }
+
+
+//                }else
+//                {
+//                    logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
+//
+//                }
+
+
+
+
+
+            };
+        }
+
+    }
+
+    /**
+     * 计算公司日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calCompanyInfoDay(Date recordDate) throws Exception {
+
+        List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                        && i.getLocation().equals(Location.wp.getValue()))
+                .collect(Collectors.toList());
+        if(!wpinfodayls.isEmpty())
+        {
+
+            Map<String, Map<String, List<ProEconPowerstationInfoDay6>>>cpmap=new HashMap<>();
+
+
+
+
+            for(ProEconPowerstationInfoDay6 wpinfo:wpinfodayls)
+            {
+
+                if(cpmap.containsKey(wpinfo.getCompanyId()))
+                {
+                    Map<String, List<ProEconPowerstationInfoDay6>> map=cpmap.get(wpinfo.getCompanyId());
+                    List<ProEconPowerstationInfoDay6> qbls=map.get("qb");
+                    List<ProEconPowerstationInfoDay6> gfls=map.get("fd");
+                    List<ProEconPowerstationInfoDay6> fdls=map.get("gf");
+
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
+                    {
+                        fdls.add(wpinfo);
+                    }else {
+                        gfls.add(wpinfo);
+                    }
+                    qbls.add(wpinfo);
+                }else
+                {
+                    Map<String, List<ProEconPowerstationInfoDay6>> map=new HashMap<>();
+
+                    List<ProEconPowerstationInfoDay6> qbls=new ArrayList<>();
+                    List<ProEconPowerstationInfoDay6> gfls=new ArrayList<>();
+                    List<ProEconPowerstationInfoDay6> fdls=new ArrayList<>();
+
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
+                    {
+                        fdls.add(wpinfo);
+                    }else {
+                        gfls.add(wpinfo);
+                    }
+                    qbls.add(wpinfo);
+                    map.put("qb",qbls);
+                    map.put("fd",fdls);
+                    map.put("gf",gfls);
+                }
+            }
+
+
+            //判断是否有重复记录,先删除重复记录
+            List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
+                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                            && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay6::getId)
+                    .collect(Collectors.toList());
+
+            if (idls != null && idls.size() > 0) {
+
+                proEconPowerstationInfoDay6Service.removeByIds(idls);
+
+            }
+            for(Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay6>>> entry:cpmap.entrySet()){
+                Map<String, List<ProEconPowerstationInfoDay6>> map=entry.getValue();
+                List<ProEconPowerstationInfoDay6> qbls=map.get("qb");
+                List<ProEconPowerstationInfoDay6> gfls=map.get("fd");
+                List<ProEconPowerstationInfoDay6> fdls=map.get("gf");
+//                if(CacheContext.cpwpmap.size()==qbls.size())
+//                {
+
+                ProEconPowerstationInfoDay6 qb=new ProEconPowerstationInfoDay6();
+                ProEconPowerstationInfoDay6 fd=new ProEconPowerstationInfoDay6();
+                ProEconPowerstationInfoDay6 gf=new ProEconPowerstationInfoDay6();
+
+                if(CacheContext.cpmap.containsKey(entry.getKey()))
+                {
+                    ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
+                    gf.setRegionId(cp.getRegionId());
+                    gf.setCompanyId(cp.getId());
+                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setForeignKeyId("-2");
+                    gf.setLocation(Location.cp.getValue());
+
+
+
+                    fd.setRegionId(cp.getRegionId());
+                    fd.setCompanyId(cp.getId());
+                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setForeignKeyId("-1");
+                    fd.setLocation(Location.cp.getValue());
+
+                    qb.setRegionId(cp.getRegionId());
+                    qb.setCompanyId(cp.getId());
+                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setForeignKeyId("0");
+                    qb.setLocation(Location.cp.getValue());
+
+                    //计算公司级全部场站
+                    calCp(qb,qbls);
+                    //计算公司级风电场站
+                    calCp(fd,fdls);
+                    //计算公司级光电场站
+                    calCp(gf,gfls);
+
+                    proEconPowerstationInfoDay6Service.save(qb);
+                    proEconPowerstationInfoDay6Service.save(fd);
+                    proEconPowerstationInfoDay6Service.save(gf);
+                }
+
+
+//                }else
+//                {
+//                    logger.debug("公司所属场站数量与保存的场站日信息数量不一致,未进行{0}统计-------结束", entry.getKey());
+//
+//                }
+
+
+
+
+
+            };
+        }
+
+    }
+
+    private void calCp(ProEconPowerstationInfoDay6 pewp,List<ProEconPowerstationInfoDay6> ls) throws Exception {
+
+        if(!ls.isEmpty())
+        {
+
+
+        }
+    }
+    /**
+     * 计算场站日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calWindpowerInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncDay(c.getTime());
+
+
+        List<ProEconPowerstationInfoDay6> wpinfodayls=new ArrayList<>();
+
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+                        && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay6::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconPowerstationInfoDay6Service.removeByIds(idls);
+
+        }
+        for(ProBasicWindpowerstation wp:CacheContext.wpls)
+        {
+            if(CacheContext.wppointmap.containsKey(wp.getId()))
+            {
+                Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(wp.getId());
+
+                ProEconPowerstationInfoDay6 pewp=new ProEconPowerstationInfoDay6();
+                Initial.initial(pewp);
+                pewp.setRegionId(wp.getRegionId());
+                pewp.setCompanyId(wp.getCompanyId());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setForeignKeyId("0");
+                pewp.setWindpowerstationId(wp.getId());
+                pewp.setLocation(Location.wp.getValue());
+
+                //昨日的统计结果
+                List<ProEconPowerstationInfoDay6> pepid1ls =new ArrayList<>();
+                Calendar cl=Calendar.getInstance();
+                cl.setTime(recordDate);
+                if(cl.get(Calendar.DAY_OF_MONTH)!=1)
+
+                {
+                    pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                                    && i.getWindpowerstationId().equals(wp.getId())
+                                    && i.getLocation().equals(Location.wp.getValue()))
+                            .collect(Collectors.toList());
+                }
+                extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
+/*******************************************年信息统计*********************************************************/
+//                wpinfodayls.add(pewp);
+                proEconPowerstationInfoDay6Service.save(pewp);
+
+            }
+
+
+        }
+
+    }
+
+    /**
+     * 计算项目日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calProjectInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncDay(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.pjmap.containsKey(i.getProjectId())
+                        && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay6::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconPowerstationInfoDay6Service.removeByIds(idls);
+
+        }
+        for(ProBasicProject pj:CacheContext.pjls)
+        {
+            if(CacheContext.wppointmap.containsKey(pj.getId()))
+            {
+                Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(pj.getId());
+
+                ProEconPowerstationInfoDay6 pewp=new ProEconPowerstationInfoDay6();
+                Initial.initial(pewp);
+                pewp.setForeignKeyId("0");
+                pewp.setWindpowerstationId(pj.getWindpowerstationId());
+                pewp.setProjectId(pj.getId());
+                pewp.setLocation(Location.pj.getValue());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+
+                //昨日的统计结果
+                List<ProEconPowerstationInfoDay6> pepid1ls =new ArrayList<>();
+                Calendar cl=Calendar.getInstance();
+                cl.setTime(recordDate);
+                if(cl.get(Calendar.DAY_OF_MONTH)!=1)
+
+                {
+                    pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                                    && i.getProjectId().equals(pj.getId())
+                                    && i.getLocation().equals(Location.pj.getValue()))
+                            .collect(Collectors.toList());
+                }
+                extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
+
+
+                proEconPowerstationInfoDay6Service.save(pewp);
+
+            }
+
+
+        }
+
+    }
+    /**
+     * 计算线路日信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calLineInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncDay(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.lnmap.containsKey(i.getLineId())
+                        && i.getLocation().equals(Location.ln.getValue()) ).map(ProEconPowerstationInfoDay6::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconPowerstationInfoDay6Service.removeByIds(idls);
+
+        }
+        for(ProBasicLine ln:CacheContext.lnls)
+        {
+            if(CacheContext.wppointmap.containsKey(ln.getId()))
+            {
+                Map<String, ProBasicWppoint> pointmap=CacheContext.wppointmap.get(ln.getId());
+
+                ProEconPowerstationInfoDay6 pewp=new ProEconPowerstationInfoDay6();
+                Initial.initial(pewp);
+                pewp.setForeignKeyId("0");
+                pewp.setLineId(ln.getId());
+                pewp.setLocation(Location.ln.getValue());
+                pewp.setProjectId(ln.getProjectId());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+
+                //昨日的统计结果
+                List<ProEconPowerstationInfoDay6> pepid1ls =new ArrayList<>();
+                Calendar cl=Calendar.getInstance();
+                cl.setTime(recordDate);
+                if(cl.get(Calendar.DAY_OF_MONTH)!=1)
+
+                {
+                    pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                                    && i.getLineId().equals(ln.getId())
+                                    && i.getLocation().equals(Location.ln.getValue()))
+                            .collect(Collectors.toList());
+                }
+                extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
+
+                proEconPowerstationInfoDay6Service.save(pewp);
+
+            }
+
+
+        }
+
+    }
+
+    private void extracted(Date recordDate, Date end, Date begin,Map<String, ProBasicWppoint> pointmap, ProEconPowerstationInfoDay6 pewp,List<ProEconPowerstationInfoDay6> pepid1ls) throws Exception {
+        /*******************************************日信息统计*********************************************************/
+        if(pointmap.containsKey(ContantXk.FCCFTFS70))
+        {
+            ProBasicWppoint point= pointmap.get(ContantXk.FCCFTFS70);
+            List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+            if(!pointls.isEmpty())
+            {
+                DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
+                //日最大风速
+                pewp.setRzdfscft(summaryStatistics.getMax());
+                //日最小风速
+                pewp.setRzxfscft(summaryStatistics.getMin());
+                //日平均风速
+                pewp.setRpjfscft(summaryStatistics.getAverage());
+            }
+
+        }
+
+        if(pointmap.containsKey(ContantXk.SSZGL))
+        {
+            ProBasicWppoint point= pointmap.get(ContantXk.SSZGL);
+            List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+            if(!pointls.isEmpty())
+            {
+                DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
+                //日最大功率
+                pewp.setRzdglcx(summaryStatistics.getMax());
+                //日最小功率
+                pewp.setRzxglcx(summaryStatistics.getMin());
+                //日平均功率
+                pewp.setRpjglcx(summaryStatistics.getAverage());
+            }
+        }
+
+
+/*******************************************日信息统计*********************************************************/
+
+/*******************************************月信息统计*********************************************************/
+
+        if(pepid1ls.isEmpty())
+        {
+            setPowerandSpeedMonth(end, begin, pointmap, pewp);
+        }else
+        {
+
+
+            if(!pepid1ls.isEmpty())
+            {
+                ProEconPowerstationInfoDay6 pepid=pepid1ls.get(0);
+
+                //如果昨日大于今日最大功率
+                if(pepid.getYzdglcx()> pewp.getRzdglcx())
+                {
+                    pewp.setYzdglcx(pepid.getRzdglcx());
+                }else {
+                    pewp.setYzdglcx(pewp.getRzdglcx());
+                }
+                //如果昨日大于今日最大风速
+                if(pepid.getYzdfscft()> pewp.getRzdfscft())
+                {
+                    pewp.setYzdfscft(pepid.getRzdfscft());
+                }else
+                {
+                    pewp.setYzdfscft(pewp.getRzdfscft());
+                }
+
+                //如果昨日小于今日最小功率
+                if(pepid.getYzxglcx()< pewp.getRzxglcx())
+                {
+                    pewp.setYzxglcx(pepid.getRzxglcx());
+                }else
+                {
+                    pewp.setYzxglcx(pewp.getRzxglcx());
+                }
+                //如果昨日小于今日最小风速
+                if(pepid.getYzxfscft()< pewp.getRzxfscft())
+                {
+                    pewp.setYzxfscft(pepid.getRzxfscft());
+                }else
+                {
+                    pewp.setYzxfscft(pewp.getRzxfscft());
+                }
+                double   pjfs = new BigDecimal(pewp.getYpjfscft()+pepid.getRpjfscft()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
+
+                pewp.setYzxfscft(pjfs);
+
+                double   pjgl = new BigDecimal(pewp.getYpjglcx()+pepid.getRpjglcx()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
+                pewp.setYzxglcx(pjgl);
+
+            }else
+            {
+                setPowerandSpeedMonth(end, begin, pointmap, pewp);
+            }
+
+        }
+
+
+/*******************************************月信息统计*********************************************************/
+
+/*******************************************年信息统计*********************************************************/
+        if(pepid1ls.isEmpty())
+        {
+            setPowerandSpeedYear(end, begin, pointmap, pewp);
+        }else {
+
+            if (!pepid1ls.isEmpty()) {
+                ProEconPowerstationInfoDay6 pepid = pepid1ls.get(0);
+
+                //如果昨年大于今年最大功率
+                if (pepid.getNzdglcx() > pewp.getRzdglcx()) {
+                    pewp.setNzdglcx(pepid.getRzdglcx());
+                } else {
+                    pewp.setNzdglcx(pewp.getRzdglcx());
+                }
+                //如果昨年大于今年最大风速
+                if (pepid.getNzdfscft() > pewp.getRzdfscft()) {
+                    pewp.setNzdfscft(pepid.getRzdfscft());
+                } else {
+                    pewp.setNzdfscft(pewp.getRzdfscft());
+                }
+
+                //如果昨年小于今年最小功率
+                if (pepid.getNzxglcx() < pewp.getRzxglcx()) {
+                    pewp.setNzxglcx(pepid.getRzxglcx());
+                } else {
+                    pewp.setNzxglcx(pewp.getRzxglcx());
+                }
+                //如果昨年小于今年最小风速
+                if (pepid.getNzxfscft() < pewp.getRzxfscft()) {
+                    pewp.setNzxfscft(pepid.getRzxfscft());
+                } else {
+                    pewp.setNzxfscft(pewp.getRzxfscft());
+                }
+                double pjfs = new BigDecimal(pewp.getNpjfscft() + pepid.getRpjfscft()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
+
+                pewp.setNzxfscft(pjfs);
+
+                double pjgl = new BigDecimal(pewp.getNpjglcx() + pepid.getRpjglcx()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
+                pewp.setNzxglcx(pjgl);
+            } else {
+                setPowerandSpeedMonth(end, begin, pointmap, pewp);
+            }
+
+        }
+    }
+
+    private void setPowerandSpeedYear(Date end, Date begin, Map<String, ProBasicWppoint> pointmap, ProEconPowerstationInfoDay6 pewp) throws Exception {
+        //年最大风速
+        pewp.setNzdfscft(pewp.getRzdfscft());
+        //年最小风速
+        pewp.setNzxfscft(pewp.getRzxfscft());
+        //年平均风速
+        pewp.setNpjfscft(pewp.getRpjfscft());
+
+        //年最大功率
+        pewp.setNzdglcx(pewp.getRzdglcx());
+        //年最小功率
+        pewp.setNzxglcx(pewp.getRzxglcx());
+        //年平均功率
+        pewp.setNpjglcx(pewp.getRpjglcx());
+
+    }
+
+    private void setPowerandSpeedMonth(Date end, Date begin, Map<String, ProBasicWppoint> pointmap, ProEconPowerstationInfoDay6 pewp) throws Exception {
+
+        //月最大风速
+        pewp.setYzdfscft(pewp.getRzdfscft());
+        //月最小风速
+        pewp.setYzxfscft(pewp.getRzxfscft());
+        //月平均风速
+        pewp.setYpjfscft(pewp.getRpjfscft());
+
+        //月最大功率
+        pewp.setYzdglcx(pewp.getRzdglcx());
+        //月最小功率
+        pewp.setYzxglcx(pewp.getRzxglcx());
+        //月平均功率
+        pewp.setYpjglcx(pewp.getRpjglcx());
+    }
+
+
+}
+
+
+
+
+
+
+

文件差異過大導致無法顯示
+ 0 - 2759
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindpowerInfoDayService.java


文件差異過大導致無法顯示
+ 0 - 2468
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindpowerInfoMonthService.java


+ 16 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProBasicModelPowerRdService.java

@@ -0,0 +1,16 @@
+package com.gyee.generation.service.auto;
+
+import com.gyee.generation.model.auto.ProBasicModelPowerRd;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-06
+ */
+public interface IProBasicModelPowerRdService extends IService<ProBasicModelPowerRd> {
+
+}

+ 8 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconActivePowerDataService.java

@@ -1,7 +1,14 @@
 package com.gyee.generation.service.auto;
 
+import com.gyee.generation.mapper.auto.ProEconActivePowerDataMapper;
 import com.gyee.generation.model.auto.ProEconActivePowerData;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.generation.model.vo.FitClassVo;
+import org.apache.ibatis.annotations.Param;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +20,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IProEconActivePowerDataService extends IService<ProEconActivePowerData> {
 
+    public List<FitClassVo> getFitList(String windpowerstationId, Date beginDate, Date endDate);
 }

+ 16 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconEquipmentInfo15minuteService.java

@@ -0,0 +1,16 @@
+package com.gyee.generation.service.auto;
+
+import com.gyee.generation.model.auto.ProEconEquipmentInfo15minute;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 电设备15分钟信息表 服务类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+public interface IProEconEquipmentInfo15minuteService extends IService<ProEconEquipmentInfo15minute> {
+
+}

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconEquipmentInfoDay2Service.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 public interface IProEconEquipmentInfoDay2Service extends IService<ProEconEquipmentInfoDay2> {
 

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconEquipmentInfoDay3Service.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 public interface IProEconEquipmentInfoDay3Service extends IService<ProEconEquipmentInfoDay3> {
 

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconPowerstationInfoDay2Service.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 public interface IProEconPowerstationInfoDay2Service extends IService<ProEconPowerstationInfoDay2> {
 

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconPowerstationInfoDay3Service.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 public interface IProEconPowerstationInfoDay3Service extends IService<ProEconPowerstationInfoDay3> {
 

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProBasicModelPowerRdServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.service.auto.impl;
+
+import com.gyee.generation.model.auto.ProBasicModelPowerRd;
+import com.gyee.generation.mapper.auto.ProBasicModelPowerRdMapper;
+import com.gyee.generation.service.auto.IProBasicModelPowerRdService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-06
+ */
+@Service
+public class ProBasicModelPowerRdServiceImpl extends ServiceImpl<ProBasicModelPowerRdMapper, ProBasicModelPowerRd> implements IProBasicModelPowerRdService {
+
+}

+ 14 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconActivePowerDataServiceImpl.java

@@ -2,10 +2,15 @@ package com.gyee.generation.service.auto.impl;
 
 import com.gyee.generation.model.auto.ProEconActivePowerData;
 import com.gyee.generation.mapper.auto.ProEconActivePowerDataMapper;
+import com.gyee.generation.model.vo.FitClassVo;
 import com.gyee.generation.service.auto.IProEconActivePowerDataService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
 /**
  * <p>
  * 动态功率数据 服务实现类
@@ -17,4 +22,13 @@ import org.springframework.stereotype.Service;
 @Service
 public class ProEconActivePowerDataServiceImpl extends ServiceImpl<ProEconActivePowerDataMapper, ProEconActivePowerData> implements IProEconActivePowerDataService {
 
+    @Resource
+    private ProEconActivePowerDataMapper proEconActivePowerDataMapper;
+
+
+
+    @Override
+    public List<FitClassVo> getFitList(String windpowerstationId, Date beginDate, Date endDate) {
+        return proEconActivePowerDataMapper.getFitList(windpowerstationId,beginDate, endDate);
+    }
 }

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconEquipmentInfo15minuteServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.service.auto.impl;
+
+import com.gyee.generation.model.auto.ProEconEquipmentInfo15minute;
+import com.gyee.generation.mapper.auto.ProEconEquipmentInfo15minuteMapper;
+import com.gyee.generation.service.auto.IProEconEquipmentInfo15minuteService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 电设备15分钟信息表 服务实现类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+@Service
+public class ProEconEquipmentInfo15minuteServiceImpl extends ServiceImpl<ProEconEquipmentInfo15minuteMapper, ProEconEquipmentInfo15minute> implements IProEconEquipmentInfo15minuteService {
+
+}

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconEquipmentInfoDay2ServiceImpl.java

@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 @Service
 public class ProEconEquipmentInfoDay2ServiceImpl extends ServiceImpl<ProEconEquipmentInfoDay2Mapper, ProEconEquipmentInfoDay2> implements IProEconEquipmentInfoDay2Service {

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconEquipmentInfoDay3ServiceImpl.java

@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 @Service
 public class ProEconEquipmentInfoDay3ServiceImpl extends ServiceImpl<ProEconEquipmentInfoDay3Mapper, ProEconEquipmentInfoDay3> implements IProEconEquipmentInfoDay3Service {

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconPowerstationInfoDay2ServiceImpl.java

@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 @Service
 public class ProEconPowerstationInfoDay2ServiceImpl extends ServiceImpl<ProEconPowerstationInfoDay2Mapper, ProEconPowerstationInfoDay2> implements IProEconPowerstationInfoDay2Service {

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconPowerstationInfoDay3ServiceImpl.java

@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  * </p>
  *
  * @author shilin
- * @since 2022-11-01
+ * @since 2022-11-02
  */
 @Service
 public class ProEconPowerstationInfoDay3ServiceImpl extends ServiceImpl<ProEconPowerstationInfoDay3Mapper, ProEconPowerstationInfoDay3> implements IProEconPowerstationInfoDay3Service {

+ 176 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/initalcache/CacheService.java

@@ -0,0 +1,176 @@
+package com.gyee.generation.service.initalcache;/*
+@author   谢生杰
+@date   2022/11/3-9:14
+*/
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.model.auto.Windturbine;
+import com.gyee.common.service.IWindturbineService;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.service.auto.*;
+import com.gyee.generation.util.redis.RedisService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+@Slf4j
+public class CacheService {
+
+    @Autowired
+    private RedisService redisService;
+    @Autowired
+    private IProBasicWindturbineService windturbineService;
+    @Autowired
+    private IProBasicLineService lineService;
+    @Autowired
+    private IProBasicProjectService projectService;
+    @Autowired
+    private IProBasicWindpowerstationService windpowerstationService;
+    @Autowired
+    private IProBasicEquipmentPointService windturbinetestingpointnewService;
+    @Autowired
+    private IProBasicWppointService windpowerstationpointnewService;
+    @Autowired
+    private IProBasicCompanyService companyService;
+    @Autowired
+    private IProBasicRegionService regionsService;
+    @Resource
+    private IProBasicModelPowerRdService proBasicModelPowerRdService;
+
+
+    public void initRedisCache(){
+        log.info("--------------------------redisWT");
+        List<ProBasicWindturbine> windturbineList = windturbineService.list().stream().filter(i->i.getIsable().equals(1)).collect(Collectors.toList());
+        windturbineList.stream().forEach(i->{
+            Map<String, ProBasicEquipmentPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicEquipmentPoint> qw = new QueryWrapper<>();
+            qw.eq("windturbine_id",i.getId());
+            List<ProBasicEquipmentPoint> windturbinetestingpointai2List = windturbinetestingpointnewService.list(qw);
+            windturbinetestingpointai2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
+
+        log.info("--------------------------redisLN");
+        List<ProBasicLine> lineList = lineService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        lineList.stream().forEach(i->{
+            Map<String, ProBasicWppoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicWppoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i.getId());
+            List<ProBasicWppoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
+
+        log.info("--------------------------redisPJ");
+        List<ProBasicProject> projectList = projectService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        projectList.stream().forEach(i->{
+            Map<String,ProBasicWppoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicWppoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i.getId());
+            List<ProBasicWppoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
+
+        log.info("--------------------------redisWP");
+        List<ProBasicWindpowerstation> wpList = windpowerstationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+
+        wpList.stream().forEach(i->{
+            Map<String, ProBasicWppoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicWppoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i.getId());
+            List<ProBasicWppoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
+
+        log.info("--------------------------redisCOMPANY");
+        List<ProBasicCompany> coms = companyService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        List<String> comList = coms.stream().map(i->i.getId()).collect(Collectors.toList());
+        coms.stream().forEach(company -> {
+            comList.add(company.getId()+"0");
+            comList.add(company.getId()+"-1");
+            comList.add(company.getId()+"-2");
+        });
+        comList.stream().forEach(i->{
+            Map<String, ProBasicWppoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicWppoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i);
+            List<ProBasicWppoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i,s);
+        });
+
+        log.info("--------------------------redisREGION");
+        List<ProBasicRegion> regs = regionsService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        List<String> regList = regs.stream().map(i->i.getId()).collect(Collectors.toList());
+        regs.stream().forEach(region -> {
+            regList.add(region.getId()+"0");
+            regList.add(region.getId()+"-1");
+            regList.add(region.getId()+"-2");
+        });
+        regList.stream().forEach(i->{
+            Map<String, ProBasicWppoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicWppoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i);
+            List<ProBasicWppoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i,s);
+        });
+        log.info("--------------------------redis理论保证功率");
+        Map<String, Map<Double,ProBasicModelPowerRd>> powerrdMap = new HashMap<>();
+
+        List<ProBasicModelPowerRd> proBasicModelPowerRds = proBasicModelPowerRdService.list();
+        proBasicModelPowerRds.stream().forEach(powerrd->{
+            if (powerrdMap.containsKey(powerrd.getModelId())){
+                powerrdMap.get(powerrd.getModelId()).put(powerrd.getSpeed(),powerrd);
+            }else {
+                Map<Double,ProBasicModelPowerRd> powerMap = new HashMap<>();
+                powerMap.put(powerrd.getSpeed(),powerrd);
+                powerrdMap.put(powerrd.getModelId(),powerMap);
+            }
+        });
+        redisService.set("ZLLGL", JSONObject.toJSONString(powerrdMap));
+
+//        log.info("--------------------------redis十三种状态");
+//        Map<String,List<Windturbinestatusdi>> sszztMap = new HashMap<>();
+//        List<Windturbinestatusdi> windturbinestatusdis = windturbinestatusdiService.list();
+//        windturbinestatusdis.stream().forEach(w->{
+//            if (sszztMap.containsKey(w.getWindturbineid())){
+//                sszztMap.get(w.getWindturbineid()).add(w);
+//            }else {
+//                List<Windturbinestatusdi> wdisList = new ArrayList<>();
+//                wdisList.add(w);
+//                sszztMap.put(w.getWindturbineid(),wdisList);
+//            }
+//        });
+//        redisService.set("SSZZT",JSONObject.toJSONString(sszztMap));
+    }
+}

+ 895 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/initialpoint/InitialPointGoldenXkByEqService.java

@@ -0,0 +1,895 @@
+package com.gyee.generation.service.initialpoint;
+
+
+
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.service.auto.*;
+import com.gyee.generation.util.ExcelExport;
+import com.gyee.generation.util.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class InitialPointGoldenXkByEqService implements IinitialPoint {
+
+
+    @Resource
+    private IProBasicRegionService proBasicRegionService;
+    @Resource
+    private IProBasicCompanyService proBasicCompanyService;
+
+    @Resource
+    private IProEconTestingPointService proEconTestingPointService;
+
+    private final String FJ = "fj";
+    private final String FJJSFW = "fjjsfw";
+    private final String GFJSFW = "gfjsfw";
+    private final String GF = "gf";
+
+    private final String GCJSFW = "gcjsfw";
+    private final String FCJSFW = "fcjsfw";
+
+
+
+    @Override
+    public void initalFc() throws IOException {
+
+
+        //   windPowerstationTestingPointService.deleteAll();
+
+
+        List<ProEconTestingPoint> pointls = proEconTestingPointService.list().stream()
+                .filter(i->i.getTypeId().equals(FCJSFW) || i.getTypeId().equals(GCJSFW)).collect(Collectors.toList());
+
+        List<ProEconTestingPoint> fdpointls = proEconTestingPointService.list().stream()
+                .filter(i->i.getTypeId().equals(FCJSFW) ).collect(Collectors.toList());
+        List<ProEconTestingPoint> gfpointls = proEconTestingPointService.list().stream()
+                .filter(i->i.getTypeId().equals(GCJSFW)).collect(Collectors.toList());
+
+
+        List<ProBasicRegion> regions = proBasicRegionService.list();
+
+
+        List<ProBasicWppoint> allpoints = new ArrayList<>();
+
+        if(!regions.isEmpty())
+        {
+
+
+            for(ProBasicRegion re:regions)
+            {
+
+                StringBuilder sba=new StringBuilder();
+                sba.append(re.getId().substring(0,re.getId().indexOf("_"))).append("_");
+/********************************************区域公司测点**************************************************/
+
+                
+                List<ProBasicWppoint>  points=new ArrayList<>();
+                for(int i=0;i<pointls.size();i++)
+                {
+
+                    ProEconTestingPoint stp=pointls.get(i);
+                    StringBuilder sb =new StringBuilder();
+                    StringBuilder sbtable =new StringBuilder();
+                    sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
+                    sb.append(String.valueOf(sba));
+                    sb.append("XXXX_XXX_X_XX_XX_XXXX_");
+                    sb.append("CI");
+                    sb.append(stp.getNemCode());
+                    
+                    sbtable.append("JSFW.");
+                    sbtable.append(sb);
+                    
+                    ProBasicWppoint po=new ProBasicWppoint();
+                    po.setId(StringUtils.getUUID());
+//                            po.setNemCode(V2Config.getInitialcode());
+                    po.setNemCode(String.valueOf(sbtable));
+                    sb =new StringBuilder();
+                    sb.append(re.getName()).append(stp.getName());
+                    po.setName(String.valueOf(sb));
+                    po.setModel(null);
+                    po.setModelId(null);
+
+                    StringBuilder tempsb=new StringBuilder();
+
+                    if(StringUtils.notEmp(re.getNemCode()))
+                    {
+                        tempsb.append(re.getNemCode()).append("0");
+                    }else
+                    {
+                        tempsb.append("0");
+                    }
+
+                    po.setWindpowerstationId(String.valueOf(tempsb));
+                    po.setUniformCode(stp.getUniformCode());
+
+
+
+                    sb =new StringBuilder();
+                    sb.append(re.getNemCode()).append(".JSFW");
+                    po.setRealtimeId(String.valueOf(sb));
+
+
+                    points.add(po);
+                }
+
+                allpoints.addAll(points);
+                // windPowerstationTestingPointService.insertBatch(points);
+
+/*******************************************区域公司测点*******************************************************/
+/********************************************风电场公司测点**************************************************/
+                points=new ArrayList<>();
+
+                for(int i=0;i<fdpointls.size();i++)
+                {
+                     sba=new StringBuilder();
+
+                    ProEconTestingPoint stp=fdpointls.get(i);
+                    StringBuilder sb =new StringBuilder();
+                    StringBuilder sbtable =new StringBuilder();
+                    sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
+                    sb.append(String.valueOf(sba));
+                    sb.append(re.getId().substring(0,re.getId().indexOf("_"))).append("_XXXX_XXX_F_XX_XX_XXXX_");
+                    sb.append("CI");
+                    sb.append(stp.getNemCode());
+
+                    sbtable.append("JSFW.");
+                    sbtable.append(sb);
+
+                    ProBasicWppoint po=new ProBasicWppoint();
+                    po.setId(StringUtils.getUUID());
+//                            po.setNemCode(V2Config.getInitialcode());
+                    po.setNemCode(String.valueOf(sbtable));
+                    sb =new StringBuilder();
+                    sb.append(re.getName()).append("风电").append(stp.getName());
+                    po.setName(String.valueOf(sb));
+                    po.setModel(null);
+                    po.setModelId(null);
+
+                    StringBuilder tempsb=new StringBuilder();
+                    if(StringUtils.notEmp(re.getNemCode()))
+                    {
+                        tempsb.append(re.getNemCode()).append("-1");
+                    }else
+                    {
+                        tempsb.append("-1");
+                    }
+                    po.setWindpowerstationId(String.valueOf(tempsb));
+                    po.setUniformCode(stp.getUniformCode());
+
+
+
+                    sb =new StringBuilder();
+                    sb.append(re.getNemCode()).append(".JSFW");
+                    po.setRealtimeId(String.valueOf(sb));
+//                            else
+//                            {
+//                                sb =new StringBuilder();
+//                                sb.append(re.getNemCode()).append(cs.getId()).append(".JSFWDD");
+//                                po.setRealtimeId(String.valueOf(sb));
+//                            }
+
+
+
+                    points.add(po);
+                }
+
+                allpoints.addAll(points);
+                // windPowerstationTestingPointService.insertBatch(points);
+
+                /*******************************************风电测点生成*******************************************************/
+
+
+/*********************************************光伏测点生成*****************************************************/
+
+                points=new ArrayList<>();
+                for(int i=0;i<gfpointls.size();i++)
+                {
+
+
+                    ProEconTestingPoint stp=gfpointls.get(i);
+                    StringBuilder sb =new StringBuilder();
+                    StringBuilder sbtable =new StringBuilder();
+                    sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
+                    sb.append(String.valueOf(sba));
+                    sb.append(re.getId().substring(0,re.getId().indexOf("_"))).append("_XXXX_XXX_G_XX_XX_XXXX_");
+                    sb.append("CI");
+                    sb.append(stp.getNemCode());
+
+                    sbtable.append("JSFW.");
+                    sbtable.append(sb);
+
+                    ProBasicWppoint po=new ProBasicWppoint();
+                    po.setId(StringUtils.getUUID());
+//                            po.setNemCode(V2Config.getInitialcode());
+                    po.setNemCode(String.valueOf(sbtable));
+                    sb =new StringBuilder();
+                    sb.append(re.getName()).append("光伏").append(stp.getName());
+                    po.setName(String.valueOf(sb));
+                    po.setModel(null);
+                    po.setModelId(null);
+                    StringBuilder tempsb=new StringBuilder();
+
+                    if(StringUtils.notEmp(re.getNemCode()))
+                    {
+                        tempsb.append(re.getNemCode()).append("-2");
+                    }else
+                    {
+                        tempsb.append("-2");
+                    }
+
+                    po.setWindpowerstationId(String.valueOf(tempsb));
+                    po.setUniformCode(stp.getUniformCode());
+
+                    sb =new StringBuilder();
+                    sb.append(re.getNemCode()).append(".JSFW");
+                    po.setRealtimeId(String.valueOf(sb));
+
+
+                    points.add(po);
+                }
+
+                allpoints.addAll(points);
+                List<ProBasicCompany> companys= proBasicCompanyService.list().stream().filter(i->i.getRegionId().equals(re.getId())).collect(Collectors.toList());
+                if(!companys.isEmpty())
+                {
+                    for(ProBasicCompany cs:companys)
+                    {
+                        sba=new StringBuilder();
+                        sba.append(cs.getId().substring(0,cs.getId().lastIndexOf("_"))).append("_");
+/********************************************区域公司测点**************************************************/
+                         points=new ArrayList<>();
+                        for(int i=0;i<pointls.size();i++)
+                        {
+
+
+                            ProEconTestingPoint stp=pointls.get(i);
+                            StringBuilder sb =new StringBuilder();
+                            StringBuilder sbtable =new StringBuilder();
+                            sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
+
+                            sb.append(String.valueOf(sba));
+                            sb.append("XXX_X_XX_XX_XXXX_");
+                            sb.append("CI");
+                            sb.append(stp.getNemCode());
+
+                            sbtable.append("JSFW.");
+                            sbtable.append(sb);
+
+                            ProBasicWppoint po=new ProBasicWppoint();
+                            po.setId(StringUtils.getUUID());
+//                            po.setNemCode(V2Config.getInitialcode());
+                            po.setNemCode(String.valueOf(sbtable));
+                            sb =new StringBuilder();
+                            sb.append(cs.getName()).append(stp.getName());
+                            po.setName(String.valueOf(sb));
+                            po.setModel(null);
+                            po.setModelId(null);
+
+                            StringBuilder tempsb=new StringBuilder();
+
+                            if(StringUtils.notEmp(cs.getNemCode()))
+                            {
+                                tempsb.append(cs.getNemCode()).append("0");
+                            }else
+                            {
+                                tempsb.append("0");
+                            }
+
+                            po.setWindpowerstationId(String.valueOf(tempsb));
+                            po.setUniformCode(stp.getUniformCode());
+
+                            sb =new StringBuilder();
+                            sb.append(cs.getId()).append(".JSFW");
+                            po.setRealtimeId(String.valueOf(sb));
+
+
+                            points.add(po);
+                        }
+
+                        allpoints.addAll(points);
+                        // windPowerstationTestingPointService.insertBatch(points);
+
+/*******************************************区域公司测点*******************************************************/
+/********************************************风电场公司测点**************************************************/
+                        points=new ArrayList<>();
+
+                        sba=new StringBuilder();
+                        sba.append(cs.getId().substring(0,cs.getId().lastIndexOf("_"))).append("_");
+                        for(int i=0;i<fdpointls.size();i++)
+                        {
+
+                            ProEconTestingPoint stp=fdpointls.get(i);
+                            StringBuilder sb =new StringBuilder();
+                            StringBuilder sbtable =new StringBuilder();
+                            sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
+                            sb.append(String.valueOf(sba));
+                            sb.append("XXX_F_XX_XX_XXXX_");
+                            sb.append("CI");
+                            sb.append(stp.getNemCode());
+
+                            sbtable.append("JSFW.");
+                            sbtable.append(sb);
+
+                            ProBasicWppoint po=new ProBasicWppoint();
+                            po.setId(StringUtils.getUUID());
+//                            po.setNemCode(V2Config.getInitialcode());
+                            po.setNemCode(String.valueOf(sbtable));
+                            sb =new StringBuilder();
+                            sb.append(cs.getName()).append("风电").append(stp.getName());
+                            po.setName(String.valueOf(sb));
+                            po.setModel(null);
+                            po.setModelId(null);
+
+                            StringBuilder tempsb=new StringBuilder();
+                            if(StringUtils.notEmp(cs.getNemCode()))
+                            {
+                                tempsb.append(cs.getNemCode()).append("-1");
+                            }else
+                            {
+                                tempsb.append("-1");
+                            }
+                            po.setWindpowerstationId(String.valueOf(tempsb));
+                            po.setUniformCode(stp.getUniformCode());
+
+                            sb =new StringBuilder();
+                            sb.append(cs.getId()).append(".JSFW");
+                            po.setRealtimeId(String.valueOf(sb));
+
+
+
+                            points.add(po);
+                        }
+
+                        allpoints.addAll(points);
+                        // windPowerstationTestingPointService.insertBatch(points);
+
+                        /*******************************************风电测点生成*******************************************************/
+
+
+/*********************************************光伏测点生成*****************************************************/
+                        sba=new StringBuilder();
+                        sba.append(cs.getId().substring(0,cs.getId().lastIndexOf("_"))).append("_");
+                        points=new ArrayList<>();
+                        for(int i=0;i<gfpointls.size();i++)
+                        {
+
+                            ProEconTestingPoint stp=gfpointls.get(i);
+                            StringBuilder sb =new StringBuilder();
+                            StringBuilder sbtable =new StringBuilder();
+                            sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
+                            sb.append(String.valueOf(sba));
+                            sb.append("XXX_G_XX_XX_XXXX_");
+                            sb.append("CI");
+                            sb.append(stp.getNemCode());
+
+                            sbtable.append("JSFW.");
+                            sbtable.append(sb);
+
+                            ProBasicWppoint po=new ProBasicWppoint();
+                            po.setId(StringUtils.getUUID());
+//                            po.setNemCode(V2Config.getInitialcode());
+                            po.setNemCode(String.valueOf(sbtable));
+                            sb =new StringBuilder();
+                            sb.append(cs.getName()).append("光伏").append(stp.getName());
+                            po.setName(String.valueOf(sb));
+                            po.setModel(null);
+                            po.setModelId(null);
+                            StringBuilder tempsb=new StringBuilder();
+
+                            if(StringUtils.notEmp(cs.getNemCode()))
+                            {
+                                tempsb.append(cs.getNemCode()).append("-2");
+                            }else
+                            {
+                                tempsb.append("-2");
+                            }
+
+                            po.setWindpowerstationId(String.valueOf(tempsb));
+                            po.setUniformCode(stp.getUniformCode());
+
+                            sb =new StringBuilder();
+                            sb.append(cs.getId()).append(".JSFW");
+                            po.setRealtimeId(String.valueOf(sb));
+
+                            points.add(po);
+                        }
+
+                        allpoints.addAll(points);
+                        // windPowerstationTestingPointService.insertBatch(points);
+                    }
+                }
+            }
+        }
+
+
+//        }
+
+
+        /*********************************************场站、项目、线路测点生成*****************************************************/
+
+
+        for (ProBasicWindpowerstation wp : CacheContext.wpls) {
+            List<ProEconTestingPoint> ls=null;
+            if(wp.getId().indexOf("FDC")>=0)
+            {
+                ls=fdpointls;
+
+            }else
+            {
+                ls=gfpointls;
+
+            }
+            createWpPoints(wp, ls, allpoints);
+            createPjPoints(wp, ls, allpoints);
+            createLnPoints(wp, ls, allpoints);
+
+        }
+
+//        if(!allpoints.isEmpty())
+//        {
+//            for(ProBasicWppoint wp:allpoints)
+//            {
+//                windPowerstationTestingPoint2Service.insertSelective(wp);
+//            }
+//        }
+        //创建一个数组用于设置表头
+      //  编号,编码,名称,实时库名称,型号,单位,英文名称,类型编号,所属型号,最大值,最小值,合理最大值,合理最小值,统一编码,短ID,长ID,场站编号,实时配置编号,集团测点编号,具体名称,系数
+        String[] arr = new String[]{"编号", "编码", "名称","实时库名称", "型号", "单位", "英文名称", "类型编号", "所属型号", "最大值", "最小值", "合理最大值",
+                "合理最小值", "统一编码", "短ID", "长ID", "风场编号", "实时配置编号", "集团测点编号", "具体名称", "系数"};
+        String heardName = "场站测点表";
+        //调用Excel导出工具类
+        ExcelExport.exportToPath(allpoints, arr, heardName, 6, "场站测点");
+    }
+
+    @Override
+    public void initalSyz() {
+
+    }
+
+    @Override
+    public void initalDd() throws IOException {
+
+    }
+
+    @Override
+    public void initalFgl() throws IOException {
+
+    }
+
+    private void createWpPoints(ProBasicWindpowerstation wp, List<ProEconTestingPoint> stpointls, List<ProBasicWppoint> allpoints) {
+        List<ProBasicWppoint> points = new ArrayList<>();
+        for (int i = 0; i < stpointls.size(); i++) {
+
+
+
+            ProEconTestingPoint stp = stpointls.get(i);
+            StringBuilder sb = new StringBuilder();
+//            sb.append(wp.getPhoto());
+            String temp = wp.getId().substring(0, wp.getId().lastIndexOf("_"));
+            temp = temp.substring(0, temp.lastIndexOf("_"));
+            temp = temp.substring(temp.lastIndexOf("_")+1);
+            StringBuilder sba = new StringBuilder();
+
+
+            String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+            temp2=temp2.substring(temp2.indexOf("_")+1);
+
+            String temp3=wp.getId().substring(0,wp.getId().lastIndexOf("_"));
+            temp3=temp3.substring(0,temp3.lastIndexOf("_"));
+            temp3=temp3.substring(temp3.lastIndexOf("_")+1);
+
+            sb.append(wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"))).append("_");
+            if (wp.getId().indexOf("FDC")>=0) {
+
+
+                sba.append(temp2).append(temp3).append("FC");
+                sb.append(temp).append("_F").append("_XX_XX_XXXX_");
+            } else if (wp.getId().indexOf("GDC")>=0) {
+
+                sba.append(temp2).append(temp3).append("GC");
+                sb.append(temp).append("_G").append("_XX_XX_XXXX_");
+            }
+
+            sb.append("CI");
+            sb.append(stp.getNemCode());
+            StringBuilder sbtable = new StringBuilder();
+
+
+            sbtable.append(sba).append("JSFW.");
+            sbtable.append(sb);
+
+            ProBasicWppoint po = new ProBasicWppoint();
+            po.setId(StringUtils.getUUID());
+//            po.setNemCode(V2Config.getInitialcode());
+            po.setNemCode(String.valueOf(sbtable));
+            sb = new StringBuilder();
+            sb.append(wp.getName()).append(stp.getName());
+            po.setName(String.valueOf(sb));
+            po.setModel(null);
+            po.setModelId(null);
+            po.setWindpowerstationId(wp.getId());
+            po.setUniformCode(stp.getUniformCode());
+
+
+
+            sb = new StringBuilder();
+
+            if (StringUtils.notEmp(wp.getPhoto())) {
+                sb.append(wp.getPhoto().replace("_", "")).append(".JSFW").append(sba);
+            }
+
+            po.setRealtimeId(String.valueOf(sb));
+
+            points.add(po);
+        }
+
+        allpoints.addAll(points);
+        //windPowerstationTestingPointService.insertBatch(points);
+    }
+
+
+    
+
+    private void createPjPoints(ProBasicWindpowerstation wp, List<ProEconTestingPoint> stpointls, List<ProBasicWppoint> allpoints) {
+
+
+        for (ProBasicProject pj : CacheContext.pjls) {
+            if (pj.getWindpowerstationId().equals(wp.getId())) {
+                List<ProBasicWppoint> points = new ArrayList<>();
+                for (int i = 0; i < stpointls.size(); i++) {
+
+
+                    ProEconTestingPoint stp = stpointls.get(i);
+                    StringBuilder sb = new StringBuilder();
+
+                    String temp = wp.getId().substring(0, wp.getId().lastIndexOf("_"));
+                    temp = temp.substring(0, temp.lastIndexOf("_"));
+                    temp = temp.substring(temp.lastIndexOf("_")+1);
+                    sb.append(wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"))).append("_");
+
+
+                    StringBuilder sba = new StringBuilder();
+
+                    String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                    temp2=temp2.substring(temp2.indexOf("_")+1);
+
+                    String temp3=wp.getId().substring(0,wp.getId().lastIndexOf("_"));
+                    temp3=temp3.substring(0,temp3.lastIndexOf("_"));
+                    temp3=temp3.substring(temp3.lastIndexOf("_")+1);
+
+                    if (wp.getId().indexOf("FDC")>=0) {
+
+                        sba.append(temp2).append(temp3).append("FC");
+                        sb.append(temp).append("_F_");
+                        temp = pj.getId().substring(0, pj.getId().lastIndexOf("_"));
+                        sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
+                        sb.append("XX_XXXX_");
+                    } else if (wp.getId().indexOf("GDC")>=0) {
+
+                        sba.append(temp2).append(temp3).append("GC");
+                        sb.append(temp).append("_G_");
+                        temp = pj.getId().substring(0, pj.getId().lastIndexOf("_"));
+                        sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
+                        sb.append("XX_XXXX_");
+                    }
+
+                    sb.append("CI");
+                    sb.append(stp.getNemCode());
+
+                    StringBuilder sbtable = new StringBuilder();
+
+
+                    sbtable.append(sba).append("JSFW.");
+                    sbtable.append(sb);
+
+                    ProBasicWppoint po = new ProBasicWppoint();
+
+                    po.setId(StringUtils.getUUID());
+
+                    po.setNemCode(String.valueOf(sbtable));
+                    sb = new StringBuilder();
+                    sb.append(pj.getName()).append(stp.getName());
+                    po.setName(String.valueOf(sb));
+                    po.setModel(null);
+                    po.setModelId(null);
+                    po.setWindpowerstationId(pj.getId());
+                    po.setUniformCode(stp.getUniformCode());
+
+                    sb = new StringBuilder();
+
+                    if (StringUtils.notEmp(wp.getPhoto())) {
+                        sb.append(wp.getPhoto().replace("_", "")).append(".JSFW").append(sba);
+                    }
+
+                    po.setRealtimeId(String.valueOf(sb));
+
+                    points.add(po);
+                }
+                allpoints.addAll(points);
+            }
+        }
+
+    }
+
+    
+
+    private void createLnPoints(ProBasicWindpowerstation wp, List<ProEconTestingPoint> stpointls, List<ProBasicWppoint> allpoints) {
+
+        for (ProBasicLine ln : CacheContext.lnls) {
+            if (CacheContext.pjmap.containsKey(ln.getProjectId())) {
+                ProBasicProject pj = CacheContext.pjmap.get(ln.getProjectId());
+
+                if (pj.getWindpowerstationId().equals(wp.getId())) {
+                    List<ProBasicWppoint> points = new ArrayList<>();
+                    for (int i = 0; i < stpointls.size(); i++) {
+
+
+                        ProEconTestingPoint stp = stpointls.get(i);
+                        StringBuilder sb = new StringBuilder();
+//                        sb.append(wp.getPhoto());
+                        String temp = wp.getId().substring(0, wp.getId().lastIndexOf("_"));
+                        temp = temp.substring(0, temp.lastIndexOf("_"));
+                        temp = temp.substring(temp.lastIndexOf("_")+1);
+                        sb.append(wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"))).append("_");
+
+
+                        StringBuilder sba = new StringBuilder();
+
+                        String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                        temp2=temp2.substring(temp2.indexOf("_")+1);
+
+                        String temp3=wp.getId().substring(0,wp.getId().lastIndexOf("_"));
+                        temp3=temp3.substring(0,temp3.lastIndexOf("_"));
+                        temp3=temp3.substring(temp3.lastIndexOf("_")+1);
+
+                        if (wp.getId().indexOf("FDC")>=0) {
+
+                            sba.append(temp2).append(temp3).append("FC");
+                            sb.append(temp).append("_F_");
+                            temp = pj.getId().substring(0, pj.getId().lastIndexOf("_"));
+                            sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
+                            temp = ln.getId().substring(0, ln.getId().lastIndexOf("_"));
+                            sb.append("L").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
+                            sb.append("XXXX_");
+//                            sb.append(CI);
+                        } else if (wp.getId().indexOf("GDC")>=0) {
+
+                            sba.append(temp2).append(temp3).append("GC");
+                            sb.append(temp).append("G_");
+                            temp = pj.getId().substring(0, pj.getId().lastIndexOf("_"));
+                            sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
+                            temp = ln.getId().substring(0, ln.getId().lastIndexOf("_"));
+                            sb.append("L").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
+                            sb.append("XXXX_");
+//                            sb.append(CI);
+                        }
+
+                        sb.append("CI");
+                        sb.append(stp.getNemCode());
+
+                        StringBuilder sbtable = new StringBuilder();
+
+                        sbtable.append(sba).append("JSFW.");
+                        sbtable.append(sb);
+
+                        ProBasicWppoint po = new ProBasicWppoint();
+                        po.setId(StringUtils.getUUID());
+
+                        po.setNemCode(String.valueOf(sbtable));
+                        sb = new StringBuilder();
+                        sb.append(ln.getName()).append(stp.getName());
+                        po.setName(String.valueOf(sb));
+                        po.setModel(null);
+                        po.setModelId(null);
+                        po.setWindpowerstationId(ln.getId());
+                        po.setUniformCode(stp.getUniformCode());
+
+                        sb = new StringBuilder();
+
+                        if (StringUtils.notEmp(wp.getPhoto())) {
+                            sb.append(wp.getPhoto().replace("_", "")).append(".JSFW").append(sba);
+                        }
+
+                        po.setRealtimeId(String.valueOf(sb));
+
+                        
+                        points.add(po);
+                    }
+                    allpoints.addAll(points);
+
+
+                }
+            }
+
+        }
+
+    }
+
+
+
+    public void initalFj() throws IOException {
+
+        // windturbinetestingpointService.deleteAll();
+
+
+
+
+
+        List<ProBasicEquipmentPoint> allpoints = new ArrayList<>();
+
+        List<ProEconTestingPoint>  fdls=proEconTestingPointService.list().stream().filter(i->i.getTypeId().equals("fj") || i.getTypeId().equals("fjjsfw")).collect(Collectors.toList());
+
+        List<ProEconTestingPoint>  gfls=proEconTestingPointService.list().stream().filter(i->i.getTypeId().equals("gf") || i.getTypeId().equals("gfjsfw")).collect(Collectors.toList());
+
+        for (ProBasicWindpowerstation wp : CacheContext.wpls) {
+
+            List<ProEconTestingPoint> ls=null;
+            if(wp.getId().indexOf("FDC")>=0)
+            {
+                ls=fdls;
+
+            }else
+            {
+                ls=gfls;
+
+            }
+            List<ProBasicWindturbine> wtls = CacheContext.wpwtmap.get(wp.getId());
+
+
+            if (!ls.isEmpty() ) {
+                for (ProBasicWindturbine wt : wtls) {
+
+                    List<ProBasicEquipmentPoint> points = new ArrayList<>();
+                    for (int i = 0; i < ls.size(); i++) {
+
+
+                        ProEconTestingPoint stp = ls.get(i);
+                        StringBuilder sb = new StringBuilder();
+//                        sb.append(wp.getPhoto());
+
+                        String temp = wp.getId().substring(0, wp.getId().lastIndexOf("_"));
+                        temp = temp.substring(0, temp.lastIndexOf("_"));
+                        temp = temp.substring(temp.lastIndexOf("_")+1);
+                        if(wp.getId().indexOf("FDC")>=0)
+                        {
+                            sb.append(wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"))).append("_").append(temp).append("_F_");
+                        }else
+                        {
+                            sb.append(wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"))).append("_").append(temp).append("_G_");
+                        }
+
+
+                        temp = null;
+                        temp = wt.getProjectId().substring(0, wt.getProjectId().lastIndexOf("_"));
+                        sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
+                        temp = wt.getLineId().substring(0, wt.getProjectId().lastIndexOf("_"));
+                        sb.append("L").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
+
+                        temp = wt.getId().substring(wt.getId().lastIndexOf("_")-4,wt.getId().lastIndexOf("_") );
+
+                        if (temp.length() == 1) {
+                            sb.append("000").append(temp).append("_");
+                        } else if (temp.length() == 2) {
+                            sb.append("00").append(temp).append("_");
+                        }else if (temp.length() == 3) {
+                            sb.append("0").append(temp).append("_");
+                        } else {
+                            sb.append(temp).append("_");
+                        }
+
+
+                        if(ls.get(i).getUniformCode().indexOf("AI")>=0)
+                        {
+                            sb.append("AI");
+
+                        }else if(ls.get(i).getUniformCode().indexOf("DI")>=0)
+                        {
+                            sb.append("DI");
+
+                        }else
+                        {
+                            sb.append("CI");
+
+                        }
+
+                        sb.append(stp.getNemCode());
+
+                        StringBuilder sba = new StringBuilder();
+
+                        temp = wp.getId().substring(0, wp.getId().lastIndexOf("_"));
+                        temp = temp.substring(0, temp.lastIndexOf("_"));
+                        temp = temp.substring(temp.lastIndexOf("_")+1);
+
+                        String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                        temp2=temp2.substring(temp2.indexOf("_")+1);
+
+                        String temp3=wp.getId().substring(0,wp.getId().lastIndexOf("_"));
+                        temp3=temp3.substring(0,temp3.lastIndexOf("_"));
+                        temp3=temp3.substring(temp3.lastIndexOf("_")+1);
+                        if (wp.getId().indexOf("FDC")>=0) {
+                            sba.append(temp2).append(temp3).append("FJ");
+                        } else if (wp.getId().indexOf("GDC")>=0) {
+                            sba.append(temp2).append(temp3).append("GF");
+                        }
+
+                        StringBuilder sbtable = new StringBuilder();
+
+
+                        if (stp.getUniformCode().indexOf("AI")<0 && stp.getUniformCode().indexOf("DI")<0) {
+                            sbtable.append(sba).append("JSFW.");
+                            sbtable.append(sb);
+                        } else {
+                            sbtable.append(sba).append(".");
+                            sbtable.append(sb);
+                        }
+
+                        ProBasicEquipmentPoint po = new ProBasicEquipmentPoint();
+                        po.setId(StringUtils.getUUID());
+//                        po.setNemCode(V2Config.getInitialcode());
+
+                        if (stp.getUniformCode().indexOf("AI")<0 && stp.getUniformCode().indexOf("DI")<0)
+                        {
+                            po.setNemCode(String.valueOf(sbtable));
+                        }else
+                        {
+                            po.setNemCode("INITIAL");
+                        }
+
+                        sb = new StringBuilder();
+                        sb.append(wt.getName()).append(stp.getName());
+                        po.setName(String.valueOf(sb));
+                        po.setModel(wt.getModelId());
+                        po.setModelId(wt.getModelId());
+                        po.setWindturbineId(wt.getId());
+                        po.setUniformCode(stp.getUniformCode());
+                        po.setWindpowerstationId(wt.getWindpowerstationId());
+                        po.setLogicalUnitId(ls.get(i).getLogicalUnitId());
+
+                        if (stp.getUniformCode().indexOf("AI")<0 && stp.getUniformCode().indexOf("DI")<0) {
+                            sb = new StringBuilder();
+
+                            sb.append(wp.getId().substring(0,wp.getId().lastIndexOf("_")).replace("_", "")).append(".JSFW").append(sba);
+
+                            po.setRealtimeId(String.valueOf(sb));
+                        } else {
+                            sb = new StringBuilder();
+
+                            sb.append(wp.getId().substring(0,wp.getId().lastIndexOf("_")).replace("_", "")).append(".").append(sba);
+
+                            po.setRealtimeId(String.valueOf(sb));
+                        }
+
+                        points.add(po);
+
+
+//                               allpoints.addAll(points);
+                    }
+                    allpoints.addAll(points);
+                }
+
+            }
+//            }
+
+
+        }
+
+
+        //创建一个数组用于设置表头
+        String[] arr = new String[]{"编号", "编码", "名称","别名", "型号", "单位", "英文名称", "类型编号", "所属型号", "最大值", "最小值", "合理最大值",
+                "合理最小值", "风机编号", "统一编码", "短ID", "长ID", "风场编号", "实时配置编号", "部件编号", "集团测点编号", "具体名称", "系数"};
+        String heardName = "风机测点表";
+        //调用Excel导出工具类
+        ExcelExport.exportToPath(allpoints, arr, heardName, 6, "风机测点");
+
+    }
+
+
+
+}

+ 133 - 93
realtime/generationXK-service/src/main/java/com/gyee/generation/service/initialpoint/InitialPointGoldenXkService.java

@@ -81,18 +81,18 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     StringBuilder sbtable =new StringBuilder();
                     sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
                     sb.append(String.valueOf(sba));
-                    sb.append("XXX_X_XX_XX_XX_XXX_");
+                    sb.append("XXXX_XXX_X_XX_XX_XXXX_");
                     sb.append(CI);
                     sb.append(stp.getOrdernum());
-                    if(stp.getCode().equals(CI))
+                    if(stp.getNemCode().equals(CI))
                     {
                         sbtable.append("JSFW.");
                         sbtable.append(sb);
                     }
                     ProBasicWppoint po=new ProBasicWppoint();
                     po.setId(StringUtils.getUUID());
-//                            po.setCode(V2Config.getInitialcode());
-                    po.setCode(String.valueOf(sbtable));
+//                            po.setNemCode(V2Config.getInitialcode());
+                    po.setNemCode(String.valueOf(sbtable));
                     sb =new StringBuilder();
                     sb.append(re.getName()).append(stp.getName());
                     po.setName(String.valueOf(sb));
@@ -101,9 +101,9 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
                     StringBuilder tempsb=new StringBuilder();
 
-                    if(StringUtils.notEmp(re.getCode()))
+                    if(StringUtils.notEmp(re.getNemCode()))
                     {
-                        tempsb.append(re.getCode()).append("0");
+                        tempsb.append(re.getNemCode()).append("0");
                     }else
                     {
                         tempsb.append("0");
@@ -114,10 +114,10 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
 
 
-                    if(stp.getCode().equals(CI))
+                    if(stp.getNemCode().equals(CI))
                     {
                         sb =new StringBuilder();
-                        sb.append(re.getCode()).append(".JSFW");
+                        sb.append(re.getNemCode()).append(".JSFW");
                         po.setRealtimeId(String.valueOf(sb));
                     }
 
@@ -143,10 +143,10 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     StringBuilder sbtable =new StringBuilder();
                     sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
                     sb.append(String.valueOf(sba));
-                    sb.append(re.getId().substring(0,re.getId().indexOf("_"))).append("_XXX_F_XX_XX_XX_XXX_");
+                    sb.append(re.getId().substring(0,re.getId().indexOf("_"))).append("_XXXX_XXX_F_XX_XX_XXXX_");
                     sb.append(CI);
                     sb.append(stp.getOrdernum());
-                    if(stp.getCode().equals(CI))
+                    if(stp.getNemCode().equals(CI))
                     {
 //                                sbtable.append("JSFW.");
                         sbtable.append("JSFW.");
@@ -154,8 +154,8 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     }
                     ProBasicWppoint po=new ProBasicWppoint();
                     po.setId(StringUtils.getUUID());
-//                            po.setCode(V2Config.getInitialcode());
-                    po.setCode(String.valueOf(sbtable));
+//                            po.setNemCode(V2Config.getInitialcode());
+                    po.setNemCode(String.valueOf(sbtable));
                     sb =new StringBuilder();
                     sb.append(re.getName()).append("风电").append(stp.getName());
                     po.setName(String.valueOf(sb));
@@ -163,9 +163,9 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     po.setModelId(null);
 
                     StringBuilder tempsb=new StringBuilder();
-                    if(StringUtils.notEmp(re.getCode()))
+                    if(StringUtils.notEmp(re.getNemCode()))
                     {
-                        tempsb.append(re.getCode()).append("-1");
+                        tempsb.append(re.getNemCode()).append("-1");
                     }else
                     {
                         tempsb.append("-1");
@@ -175,16 +175,16 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
 
 
-                    if(stp.getCode().equals(CI))
+                    if(stp.getNemCode().equals(CI))
                     {
                         sb =new StringBuilder();
-                        sb.append(re.getCode()).append(".JSFW");
+                        sb.append(re.getNemCode()).append(".JSFW");
                         po.setRealtimeId(String.valueOf(sb));
                     }
 //                            else
 //                            {
 //                                sb =new StringBuilder();
-//                                sb.append(re.getCode()).append(cs.getId()).append(".JSFWDD");
+//                                sb.append(re.getNemCode()).append(cs.getId()).append(".JSFWDD");
 //                                po.setRealtimeId(String.valueOf(sb));
 //                            }
 
@@ -214,10 +214,10 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     StringBuilder sbtable =new StringBuilder();
                     sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
                     sb.append(String.valueOf(sba));
-                    sb.append(re.getId().substring(0,re.getId().indexOf("_"))).append("_XXX_G_XX_XX_XX_XXX_");
+                    sb.append(re.getId().substring(0,re.getId().indexOf("_"))).append("_XXXX_XXX_G_XX_XX_XXXX_");
                     sb.append(CI);
                     sb.append(stp.getOrdernum());
-                    if(stp.getCode().equals(CI))
+                    if(stp.getNemCode().equals(CI))
                     {
 //                                sbtable.append("JSFW.");
                         sbtable.append("JSFW.");
@@ -225,8 +225,8 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     }
                     ProBasicWppoint po=new ProBasicWppoint();
                     po.setId(StringUtils.getUUID());
-//                            po.setCode(V2Config.getInitialcode());
-                    po.setCode(String.valueOf(sbtable));
+//                            po.setNemCode(V2Config.getInitialcode());
+                    po.setNemCode(String.valueOf(sbtable));
                     sb =new StringBuilder();
                     sb.append(re.getName()).append("光伏").append(stp.getName());
                     po.setName(String.valueOf(sb));
@@ -234,9 +234,9 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     po.setModelId(null);
                     StringBuilder tempsb=new StringBuilder();
 
-                    if(StringUtils.notEmp(re.getCode()))
+                    if(StringUtils.notEmp(re.getNemCode()))
                     {
-                        tempsb.append(re.getCode()).append("-2");
+                        tempsb.append(re.getNemCode()).append("-2");
                     }else
                     {
                         tempsb.append("-2");
@@ -245,16 +245,16 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     po.setWindpowerstationId(String.valueOf(tempsb));
                     po.setUniformCode(stp.getUniformcode());
 
-                    if(stp.getCode().equals(CI))
+                    if(stp.getNemCode().equals(CI))
                     {
                         sb =new StringBuilder();
-                        sb.append(re.getCode()).append(".JSFW");
+                        sb.append(re.getNemCode()).append(".JSFW");
                         po.setRealtimeId(String.valueOf(sb));
                     }
 //                            else
 //                            {
 //                                sb =new StringBuilder();
-//                                sb.append(re.getCode()).append(cs.getId()).append(".JSFWDD");
+//                                sb.append(re.getNemCode()).append(cs.getId()).append(".JSFWDD");
 //                                po.setRealtimeId(String.valueOf(sb));
 //                            }
 
@@ -282,21 +282,21 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                             ProEconWindpowerStandardPoint stp=stpointls.get(i);
                             StringBuilder sb =new StringBuilder();
                             StringBuilder sbtable =new StringBuilder();
-                            sbtable.append(cs.getId().substring(0,cs.getId().lastIndexOf("_")));
+                            sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
 
                             sb.append(String.valueOf(sba));
-                            sb.append("X_XX_XX_XX_XXX_");
+                            sb.append("XXX_X_XX_XX_XXXX_");
                             sb.append(CI);
                             sb.append(stp.getOrdernum());
-                            if(stp.getCode().equals(CI))
+                            if(stp.getNemCode().equals(CI))
                             {
                                 sbtable.append("JSFW.");
                                 sbtable.append(sb);
                             }
                             ProBasicWppoint po=new ProBasicWppoint();
                             po.setId(StringUtils.getUUID());
-//                            po.setCode(V2Config.getInitialcode());
-                            po.setCode(String.valueOf(sbtable));
+//                            po.setNemCode(V2Config.getInitialcode());
+                            po.setNemCode(String.valueOf(sbtable));
                             sb =new StringBuilder();
                             sb.append(cs.getName()).append(stp.getName());
                             po.setName(String.valueOf(sb));
@@ -305,9 +305,9 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
                             StringBuilder tempsb=new StringBuilder();
 
-                            if(StringUtils.notEmp(cs.getCode()))
+                            if(StringUtils.notEmp(cs.getNemCode()))
                             {
-                                tempsb.append(cs.getCode()).append("0");
+                                tempsb.append(cs.getNemCode()).append("0");
                             }else
                             {
                                 tempsb.append("0");
@@ -318,7 +318,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
 
 
-                            if(stp.getCode().equals(CI))
+                            if(stp.getNemCode().equals(CI))
                             {
                                 sb =new StringBuilder();
                                 sb.append(cs.getId()).append(".JSFW");
@@ -348,12 +348,12 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                             ProEconWindpowerStandardPoint stp=stpointls.get(i);
                             StringBuilder sb =new StringBuilder();
                             StringBuilder sbtable =new StringBuilder();
-                            sbtable.append(cs.getId().substring(0,cs.getId().lastIndexOf("_")));
+                            sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
                             sb.append(String.valueOf(sba));
-                            sb.append("F_XX_XX_XX_XXX_");
+                            sb.append("XXX_F_XX_XX_XXXX_");
                             sb.append(CI);
                             sb.append(stp.getOrdernum());
-                            if(stp.getCode().equals(CI))
+                            if(stp.getNemCode().equals(CI))
                             {
 //                                sbtable.append("JSFW.");
                                 sbtable.append("JSFW.");
@@ -361,8 +361,8 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                             }
                             ProBasicWppoint po=new ProBasicWppoint();
                             po.setId(StringUtils.getUUID());
-//                            po.setCode(V2Config.getInitialcode());
-                            po.setCode(String.valueOf(sbtable));
+//                            po.setNemCode(V2Config.getInitialcode());
+                            po.setNemCode(String.valueOf(sbtable));
                             sb =new StringBuilder();
                             sb.append(cs.getName()).append("风电").append(stp.getName());
                             po.setName(String.valueOf(sb));
@@ -370,9 +370,9 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                             po.setModelId(null);
 
                             StringBuilder tempsb=new StringBuilder();
-                            if(StringUtils.notEmp(cs.getCode()))
+                            if(StringUtils.notEmp(cs.getNemCode()))
                             {
-                                tempsb.append(cs.getCode()).append("-1");
+                                tempsb.append(cs.getNemCode()).append("-1");
                             }else
                             {
                                 tempsb.append("-1");
@@ -382,7 +382,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
 
 
-                            if(stp.getCode().equals(CI))
+                            if(stp.getNemCode().equals(CI))
                             {
                                 sb =new StringBuilder();
                                 sb.append(cs.getId()).append(".JSFW");
@@ -391,7 +391,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 //                            else
 //                            {
 //                                sb =new StringBuilder();
-//                                sb.append(re.getCode()).append(cs.getId()).append(".JSFWDD");
+//                                sb.append(re.getNemCode()).append(cs.getId()).append(".JSFWDD");
 //                                po.setRealtimeId(String.valueOf(sb));
 //                            }
 
@@ -420,12 +420,12 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                             ProEconWindpowerStandardPoint stp=stpointls.get(i);
                             StringBuilder sb =new StringBuilder();
                             StringBuilder sbtable =new StringBuilder();
-                            sbtable.append(cs.getId().substring(0,cs.getId().lastIndexOf("_")));
+                            sbtable.append(re.getId().substring(0,re.getId().indexOf("_")));
                             sb.append(String.valueOf(sba));
-                            sb.append("G_XX_XX_XX_XXX_");
+                            sb.append("XXX_G_XX_XX_XXXX_");
                             sb.append(CI);
                             sb.append(stp.getOrdernum());
-                            if(stp.getCode().equals(CI))
+                            if(stp.getNemCode().equals(CI))
                             {
 //                                sbtable.append("JSFW.");
                                 sbtable.append("JSFW.");
@@ -433,8 +433,8 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                             }
                             ProBasicWppoint po=new ProBasicWppoint();
                             po.setId(StringUtils.getUUID());
-//                            po.setCode(V2Config.getInitialcode());
-                            po.setCode(String.valueOf(sbtable));
+//                            po.setNemCode(V2Config.getInitialcode());
+                            po.setNemCode(String.valueOf(sbtable));
                             sb =new StringBuilder();
                             sb.append(cs.getName()).append("光伏").append(stp.getName());
                             po.setName(String.valueOf(sb));
@@ -442,9 +442,9 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                             po.setModelId(null);
                             StringBuilder tempsb=new StringBuilder();
 
-                            if(StringUtils.notEmp(cs.getCode()))
+                            if(StringUtils.notEmp(cs.getNemCode()))
                             {
-                                tempsb.append(cs.getCode()).append("-2");
+                                tempsb.append(cs.getNemCode()).append("-2");
                             }else
                             {
                                 tempsb.append("-2");
@@ -453,7 +453,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                             po.setWindpowerstationId(String.valueOf(tempsb));
                             po.setUniformCode(stp.getUniformcode());
 
-                            if(stp.getCode().equals(CI))
+                            if(stp.getNemCode().equals(CI))
                             {
                                 sb =new StringBuilder();
                                 sb.append(cs.getId()).append(".JSFW");
@@ -462,7 +462,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 //                            else
 //                            {
 //                                sb =new StringBuilder();
-//                                sb.append(re.getCode()).append(cs.getId()).append(".JSFWDD");
+//                                sb.append(re.getNemCode()).append(cs.getId()).append(".JSFWDD");
 //                                po.setRealtimeId(String.valueOf(sb));
 //                            }
 
@@ -547,11 +547,16 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
             sb.append(wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"))).append("_");
             if (wp.getId().indexOf("FDC")>=0) {
-                sba.append(temp);
-                sb.append(temp).append("_F").append("_XX_XX_XXX_");
+
+                String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                temp2=temp2.substring(temp2.indexOf("_")+1);
+                sba.append(temp2).append("FC");
+                sb.append(temp).append("_F").append("_XX_XX_XXXX_");
             } else if (wp.getId().indexOf("GDC")>=0) {
-                sba.append(temp);
-                sb.append(temp).append("_G").append("_XX_XX_XXX_");
+                String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                temp2=temp2.substring(temp2.indexOf("_")+1);
+                sba.append(temp2).append("GC");
+                sb.append(temp).append("_G").append("_XX_XX_XXXX_");
             }
 
             sb.append(CI);
@@ -559,7 +564,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
             StringBuilder sbtable = new StringBuilder();
 
 
-            if (stp.getCode().equals(CI)) {
+            if (stp.getNemCode().equals(CI)) {
                 sbtable.append(sba).append("JSFW.");
                 sbtable.append(sb);
             }
@@ -572,8 +577,8 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
             ProBasicWppoint po = new ProBasicWppoint();
             po.setId(StringUtils.getUUID());
-//            po.setCode(V2Config.getInitialcode());
-            po.setCode(String.valueOf(sbtable));
+//            po.setNemCode(V2Config.getInitialcode());
+            po.setNemCode(String.valueOf(sbtable));
             sb = new StringBuilder();
             sb.append(wp.getName()).append(stp.getName());
             po.setName(String.valueOf(sb));
@@ -582,7 +587,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
             po.setWindpowerstationId(wp.getId());
             po.setUniformCode(stp.getUniformcode());
 
-//            if(stp.getCode().equals(CI))
+//            if(stp.getNemCode().equals(CI))
 //            {
 //                sb =new StringBuilder();
 //                temp=wp.getId().substring(0,wp.getId().indexOf("_"));
@@ -590,7 +595,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 //                po.setRealtimeId(String.valueOf(sb));
 //            }
 
-            if (stp.getCode().equals(CI)) {
+            if (stp.getNemCode().equals(CI)) {
                 sb = new StringBuilder();
 
                 if (StringUtils.notEmp(wp.getPhoto())) {
@@ -646,17 +651,21 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     StringBuilder sba = new StringBuilder();
 
                     if (wp.getId().indexOf("FDC")>=0) {
-                        sba.append(temp);
-                        sb.append(temp).append("_F_").append("JS_");
+                        String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                        temp2=temp2.substring(temp2.indexOf("_")+1);
+                        sba.append(temp2).append("FC");
+                        sb.append(temp).append("_F_");
                         temp = pj.getId().substring(0, pj.getId().lastIndexOf("_"));
                         sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
-                        sb.append("XX_XXX_");
+                        sb.append("XX_XXXX_");
                     } else if (wp.getId().indexOf("GDC")>=0) {
-                        sba.append(temp);
-                        sb.append(temp).append("_G_").append("JS_");
+                        String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                        temp2=temp2.substring(temp2.indexOf("_")+1);
+                        sba.append(temp2).append("GC");
+                        sb.append(temp).append("_G_");
                         temp = pj.getId().substring(0, pj.getId().lastIndexOf("_"));
                         sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
-                        sb.append("XX_XXX_");
+                        sb.append("XX_XXXX_");
                     }
 
                     sb.append(CI);
@@ -665,7 +674,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     StringBuilder sbtable = new StringBuilder();
 
 
-                    if (stp.getCode().equals(CI)) {
+                    if (stp.getNemCode().equals(CI)) {
                         sbtable.append(sba).append("JSFW.");
                         sbtable.append(sb);
                     }
@@ -673,8 +682,8 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     ProBasicWppoint po = new ProBasicWppoint();
 
                     po.setId(StringUtils.getUUID());
-//                    po.setCode(V2Config.getInitialcode());
-                    po.setCode(String.valueOf(sbtable));
+//                    po.setNemCode(V2Config.getInitialcode());
+                    po.setNemCode(String.valueOf(sbtable));
                     sb = new StringBuilder();
                     sb.append(pj.getName()).append(stp.getName());
                     po.setName(String.valueOf(sb));
@@ -683,7 +692,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                     po.setWindpowerstationId(pj.getId());
                     po.setUniformCode(stp.getUniformcode());
 
-//                    if(stp.getCode().equals(CI))
+//                    if(stp.getNemCode().equals(CI))
 //                    {
 //                        sb =new StringBuilder();
 //                        temp=wp.getId().substring(0,wp.getId().indexOf("_"));
@@ -691,7 +700,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 //                        po.setRealtimeId(String.valueOf(sb));
 //                    }
 
-                    if (stp.getCode().equals(CI)) {
+                    if (stp.getNemCode().equals(CI)) {
                         sb = new StringBuilder();
 
                         if (StringUtils.notEmp(wp.getPhoto())) {
@@ -741,22 +750,26 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                         StringBuilder sba = new StringBuilder();
 
                         if (wp.getId().indexOf("FDC")>=0) {
-                            sba.append(temp);
-                            sb.append(temp).append("_F_").append("JS_");
+                            String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                            temp2=temp2.substring(temp2.indexOf("_")+1);
+                            sba.append(temp2).append("FC");
+                            sb.append(temp).append("_F_");
                             temp = pj.getId().substring(0, pj.getId().lastIndexOf("_"));
                             sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
                             temp = ln.getId().substring(0, ln.getId().lastIndexOf("_"));
                             sb.append("L").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
-                            sb.append("XXX_");
+                            sb.append("XXXX_");
 //                            sb.append(CI);
                         } else if (wp.getId().indexOf("GDC")>=0) {
-                            sba.append(temp);
-                            sb.append(temp).append("G_").append("JS_");
+                            String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                            temp2=temp2.substring(temp2.indexOf("_")+1);
+                            sba.append(temp2).append("GC");
+                            sb.append(temp).append("G_");
                             temp = pj.getId().substring(0, pj.getId().lastIndexOf("_"));
                             sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
                             temp = ln.getId().substring(0, ln.getId().lastIndexOf("_"));
                             sb.append("L").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
-                            sb.append("XXX_");
+                            sb.append("XXXX_");
 //                            sb.append(CI);
                         }
 
@@ -766,7 +779,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                         StringBuilder sbtable = new StringBuilder();
 
 
-                        if (stp.getCode().equals(CI)) {
+                        if (stp.getNemCode().equals(CI)) {
                             sbtable.append(sba).append("JSFW.");
                             sbtable.append(sb);
                         }
@@ -774,8 +787,8 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
                         ProBasicWppoint po = new ProBasicWppoint();
                         po.setId(StringUtils.getUUID());
-//                        po.setCode(V2Config.getInitialcode());
-                        po.setCode(String.valueOf(sbtable));
+//                        po.setNemCode(V2Config.getInitialcode());
+                        po.setNemCode(String.valueOf(sbtable));
                         sb = new StringBuilder();
                         sb.append(ln.getName()).append(stp.getName());
                         po.setName(String.valueOf(sb));
@@ -785,7 +798,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                         po.setUniformCode(stp.getUniformcode());
 
 
-                        if (stp.getCode().equals(CI)) {
+                        if (stp.getNemCode().equals(CI)) {
                             sb = new StringBuilder();
 
                             if (StringUtils.notEmp(wp.getPhoto())) {
@@ -821,11 +834,20 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
         for (ProBasicWindpowerstation wp : CacheContext.wpls) {
 
+            List<ProEconWindturbineStandardPoint> ls=null;
+            if(wp.getId().indexOf("FDC")>=0)
+            {
+                ls=stpointls.stream().filter(i->i.getTypes().equals("FD")).collect(Collectors.toList());
+
+            }else
+            {
+                ls =stpointls.stream().filter(i->i.getTypes().equals("GF")).collect(Collectors.toList());
 
+            }
             List<ProBasicWindturbine> wtls = CacheContext.wpwtmap.get(wp.getId());
 
 
-            if (!stpointls.isEmpty() && wp.getId().indexOf("FDC")>=0) {
+            if (!stpointls.isEmpty() ) {
                 for (ProBasicWindturbine wt : wtls) {
 
 //                    if(wpsmap.containsKey(wt.getModelId()))
@@ -833,17 +855,24 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 //                        List<Windturbinestandardpoints> wpsls=wpsmap.get(wt.getModelId());
 
                     List<ProBasicEquipmentPoint> points = new ArrayList<>();
-                    for (int i = 0; i < stpointls.size(); i++) {
+                    for (int i = 0; i < ls.size(); i++) {
 
 
-                        ProEconWindturbineStandardPoint stp = stpointls.get(i);
+                        ProEconWindturbineStandardPoint stp = ls.get(i);
                         StringBuilder sb = new StringBuilder();
 //                        sb.append(wp.getPhoto());
 
                         String temp = wp.getId().substring(0, wp.getId().lastIndexOf("_"));
                         temp = temp.substring(0, temp.lastIndexOf("_"));
                         temp = temp.substring(temp.lastIndexOf("_")+1);
-                        sb.append(wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"))).append("_").append(temp).append("_F_");
+                        if(wp.getId().indexOf("FDC")>=0)
+                        {
+                            sb.append(wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"))).append("_").append(temp).append("_F_");
+                        }else
+                        {
+                            sb.append(wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"))).append("_").append(temp).append("_G_");
+                        }
+
 
                         temp = null;
                         temp = wt.getProjectId().substring(0, wt.getProjectId().lastIndexOf("_"));
@@ -864,7 +893,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                         }
 
 
-                        sb.append(stp.getCode());
+                        sb.append(stp.getNemCode());
 
                         sb.append(stp.getOrdernum());
 
@@ -873,16 +902,19 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                         temp = wp.getId().substring(0, wp.getId().lastIndexOf("_"));
                         temp = temp.substring(0, temp.lastIndexOf("_"));
                         temp = temp.substring(temp.lastIndexOf("_")+1);
+
+                        String temp2=wp.getCompanyId().substring(0,wp.getCompanyId().lastIndexOf("_"));
+                        temp2=temp2.substring(temp2.indexOf("_")+1);
                         if (wp.getId().indexOf("FDC")>=0) {
-                            sba.append(temp).append("FJ");
+                            sba.append(temp2).append("FJ");
                         } else if (wp.getId().indexOf("GDC")>=0) {
-                            sba.append(temp).append("NBQ");
+                            sba.append(temp2).append("GF");
                         }
 
                         StringBuilder sbtable = new StringBuilder();
 
 
-                        if (stp.getCode().equals(CI)) {
+                        if (stp.getNemCode().equals(CI)) {
                             sbtable.append(sba).append("JSFW.");
                             sbtable.append(sb);
                         } else {
@@ -892,8 +924,16 @@ public class InitialPointGoldenXkService implements IinitialPoint {
 
                         ProBasicEquipmentPoint po = new ProBasicEquipmentPoint();
                         po.setId(StringUtils.getUUID());
-//                        po.setCode(V2Config.getInitialcode());
-                        po.setCode(String.valueOf(sbtable));
+//                        po.setNemCode(V2Config.getInitialcode());
+
+                        if(stp.getNemCode().equals(CI))
+                        {
+                            po.setNemCode(String.valueOf(sbtable));
+                        }else
+                        {
+                            po.setNemCode("INITIAL");
+                        }
+
                         sb = new StringBuilder();
                         sb.append(wt.getName()).append(stp.getName());
                         po.setName(String.valueOf(sb));
@@ -903,7 +943,7 @@ public class InitialPointGoldenXkService implements IinitialPoint {
                         po.setUniformCode(stp.getUniformcode());
                         po.setWindpowerstationId(wt.getWindpowerstationId());
 
-                        if (stp.getCode().equals(CI)) {
+                        if (stp.getNemCode().equals(CI)) {
                             sb = new StringBuilder();
 
                             sb.append(wp.getId().substring(0,wp.getId().lastIndexOf("_")).replace("_", "")).append(".JSFW").append(sba);

+ 451 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/ElectricityMeteringService.java

@@ -0,0 +1,451 @@
+package com.gyee.generation.service.realtimelibrary;
+
+/*
+@author   谢生杰
+@date   2022/11/1-9:38
+*/
+
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.util.DateUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.service.auto.IProBasicMeterPointService;
+import com.gyee.generation.util.PointUtil;
+import com.gyee.generation.util.StringUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
+
+@Service
+@Slf4j
+public class ElectricityMeteringService {
+
+    @Resource
+    private IProBasicMeterPointService meterPointService;
+    @Resource
+    private IEdosUtil edosUtil;
+
+    /**
+     * 存储电计量实时数据
+     * @throws Exception
+     */
+    public void saveGenerationDatas() throws Exception {
+
+        List<ProBasicLine> lnls = CacheContext.lnls;
+        List<ProBasicMeterPoint> meterpoints = CacheContext.meterpoints;
+        List<ProBasicProject> projects = CacheContext.pjls;
+        List<ProBasicWindpowerstation> wpls = CacheContext.wpls;
+        Map<String, Map<String, ProBasicWppoint>> linepointmap = CacheContext.linepointmap;
+        Map<String, Map<String, ProBasicWppoint>> propointmap = CacheContext.propointmap;
+        Map<String, Map<String, ProBasicWppoint>> wppointmap = CacheContext.wppointmap;
+        Map<String, List<ProBasicLine>> prolinemap = CacheContext.prolinemap;
+        Map<String, List<ProBasicProject>> wppromap = CacheContext.wppromap;
+        Date samedayZero = DateUtils.getSamedayZero();
+        Date monthFirstZero = DateUtils.getMonthFirstZero();
+        Date yearFirstZero = DateUtils.getYearFirstZero();
+        Date currentDate = DateUtils.getCurrentDate();
+        Date tomorrow = DateUtils.addDays(samedayZero,1);
+
+        List<PointData> lineResultList = new ArrayList<>();
+        lnls.stream().forEach(line->{
+            Map<String, ProBasicWppoint> proBasicWppointMap = linepointmap.get(line.getId());
+            //线路发电量
+            log.info(line.getName()+"电计量电量计算开始!");
+            Optional<ProBasicMeterPoint> fdlOptional = meterpoints.stream().filter(me -> me.getLineId().equals(line.getId()) &&   me.getUniformCode().equals("ZXYG") && me.getMeterType().equals("进线") && me.getMeterSort().equals("主")).findFirst();
+            getLineFdl(samedayZero, monthFirstZero, yearFirstZero, currentDate, lineResultList, proBasicWppointMap, fdlOptional);
+            log.info(line.getName()+"电计量电量计算完毕!");
+
+            //线路上网电量
+            log.info(line.getName()+"电计量上网电量计算开始!");
+            List<PointData> fdlList = new ArrayList<>();
+            Optional<ProBasicMeterPoint> swdlOptional = meterpoints.stream().filter(me ->   me.getUniformCode().equals("ZXYG") && me.getMeterType().equals("出线") && me.getMeterSort().equals("主") && me.getLineId().contains(line.getId())).findFirst();
+            getLineOtherFdl(linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, lineResultList, line, proBasicWppointMap, fdlOptional, fdlList, swdlOptional);
+            log.info(line.getName()+"电计量上网电量计算完毕!");
+            //线路购网电量
+            log.info(line.getName()+"电计量购网电量计算开始!");
+            Optional<ProBasicMeterPoint> gwdlOptional = meterpoints.stream().filter(me ->  me.getUniformCode().equals("FXYG") && me.getMeterType().equals("出线") && me.getMeterSort().equals("主") && me.getLineId().contains(line.getId())).findFirst();
+            getLineOtherFdl(linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, lineResultList, line, proBasicWppointMap, fdlOptional, fdlList, gwdlOptional);
+            log.info(line.getName()+"电计量购网电量计算完毕!");
+
+            //线路厂用电量
+            log.info(line.getName()+"电计量厂用电量计算开始!");
+            Optional<ProBasicMeterPoint> zybOptional = meterpoints.stream().filter(me->   me.getUniformCode().equals("ZXYG") && me.getMeterType().equals("站用变") && me.getMeterSort().equals("主") && me.getLineId().contains(line.getId())).findFirst();
+            getLineOtherFdl(linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, lineResultList, line, proBasicWppointMap, fdlOptional, fdlList, zybOptional);
+            log.info(line.getName()+"电计量厂用电量计算完毕!");
+
+            //农网购网电量
+            log.info(line.getName()+"农网购网电量计算开始!");
+            setZero(lineResultList,currentDate,proBasicWppointMap,ContantXk.RNWGWDL,ContantXk.YNWGWDL,ContantXk.NNWGWDL);
+            log.info(line.getName()+"农网购网电量计算完毕!");
+        });
+        //线路存储
+        edosUtil.sendMultiPoint(lineResultList);
+
+        List<PointData> proResultList = new ArrayList<>();
+        projects.stream().forEach(pro->{
+            Map<String, ProBasicWppoint> proBasicWppointMap = propointmap.get(pro.getId());
+            List<ProBasicLine> proBasicLines = prolinemap.get(pro.getId());
+            AtomicReference<Double> rfdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> yfdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> nfdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> rswdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> yswdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> nswdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> rgwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ygwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ngwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> rnwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ynwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> nnwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> rcydl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ycydl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ncydl = new AtomicReference<>((double) 0);
+            proBasicLines.stream().forEach(line->{
+                try {
+                    double linerfdl = getLineValue(line.getId(), ContantXk.RFDLSYZ, currentDate, linepointmap);
+                    rfdl.updateAndGet(v -> new Double((double) (v + linerfdl)));
+                    double lineyfdl = getLineValue(line.getId(), ContantXk.YFDLSYZ, currentDate, linepointmap);
+                    yfdl.updateAndGet(v -> new Double((double) (v + lineyfdl)));
+                    double linenfdl = getLineValue(line.getId(), ContantXk.NFDLSYZ, currentDate, linepointmap);
+                    nfdl.updateAndGet(v -> new Double((double) (v + linenfdl)));
+                    double linerswdl = getLineValue(line.getId(), ContantXk.RSWDL, currentDate, linepointmap);
+                    rswdl.updateAndGet(v -> new Double((double) (v + linerswdl)));
+                    double lineyswdl = getLineValue(line.getId(), ContantXk.YSWDL, currentDate, linepointmap);
+                    yswdl.updateAndGet(v -> new Double((double) (v + lineyswdl)));
+                    double linenswdl = getLineValue(line.getId(), ContantXk.NSWDL, currentDate, linepointmap);
+                    nswdl.updateAndGet(v -> new Double((double) (v + linenswdl)));
+                    double linergwgwdl = getLineValue(line.getId(), ContantXk.RGWGWDL, currentDate, linepointmap);
+                    rgwgwdl.updateAndGet(v -> new Double((double) (v + linergwgwdl)));
+                    double lineygwgwdl = getLineValue(line.getId(), ContantXk.YGWGWDL, currentDate, linepointmap);
+                    ygwgwdl.updateAndGet(v -> new Double((double) (v + lineygwgwdl)));
+                    double linengwgwdl = getLineValue(line.getId(), ContantXk.NGWGWDL, currentDate, linepointmap);
+                    ngwgwdl.updateAndGet(v -> new Double((double) (v + linengwgwdl)));
+                    double linernwgwdl = getLineValue(line.getId(), ContantXk.RNWGWDL, currentDate, linepointmap);
+                    rnwgwdl.updateAndGet(v -> new Double((double) (v + linernwgwdl)));
+                    double lineynwgwdl = getLineValue(line.getId(), ContantXk.YNWGWDL, currentDate, linepointmap);
+                    ynwgwdl.updateAndGet(v -> new Double((double) (v + lineynwgwdl)));
+                    double linennwgwdl = getLineValue(line.getId(), ContantXk.NNWGWDL, currentDate, linepointmap);
+                    nnwgwdl.updateAndGet(v -> new Double((double) (v + linennwgwdl)));
+                    double linercydl = getLineValue(line.getId(), ContantXk.RCYDL, currentDate, linepointmap);
+                    rcydl.updateAndGet(v -> new Double((double) (v + linercydl)));
+                    double lineycydl = getLineValue(line.getId(), ContantXk.YCYDL, currentDate, linepointmap);
+                    ycydl.updateAndGet(v -> new Double((double) (v + lineycydl)));
+                    double linencydl = getLineValue(line.getId(), ContantXk.NCYDL, currentDate, linepointmap);
+                    ncydl.updateAndGet(v -> new Double((double) (v + linencydl)));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            });
+            ProBasicWppoint rfdlpoint = proBasicWppointMap.get(ContantXk.RFDLSYZ);
+            proResultList.add(PointUtil.createPointData(currentDate,rfdl.get(),rfdlpoint.getNemCode(),rfdlpoint.getName()));
+            ProBasicWppoint yfdlpoint = proBasicWppointMap.get(ContantXk.YFDLSYZ);
+            proResultList.add(PointUtil.createPointData(currentDate,yfdl.get(),yfdlpoint.getNemCode(),yfdlpoint.getName()));
+            ProBasicWppoint nfdlpoint = proBasicWppointMap.get(ContantXk.YFDLSYZ);
+            proResultList.add(PointUtil.createPointData(currentDate,nfdl.get(),yfdlpoint.getNemCode(),nfdlpoint.getName()));
+
+            ProBasicWppoint rswdlpoint = proBasicWppointMap.get(ContantXk.RSWDL);
+            proResultList.add(PointUtil.createPointData(currentDate,rswdl.get(),rswdlpoint.getNemCode(),rswdlpoint.getName()));
+            ProBasicWppoint yswdlpoint = proBasicWppointMap.get(ContantXk.YSWDL);
+            proResultList.add(PointUtil.createPointData(currentDate,yswdl.get(),yswdlpoint.getNemCode(),yswdlpoint.getName()));
+            ProBasicWppoint nswdlpoint = proBasicWppointMap.get(ContantXk.NSWDL);
+            proResultList.add(PointUtil.createPointData(currentDate,nswdl.get(),nswdlpoint.getNemCode(),nswdlpoint.getName()));
+
+            ProBasicWppoint rgwgwdlpoint = proBasicWppointMap.get(ContantXk.RGWGWDL);
+            proResultList.add(PointUtil.createPointData(currentDate,rgwgwdl.get(),rgwgwdlpoint.getNemCode(),rgwgwdlpoint.getName()));
+            ProBasicWppoint ygwgwdlpoint = proBasicWppointMap.get(ContantXk.YGWGWDL);
+            proResultList.add(PointUtil.createPointData(currentDate,ygwgwdl.get(),ygwgwdlpoint.getNemCode(),ygwgwdlpoint.getName()));
+            ProBasicWppoint ngwgwdlpoint = proBasicWppointMap.get(ContantXk.NGWGWDL);
+            proResultList.add(PointUtil.createPointData(currentDate,ngwgwdl.get(),ngwgwdlpoint.getNemCode(),ngwgwdlpoint.getName()));
+
+            ProBasicWppoint rnwgwdlpoint = proBasicWppointMap.get(ContantXk.RNWGWDL);
+            proResultList.add(PointUtil.createPointData(currentDate,rnwgwdl.get(),rnwgwdlpoint.getNemCode(),rnwgwdlpoint.getName()));
+            ProBasicWppoint ynwgwdlpoint = proBasicWppointMap.get(ContantXk.YNWGWDL);
+            proResultList.add(PointUtil.createPointData(currentDate,ynwgwdl.get(),ynwgwdlpoint.getNemCode(),ynwgwdlpoint.getName()));
+            ProBasicWppoint nnwgwdlpoint = proBasicWppointMap.get(ContantXk.NNWGWDL);
+            proResultList.add(PointUtil.createPointData(currentDate,nnwgwdl.get(),nnwgwdlpoint.getNemCode(),nnwgwdlpoint.getName()));
+
+            ProBasicWppoint rcydlpoint = proBasicWppointMap.get(ContantXk.RCYDL);
+            proResultList.add(PointUtil.createPointData(currentDate,rcydl.get(),rcydlpoint.getNemCode(),rcydlpoint.getName()));
+            ProBasicWppoint ycydlpoint = proBasicWppointMap.get(ContantXk.YCYDL);
+            proResultList.add(PointUtil.createPointData(currentDate,ycydl.get(),ycydlpoint.getNemCode(),ycydlpoint.getName()));
+            ProBasicWppoint ncydlpoint = proBasicWppointMap.get(ContantXk.NCYDL);
+            proResultList.add(PointUtil.createPointData(currentDate,ncydl.get(),ncydlpoint.getNemCode(),ncydlpoint.getName()));
+
+        });
+        //期次存储
+        edosUtil.sendMultiPoint(proResultList);
+
+        List<PointData> wpResultList = new ArrayList<>();
+        wpls.stream().forEach(wp->{
+            Map<String, ProBasicWppoint> wpBasicWppointMap = wppointmap.get(wp.getId());
+            List<ProBasicProject> proBasicPros = wppromap.get(wp.getId());
+            AtomicReference<Double> rfdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> yfdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> nfdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> rswdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> yswdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> nswdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> rgwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ygwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ngwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> rnwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ynwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> nnwgwdl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> rcydl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ycydl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> ncydl = new AtomicReference<>((double) 0);
+            proBasicPros.stream().forEach(line->{    //期次
+                try {
+                    double linerfdl = getLineValue(line.getId(), ContantXk.RFDLSYZ, currentDate, linepointmap);
+                    rfdl.updateAndGet(v -> new Double((double) (v + linerfdl)));
+                    double lineyfdl = getLineValue(line.getId(), ContantXk.YFDLSYZ, currentDate, linepointmap);
+                    yfdl.updateAndGet(v -> new Double((double) (v + lineyfdl)));
+                    double linenfdl = getLineValue(line.getId(), ContantXk.NFDLSYZ, currentDate, linepointmap);
+                    nfdl.updateAndGet(v -> new Double((double) (v + linenfdl)));
+                    double linerswdl = getLineValue(line.getId(), ContantXk.RSWDL, currentDate, linepointmap);
+                    rswdl.updateAndGet(v -> new Double((double) (v + linerswdl)));
+                    double lineyswdl = getLineValue(line.getId(), ContantXk.YSWDL, currentDate, linepointmap);
+                    yswdl.updateAndGet(v -> new Double((double) (v + lineyswdl)));
+                    double linenswdl = getLineValue(line.getId(), ContantXk.NSWDL, currentDate, linepointmap);
+                    nswdl.updateAndGet(v -> new Double((double) (v + linenswdl)));
+                    double linergwgwdl = getLineValue(line.getId(), ContantXk.RGWGWDL, currentDate, linepointmap);
+                    rgwgwdl.updateAndGet(v -> new Double((double) (v + linergwgwdl)));
+                    double lineygwgwdl = getLineValue(line.getId(), ContantXk.YGWGWDL, currentDate, linepointmap);
+                    ygwgwdl.updateAndGet(v -> new Double((double) (v + lineygwgwdl)));
+                    double linengwgwdl = getLineValue(line.getId(), ContantXk.NGWGWDL, currentDate, linepointmap);
+                    ngwgwdl.updateAndGet(v -> new Double((double) (v + linengwgwdl)));
+                    double linernwgwdl = getLineValue(line.getId(), ContantXk.RNWGWDL, currentDate, linepointmap);
+                    rnwgwdl.updateAndGet(v -> new Double((double) (v + linernwgwdl)));
+                    double lineynwgwdl = getLineValue(line.getId(), ContantXk.YNWGWDL, currentDate, linepointmap);
+                    ynwgwdl.updateAndGet(v -> new Double((double) (v + lineynwgwdl)));
+                    double linennwgwdl = getLineValue(line.getId(), ContantXk.NNWGWDL, currentDate, linepointmap);
+                    nnwgwdl.updateAndGet(v -> new Double((double) (v + linennwgwdl)));
+                    double linercydl = getLineValue(line.getId(), ContantXk.RCYDL, currentDate, linepointmap);
+                    rcydl.updateAndGet(v -> new Double((double) (v + linercydl)));
+                    double lineycydl = getLineValue(line.getId(), ContantXk.YCYDL, currentDate, linepointmap);
+                    ycydl.updateAndGet(v -> new Double((double) (v + lineycydl)));
+                    double linencydl = getLineValue(line.getId(), ContantXk.NCYDL, currentDate, linepointmap);
+                    ncydl.updateAndGet(v -> new Double((double) (v + linencydl)));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            });
+            ProBasicWppoint rfdlpoint = wpBasicWppointMap.get(ContantXk.RFDLSYZ);
+            wpResultList.add(PointUtil.createPointData(currentDate,rfdl.get(),rfdlpoint.getNemCode(),rfdlpoint.getName()));
+            ProBasicWppoint yfdlpoint = wpBasicWppointMap.get(ContantXk.YFDLSYZ);
+            wpResultList.add(PointUtil.createPointData(currentDate,yfdl.get(),yfdlpoint.getNemCode(),yfdlpoint.getName()));
+            ProBasicWppoint nfdlpoint = wpBasicWppointMap.get(ContantXk.YFDLSYZ);
+            wpResultList.add(PointUtil.createPointData(currentDate,nfdl.get(),yfdlpoint.getNemCode(),nfdlpoint.getName()));
+
+            ProBasicWppoint rswdlpoint = wpBasicWppointMap.get(ContantXk.RSWDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,rswdl.get(),rswdlpoint.getNemCode(),rswdlpoint.getName()));
+            ProBasicWppoint yswdlpoint = wpBasicWppointMap.get(ContantXk.YSWDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,yswdl.get(),yswdlpoint.getNemCode(),yswdlpoint.getName()));
+            ProBasicWppoint nswdlpoint = wpBasicWppointMap.get(ContantXk.NSWDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,nswdl.get(),nswdlpoint.getNemCode(),nswdlpoint.getName()));
+
+            ProBasicWppoint rgwgwdlpoint = wpBasicWppointMap.get(ContantXk.RGWGWDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,rgwgwdl.get(),rgwgwdlpoint.getNemCode(),rgwgwdlpoint.getName()));
+            ProBasicWppoint ygwgwdlpoint = wpBasicWppointMap.get(ContantXk.YGWGWDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,ygwgwdl.get(),ygwgwdlpoint.getNemCode(),ygwgwdlpoint.getName()));
+            ProBasicWppoint ngwgwdlpoint = wpBasicWppointMap.get(ContantXk.NGWGWDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,ngwgwdl.get(),ngwgwdlpoint.getNemCode(),ngwgwdlpoint.getName()));
+
+            ProBasicWppoint rnwgwdlpoint = wpBasicWppointMap.get(ContantXk.RNWGWDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,rnwgwdl.get(),rnwgwdlpoint.getNemCode(),rnwgwdlpoint.getName()));
+            ProBasicWppoint ynwgwdlpoint = wpBasicWppointMap.get(ContantXk.YNWGWDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,ynwgwdl.get(),ynwgwdlpoint.getNemCode(),ynwgwdlpoint.getName()));
+            ProBasicWppoint nnwgwdlpoint = wpBasicWppointMap.get(ContantXk.NNWGWDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,nnwgwdl.get(),nnwgwdlpoint.getNemCode(),nnwgwdlpoint.getName()));
+
+            ProBasicWppoint rcydlpoint = wpBasicWppointMap.get(ContantXk.RCYDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,rcydl.get(),rcydlpoint.getNemCode(),rcydlpoint.getName()));
+            ProBasicWppoint ycydlpoint = wpBasicWppointMap.get(ContantXk.YCYDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,ycydl.get(),ycydlpoint.getNemCode(),ycydlpoint.getName()));
+            ProBasicWppoint ncydlpoint = wpBasicWppointMap.get(ContantXk.NCYDL);
+            wpResultList.add(PointUtil.createPointData(currentDate,ncydl.get(),ncydlpoint.getNemCode(),ncydlpoint.getName()));
+
+        });
+        //场站存储
+        edosUtil.sendMultiPoint(wpResultList);
+    }
+
+    private double getLineValue(String lineid, String uniformcode, Date currentDate, Map<String, Map<String, ProBasicWppoint>> linepointmap) throws Exception {
+        ProBasicWppoint proBasicWppoint = linepointmap.get(lineid).get(uniformcode);
+        return edosUtil.getSectionData(proBasicWppoint,currentDate.getTime()).getPointValueInDouble();
+    }
+
+
+    private void setZero(List<PointData> resultList,Date currentDate,Map<String, ProBasicWppoint> linemap,String rcode,String ycode,String ncode) {
+        //线路日发电量
+        PointData r = new PointData();
+        r.setPointTime(currentDate.getTime());
+        r.setPointValue("0");
+        r.setPointValueInDouble(0);
+        r.setEdnaId(linemap.get(rcode).getNemCode());
+        r.setPointName(linemap.get(rcode).getName());
+        resultList.add(r);
+        //线路月发电量
+        PointData y = new PointData();
+        y.setPointTime(currentDate.getTime());
+        y.setPointValue("0");
+        y.setPointValueInDouble(0);
+        y.setEdnaId(linemap.get(ycode).getNemCode());
+        y.setPointName(linemap.get(ycode).getName());
+        resultList.add(y);
+        //线路年发电量
+        PointData n = new PointData();
+        n.setPointTime(currentDate.getTime());
+        n.setPointValue("0");
+        n.setPointValueInDouble(0);
+        n.setEdnaId(linemap.get(ncode).getNemCode());
+        n.setPointName(linemap.get(ncode).getName());
+        resultList.add(n);
+    }
+
+    private void getLineOtherFdl(Map<String, Map<String, ProBasicWppoint>> linepointmap, Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, List<PointData> lineResultList, ProBasicLine line, Map<String, ProBasicWppoint> proBasicWppointMap, Optional<ProBasicMeterPoint> fdlOptional, List<PointData> fdlList, Optional<ProBasicMeterPoint> swdlOptional) {
+        if (swdlOptional.isPresent()){
+            ProBasicMeterPoint swdlMeterpoint = swdlOptional.get();
+            if (StringUtils.isEmpty(fdlList)){
+                String[] lines = swdlMeterpoint.getLineId().split("\\|");
+                Arrays.stream(lines).forEach(l->{
+                    getLineFdl(samedayZero, monthFirstZero, yearFirstZero, currentDate, fdlList, proBasicWppointMap, fdlOptional);
+                });
+            }
+            //获取电量百分比,算其他电量
+            Map<String, Double> percentageMap = getPercentage(fdlList,swdlMeterpoint,linepointmap, line);
+
+            String pointid = swdlMeterpoint.getId();
+            Double real = 0.0;
+            Double sameday = 0.0;
+            Double month = 0.0;
+            Double year = 0.0;
+            try {
+                real = edosUtil.getSectionData(pointid,currentDate.getTime()).getPointValueInDouble();
+                sameday = edosUtil.getSectionData(pointid,samedayZero.getTime()).getPointValueInDouble();
+                month = edosUtil.getSectionData(pointid,monthFirstZero.getTime()).getPointValueInDouble();
+                year = edosUtil.getSectionData(pointid,yearFirstZero.getTime()).getPointValueInDouble();
+
+                Double magnification = swdlMeterpoint.getMagnification();
+                Double xs = swdlMeterpoint.getXs();
+
+
+                //线路上网电量
+                double xlswdl = (real - sameday) * magnification / xs * percentageMap.get("percentage");
+                ProBasicWppoint rpoint = proBasicWppointMap.get(ContantXk.RSWDL);
+                PointData rpointData = PointUtil.createPointData(currentDate, xlswdl, rpoint.getNemCode(), rpoint.getName());
+                lineResultList.add(rpointData);
+                //线路月上网发电量
+                double xlyswdl = (real - month) * magnification / xs * percentageMap.get("ypercentage");
+                ProBasicWppoint ypoint = proBasicWppointMap.get(ContantXk.YSWDL);
+                PointData ypointData = PointUtil.createPointData(currentDate, xlyswdl, ypoint.getNemCode(), ypoint.getName());
+                lineResultList.add(ypointData);
+                //线路年上网发电量
+                double xlnswfdl = (real - year) * magnification / xs * percentageMap.get("npercentage");
+                ProBasicWppoint npoint = proBasicWppointMap.get(ContantXk.NSWDL);
+                PointData npointData = PointUtil.createPointData(currentDate, xlnswfdl, npoint.getNemCode(), npoint.getName());
+                lineResultList.add(npointData);
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private void getLineFdl(Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, List<PointData> lineResultList, Map<String, ProBasicWppoint> proBasicWppointMap, Optional<ProBasicMeterPoint> fdlOptional) {
+        if (fdlOptional.isPresent()){
+            ProBasicMeterPoint proBasicMeterPoint = fdlOptional.get();
+            String pointid = proBasicMeterPoint.getId();
+            Double real = 0.0;
+            Double sameday = 0.0;
+            Double month = 0.0;
+            Double year = 0.0;
+            try {
+                real = edosUtil.getSectionData(pointid,currentDate.getTime()).getPointValueInDouble();
+                sameday = edosUtil.getSectionData(pointid,samedayZero.getTime()).getPointValueInDouble();
+                month = edosUtil.getSectionData(pointid,monthFirstZero.getTime()).getPointValueInDouble();
+                year = edosUtil.getSectionData(pointid,yearFirstZero.getTime()).getPointValueInDouble();
+
+                Double magnification = fdlOptional.get().getMagnification();
+                Double xs = proBasicMeterPoint.getXs();
+                //线路日发电量
+                double xlrfdl = (real - sameday) * magnification / xs;
+                ProBasicWppoint rpoint = proBasicWppointMap.get(ContantXk.RFDLSYZ);
+                PointData r = PointUtil.createPointData(currentDate, xlrfdl, rpoint.getNemCode(),rpoint.getName());
+                lineResultList.add(r);
+                //线路月发电量
+                double xlyfdl = (real - month) * magnification / xs;
+                ProBasicWppoint ypoint = proBasicWppointMap.get(ContantXk.YFDLSYZ);
+                PointData y = PointUtil.createPointData(currentDate, xlyfdl,ypoint.getNemCode(),ypoint.getName());
+                lineResultList.add(y);
+                //线路年发电量
+                double xlnfdl = (real - year) * magnification / xs;
+                ProBasicWppoint npoint = proBasicWppointMap.get(ContantXk.NFDLSYZ);
+                PointData n = PointUtil.createPointData(currentDate, xlnfdl,npoint.getNemCode(),npoint.getName());
+                lineResultList.add(n);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private Map<String,Double> getPercentage(List<PointData> fdlList,ProBasicMeterPoint swdlMeterpoint,Map<String, Map<String, ProBasicWppoint>> linepointmap,ProBasicLine line){
+
+        Map<String,Double> percentageMap = new HashMap<>();
+        String[] swdlLines = swdlMeterpoint.getLineId().split("\\|");
+        AtomicReference<Double> xldl = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xlzdl = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xlydl = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xlzydl = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xlndl = new AtomicReference<>((double) 0);
+        AtomicReference<Double> xlzndl = new AtomicReference<>((double) 0);
+        Arrays.stream(swdlLines).forEach(l->{
+            Optional<PointData> xldlfirst = fdlList.stream().filter(res -> res.getEdnaId().equals(linepointmap.get(l).get(ContantXk.RFDLSYZ).getNemCode())).findFirst();
+            if (xldlfirst.isPresent()){
+                if (l.equals(line.getId())){
+                    xldl.set(xldlfirst.get().getPointValueInDouble());
+                    xlzdl.updateAndGet(v -> new Double((double) (v + xldlfirst.get().getPointValueInDouble())));
+                }else{
+                    xlzdl.updateAndGet(v -> new Double((double) (v + xldlfirst.get().getPointValueInDouble())));
+                }
+            }
+            Optional<PointData> xlydlfirst = fdlList.stream().filter(res -> res.getEdnaId().equals(linepointmap.get(l).get(ContantXk.YFDLSYZ).getNemCode())).findFirst();
+            if (xlydlfirst.isPresent()){
+                if (l.equals(line.getId())){
+                    xlydl.set(xlydlfirst.get().getPointValueInDouble());
+                    xlzydl.updateAndGet(v -> new Double((double) (v + xlydlfirst.get().getPointValueInDouble())));
+                }else{
+                    xlzydl.updateAndGet(v -> new Double((double) (v + xlydlfirst.get().getPointValueInDouble())));
+                }
+            }
+            Optional<PointData> xlndlfirst = fdlList.stream().filter(res -> res.getEdnaId().equals(linepointmap.get(l).get(ContantXk.NFDLSYZ).getNemCode())).findFirst();
+            if (xlndlfirst.isPresent()){
+                if (l.equals(line.getId())){
+                    xlndl.set(xlndlfirst.get().getPointValueInDouble());
+                    xlzndl.updateAndGet(v -> new Double((double) (v + xlndlfirst.get().getPointValueInDouble())));
+                }else{
+                    xlzndl.updateAndGet(v -> new Double((double) (v + xlndlfirst.get().getPointValueInDouble())));
+                }
+            }
+        });
+        //电量百分比
+        double percentage = xlzdl.get() != 0 ? xldl.get() / xlzdl.get() * 100 : 0;
+        percentageMap.put("percentage",percentage);
+        double ypercentage = xlzydl.get() != 0 ? xlydl.get() / xlzydl.get() * 100 : 0;
+        percentageMap.put("ypercentage",ypercentage);
+        double npercentage = xlzndl.get() != 0 ? xlndl.get() / xlzndl.get() * 100 : 0;
+        percentageMap.put("npercentage",npercentage);
+        return percentageMap;
+    }
+
+
+
+
+
+}

+ 433 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/RealtimeService.java

@@ -0,0 +1,433 @@
+package com.gyee.generation.service.realtimelibrary;
+/*
+@author   谢生杰
+@date   2022/11/4-17:09
+*/
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.util.DateUtils;
+import com.gyee.common.util.algorithm.Underdelivery;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.util.PointUtil;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicReference;
+
+@Service
+public class RealtimeService {
+    @Resource
+    private IEdosUtil edosUtil;
+
+    /**
+     * 存储补风风速实时点,理论保证自算最优可用功率,
+     *
+     * @throws Exception
+     */
+    public void savaRealtimeTarget() throws Exception {
+
+        List<ProBasicWindturbine> wtls = CacheContext.wtls;
+        List<ProBasicLine> lnls = CacheContext.lnls;
+        List<ProBasicProject> pjls = CacheContext.pjls;
+        List<ProBasicWindpowerstation> wpls = CacheContext.wpls;
+        Map<String, List<ProBasicWindturbine>> lnwtmap = CacheContext.lnwtmap;
+        Map<String, List<ProBasicLine>> prolinemap = CacheContext.prolinemap;
+        Map<String, List<ProBasicProject>> wppromap = CacheContext.wppromap;
+        Map<String, Map<Double, ProBasicModelPowerRd>> theoreticalPowerMap = CacheContext.theoreticalPowerMap; //理论保证功率
+        Map<String, Map<Double, ProEconWtPowerCurveFitting>> curveFittingPowerMap = CacheContext.curveFittingPowerMap; //最优自算功率
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+        Map<String, Map<String, ProBasicWppoint>> linepointmap = CacheContext.linepointmap;
+        Map<String, Map<String, ProBasicWppoint>> propointmap = CacheContext.propointmap;
+        Map<String, Map<String, ProBasicWppoint>> wppointmap = CacheContext.wppointmap;
+        Date currentDate = DateUtils.getCurrentDate();
+        Date minute15begin = DateUtils.addMinutes(currentDate, -15);
+        //保存风机点
+        List<PointData> wtResultList = new ArrayList<>();
+        wtls.stream().forEach(wt -> {
+            Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
+            ProBasicEquipmentPoint speedPoint = equipmentPointMap.get(ContantXk.CJ_SSFS);
+            ProBasicEquipmentPoint mxztPoint = equipmentPointMap.get(ContantXk.MXZT);
+            ProBasicEquipmentPoint ssbfPoint = equipmentPointMap.get(ContantXk.SSBF);
+            ProBasicEquipmentPoint ssglPoint = equipmentPointMap.get(ContantXk.CJ_SSGL);
+            //理论功率测点
+            ProBasicEquipmentPoint llglPoint = equipmentPointMap.get(ContantXk.LLGL);
+            //保证功率测点
+            ProBasicEquipmentPoint bzglPoint = equipmentPointMap.get(ContantXk.BZGL);
+            //自算功率测点
+            ProBasicEquipmentPoint zsglPoint = equipmentPointMap.get(ContantXk.ZSGL);
+            //最优功率测点
+            ProBasicEquipmentPoint zyglPoint = equipmentPointMap.get(ContantXk.ZYGL);
+            //可用功率测点
+            ProBasicEquipmentPoint kyglPoint = equipmentPointMap.get(ContantXk.KYGL);
+            //实时欠发状态
+            ProBasicEquipmentPoint ssqfztPoint = equipmentPointMap.get(ContantXk.SSQFZT);
+            //历史欠发状态
+            ProBasicEquipmentPoint lsqfztPoint = equipmentPointMap.get(ContantXk.LSQFZT);
+            double mxzt = 0;
+            double speed = 0;
+            double ssbf = 0;
+            double ssgl = 0;
+            Optional<PointData> ssglOptional = null;
+            Optional<PointData> zsglOptional = null;
+            try {
+                mxzt = edosUtil.getSectionData(mxztPoint, currentDate.getTime()).getPointValueInDouble();
+                speed = edosUtil.getSectionData(speedPoint, currentDate.getTime()).getPointValueInDouble();
+                ssgl = edosUtil.getSectionData(ssglPoint, currentDate.getTime()).getPointValueInDouble();
+                ssglOptional = edosUtil.getHistStat(ssglPoint, minute15begin.getTime() / 1000, currentDate.getTime() / 1000, 1l, 900l, 2).stream().findFirst();
+                zsglOptional = edosUtil.getHistStat(zsglPoint, minute15begin.getTime() / 1000, currentDate.getTime() / 1000, 1l, 900l, 2).stream().findFirst();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            PointData ssbfPointDate = null;
+            if (mxzt == 12 || mxzt == 13) {
+                //补风算法(后续补充,暂时用0)
+                ssbfPointDate = PointUtil.createPointData(currentDate, 0, ssbfPoint.getNemCode(), ssbfPoint.getName());
+            } else {
+                ssbf = speed;
+                ssbfPointDate = PointUtil.createPointData(currentDate, ssbf, ssbfPoint.getNemCode(), ssbfPoint.getName());
+            }
+            wtResultList.add(ssbfPointDate);
+            ProBasicModelPowerRd basicModelPowerRd = theoreticalPowerMap.get(wt.getModelId()).get(ssbf);
+            wtResultList.add(PointUtil.createPointData(currentDate, basicModelPowerRd.getTheoryPower(), llglPoint.getNemCode(), llglPoint.getName()));
+            wtResultList.add(PointUtil.createPointData(currentDate, basicModelPowerRd.getEnsurePower(), bzglPoint.getNemCode(), bzglPoint.getName()));
+            ProEconWtPowerCurveFitting wtPowerCurveFitting = curveFittingPowerMap.get(wt.getId()).get(ssbf);
+            Double actualPower = wtPowerCurveFitting.getActualPower();
+            double[] underissuanceArray = {0, 1, 2, 3, 8, 9, 11};
+            double qfzt = 0;
+            double lsqfzt = 0;
+            double ssgl15 = 0;
+            double zsgl15 = 0;
+            if (ssglOptional.isPresent()) {
+                ssgl15 = ssglOptional.get().getPointValueInDouble();
+                zsgl15 = zsglOptional.get().getPointValueInDouble();
+            }
+            if (Arrays.asList(underissuanceArray).contains(mxzt)) {
+                qfzt = Underdelivery.underdeliveryStatusReal(ssgl, actualPower);
+                lsqfzt = Underdelivery.underdeliveryStatusReal(ssgl15, zsgl15);
+            }
+            wtResultList.add(PointUtil.createPointData(currentDate, qfzt, ssqfztPoint.getNemCode(), ssqfztPoint.getName()));
+            wtResultList.add(PointUtil.createPointData(currentDate, lsqfzt, lsqfztPoint.getNemCode(), lsqfztPoint.getName()));
+
+            wtResultList.add(PointUtil.createPointData(currentDate, wtPowerCurveFitting.getActualPower(), zsglPoint.getNemCode(), zsglPoint.getName()));
+            wtResultList.add(PointUtil.createPointData(currentDate, wtPowerCurveFitting.getOptimalPower(), zyglPoint.getNemCode(), zyglPoint.getName()));
+
+            if (mxzt == 4 || mxzt == 5 || mxzt == 6 || mxzt == 7) {
+                wtResultList.add(PointUtil.createPointData(currentDate, 0, kyglPoint.getNemCode(), kyglPoint.getName()));
+            } else {
+                wtResultList.add(PointUtil.createPointData(currentDate, wtPowerCurveFitting.getActualPower(), kyglPoint.getNemCode(), kyglPoint.getName()));
+            }
+        });
+        edosUtil.sendMultiPoint(wtResultList);
+        //保存线路点
+        List<PointData> lineResultList = new ArrayList<>();
+        lnls.stream().forEach(line -> {
+            List<ProBasicWindturbine> proBasicWindturbines = lnwtmap.get(line.getId());
+            Map<String, ProBasicWppoint> proBasicWppointMap = linepointmap.get(line.getId());
+            AtomicReference<Double> zssbf = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zssgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zllgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zbzgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zzsgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zzygl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zkygl = new AtomicReference<>((double) 0);
+
+            ProBasicWppoint ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJFS);
+            ProBasicWppoint ssglWpPoint = proBasicWppointMap.get(ContantXk.SSZGL);
+            ProBasicWppoint llglWpPoint = proBasicWppointMap.get(ContantXk.SSZLLGL);
+            ProBasicWppoint bzglWpPoint = proBasicWppointMap.get(ContantXk.SSZBZGL);
+            ProBasicWppoint zsglWpPoint = proBasicWppointMap.get(ContantXk.SSZNHGLZS);
+            ProBasicWppoint zyglWpPoint = proBasicWppointMap.get(ContantXk.SSZZYGL);
+            ProBasicWppoint kyglWpPoint = proBasicWppointMap.get(ContantXk.SSZKYGL);
+
+            proBasicWindturbines.stream().forEach(wt -> {
+                Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
+                ProBasicEquipmentPoint ssbfPoint = equipmentPointMap.get(ContantXk.SSBF);
+                ProBasicEquipmentPoint ssglPoint = equipmentPointMap.get(ContantXk.CJ_SSGL);
+                //理论功率测点
+                ProBasicEquipmentPoint llglPoint = equipmentPointMap.get(ContantXk.LLGL);
+                //保证功率测点
+                ProBasicEquipmentPoint bzglPoint = equipmentPointMap.get(ContantXk.BZGL);
+                //自算功率测点
+                ProBasicEquipmentPoint zsglPoint = equipmentPointMap.get(ContantXk.ZSGL);
+                //最优功率测点
+                ProBasicEquipmentPoint zyglPoint = equipmentPointMap.get(ContantXk.ZYGL);
+                //可用功率测点
+                ProBasicEquipmentPoint kyglPoint = equipmentPointMap.get(ContantXk.KYGL);
+
+                zssbf.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(ssbfPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zssgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(ssglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zllgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(llglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zbzgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(bzglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zzsgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(zsglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zzygl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(zyglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zkygl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(kyglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+            });
+            lineResultList.add(PointUtil.createPointData(currentDate, zssbf.get() / proBasicWindturbines.size(), ssfsWpPoint.getNemCode(), ssfsWpPoint.getName()));
+            lineResultList.add(PointUtil.createPointData(currentDate, zssgl.get(), ssglWpPoint.getNemCode(), ssglWpPoint.getName()));
+            lineResultList.add(PointUtil.createPointData(currentDate, zllgl.get(), llglWpPoint.getNemCode(), llglWpPoint.getName()));
+            lineResultList.add(PointUtil.createPointData(currentDate, zbzgl.get(), bzglWpPoint.getNemCode(), bzglWpPoint.getName()));
+            lineResultList.add(PointUtil.createPointData(currentDate, zzsgl.get(), zsglWpPoint.getNemCode(), zsglWpPoint.getName()));
+            lineResultList.add(PointUtil.createPointData(currentDate, zzygl.get(), zyglWpPoint.getNemCode(), zyglWpPoint.getName()));
+            lineResultList.add(PointUtil.createPointData(currentDate, zkygl.get(), kyglWpPoint.getNemCode(), kyglWpPoint.getName()));
+        });
+        edosUtil.sendMultiPoint(lineResultList);
+        //保存期次点
+        List<PointData> projectResultList = new ArrayList<>();
+        pjls.stream().forEach(project -> {
+            List<ProBasicLine> proBasicLines = prolinemap.get(project.getId());
+            Map<String, ProBasicWppoint> proBasicWppointMap = propointmap.get(project.getId());
+            AtomicReference<Double> zssbf = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zssgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zllgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zbzgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zzsgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zzygl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zkygl = new AtomicReference<>((double) 0);
+
+            ProBasicWppoint ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJFS);
+            ProBasicWppoint ssglWpPoint = proBasicWppointMap.get(ContantXk.SSZGL);
+            ProBasicWppoint llglWpPoint = proBasicWppointMap.get(ContantXk.SSZLLGL);
+            ProBasicWppoint bzglWpPoint = proBasicWppointMap.get(ContantXk.SSZBZGL);
+            ProBasicWppoint zsglWpPoint = proBasicWppointMap.get(ContantXk.SSZNHGLZS);
+            ProBasicWppoint zyglWpPoint = proBasicWppointMap.get(ContantXk.SSZZYGL);
+            ProBasicWppoint kyglWpPoint = proBasicWppointMap.get(ContantXk.SSZKYGL);
+
+            proBasicLines.stream().forEach(wp -> {
+                Map<String, ProBasicWppoint> basicWppointMap = linepointmap.get(wp.getId());
+                ProBasicWppoint ssbfPoint = basicWppointMap.get(ContantXk.SSPJFS);
+                ProBasicWppoint ssglPoint = basicWppointMap.get(ContantXk.SSZGL);
+                //理论功率测点
+                ProBasicWppoint llglPoint = basicWppointMap.get(ContantXk.SSZLLGL);
+                //保证功率测点
+                ProBasicWppoint bzglPoint = basicWppointMap.get(ContantXk.SSZBZGL);
+                //自算功率测点
+                ProBasicWppoint zsglPoint = basicWppointMap.get(ContantXk.SSZNHGLZS);
+                //最优功率测点
+                ProBasicWppoint zyglPoint = basicWppointMap.get(ContantXk.SSZZYGL);
+                //可用功率测点
+                ProBasicWppoint kyglPoint = basicWppointMap.get(ContantXk.SSZKYGL);
+
+                zssbf.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(ssbfPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zssgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(ssglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zllgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(llglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zbzgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(bzglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zzsgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(zsglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zzygl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(zyglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zkygl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(kyglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+            });
+            projectResultList.add(PointUtil.createPointData(currentDate, zssbf.get() / proBasicLines.size(), ssfsWpPoint.getNemCode(), ssfsWpPoint.getName()));
+            projectResultList.add(PointUtil.createPointData(currentDate, zssgl.get(), ssglWpPoint.getNemCode(), ssglWpPoint.getName()));
+            projectResultList.add(PointUtil.createPointData(currentDate, zllgl.get(), llglWpPoint.getNemCode(), llglWpPoint.getName()));
+            projectResultList.add(PointUtil.createPointData(currentDate, zbzgl.get(), bzglWpPoint.getNemCode(), bzglWpPoint.getName()));
+            projectResultList.add(PointUtil.createPointData(currentDate, zzsgl.get(), zsglWpPoint.getNemCode(), zsglWpPoint.getName()));
+            projectResultList.add(PointUtil.createPointData(currentDate, zzygl.get(), zyglWpPoint.getNemCode(), zyglWpPoint.getName()));
+            projectResultList.add(PointUtil.createPointData(currentDate, zkygl.get(), kyglWpPoint.getNemCode(), kyglWpPoint.getName()));
+        });
+        edosUtil.sendMultiPoint(projectResultList);
+        //保存场站点
+        List<PointData> wpResultList = new ArrayList<>();
+        wpls.stream().forEach(wps -> {
+            List<ProBasicProject> proBasicProjects = wppromap.get(wps.getId());
+            Map<String, ProBasicWppoint> proBasicWppointMap = wppointmap.get(wps.getId());
+            AtomicReference<Double> zssbf = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zssgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zllgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zbzgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zzsgl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zzygl = new AtomicReference<>((double) 0);
+            AtomicReference<Double> zkygl = new AtomicReference<>((double) 0);
+
+            ProBasicWppoint ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJFS);
+            ProBasicWppoint ssglWpPoint = proBasicWppointMap.get(ContantXk.SSZGL);
+            ProBasicWppoint llglWpPoint = proBasicWppointMap.get(ContantXk.SSZLLGL);
+            ProBasicWppoint bzglWpPoint = proBasicWppointMap.get(ContantXk.SSZBZGL);
+            ProBasicWppoint zsglWpPoint = proBasicWppointMap.get(ContantXk.SSZNHGLZS);
+            ProBasicWppoint zyglWpPoint = proBasicWppointMap.get(ContantXk.SSZZYGL);
+            ProBasicWppoint kyglWpPoint = proBasicWppointMap.get(ContantXk.SSZKYGL);
+
+            proBasicProjects.stream().forEach(wp -> {
+                Map<String, ProBasicWppoint> basicWppointMap = propointmap.get(wp.getId());
+                ProBasicWppoint ssbfPoint = basicWppointMap.get(ContantXk.SSPJFS);
+                ProBasicWppoint ssglPoint = basicWppointMap.get(ContantXk.SSZGL);
+                //理论功率测点
+                ProBasicWppoint llglPoint = basicWppointMap.get(ContantXk.SSZLLGL);
+                //保证功率测点
+                ProBasicWppoint bzglPoint = basicWppointMap.get(ContantXk.SSZBZGL);
+                //自算功率测点
+                ProBasicWppoint zsglPoint = basicWppointMap.get(ContantXk.SSZNHGLZS);
+                //最优功率测点
+                ProBasicWppoint zyglPoint = basicWppointMap.get(ContantXk.SSZZYGL);
+                //可用功率测点
+                ProBasicWppoint kyglPoint = basicWppointMap.get(ContantXk.SSZKYGL);
+
+                zssbf.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(ssbfPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zssgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(ssglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zllgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(llglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zbzgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(bzglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zzsgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(zsglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zzygl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(zyglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zkygl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(kyglPoint, currentDate.getTime()).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+            });
+            wpResultList.add(PointUtil.createPointData(currentDate, zssbf.get() / proBasicProjects.size(), ssfsWpPoint.getNemCode(), ssfsWpPoint.getName()));
+            wpResultList.add(PointUtil.createPointData(currentDate, zssgl.get(), ssglWpPoint.getNemCode(), ssglWpPoint.getName()));
+            wpResultList.add(PointUtil.createPointData(currentDate, zllgl.get(), llglWpPoint.getNemCode(), llglWpPoint.getName()));
+            wpResultList.add(PointUtil.createPointData(currentDate, zbzgl.get(), bzglWpPoint.getNemCode(), bzglWpPoint.getName()));
+            wpResultList.add(PointUtil.createPointData(currentDate, zzsgl.get(), zsglWpPoint.getNemCode(), zsglWpPoint.getName()));
+            wpResultList.add(PointUtil.createPointData(currentDate, zzygl.get(), zyglWpPoint.getNemCode(), zyglWpPoint.getName()));
+            wpResultList.add(PointUtil.createPointData(currentDate, zkygl.get(), kyglWpPoint.getNemCode(), kyglWpPoint.getName()));
+        });
+        edosUtil.sendMultiPoint(wpResultList);
+
+    }
+}

+ 88 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/TheoreticalPowerService.java

@@ -0,0 +1,88 @@
+package com.gyee.generation.service.realtimelibrary;/*
+@author   谢生杰
+@date   2022/11/6-12:07
+*/
+
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.util.DateUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
+import com.gyee.generation.model.auto.ProBasicModelPowerRd;
+import com.gyee.generation.model.auto.ProBasicWindturbine;
+import com.gyee.generation.model.auto.ProEconWtPowerCurveFitting;
+import com.gyee.generation.service.auto.IProBasicModelPowerRdService;
+import com.gyee.generation.service.auto.IProEconWtPowerCurveFittingService;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.redis.RedisService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class TheoreticalPowerService {
+
+    @Resource
+    private RedisService redisService;
+    @Resource
+    private IProBasicModelPowerRdService proBasicModelPowerRdService;
+    @Resource
+    private IProEconWtPowerCurveFittingService proEconWtPowerCurveFittingService;
+    @Resource
+    private IEdosUtil edosUtil;
+    /**
+     * 缓存自算功率,最优功率
+     * 1个月
+     */
+    public void updateCachePower(){
+        Map<String, Map<Double,ProEconWtPowerCurveFitting>> resultMap = new HashMap<>();
+
+        List<ProEconWtPowerCurveFitting> econWtPowerCurveFittings = proEconWtPowerCurveFittingService.list();
+        econWtPowerCurveFittings.stream().forEach(curveFitting->{
+            if (resultMap.containsKey(curveFitting.getWindturbineId())){
+                resultMap.get(curveFitting.getWindturbineId()).put(curveFitting.getSpeed(),curveFitting);
+            }else {
+                Map<Double,ProEconWtPowerCurveFitting> powerMap = new HashMap<>();
+                powerMap.put(curveFitting.getSpeed(),curveFitting);
+                resultMap.put(curveFitting.getWindturbineId(),powerMap);
+            }
+        });
+        CacheContext.curveFittingPowerMap = resultMap;
+    }
+
+    /**
+     * 实时存储理论,保证,自算,最优,可用
+     */
+    public void saveWtRealTheoreticalPower(){
+
+        Date currentDate = DateUtils.getCurrentDate();
+
+        List<ProBasicWindturbine> wtls = CacheContext.wtls;
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+        wtls.stream().forEach(wt->{
+            Map<String, ProBasicEquipmentPoint> basicEquipmentPointMap = wtpAimap.get(wt.getId());
+            //理论功率测点
+            ProBasicEquipmentPoint llglPoint = basicEquipmentPointMap.get(ContantXk.LLGL);
+            //保证功率测点
+            ProBasicEquipmentPoint bzglPoint = basicEquipmentPointMap.get(ContantXk.BZGL);
+            //自算功率测点
+            ProBasicEquipmentPoint zsglPoint = basicEquipmentPointMap.get(ContantXk.ZSGL);
+            //最优功率测点
+            ProBasicEquipmentPoint zyglPoint = basicEquipmentPointMap.get(ContantXk.ZYGL);
+            //可用功率测点
+            ProBasicEquipmentPoint kyglPoint = basicEquipmentPointMap.get(ContantXk.KYGL);
+
+
+
+
+
+
+
+        });
+
+    }
+}

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/util/PointUtil.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.util;/*
+@author   谢生杰
+@date   2022/11/4-20:09
+*/
+
+import com.gyee.common.model.PointData;
+
+import java.util.Date;
+
+public class PointUtil {
+    public static PointData createPointData(Date date, double value, String code, String name) {
+        PointData y = new PointData();
+        y.setPointTime(date.getTime());
+        y.setPointValue(String.valueOf(value));
+        y.setPointValueInDouble(value);
+        y.setEdnaId(code);
+        y.setPointName(name);
+        return y;
+    }
+}

+ 34 - 34
realtime/generationXK-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java

@@ -32,7 +32,7 @@ public class EdosUtil implements IEdosUtil {
     @Override
     public PointData getRealData(ProBasicWppoint point) throws Exception {
         try {
-            Optional<String> keys = Optional.ofNullable(point.getCode());
+            Optional<String> keys = Optional.ofNullable(point.getNemCode());
             Optional<String> thingType = Optional.ofNullable("station");
             Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
             Optional<String> uniformCodes = Optional.ofNullable(point.getUniformCode());
@@ -54,14 +54,14 @@ public class EdosUtil implements IEdosUtil {
                 if (list.size() > 0)
                     return list.get(0);
                 else
-                    return ErrorRequest.RequestError(point.getCode());
+                    return ErrorRequest.RequestError(point.getNemCode());
             } else {
-                return ErrorRequest.RequestError(point.getCode());
+                return ErrorRequest.RequestError(point.getNemCode());
             }
         } catch (HttpClientErrorException exception) {
             if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
                 System.out.println("404请求错误");
-                return ErrorRequest.RequestError(point.getCode());
+                return ErrorRequest.RequestError(point.getNemCode());
             } else {
                 throw exception;
             }
@@ -87,7 +87,7 @@ public class EdosUtil implements IEdosUtil {
 
     @Override
     public PointData getSectionData(ProBasicWppoint point, Long date) throws Exception {
-        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + date;
+        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + date;
 
         ResponseEntity<JSONObject> resp = restTemplate.getForEntity(rawUrl, JSONObject.class);
         JSONObject jsonArray = resp.getBody();
@@ -96,15 +96,15 @@ public class EdosUtil implements IEdosUtil {
             if (list.size() > 0)
                 return list.get(0);
             else
-                return ErrorRequest.RequestError(point.getCode());
+                return ErrorRequest.RequestError(point.getNemCode());
         } else {
-            return ErrorRequest.RequestError(point.getCode());
+            return ErrorRequest.RequestError(point.getNemCode());
         }
     }
 
     @Override
     public PointData getSectionData(ProBasicEquipmentPoint point, Long date) throws Exception {
-        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + date;
+        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + date;
 
         ResponseEntity<JSONObject> resp = restTemplate.getForEntity(rawUrl, JSONObject.class);
         JSONObject jsonArray = resp.getBody();
@@ -113,16 +113,16 @@ public class EdosUtil implements IEdosUtil {
             if (list.size() > 0)
                 return list.get(0);
             else
-                return ErrorRequest.RequestError(point.getCode());
+                return ErrorRequest.RequestError(point.getNemCode());
         } else {
-            return ErrorRequest.RequestError(point.getCode());
+            return ErrorRequest.RequestError(point.getNemCode());
         }
     }
 
 
     @Override
     public List<PointData> getHistoryDatasSnap(ProBasicWppoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getCode());
+        Optional<String> tagName = Optional.ofNullable(point.getNemCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
         Optional<String> thingType = Optional.ofNullable(point.getModelId());
         Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
@@ -135,7 +135,7 @@ public class EdosUtil implements IEdosUtil {
         else if (count != null)
             finalInterval = (endDate - beginDate) / count;
         else
-            return ErrorRequest.RequestListError(point.getCode());
+            return ErrorRequest.RequestListError(point.getNemCode());
         Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
 
         try {
@@ -161,13 +161,13 @@ 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.getNemCode());
                 List<PointData> resultList = new ArrayList<>();
 
                 if(snapList.isEmpty())
                 {
 
-                	getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
+                	getHistsnapSameTiem(point.getNemCode(), beginDate, pried, resultList);
                 }else
                 {
                 	 for (PointData snapItem : snapList) {
@@ -176,7 +176,7 @@ public class EdosUtil implements IEdosUtil {
                          //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
                          // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
                          // 则代表该时间节点快照有效,否则为0
-                         String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
+                         String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() + "000";
                          ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
                          JSONObject jsonObjectSection = sectionResp.getBody();
 
@@ -188,7 +188,7 @@ public class EdosUtil implements IEdosUtil {
                                  }
                                  else{
                                      PointData data = new PointData();
-                                     data.setEdnaId(point.getCode());
+                                     data.setEdnaId(point.getNemCode());
                                      data.setPointTime(snapItem.getPointTime());
                                      data.setPointValue("0");
                                      data.setPointName("1");
@@ -197,7 +197,7 @@ public class EdosUtil implements IEdosUtil {
                                  }
                              } else {
                                  PointData data = new PointData();
-                                 data.setEdnaId(point.getCode());
+                                 data.setEdnaId(point.getNemCode());
                                  data.setPointTime(snapItem.getPointTime());
                                  data.setPointValue("0");
                                  data.setPointName("1");
@@ -206,7 +206,7 @@ public class EdosUtil implements IEdosUtil {
                              }
                          } else {
                              PointData data = new PointData();
-                             data.setEdnaId(point.getCode());
+                             data.setEdnaId(point.getNemCode());
                              data.setPointTime(snapItem.getPointTime());
                              data.setPointValue("0");
                              data.setPointName("1");
@@ -221,13 +221,13 @@ public class EdosUtil implements IEdosUtil {
 
 
             } else {
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getNemCode());
             }
 
         } catch (HttpClientErrorException exception) {
             if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
                 System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getNemCode());
             } else {
                 throw exception;
             }
@@ -282,7 +282,7 @@ public class EdosUtil implements IEdosUtil {
 
     @Override
     public List<PointData> getHistoryDatasRaw(ProBasicWppoint point, Long beginDate, Long endDate) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getCode());
+        Optional<String> tagName = Optional.ofNullable(point.getNemCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
         Optional<String> thingType = Optional.ofNullable(point.getModelId());
         Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
@@ -311,15 +311,15 @@ 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.getNemCode());
             else {
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getNemCode());
             }
 
         } catch (HttpClientErrorException exception) {
             if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
                 System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getNemCode());
             } else {
                 throw exception;
             }
@@ -328,7 +328,7 @@ public class EdosUtil implements IEdosUtil {
 
     @Override
     public PointData getRealData(ProBasicEquipmentPoint point) throws Exception {
-        Optional<String> keys = Optional.ofNullable(point.getCode());
+        Optional<String> keys = Optional.ofNullable(point.getNemCode());
         Optional<String> thingType = Optional.ofNullable(point.getModelId());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
         Optional<String> uniformCodes = Optional.ofNullable(point.getUniformCode());
@@ -376,7 +376,7 @@ public class EdosUtil implements IEdosUtil {
         }else if(point.getId()==null){
             System.out.println(222);
         }
-        Optional<String> tagName = Optional.ofNullable(point.getCode());
+        Optional<String> tagName = Optional.ofNullable(point.getNemCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
         Optional<String> thingType = Optional.ofNullable(point.getModelId());
         Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
@@ -429,7 +429,7 @@ public class EdosUtil implements IEdosUtil {
                         //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
                         // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
                         // 则代表该时间节点快照有效,否则为0
-                        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
+                        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() + "000";
                         ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
                         JSONObject jsonObjectSection = sectionResp.getBody();
 
@@ -477,7 +477,7 @@ public class EdosUtil implements IEdosUtil {
 
     @Override
     public List<PointData> getHistoryDatasRaw(ProBasicEquipmentPoint point, Long beginDate, Long endDate) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getCode());
+        Optional<String> tagName = Optional.ofNullable(point.getNemCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
         Optional<String> thingType = Optional.ofNullable(point.getModelId());
         Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
@@ -898,7 +898,7 @@ public class EdosUtil implements IEdosUtil {
 
     @Override
     public List<PointData> getHistStat(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getCode());
+        Optional<String> tagName = Optional.ofNullable(point.getNemCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
         Optional<String> thingType = Optional.ofNullable(point.getModelId());
         Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
@@ -960,7 +960,7 @@ public class EdosUtil implements IEdosUtil {
 
     @Override
     public List<PointData> getHistStat(ProBasicWppoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getCode());
+        Optional<String> tagName = Optional.ofNullable(point.getNemCode());
         Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
         Optional<String> thingType = Optional.ofNullable(point.getModelId());
         Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
@@ -973,7 +973,7 @@ public class EdosUtil implements IEdosUtil {
         else if (count != null)
             finalInterval = (endDate - beginDate) / count;
         else
-            return ErrorRequest.RequestListError(point.getCode());
+            return ErrorRequest.RequestListError(point.getNemCode());
         Optional<Integer> interval = Optional.ofNullable(Integer.parseInt(finalInterval.toString()));
 
         try {
@@ -999,14 +999,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.getNemCode(), type);
             else {
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getNemCode());
             }
         } catch (HttpClientErrorException exception) {
             if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
                 System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getCode());
+                return ErrorRequest.RequestListError(point.getNemCode());
             } else {
                 throw exception;
             }

+ 0 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtilTd.java


部分文件因文件數量過多而無法顯示