Browse Source

修复问题

xieshengjie 2 years ago
parent
commit
b0d245ccc7
27 changed files with 985 additions and 513 deletions
  1. 0 20
      common/src/main/java/com/gyee/common/controller/WindturbineController.java
  2. 0 16
      common/src/main/java/com/gyee/common/mapper/WindturbineMapper.java
  3. 0 67
      common/src/main/java/com/gyee/common/model/auto/Windturbine.java
  4. 0 16
      common/src/main/java/com/gyee/common/service/IWindturbineService.java
  5. 0 21
      common/src/main/java/com/gyee/common/service/impl/WindturbineServiceImpl.java
  6. 9 0
      histroy/benchmarking-histroy-new/pom.xml
  7. 1 1
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/benchmarking/BenchmarkingHistroyService.java
  8. 1 1
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/task/SaticScheduleTask.java
  9. 7 4
      histroy/benchmarking-histroy-new/src/test/java/com/gyee/benchmarkinghistroy/BenchmarkingHistroyMainNewTest.java
  10. 1 0
      realtime/computing-services7001/pom.xml
  11. 220 8
      realtime/computing-services7001/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java
  12. 5 5
      realtime/computing-services7001/src/main/java/com/gyee/generation/service/GenerationService.java
  13. 1 0
      realtime/computing-services7002/pom.xml
  14. 221 8
      realtime/computing-services7002/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java
  15. 3 3
      realtime/computing-services7002/src/main/java/com/gyee/generation/service/GenerationService.java
  16. 5 0
      realtime/computing-services7003/pom.xml
  17. 220 8
      realtime/computing-services7003/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java
  18. 5 5
      realtime/computing-services7003/src/main/java/com/gyee/generation/service/GenerationService.java
  19. 6 0
      realtime/generationGF-service/pom.xml
  20. 150 242
      realtime/generationGF-service/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java
  21. 35 50
      realtime/generationGF-service/src/main/java/com/gyee/generation/service/RealtimeSpeedPowerService.java
  22. 4 4
      realtime/generationGF-service/src/main/java/com/gyee/generation/service/StatusService.java
  23. 23 23
      realtime/generationGF-service/src/main/java/com/gyee/generation/task/SaticScheduleTask.java
  24. 1 0
      realtime/generationregion-service/pom.xml
  25. 53 10
      realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/service/RegionRealtimeService.java
  26. 13 0
      realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/task/SaticScheduleTask.java
  27. 1 1
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/common/spring/Constant.java

+ 0 - 20
common/src/main/java/com/gyee/common/controller/WindturbineController.java

@@ -1,20 +0,0 @@
-package com.gyee.common.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 谢生杰
- * @since 2021-09-28
- */
-@RestController
-@RequestMapping("//windturbine")
-public class WindturbineController {
-
-}

+ 0 - 16
common/src/main/java/com/gyee/common/mapper/WindturbineMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.common.mapper;
-
-import com.gyee.common.model.auto.Windturbine;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2021-09-28
- */
-public interface WindturbineMapper extends BaseMapper<Windturbine> {
-
-}

+ 0 - 67
common/src/main/java/com/gyee/common/model/auto/Windturbine.java

@@ -1,67 +0,0 @@
-package com.gyee.common.model.auto;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableField;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.util.Date;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author 谢生杰
- * @since 2021-09-28
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("WINDTURBINE")
-public class Windturbine extends Model {
-
-    private static final long serialVersionUID = 1L;
-
-    @TableId("ID")
-    private String id;
-
-    @TableField("CODE")
-    private String code;
-
-    @TableField("WINDPOWERSTATIONID")
-    private String windpowerstationid;
-
-    @TableField("LONGITUDE")
-    private Double longitude;
-
-    @TableField("LATITUDE")
-    private Double latitude;
-
-    @TableField("MODELID")
-    private String modelid;
-
-    @TableField("STATUS")
-    private String status;
-
-    @TableField("PROJECTID")
-    private String projectid;
-
-    @TableField("LINEID")
-    private String lineid;
-
-    @TableField("FIRSTINTEGRATEDTIME")
-    private Date firstintegratedtime;
-
-    @TableField("PHOTO")
-    private String photo;
-
-    @TableField("NAME")
-    private String name;
-
-    @TableField("STANDARDID")
-    private String standardid;
-
-
-}

+ 0 - 16
common/src/main/java/com/gyee/common/service/IWindturbineService.java

@@ -1,16 +0,0 @@
-package com.gyee.common.service;
-
-import com.gyee.common.model.auto.Windturbine;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2021-09-28
- */
-public interface IWindturbineService extends IService<Windturbine> {
-
-}

+ 0 - 21
common/src/main/java/com/gyee/common/service/impl/WindturbineServiceImpl.java

@@ -1,21 +0,0 @@
-package com.gyee.common.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.gyee.common.model.auto.Windturbine;
-import com.gyee.common.mapper.WindturbineMapper;
-import com.gyee.common.service.IWindturbineService;
-import org.springframework.stereotype.Service;
-
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2021-09-28
- */
-@Service
-public class WindturbineServiceImpl extends ServiceImpl<WindturbineMapper, Windturbine> implements IWindturbineService {
-
-}

+ 9 - 0
histroy/benchmarking-histroy-new/pom.xml

@@ -27,6 +27,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
             <optional>true</optional>
@@ -90,6 +95,10 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-test</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.data</groupId>
+            <artifactId>spring-data-redis</artifactId>
+        </dependency>
 
     </dependencies>
     <build>

+ 1 - 1
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/benchmarking/BenchmarkingHistroyService.java

@@ -80,7 +80,7 @@ public class BenchmarkingHistroyService {
             Date begin = DateUtils.getStartOfDay(addDays);
             Date end = DateUtils.addSeconds(begin, 1);
 
-            wtls.stream().filter(i->i.getWindpowerstationid().endsWith("FDC") && !i.getId().equals("DJY01_001")).forEach(wt->{
+            wtls.stream().filter(i->i.getWindpowerstationid().endsWith("FDC") && i.getWindpowerstationid().equals("HSM_FDC") ).forEach(wt->{
                 Map<String,Double> wtDataMap = new HashMap<>();
                 Map<String, Windturbinetestingpointnew> nmap = wtpAimap.get(wt.getId());
                 for (String uniformcode : uniformcodes) {

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

@@ -103,7 +103,7 @@ public class SaticScheduleTask {
     /**
      * 专题分析调度
      */
-    @Scheduled(cron = "0 0 0 * * ?")
+    @Scheduled(cron = "0 0 1 * * ?")
     //或直接指定时间间隔,例如:5秒
     //@Scheduled(fixedRate=5000)
     private void configureTasks5() {

+ 7 - 4
histroy/benchmarking-histroy-new/src/test/java/com/gyee/benchmarkinghistroy/BenchmarkingHistroyMainNewTest.java

@@ -42,10 +42,11 @@ public  class BenchmarkingHistroyMainNewTest {
 
     @Test
     public void test1() throws Exception {
-        String date = "2022-08-03";
-        threeRateService.FailRate(date,date);
-//        benchmarkingHistroyService.saveEquipmentdayinfo(date,date);
-//        benchmarkingHistroyService.saveEquipmentdaydetailed(date,date);
+        String date = "2023-03-01";
+        String date1 = "2023-03-01";
+//        threeRateService.FailRate(date,date);
+//        benchmarkingHistroyService.saveEquipmentdayinfo(date,date1);
+//        benchmarkingHistroyService.saveEquipmentdaydetailed(date,date1);
 //        benchmarkingHistroyService.saveOperationrecord(date,date);
 //        benchmarkingHistroyService.saveBeanchmarkList(date,date);
 //        benchmarkingHistroyService.saveBenchmark(date,date);
@@ -53,6 +54,8 @@ public  class BenchmarkingHistroyMainNewTest {
 //        infodayService.saveWindturbineinfoday3(date,date);
 //        infodayService.saveWindpowerinfoday(date,date);
 //        infodayService.saveWindpowerinfoday3(date,date);
+        threeRateService.FailRate(date,date);
+        threeRateService.ResetAngStateRate(date,date);
     }
 
     @Test

+ 1 - 0
realtime/computing-services7001/pom.xml

@@ -106,6 +106,7 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.6.2</version>
                 <executions>
                     <execution>
                         <goals>

+ 220 - 8
realtime/computing-services7001/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java

@@ -179,6 +179,7 @@ public class AverageAndGeneratingService {
                             Double rfdl = 0.0;
                             Double yfdl = 0.0;
                             Double nfdl = 0.0;
+                            Double rfdlnew = 0.0;
                             if (direct.contains(wt.getProjectid())){
                                 rfdl = edosUtil.getSectionData(ai064,tomorrow.getTime()).getPointValueInDouble();
                                 yfdl = edosUtil.getSectionData(ai138,tomorrow.getTime()).getPointValueInDouble();
@@ -197,8 +198,24 @@ public class AverageAndGeneratingService {
                                 rfdl = currentValue - samedayValue;
                                 yfdl = currentValue - monthFirstValue;
                                 nfdl = currentValue - yearFirstValue;
+
+                                double time = DateUtils.hoursDiff2(samedayZero, currentDate);
+                                double minute = DateUtils.minutesDiff2(samedayZero, currentDate);
+
+                                List<PointData> ssglList = edosUtil.getHistoryDatasSnap(avePowerPoint, samedayZero.getTime()/1000, currentDate.getTime()/1000, null, 600l);
+                                int glSize = ssglList.size();
+                                long samedayZeroTime = samedayZero.getTime();
+
+                                for (int i = 0;i<ssglList.size();i++){
+                                    Long pointTime = ssglList.get(i).getPointTime()*1000;
+                                    Date currentDate = DateUtils.getCurrentDate();
+                                    double hours = (currentDate.getTime() - samedayZeroTime) / 1000 / 60 / 60;
+                                    rfdlnew += hours*1/glSize*ssglList.get(i).getPointValueInDouble();
+                                }
+
                             }
-                            PointData fdlpointData = createPointData(fjfdl, rfdl);
+                            PointData fdlpointData = createPointData(fjfdl, rfdlnew);
+//                            PointData fdlpointData = createPointData(fjfdl, rfdl);
                             rfdlList.add(fdlpointData);
 
                             PointData yfdlpointData = createPointData(fjyfdl, yfdl);
@@ -251,7 +268,7 @@ public class AverageAndGeneratingService {
                             if (zyglFirst.isPresent()){
                                 PointData pointData = zyglFirst.get();
                                 double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(zyglPoint, pointData, inDouble);
+//                                createWtPointData(zyglPoint, pointData, inDouble);
                                 wtzygldList.add(pointData);
                             }
                             //算月平均功率
@@ -298,10 +315,10 @@ public class AverageAndGeneratingService {
                     nlinefdlList.add(nfdlpoint);
 
                     //算节能减排
-                    double jpeyhl = lineyfdl * 0.0059;
-                    double jpeyht = lineyfdl * 0.8568;
-                    double jybm = lineyfdl * 0.37;
-                    double jys = lineyfdl * 3.05;
+                    double jpeyhl = lineyfdl * 0.0059/1000;
+                    double jpeyht = lineyfdl * 0.8568/1000;
+                    double jybm = lineyfdl * 0.37/1000;
+                    double jys = lineyfdl * 3.05/1000;
                     PointData jpeyhlpoint = createWpPointData(jpeyhlpointnew, jpeyhl);
                     PointData jpeyhtpoint = createWpPointData(jpeyhtpointnew, jpeyht);
                     PointData jybmpoint = createWpPointData(jybmpointnew, jybm);
@@ -380,8 +397,8 @@ public class AverageAndGeneratingService {
                 resultList.addAll(linezyglpowerList);
 
                 //算节能减排
-                double jpeyhl = proyfdl * 0.0059;
-                double jpeyht = proyfdl * 0.8568;
+                double jpeyhl = proyfdl * 0.0059/1000;
+                double jpeyht = proyfdl * 0.8568/1000;
                 double jybm = proyfdl * 0.37;
                 double jys = proyfdl * 3.05;
                 PointData jpeyhlpoint = createWpPointData(jpeyhlprojectpointnew, jpeyhl);
@@ -560,4 +577,199 @@ public class AverageAndGeneratingService {
         pointData.setPointValue(String.valueOf(inDouble));
         pointData.setPointTime(currentDate.getTime());
     }
+
+
+    public void calwtGenecapacity(String begin,String end) throws Exception {
+        init();
+        List<String> days = DateUtils.getDays(begin, end);
+
+        for(String day : days){
+            Date date = DateUtils.parseDate(day);
+            Date samedayZero = DateUtils.getSamedayZero(day);
+            Date endOfDay = DateUtils.getEndOfDay(date);
+            wpls.stream().forEach(wp->{
+                List<PointData> resultList = new ArrayList<>();
+                List<Project> projects = wppromap.get(wp.getId());
+                Map<String, Windpowerstationpointnew> wppointnewmap = wppointmap.get(wp.getId());
+                Windpowerstationpointnew wpzyglpointnew = wppointnewmap.get(Contant.ZZYGL);
+                Windpowerstationpointnew wppointnew = wppointnewmap.get(Contant.RPJFS);
+                Windpowerstationpointnew ywppointnew = wppointnewmap.get(Contant.YPJFS);
+                Windpowerstationpointnew nwppointnew = wppointnewmap.get(Contant.NPJFS);
+                Windpowerstationpointnew powerwppointnew = wppointnewmap.get(Contant.RPJGL);
+                Windpowerstationpointnew ypowerwppointnew = wppointnewmap.get(Contant.YPJGL);
+                Windpowerstationpointnew npowerwppointnew = wppointnewmap.get(Contant.NPJGL);
+                Windpowerstationpointnew fdlwppointnew = wppointnewmap.get(Contant.RFDL);
+                Windpowerstationpointnew yfdlwppointnew = wppointnewmap.get(Contant.YFDL);
+                Windpowerstationpointnew nfdlwppointnew = wppointnewmap.get(Contant.NFDL);
+                Windpowerstationpointnew fnlylwppointnew = wppointnewmap.get(Contant.FNLYL);
+                Windpowerstationpointnew jpeyhlwppointnew = wppointnewmap.get(Contant.JPEYHL);
+                Windpowerstationpointnew jpeyhtwppointnew = wppointnewmap.get(Contant.JPEYHT);
+                Windpowerstationpointnew jybmwppointnew = wppointnewmap.get(Contant.JYBM);
+                Windpowerstationpointnew jyswppointnew = wppointnewmap.get(Contant.JYS);
+
+                List<PointData> projectavespeedList = new ArrayList<>();
+                List<PointData> yprojectavespeedList = new ArrayList<>();
+                List<PointData> nprojectavespeedList = new ArrayList<>();
+                List<PointData> projectzyglList = new ArrayList<>();
+                List<PointData> projectavepowerList = new ArrayList<>();
+                List<PointData> yprojectavepowerList = new ArrayList<>();
+                List<PointData> nprojectavepowerList = new ArrayList<>();
+                List<PointData> projectfdlList = new ArrayList<>();
+                List<PointData> projectyfdlList = new ArrayList<>();
+                List<PointData> projectnfdlList = new ArrayList<>();
+                projects.stream().forEach(project -> {
+                    List<Line> lines = prolinemap.get(project.getId());
+                    Map<String, Windpowerstationpointnew> projectpointnewmap = propointmap.get(project.getId());
+
+                    Windpowerstationpointnew projectzyglpointnew = projectpointnewmap.get(Contant.ZZYGL);
+                    Windpowerstationpointnew projectpointnew = projectpointnewmap.get(Contant.RPJFS);
+                    Windpowerstationpointnew yprojectpointnew = projectpointnewmap.get(Contant.YPJFS);
+                    Windpowerstationpointnew nprojectpointnew = projectpointnewmap.get(Contant.NPJFS);
+                    Windpowerstationpointnew powerprojectpointnew = projectpointnewmap.get(Contant.RPJGL);
+                    Windpowerstationpointnew ypowerprojectpointnew = projectpointnewmap.get(Contant.YPJGL);
+                    Windpowerstationpointnew npowerprojectpointnew = projectpointnewmap.get(Contant.NPJGL);
+                    Windpowerstationpointnew fdlprojectpointnew = projectpointnewmap.get(Contant.RFDL);
+                    Windpowerstationpointnew yfdlprojectpointnew = projectpointnewmap.get(Contant.YFDL);
+                    Windpowerstationpointnew nfdlprojectpointnew = projectpointnewmap.get(Contant.NFDL);
+                    Windpowerstationpointnew fnlylprojectpointnew = projectpointnewmap.get(Contant.FNLYL);
+
+                    Windpowerstationpointnew jpeyhlprojectpointnew = projectpointnewmap.get(Contant.JPEYHL);
+                    Windpowerstationpointnew jpeyhtprojectpointnew = projectpointnewmap.get(Contant.JPEYHT);
+                    Windpowerstationpointnew jybmprojectpointnew = projectpointnewmap.get(Contant.JYBM);
+                    Windpowerstationpointnew jysprojectpointnew = projectpointnewmap.get(Contant.JYS);
+
+                    List<PointData> lineavespeedList = new ArrayList<>();
+                    List<PointData> ylineavespeedList = new ArrayList<>();
+                    List<PointData> nlineavespeedList = new ArrayList<>();
+                    List<PointData> lineavepowerList = new ArrayList<>();
+                    List<PointData> linezyglpowerList = new ArrayList<>();
+                    List<PointData> ylineavepowerList = new ArrayList<>();
+                    List<PointData> nlineavepowerList = new ArrayList<>();
+                    List<PointData> linefdlList = new ArrayList<>();
+                    List<PointData> ylinefdlList = new ArrayList<>();
+                    List<PointData> nlinefdlList = new ArrayList<>();
+                    lines.stream().forEach(line -> {
+                        List<Windturbine> windturbines = linewtmap.get(line.getId());
+                        Map<String, Windpowerstationpointnew> linepointnewmap = linepointmap.get(line.getId());
+                        Windpowerstationpointnew linezyglpointnew = linepointnewmap.get(Contant.ZZYGL);
+                        Windpowerstationpointnew linepointnew = linepointnewmap.get(Contant.RPJFS);
+                        Windpowerstationpointnew ylinepointnew = linepointnewmap.get(Contant.YPJFS);
+                        Windpowerstationpointnew nlinepointnew = linepointnewmap.get(Contant.NPJFS);
+                        Windpowerstationpointnew linepowerpointnew = linepointnewmap.get(Contant.RPJGL);
+                        Windpowerstationpointnew ylinepowerpointnew = linepointnewmap.get(Contant.YPJGL);
+                        Windpowerstationpointnew nlinepowerpointnew = linepointnewmap.get(Contant.NPJGL);
+                        Windpowerstationpointnew linefdlpointnew = linepointnewmap.get(Contant.RFDL);
+                        Windpowerstationpointnew ylinefdlpointnew = linepointnewmap.get(Contant.YFDL);
+                        Windpowerstationpointnew nlinefdlpointnew = linepointnewmap.get(Contant.NFDL);
+                        Windpowerstationpointnew linefnlylpointnew = linepointnewmap.get(Contant.FNLYL);
+
+                        Windpowerstationpointnew jpeyhlpointnew = linepointnewmap.get(Contant.JPEYHL);
+                        Windpowerstationpointnew jpeyhtpointnew = linepointnewmap.get(Contant.JPEYHT);
+                        Windpowerstationpointnew jybmpointnew = linepointnewmap.get(Contant.JYBM);
+                        Windpowerstationpointnew jyspointnew = linepointnewmap.get(Contant.JYS);
+
+                        List<PointData> wtzygldList = new ArrayList<>();
+                        List<PointData> wtavespeedList = new ArrayList<>();
+                        List<PointData> ywtavespeedList = new ArrayList<>();
+                        List<PointData> nwtavespeedList = new ArrayList<>();
+                        List<PointData> wtavepowerList = new ArrayList<>();
+                        List<PointData> ywtavepowerList = new ArrayList<>();
+                        List<PointData> nwtavepowerList = new ArrayList<>();
+                        List<PointData> rfdlList = new ArrayList<>();
+                        List<PointData> yfdlList = new ArrayList<>();
+                        List<PointData> nfdlList = new ArrayList<>();
+
+                        windturbines.stream().forEach(wt->{
+
+                            Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
+                            Windturbinetestingpointnew zyglPoint = windturbinetestingpointnewMap.get(Contant.ZZYGL);
+                            Windturbinetestingpointnew aveSpeedPoint = windturbinetestingpointnewMap.get(Contant.RPJFS);
+                            Windturbinetestingpointnew monthAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.YPJFS);
+                            Windturbinetestingpointnew yearAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.NPJFS);
+                            Windturbinetestingpointnew fjssfs = windturbinetestingpointnewMap.get(Contant.AI022);
+                            Windturbinetestingpointnew avePowerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
+                            Windturbinetestingpointnew yavePowerPoint = windturbinetestingpointnewMap.get(Contant.YPJGL);
+                            Windturbinetestingpointnew navePowerPoint = windturbinetestingpointnewMap.get(Contant.NPJGL);
+                            Windturbinetestingpointnew fjssgl = windturbinetestingpointnewMap.get(Contant.AI130);
+                            Windturbinetestingpointnew ai064 = windturbinetestingpointnewMap.get(Contant.AI064);
+                            Windturbinetestingpointnew fjfdl = windturbinetestingpointnewMap.get(Contant.RFDL);
+                            Windturbinetestingpointnew fjyfdl = windturbinetestingpointnewMap.get(Contant.YFDL);
+                            Windturbinetestingpointnew fjnfdl = windturbinetestingpointnewMap.get(Contant.NFDL);
+                            Windturbinetestingpointnew ai138 = windturbinetestingpointnewMap.get(Contant.AI138);
+                            Windturbinetestingpointnew ai139 = windturbinetestingpointnewMap.get(Contant.AI139);
+                            List<PointData> ssglList = null;
+                            try {
+                                ssglList = edosUtil.getHistoryDatasSnap(avePowerPoint, samedayZero.getTime()/1000, endOfDay.getTime()/1000, null, 600l);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                            int glSize = ssglList.size();
+                            long samedayZeroTime = samedayZero.getTime();
+                            Double rfdlnew = 0.0;
+                            for (int i = 0;i<ssglList.size();i++){
+                                Long pointTime = ssglList.get(i).getPointTime()*1000;
+                                Date currentDate = DateUtils.getCurrentDate();
+                                double hours = (endOfDay.getTime() - samedayZeroTime) / 1000 / 60 / 60;
+                                rfdlnew += hours*1/glSize*ssglList.get(i).getPointValueInDouble();
+                            }
+
+                            PointData fdlpointData = createPointData(fjfdl, rfdlnew);
+//                            PointData fdlpointData = createPointData(fjfdl, rfdl);
+                            rfdlList.add(fdlpointData);
+
+
+
+                        });
+
+                        resultList.addAll(rfdlList);
+
+                        double linefdl = rfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+
+                        PointData fdlpoint = createWpPointData(linefdlpointnew, linefdl);
+                        fdlpoint.setPointTime(endOfDay.getTime()/1000);
+                        linefdlList.add(fdlpoint);
+
+
+
+
+
+                    });
+
+                    Double prorfdl = linefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                    PointData fdlpoint = createWpPointData(fdlprojectpointnew, prorfdl);
+                    fdlpoint.setPointTime(endOfDay.getTime()/1000);
+                    projectfdlList.add(fdlpoint);
+
+                    resultList.addAll(linefdlList);
+
+
+
+
+
+                });
+
+                resultList.addAll(projectfdlList);
+
+                double fcrfdl = projectfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                PointData fdlpointData = createWpPointData(fdlwppointnew, fcrfdl);
+                fdlpointData.setPointTime(endOfDay.getTime()/1000);
+                resultList.add(fdlpointData);
+
+                try {
+                    edosUtil.sendMultiPoint(resultList);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+
+
+            });
+
+
+
+
+
+        }
+
+
+    }
 }

+ 5 - 5
realtime/computing-services7001/src/main/java/com/gyee/generation/service/GenerationService.java

@@ -27,7 +27,7 @@ import java.util.concurrent.atomic.AtomicReference;
 @Service
 public class GenerationService {
 
-   private Log log = LogFactory.getLog(GenerationService.class);
+    private Log log = LogFactory.getLog(GenerationService.class);
     @Resource
     private IEdosUtil edosUtil;
     @Resource
@@ -105,7 +105,7 @@ public class GenerationService {
                         swdlOptional = meterpoints.stream().filter(me ->   me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("出线") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
                         gwdlOptional = meterpoints.stream().filter(me ->  me.getUniformcode().equals("FXYG") && me.getMetertype().equals("出线") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
                     }
-                     lineOrtherdl(fdlList,tomorrow,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrswdl, qcyswdl, qcnswdl, line, linemap, swdlOptional,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
+                    lineOrtherdl(fdlList,tomorrow,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrswdl, qcyswdl, qcnswdl, line, linemap, swdlOptional,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
                     log.info(line.getName()+"上网电量计算完毕!");
                     //线路购网电量
                     lineOrtherdl(fdlList,tomorrow,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrgwdl, qcygwdl, qcngwdl, line, linemap, gwdlOptional,Contant.GWGWB,Contant.GWGWY,Contant.GWGWN);
@@ -347,11 +347,11 @@ public class GenerationService {
             }
         });
         //电量百分比
-        double percentage = xlzdl.get() != 0 ? xldl.get() / xlzdl.get() * 100 : 0;
+        double percentage = xlzdl.get() != 0 ? xldl.get() / xlzdl.get()  : 0;
         percentageMap.put("percentage",percentage);
-        double ypercentage = xlzydl.get() != 0 ? xlydl.get() / xlzydl.get() * 100 : 0;
+        double ypercentage = xlzydl.get() != 0 ? xlydl.get() / xlzydl.get()  : 0;
         percentageMap.put("ypercentage",ypercentage);
-        double npercentage = xlzndl.get() != 0 ? xlndl.get() / xlzndl.get() * 100 : 0;
+        double npercentage = xlzndl.get() != 0 ? xlndl.get() / xlzndl.get() : 0;
         percentageMap.put("npercentage",npercentage);
         return percentageMap;
     }

+ 1 - 0
realtime/computing-services7002/pom.xml

@@ -106,6 +106,7 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.6.2</version>
                 <executions>
                     <execution>
                         <goals>

+ 221 - 8
realtime/computing-services7002/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java

@@ -179,6 +179,7 @@ public class AverageAndGeneratingService {
                             Double rfdl = 0.0;
                             Double yfdl = 0.0;
                             Double nfdl = 0.0;
+                            Double rfdlnew = 0.0;
                             if (direct.contains(wt.getProjectid())){
                                 rfdl = edosUtil.getSectionData(ai064,tomorrow.getTime()).getPointValueInDouble();
                                 yfdl = edosUtil.getSectionData(ai138,tomorrow.getTime()).getPointValueInDouble();
@@ -197,8 +198,24 @@ public class AverageAndGeneratingService {
                                 rfdl = currentValue - samedayValue;
                                 yfdl = currentValue - monthFirstValue;
                                 nfdl = currentValue - yearFirstValue;
+
+                                double time = DateUtils.hoursDiff2(samedayZero, currentDate);
+                                double minute = DateUtils.minutesDiff2(samedayZero, currentDate);
+
+                                List<PointData> ssglList = edosUtil.getHistoryDatasSnap(avePowerPoint, samedayZero.getTime()/1000, currentDate.getTime()/1000, null, 600l);
+                                int glSize = ssglList.size();
+                                long samedayZeroTime = samedayZero.getTime();
+
+                                for (int i = 0;i<ssglList.size();i++){
+                                    Long pointTime = ssglList.get(i).getPointTime()*1000;
+                                    Date currentDate = DateUtils.getCurrentDate();
+                                    double hours = (currentDate.getTime() - samedayZeroTime) / 1000 / 60 / 60;
+                                    rfdlnew += hours*1/glSize*ssglList.get(i).getPointValueInDouble();
+                                }
+
                             }
-                            PointData fdlpointData = createPointData(fjfdl, rfdl);
+                            PointData fdlpointData = createPointData(fjfdl, rfdlnew);
+//                            PointData fdlpointData = createPointData(fjfdl, rfdl);
                             rfdlList.add(fdlpointData);
 
                             PointData yfdlpointData = createPointData(fjyfdl, yfdl);
@@ -251,7 +268,7 @@ public class AverageAndGeneratingService {
                             if (zyglFirst.isPresent()){
                                 PointData pointData = zyglFirst.get();
                                 double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(zyglPoint, pointData, inDouble);
+//                                createWtPointData(zyglPoint, pointData, inDouble);
                                 wtzygldList.add(pointData);
                             }
                             //算月平均功率
@@ -298,10 +315,10 @@ public class AverageAndGeneratingService {
                     nlinefdlList.add(nfdlpoint);
 
                     //算节能减排
-                    double jpeyhl = lineyfdl * 0.0059;
-                    double jpeyht = lineyfdl * 0.8568;
-                    double jybm = lineyfdl * 0.37;
-                    double jys = lineyfdl * 3.05;
+                    double jpeyhl = lineyfdl * 0.0059/1000;
+                    double jpeyht = lineyfdl * 0.8568/1000;
+                    double jybm = lineyfdl * 0.37/1000;
+                    double jys = lineyfdl * 3.05/1000;
                     PointData jpeyhlpoint = createWpPointData(jpeyhlpointnew, jpeyhl);
                     PointData jpeyhtpoint = createWpPointData(jpeyhtpointnew, jpeyht);
                     PointData jybmpoint = createWpPointData(jybmpointnew, jybm);
@@ -380,8 +397,8 @@ public class AverageAndGeneratingService {
                 resultList.addAll(linezyglpowerList);
 
                 //算节能减排
-                double jpeyhl = proyfdl * 0.0059;
-                double jpeyht = proyfdl * 0.8568;
+                double jpeyhl = proyfdl * 0.0059/1000;
+                double jpeyht = proyfdl * 0.8568/1000;
                 double jybm = proyfdl * 0.37;
                 double jys = proyfdl * 3.05;
                 PointData jpeyhlpoint = createWpPointData(jpeyhlprojectpointnew, jpeyhl);
@@ -560,4 +577,200 @@ public class AverageAndGeneratingService {
         pointData.setPointValue(String.valueOf(inDouble));
         pointData.setPointTime(currentDate.getTime());
     }
+
+
+    public void calwtGenecapacity(String begin,String end) throws Exception {
+        init();
+        List<String> days = DateUtils.getDays(begin, end);
+
+        for(String day : days){
+            Date date = DateUtils.parseDate(day);
+            Date samedayZero = DateUtils.getSamedayZero(day);
+            Date endOfDay = DateUtils.getEndOfDay(date);
+            wpls.stream().forEach(wp->{
+                List<PointData> resultList = new ArrayList<>();
+                List<Project> projects = wppromap.get(wp.getId());
+                Map<String, Windpowerstationpointnew> wppointnewmap = wppointmap.get(wp.getId());
+                Windpowerstationpointnew wpzyglpointnew = wppointnewmap.get(Contant.ZZYGL);
+                Windpowerstationpointnew wppointnew = wppointnewmap.get(Contant.RPJFS);
+                Windpowerstationpointnew ywppointnew = wppointnewmap.get(Contant.YPJFS);
+                Windpowerstationpointnew nwppointnew = wppointnewmap.get(Contant.NPJFS);
+                Windpowerstationpointnew powerwppointnew = wppointnewmap.get(Contant.RPJGL);
+                Windpowerstationpointnew ypowerwppointnew = wppointnewmap.get(Contant.YPJGL);
+                Windpowerstationpointnew npowerwppointnew = wppointnewmap.get(Contant.NPJGL);
+                Windpowerstationpointnew fdlwppointnew = wppointnewmap.get(Contant.RFDL);
+                Windpowerstationpointnew yfdlwppointnew = wppointnewmap.get(Contant.YFDL);
+                Windpowerstationpointnew nfdlwppointnew = wppointnewmap.get(Contant.NFDL);
+                Windpowerstationpointnew fnlylwppointnew = wppointnewmap.get(Contant.FNLYL);
+                Windpowerstationpointnew jpeyhlwppointnew = wppointnewmap.get(Contant.JPEYHL);
+                Windpowerstationpointnew jpeyhtwppointnew = wppointnewmap.get(Contant.JPEYHT);
+                Windpowerstationpointnew jybmwppointnew = wppointnewmap.get(Contant.JYBM);
+                Windpowerstationpointnew jyswppointnew = wppointnewmap.get(Contant.JYS);
+
+                List<PointData> projectavespeedList = new ArrayList<>();
+                List<PointData> yprojectavespeedList = new ArrayList<>();
+                List<PointData> nprojectavespeedList = new ArrayList<>();
+                List<PointData> projectzyglList = new ArrayList<>();
+                List<PointData> projectavepowerList = new ArrayList<>();
+                List<PointData> yprojectavepowerList = new ArrayList<>();
+                List<PointData> nprojectavepowerList = new ArrayList<>();
+                List<PointData> projectfdlList = new ArrayList<>();
+                List<PointData> projectyfdlList = new ArrayList<>();
+                List<PointData> projectnfdlList = new ArrayList<>();
+                projects.stream().forEach(project -> {
+                    List<Line> lines = prolinemap.get(project.getId());
+                    Map<String, Windpowerstationpointnew> projectpointnewmap = propointmap.get(project.getId());
+
+                    Windpowerstationpointnew projectzyglpointnew = projectpointnewmap.get(Contant.ZZYGL);
+                    Windpowerstationpointnew projectpointnew = projectpointnewmap.get(Contant.RPJFS);
+                    Windpowerstationpointnew yprojectpointnew = projectpointnewmap.get(Contant.YPJFS);
+                    Windpowerstationpointnew nprojectpointnew = projectpointnewmap.get(Contant.NPJFS);
+                    Windpowerstationpointnew powerprojectpointnew = projectpointnewmap.get(Contant.RPJGL);
+                    Windpowerstationpointnew ypowerprojectpointnew = projectpointnewmap.get(Contant.YPJGL);
+                    Windpowerstationpointnew npowerprojectpointnew = projectpointnewmap.get(Contant.NPJGL);
+                    Windpowerstationpointnew fdlprojectpointnew = projectpointnewmap.get(Contant.RFDL);
+                    Windpowerstationpointnew yfdlprojectpointnew = projectpointnewmap.get(Contant.YFDL);
+                    Windpowerstationpointnew nfdlprojectpointnew = projectpointnewmap.get(Contant.NFDL);
+                    Windpowerstationpointnew fnlylprojectpointnew = projectpointnewmap.get(Contant.FNLYL);
+
+                    Windpowerstationpointnew jpeyhlprojectpointnew = projectpointnewmap.get(Contant.JPEYHL);
+                    Windpowerstationpointnew jpeyhtprojectpointnew = projectpointnewmap.get(Contant.JPEYHT);
+                    Windpowerstationpointnew jybmprojectpointnew = projectpointnewmap.get(Contant.JYBM);
+                    Windpowerstationpointnew jysprojectpointnew = projectpointnewmap.get(Contant.JYS);
+
+                    List<PointData> lineavespeedList = new ArrayList<>();
+                    List<PointData> ylineavespeedList = new ArrayList<>();
+                    List<PointData> nlineavespeedList = new ArrayList<>();
+                    List<PointData> lineavepowerList = new ArrayList<>();
+                    List<PointData> linezyglpowerList = new ArrayList<>();
+                    List<PointData> ylineavepowerList = new ArrayList<>();
+                    List<PointData> nlineavepowerList = new ArrayList<>();
+                    List<PointData> linefdlList = new ArrayList<>();
+                    List<PointData> ylinefdlList = new ArrayList<>();
+                    List<PointData> nlinefdlList = new ArrayList<>();
+                    lines.stream().forEach(line -> {
+                        List<Windturbine> windturbines = linewtmap.get(line.getId());
+                        Map<String, Windpowerstationpointnew> linepointnewmap = linepointmap.get(line.getId());
+                        Windpowerstationpointnew linezyglpointnew = linepointnewmap.get(Contant.ZZYGL);
+                        Windpowerstationpointnew linepointnew = linepointnewmap.get(Contant.RPJFS);
+                        Windpowerstationpointnew ylinepointnew = linepointnewmap.get(Contant.YPJFS);
+                        Windpowerstationpointnew nlinepointnew = linepointnewmap.get(Contant.NPJFS);
+                        Windpowerstationpointnew linepowerpointnew = linepointnewmap.get(Contant.RPJGL);
+                        Windpowerstationpointnew ylinepowerpointnew = linepointnewmap.get(Contant.YPJGL);
+                        Windpowerstationpointnew nlinepowerpointnew = linepointnewmap.get(Contant.NPJGL);
+                        Windpowerstationpointnew linefdlpointnew = linepointnewmap.get(Contant.RFDL);
+                        Windpowerstationpointnew ylinefdlpointnew = linepointnewmap.get(Contant.YFDL);
+                        Windpowerstationpointnew nlinefdlpointnew = linepointnewmap.get(Contant.NFDL);
+                        Windpowerstationpointnew linefnlylpointnew = linepointnewmap.get(Contant.FNLYL);
+
+                        Windpowerstationpointnew jpeyhlpointnew = linepointnewmap.get(Contant.JPEYHL);
+                        Windpowerstationpointnew jpeyhtpointnew = linepointnewmap.get(Contant.JPEYHT);
+                        Windpowerstationpointnew jybmpointnew = linepointnewmap.get(Contant.JYBM);
+                        Windpowerstationpointnew jyspointnew = linepointnewmap.get(Contant.JYS);
+
+                        List<PointData> wtzygldList = new ArrayList<>();
+                        List<PointData> wtavespeedList = new ArrayList<>();
+                        List<PointData> ywtavespeedList = new ArrayList<>();
+                        List<PointData> nwtavespeedList = new ArrayList<>();
+                        List<PointData> wtavepowerList = new ArrayList<>();
+                        List<PointData> ywtavepowerList = new ArrayList<>();
+                        List<PointData> nwtavepowerList = new ArrayList<>();
+                        List<PointData> rfdlList = new ArrayList<>();
+                        List<PointData> yfdlList = new ArrayList<>();
+                        List<PointData> nfdlList = new ArrayList<>();
+
+                        windturbines.stream().forEach(wt->{
+
+                            Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
+                            Windturbinetestingpointnew zyglPoint = windturbinetestingpointnewMap.get(Contant.ZZYGL);
+                            Windturbinetestingpointnew aveSpeedPoint = windturbinetestingpointnewMap.get(Contant.RPJFS);
+                            Windturbinetestingpointnew monthAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.YPJFS);
+                            Windturbinetestingpointnew yearAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.NPJFS);
+                            Windturbinetestingpointnew fjssfs = windturbinetestingpointnewMap.get(Contant.AI022);
+                            Windturbinetestingpointnew avePowerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
+                            Windturbinetestingpointnew yavePowerPoint = windturbinetestingpointnewMap.get(Contant.YPJGL);
+                            Windturbinetestingpointnew navePowerPoint = windturbinetestingpointnewMap.get(Contant.NPJGL);
+                            Windturbinetestingpointnew fjssgl = windturbinetestingpointnewMap.get(Contant.AI130);
+                            Windturbinetestingpointnew ai064 = windturbinetestingpointnewMap.get(Contant.AI064);
+                            Windturbinetestingpointnew fjfdl = windturbinetestingpointnewMap.get(Contant.RFDL);
+                            Windturbinetestingpointnew fjyfdl = windturbinetestingpointnewMap.get(Contant.YFDL);
+                            Windturbinetestingpointnew fjnfdl = windturbinetestingpointnewMap.get(Contant.NFDL);
+                            Windturbinetestingpointnew ai138 = windturbinetestingpointnewMap.get(Contant.AI138);
+                            Windturbinetestingpointnew ai139 = windturbinetestingpointnewMap.get(Contant.AI139);
+                            List<PointData> ssglList = null;
+                            try {
+                                ssglList = edosUtil.getHistoryDatasSnap(avePowerPoint, samedayZero.getTime()/1000, endOfDay.getTime()/1000, null, 600l);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                            int glSize = ssglList.size();
+                            long samedayZeroTime = samedayZero.getTime();
+                            Double rfdlnew = 0.0;
+                            for (int i = 0;i<ssglList.size();i++){
+                                Long pointTime = ssglList.get(i).getPointTime()*1000;
+                                Date currentDate = DateUtils.getCurrentDate();
+                                double hours = (endOfDay.getTime() - samedayZeroTime) / 1000 / 60 / 60;
+                                rfdlnew += hours*1/glSize*ssglList.get(i).getPointValueInDouble();
+                            }
+
+                                PointData fdlpointData = createPointData(fjfdl, rfdlnew);
+                            fdlpointData.setPointTime(endOfDay.getTime());
+//                            PointData fdlpointData = createPointData(fjfdl, rfdl);
+                                rfdlList.add(fdlpointData);
+
+
+
+                        });
+
+                        resultList.addAll(rfdlList);
+
+                        double linefdl = rfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+
+                        PointData fdlpoint = createWpPointData(linefdlpointnew, linefdl);
+                        fdlpoint.setPointTime(endOfDay.getTime());
+                        linefdlList.add(fdlpoint);
+
+
+
+
+
+                    });
+
+                    Double prorfdl = linefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                    PointData fdlpoint = createWpPointData(fdlprojectpointnew, prorfdl);
+                    fdlpoint.setPointTime(endOfDay.getTime());
+                    projectfdlList.add(fdlpoint);
+
+                    resultList.addAll(linefdlList);
+
+
+
+
+
+                });
+
+                resultList.addAll(projectfdlList);
+
+                double fcrfdl = projectfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                PointData fdlpointData = createWpPointData(fdlwppointnew, fcrfdl);
+                fdlpointData.setPointTime(endOfDay.getTime());
+                resultList.add(fdlpointData);
+
+                try {
+                    edosUtil.sendMultiPoint(resultList);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+
+
+            });
+
+
+
+
+
+        }
+
+
+    }
 }

+ 3 - 3
realtime/computing-services7002/src/main/java/com/gyee/generation/service/GenerationService.java

@@ -347,11 +347,11 @@ public class GenerationService {
             }
         });
         //电量百分比
-        double percentage = xlzdl.get() != 0 ? xldl.get() / xlzdl.get() * 100 : 0;
+        double percentage = xlzdl.get() != 0 ? xldl.get() / xlzdl.get()  : 0;
         percentageMap.put("percentage",percentage);
-        double ypercentage = xlzydl.get() != 0 ? xlydl.get() / xlzydl.get() * 100 : 0;
+        double ypercentage = xlzydl.get() != 0 ? xlydl.get() / xlzydl.get()  : 0;
         percentageMap.put("ypercentage",ypercentage);
-        double npercentage = xlzndl.get() != 0 ? xlndl.get() / xlzndl.get() * 100 : 0;
+        double npercentage = xlzndl.get() != 0 ? xlndl.get() / xlzndl.get() : 0;
         percentageMap.put("npercentage",npercentage);
         return percentageMap;
     }

+ 5 - 0
realtime/computing-services7003/pom.xml

@@ -42,6 +42,10 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.springframework.data</groupId>
             <artifactId>spring-data-redis</artifactId>
         </dependency>
@@ -102,6 +106,7 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.6.2</version>
                 <executions>
                     <execution>
                         <goals>

+ 220 - 8
realtime/computing-services7003/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java

@@ -179,6 +179,7 @@ public class AverageAndGeneratingService {
                             Double rfdl = 0.0;
                             Double yfdl = 0.0;
                             Double nfdl = 0.0;
+                            Double rfdlnew = 0.0;
                             if (direct.contains(wt.getProjectid())){
                                 rfdl = edosUtil.getSectionData(ai064,tomorrow.getTime()).getPointValueInDouble();
                                 yfdl = edosUtil.getSectionData(ai138,tomorrow.getTime()).getPointValueInDouble();
@@ -197,8 +198,24 @@ public class AverageAndGeneratingService {
                                 rfdl = currentValue - samedayValue;
                                 yfdl = currentValue - monthFirstValue;
                                 nfdl = currentValue - yearFirstValue;
+
+                                double time = DateUtils.hoursDiff2(samedayZero, currentDate);
+                                double minute = DateUtils.minutesDiff2(samedayZero, currentDate);
+
+                                List<PointData> ssglList = edosUtil.getHistoryDatasSnap(avePowerPoint, samedayZero.getTime()/1000, currentDate.getTime()/1000, null, 600l);
+                                int glSize = ssglList.size();
+                                long samedayZeroTime = samedayZero.getTime();
+
+                                for (int i = 0;i<ssglList.size();i++){
+                                    Long pointTime = ssglList.get(i).getPointTime()*1000;
+                                    Date currentDate = DateUtils.getCurrentDate();
+                                    double hours = (currentDate.getTime() - samedayZeroTime) / 1000 / 60 / 60;
+                                    rfdlnew += hours*1/glSize*ssglList.get(i).getPointValueInDouble();
+                                }
+
                             }
-                            PointData fdlpointData = createPointData(fjfdl, rfdl);
+                            PointData fdlpointData = createPointData(fjfdl, rfdlnew);
+//                            PointData fdlpointData = createPointData(fjfdl, rfdl);
                             rfdlList.add(fdlpointData);
 
                             PointData yfdlpointData = createPointData(fjyfdl, yfdl);
@@ -251,7 +268,7 @@ public class AverageAndGeneratingService {
                             if (zyglFirst.isPresent()){
                                 PointData pointData = zyglFirst.get();
                                 double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(zyglPoint, pointData, inDouble);
+//                                createWtPointData(zyglPoint, pointData, inDouble);
                                 wtzygldList.add(pointData);
                             }
                             //算月平均功率
@@ -298,10 +315,10 @@ public class AverageAndGeneratingService {
                     nlinefdlList.add(nfdlpoint);
 
                     //算节能减排
-                    double jpeyhl = lineyfdl * 0.0059;
-                    double jpeyht = lineyfdl * 0.8568;
-                    double jybm = lineyfdl * 0.37;
-                    double jys = lineyfdl * 3.05;
+                    double jpeyhl = lineyfdl * 0.0059/1000;
+                    double jpeyht = lineyfdl * 0.8568/1000;
+                    double jybm = lineyfdl * 0.37/1000;
+                    double jys = lineyfdl * 3.05/1000;
                     PointData jpeyhlpoint = createWpPointData(jpeyhlpointnew, jpeyhl);
                     PointData jpeyhtpoint = createWpPointData(jpeyhtpointnew, jpeyht);
                     PointData jybmpoint = createWpPointData(jybmpointnew, jybm);
@@ -380,8 +397,8 @@ public class AverageAndGeneratingService {
                 resultList.addAll(linezyglpowerList);
 
                 //算节能减排
-                double jpeyhl = proyfdl * 0.0059;
-                double jpeyht = proyfdl * 0.8568;
+                double jpeyhl = proyfdl * 0.0059/1000;
+                double jpeyht = proyfdl * 0.8568/1000;
                 double jybm = proyfdl * 0.37;
                 double jys = proyfdl * 3.05;
                 PointData jpeyhlpoint = createWpPointData(jpeyhlprojectpointnew, jpeyhl);
@@ -560,4 +577,199 @@ public class AverageAndGeneratingService {
         pointData.setPointValue(String.valueOf(inDouble));
         pointData.setPointTime(currentDate.getTime());
     }
+
+
+    public void calwtGenecapacity(String begin,String end) throws Exception {
+        init();
+        List<String> days = DateUtils.getDays(begin, end);
+
+        for(String day : days){
+            Date date = DateUtils.parseDate(day);
+            Date samedayZero = DateUtils.getSamedayZero(day);
+            Date endOfDay = DateUtils.getEndOfDay(date);
+            wpls.stream().forEach(wp->{
+                List<PointData> resultList = new ArrayList<>();
+                List<Project> projects = wppromap.get(wp.getId());
+                Map<String, Windpowerstationpointnew> wppointnewmap = wppointmap.get(wp.getId());
+                Windpowerstationpointnew wpzyglpointnew = wppointnewmap.get(Contant.ZZYGL);
+                Windpowerstationpointnew wppointnew = wppointnewmap.get(Contant.RPJFS);
+                Windpowerstationpointnew ywppointnew = wppointnewmap.get(Contant.YPJFS);
+                Windpowerstationpointnew nwppointnew = wppointnewmap.get(Contant.NPJFS);
+                Windpowerstationpointnew powerwppointnew = wppointnewmap.get(Contant.RPJGL);
+                Windpowerstationpointnew ypowerwppointnew = wppointnewmap.get(Contant.YPJGL);
+                Windpowerstationpointnew npowerwppointnew = wppointnewmap.get(Contant.NPJGL);
+                Windpowerstationpointnew fdlwppointnew = wppointnewmap.get(Contant.RFDL);
+                Windpowerstationpointnew yfdlwppointnew = wppointnewmap.get(Contant.YFDL);
+                Windpowerstationpointnew nfdlwppointnew = wppointnewmap.get(Contant.NFDL);
+                Windpowerstationpointnew fnlylwppointnew = wppointnewmap.get(Contant.FNLYL);
+                Windpowerstationpointnew jpeyhlwppointnew = wppointnewmap.get(Contant.JPEYHL);
+                Windpowerstationpointnew jpeyhtwppointnew = wppointnewmap.get(Contant.JPEYHT);
+                Windpowerstationpointnew jybmwppointnew = wppointnewmap.get(Contant.JYBM);
+                Windpowerstationpointnew jyswppointnew = wppointnewmap.get(Contant.JYS);
+
+                List<PointData> projectavespeedList = new ArrayList<>();
+                List<PointData> yprojectavespeedList = new ArrayList<>();
+                List<PointData> nprojectavespeedList = new ArrayList<>();
+                List<PointData> projectzyglList = new ArrayList<>();
+                List<PointData> projectavepowerList = new ArrayList<>();
+                List<PointData> yprojectavepowerList = new ArrayList<>();
+                List<PointData> nprojectavepowerList = new ArrayList<>();
+                List<PointData> projectfdlList = new ArrayList<>();
+                List<PointData> projectyfdlList = new ArrayList<>();
+                List<PointData> projectnfdlList = new ArrayList<>();
+                projects.stream().forEach(project -> {
+                    List<Line> lines = prolinemap.get(project.getId());
+                    Map<String, Windpowerstationpointnew> projectpointnewmap = propointmap.get(project.getId());
+
+                    Windpowerstationpointnew projectzyglpointnew = projectpointnewmap.get(Contant.ZZYGL);
+                    Windpowerstationpointnew projectpointnew = projectpointnewmap.get(Contant.RPJFS);
+                    Windpowerstationpointnew yprojectpointnew = projectpointnewmap.get(Contant.YPJFS);
+                    Windpowerstationpointnew nprojectpointnew = projectpointnewmap.get(Contant.NPJFS);
+                    Windpowerstationpointnew powerprojectpointnew = projectpointnewmap.get(Contant.RPJGL);
+                    Windpowerstationpointnew ypowerprojectpointnew = projectpointnewmap.get(Contant.YPJGL);
+                    Windpowerstationpointnew npowerprojectpointnew = projectpointnewmap.get(Contant.NPJGL);
+                    Windpowerstationpointnew fdlprojectpointnew = projectpointnewmap.get(Contant.RFDL);
+                    Windpowerstationpointnew yfdlprojectpointnew = projectpointnewmap.get(Contant.YFDL);
+                    Windpowerstationpointnew nfdlprojectpointnew = projectpointnewmap.get(Contant.NFDL);
+                    Windpowerstationpointnew fnlylprojectpointnew = projectpointnewmap.get(Contant.FNLYL);
+
+                    Windpowerstationpointnew jpeyhlprojectpointnew = projectpointnewmap.get(Contant.JPEYHL);
+                    Windpowerstationpointnew jpeyhtprojectpointnew = projectpointnewmap.get(Contant.JPEYHT);
+                    Windpowerstationpointnew jybmprojectpointnew = projectpointnewmap.get(Contant.JYBM);
+                    Windpowerstationpointnew jysprojectpointnew = projectpointnewmap.get(Contant.JYS);
+
+                    List<PointData> lineavespeedList = new ArrayList<>();
+                    List<PointData> ylineavespeedList = new ArrayList<>();
+                    List<PointData> nlineavespeedList = new ArrayList<>();
+                    List<PointData> lineavepowerList = new ArrayList<>();
+                    List<PointData> linezyglpowerList = new ArrayList<>();
+                    List<PointData> ylineavepowerList = new ArrayList<>();
+                    List<PointData> nlineavepowerList = new ArrayList<>();
+                    List<PointData> linefdlList = new ArrayList<>();
+                    List<PointData> ylinefdlList = new ArrayList<>();
+                    List<PointData> nlinefdlList = new ArrayList<>();
+                    lines.stream().forEach(line -> {
+                        List<Windturbine> windturbines = linewtmap.get(line.getId());
+                        Map<String, Windpowerstationpointnew> linepointnewmap = linepointmap.get(line.getId());
+                        Windpowerstationpointnew linezyglpointnew = linepointnewmap.get(Contant.ZZYGL);
+                        Windpowerstationpointnew linepointnew = linepointnewmap.get(Contant.RPJFS);
+                        Windpowerstationpointnew ylinepointnew = linepointnewmap.get(Contant.YPJFS);
+                        Windpowerstationpointnew nlinepointnew = linepointnewmap.get(Contant.NPJFS);
+                        Windpowerstationpointnew linepowerpointnew = linepointnewmap.get(Contant.RPJGL);
+                        Windpowerstationpointnew ylinepowerpointnew = linepointnewmap.get(Contant.YPJGL);
+                        Windpowerstationpointnew nlinepowerpointnew = linepointnewmap.get(Contant.NPJGL);
+                        Windpowerstationpointnew linefdlpointnew = linepointnewmap.get(Contant.RFDL);
+                        Windpowerstationpointnew ylinefdlpointnew = linepointnewmap.get(Contant.YFDL);
+                        Windpowerstationpointnew nlinefdlpointnew = linepointnewmap.get(Contant.NFDL);
+                        Windpowerstationpointnew linefnlylpointnew = linepointnewmap.get(Contant.FNLYL);
+
+                        Windpowerstationpointnew jpeyhlpointnew = linepointnewmap.get(Contant.JPEYHL);
+                        Windpowerstationpointnew jpeyhtpointnew = linepointnewmap.get(Contant.JPEYHT);
+                        Windpowerstationpointnew jybmpointnew = linepointnewmap.get(Contant.JYBM);
+                        Windpowerstationpointnew jyspointnew = linepointnewmap.get(Contant.JYS);
+
+                        List<PointData> wtzygldList = new ArrayList<>();
+                        List<PointData> wtavespeedList = new ArrayList<>();
+                        List<PointData> ywtavespeedList = new ArrayList<>();
+                        List<PointData> nwtavespeedList = new ArrayList<>();
+                        List<PointData> wtavepowerList = new ArrayList<>();
+                        List<PointData> ywtavepowerList = new ArrayList<>();
+                        List<PointData> nwtavepowerList = new ArrayList<>();
+                        List<PointData> rfdlList = new ArrayList<>();
+                        List<PointData> yfdlList = new ArrayList<>();
+                        List<PointData> nfdlList = new ArrayList<>();
+
+                        windturbines.stream().forEach(wt->{
+
+                            Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
+                            Windturbinetestingpointnew zyglPoint = windturbinetestingpointnewMap.get(Contant.ZZYGL);
+                            Windturbinetestingpointnew aveSpeedPoint = windturbinetestingpointnewMap.get(Contant.RPJFS);
+                            Windturbinetestingpointnew monthAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.YPJFS);
+                            Windturbinetestingpointnew yearAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.NPJFS);
+                            Windturbinetestingpointnew fjssfs = windturbinetestingpointnewMap.get(Contant.AI022);
+                            Windturbinetestingpointnew avePowerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
+                            Windturbinetestingpointnew yavePowerPoint = windturbinetestingpointnewMap.get(Contant.YPJGL);
+                            Windturbinetestingpointnew navePowerPoint = windturbinetestingpointnewMap.get(Contant.NPJGL);
+                            Windturbinetestingpointnew fjssgl = windturbinetestingpointnewMap.get(Contant.AI130);
+                            Windturbinetestingpointnew ai064 = windturbinetestingpointnewMap.get(Contant.AI064);
+                            Windturbinetestingpointnew fjfdl = windturbinetestingpointnewMap.get(Contant.RFDL);
+                            Windturbinetestingpointnew fjyfdl = windturbinetestingpointnewMap.get(Contant.YFDL);
+                            Windturbinetestingpointnew fjnfdl = windturbinetestingpointnewMap.get(Contant.NFDL);
+                            Windturbinetestingpointnew ai138 = windturbinetestingpointnewMap.get(Contant.AI138);
+                            Windturbinetestingpointnew ai139 = windturbinetestingpointnewMap.get(Contant.AI139);
+                            List<PointData> ssglList = null;
+                            try {
+                                ssglList = edosUtil.getHistoryDatasSnap(avePowerPoint, samedayZero.getTime()/1000, endOfDay.getTime()/1000, null, 600l);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                            int glSize = ssglList.size();
+                            long samedayZeroTime = samedayZero.getTime();
+                            Double rfdlnew = 0.0;
+                            for (int i = 0;i<ssglList.size();i++){
+                                Long pointTime = ssglList.get(i).getPointTime()*1000;
+                                Date currentDate = DateUtils.getCurrentDate();
+                                double hours = (endOfDay.getTime() - samedayZeroTime) / 1000 / 60 / 60;
+                                rfdlnew += hours*1/glSize*ssglList.get(i).getPointValueInDouble();
+                            }
+
+                            PointData fdlpointData = createPointData(fjfdl, rfdlnew);
+//                            PointData fdlpointData = createPointData(fjfdl, rfdl);
+                            rfdlList.add(fdlpointData);
+
+
+
+                        });
+
+                        resultList.addAll(rfdlList);
+
+                        double linefdl = rfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+
+                        PointData fdlpoint = createWpPointData(linefdlpointnew, linefdl);
+                        fdlpoint.setPointTime(endOfDay.getTime()/1000);
+                        linefdlList.add(fdlpoint);
+
+
+
+
+
+                    });
+
+                    Double prorfdl = linefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                    PointData fdlpoint = createWpPointData(fdlprojectpointnew, prorfdl);
+                    fdlpoint.setPointTime(endOfDay.getTime()/1000);
+                    projectfdlList.add(fdlpoint);
+
+                    resultList.addAll(linefdlList);
+
+
+
+
+
+                });
+
+                resultList.addAll(projectfdlList);
+
+                double fcrfdl = projectfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                PointData fdlpointData = createWpPointData(fdlwppointnew, fcrfdl);
+                fdlpointData.setPointTime(endOfDay.getTime()/1000);
+                resultList.add(fdlpointData);
+
+                try {
+                    edosUtil.sendMultiPoint(resultList);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+
+
+            });
+
+
+
+
+
+        }
+
+
+    }
 }

+ 5 - 5
realtime/computing-services7003/src/main/java/com/gyee/generation/service/GenerationService.java

@@ -27,7 +27,7 @@ import java.util.concurrent.atomic.AtomicReference;
 @Service
 public class GenerationService {
 
-   private Log log = LogFactory.getLog(GenerationService.class);
+    private Log log = LogFactory.getLog(GenerationService.class);
     @Resource
     private IEdosUtil edosUtil;
     @Resource
@@ -105,7 +105,7 @@ public class GenerationService {
                         swdlOptional = meterpoints.stream().filter(me ->   me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("出线") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
                         gwdlOptional = meterpoints.stream().filter(me ->  me.getUniformcode().equals("FXYG") && me.getMetertype().equals("出线") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
                     }
-                     lineOrtherdl(fdlList,tomorrow,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrswdl, qcyswdl, qcnswdl, line, linemap, swdlOptional,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
+                    lineOrtherdl(fdlList,tomorrow,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrswdl, qcyswdl, qcnswdl, line, linemap, swdlOptional,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
                     log.info(line.getName()+"上网电量计算完毕!");
                     //线路购网电量
                     lineOrtherdl(fdlList,tomorrow,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrgwdl, qcygwdl, qcngwdl, line, linemap, gwdlOptional,Contant.GWGWB,Contant.GWGWY,Contant.GWGWN);
@@ -347,11 +347,11 @@ public class GenerationService {
             }
         });
         //电量百分比
-        double percentage = xlzdl.get() != 0 ? xldl.get() / xlzdl.get() * 100 : 0;
+        double percentage = xlzdl.get() != 0 ? xldl.get() / xlzdl.get()  : 0;
         percentageMap.put("percentage",percentage);
-        double ypercentage = xlzydl.get() != 0 ? xlydl.get() / xlzydl.get() * 100 : 0;
+        double ypercentage = xlzydl.get() != 0 ? xlydl.get() / xlzydl.get()  : 0;
         percentageMap.put("ypercentage",ypercentage);
-        double npercentage = xlzndl.get() != 0 ? xlndl.get() / xlzndl.get() * 100 : 0;
+        double npercentage = xlzndl.get() != 0 ? xlndl.get() / xlzndl.get() : 0;
         percentageMap.put("npercentage",npercentage);
         return percentageMap;
     }

+ 6 - 0
realtime/generationGF-service/pom.xml

@@ -27,6 +27,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,12 +100,14 @@
         </dependency>
 
 
+
     </dependencies>
     <build>
         <plugins>
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.6.2</version>
                 <executions>
                     <execution>
                         <goals>

+ 150 - 242
realtime/generationGF-service/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java

@@ -69,9 +69,7 @@ public class AverageAndGeneratingService {
         wpls.stream().forEach(wp->{
             List<Project> projects = wppromap.get(wp.getId());
             Map<String, Windpowerstationpointnew> wppointnewmap = wppointmap.get(wp.getId());
-            Windpowerstationpointnew wppointnew = wppointnewmap.get(Contant.RPJFS);
-            Windpowerstationpointnew ywppointnew = wppointnewmap.get(Contant.YPJFS);
-            Windpowerstationpointnew nwppointnew = wppointnewmap.get(Contant.NPJFS);
+
             Windpowerstationpointnew powerwppointnew = wppointnewmap.get(Contant.RPJGL);
             Windpowerstationpointnew ypowerwppointnew = wppointnewmap.get(Contant.YPJGL);
             Windpowerstationpointnew npowerwppointnew = wppointnewmap.get(Contant.NPJGL);
@@ -79,9 +77,7 @@ public class AverageAndGeneratingService {
             Windpowerstationpointnew yfdlwppointnew = wppointnewmap.get(Contant.YFDL);
             Windpowerstationpointnew nfdlwppointnew = wppointnewmap.get(Contant.NFDL);
             Windpowerstationpointnew fnlylwppointnew = wppointnewmap.get(Contant.FNLYL);
-            List<PointData> projectavespeedList = new ArrayList<>();
-            List<PointData> yprojectavespeedList = new ArrayList<>();
-            List<PointData> nprojectavespeedList = new ArrayList<>();
+
             List<PointData> projectavepowerList = new ArrayList<>();
             List<PointData> yprojectavepowerList = new ArrayList<>();
             List<PointData> nprojectavepowerList = new ArrayList<>();
@@ -91,9 +87,7 @@ public class AverageAndGeneratingService {
             projects.stream().forEach(project -> {
                 List<Line> lines = prolinemap.get(project.getId());
                 Map<String, Windpowerstationpointnew> projectpointnewmap = propointmap.get(project.getId());
-                Windpowerstationpointnew projectpointnew = projectpointnewmap.get(Contant.RPJFS);
-                Windpowerstationpointnew yprojectpointnew = projectpointnewmap.get(Contant.YPJFS);
-                Windpowerstationpointnew nprojectpointnew = projectpointnewmap.get(Contant.NPJFS);
+
                 Windpowerstationpointnew powerprojectpointnew = projectpointnewmap.get(Contant.RPJGL);
                 Windpowerstationpointnew ypowerprojectpointnew = projectpointnewmap.get(Contant.YPJGL);
                 Windpowerstationpointnew npowerprojectpointnew = projectpointnewmap.get(Contant.NPJGL);
@@ -101,9 +95,7 @@ public class AverageAndGeneratingService {
                 Windpowerstationpointnew yfdlprojectpointnew = projectpointnewmap.get(Contant.YFDL);
                 Windpowerstationpointnew nfdlprojectpointnew = projectpointnewmap.get(Contant.NFDL);
                 Windpowerstationpointnew fnlylprojectpointnew = projectpointnewmap.get(Contant.FNLYL);
-                List<PointData> lineavespeedList = new ArrayList<>();
-                List<PointData> ylineavespeedList = new ArrayList<>();
-                List<PointData> nlineavespeedList = new ArrayList<>();
+
                 List<PointData> lineavepowerList = new ArrayList<>();
                 List<PointData> ylineavepowerList = new ArrayList<>();
                 List<PointData> nlineavepowerList = new ArrayList<>();
@@ -111,212 +103,161 @@ public class AverageAndGeneratingService {
                 List<PointData> ylinefdlList = new ArrayList<>();
                 List<PointData> nlinefdlList = new ArrayList<>();
                 lines.stream().forEach(line -> {
-                    List<Inverter> windturbines = linewtmap.get(line.getId());
-                    Map<String, Windpowerstationpointnew> linepointnewmap = linepointmap.get(line.getId());
-                    Windpowerstationpointnew linepointnew = linepointnewmap.get(Contant.RPJFS);
-                    Windpowerstationpointnew ylinepointnew = linepointnewmap.get(Contant.YPJFS);
-                    Windpowerstationpointnew nlinepointnew = linepointnewmap.get(Contant.NPJFS);
-                    Windpowerstationpointnew linepowerpointnew = linepointnewmap.get(Contant.RPJGL);
-                    Windpowerstationpointnew ylinepowerpointnew = linepointnewmap.get(Contant.YPJGL);
-                    Windpowerstationpointnew nlinepowerpointnew = linepointnewmap.get(Contant.NPJGL);
-                    Windpowerstationpointnew linefdlpointnew = linepointnewmap.get(Contant.RFDL);
-                    Windpowerstationpointnew ylinefdlpointnew = linepointnewmap.get(Contant.YFDL);
-                    Windpowerstationpointnew nlinefdlpointnew = linepointnewmap.get(Contant.NFDL);
-                    Windpowerstationpointnew linefnlylpointnew = linepointnewmap.get(Contant.FNLYL);
-                    List<PointData> wtavespeedList = new ArrayList<>();
-                    List<PointData> ywtavespeedList = new ArrayList<>();
-                    List<PointData> nwtavespeedList = new ArrayList<>();
-                    List<PointData> wtavepowerList = new ArrayList<>();
-                    List<PointData> ywtavepowerList = new ArrayList<>();
-                    List<PointData> nwtavepowerList = new ArrayList<>();
-                    List<PointData> rfdlList = new ArrayList<>();
-                    List<PointData> yfdlList = new ArrayList<>();
-                    List<PointData> nfdlList = new ArrayList<>();
-
-                    windturbines.stream().forEach(wt->{
-                        Map<String, Photovoltaictestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
-                        Photovoltaictestingpointnew aveSpeedPoint = windturbinetestingpointnewMap.get(Contant.RPJFS);
-                        Photovoltaictestingpointnew monthAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.YPJFS);
-                        Photovoltaictestingpointnew yearAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.NPJFS);
-                        Photovoltaictestingpointnew fjssfs = windturbinetestingpointnewMap.get(Contant.AI022);
-                        Photovoltaictestingpointnew avePowerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
-                        Photovoltaictestingpointnew yavePowerPoint = windturbinetestingpointnewMap.get(Contant.YPJGL);
-                        Photovoltaictestingpointnew navePowerPoint = windturbinetestingpointnewMap.get(Contant.NPJGL);
-                        Photovoltaictestingpointnew fjssgl = windturbinetestingpointnewMap.get(Contant.AI130);
-                        Photovoltaictestingpointnew ai064 = windturbinetestingpointnewMap.get(Contant.AI064);
-                        Photovoltaictestingpointnew fjfdl = windturbinetestingpointnewMap.get(Contant.RFDL);
-                        Photovoltaictestingpointnew fjyfdl = windturbinetestingpointnewMap.get(Contant.YFDL);
-                        Photovoltaictestingpointnew fjnfdl = windturbinetestingpointnewMap.get(Contant.NFDL);
-                        Photovoltaictestingpointnew ai138 = windturbinetestingpointnewMap.get(Contant.AI138);
-                        Photovoltaictestingpointnew ai139 = windturbinetestingpointnewMap.get(Contant.AI139);
-                        try {
-                            //算发电量
-                            Double rfdl = 0.0;
-                            Double yfdl = 0.0;
-                            Double nfdl = 0.0;
-                            if (direct.contains(wt.getProjectid())){
-                                rfdl = edosUtil.getSectionData(ai064,tomorrow.getTime()).getPointValueInDouble();
-                                yfdl = edosUtil.getSectionData(ai138,tomorrow.getTime()).getPointValueInDouble();
-                                nfdl = edosUtil.getSectionData(ai139,tomorrow.getTime()).getPointValueInDouble();
-                            }else{
-                                Double currentValue = 0.0;
-                                Double samedayValue = 0.0;
-                                Double monthFirstValue = 0.0;
-                                Double yearFirstValue = 0.0;
-                                PointData realData = edosUtil.getSectionData(ai064,tomorrow.getTime());
-                                currentValue = realData.getPointValueInDouble();
-                                samedayValue = edosUtil.getSectionData(ai064,samedayZero.getTime()).getPointValueInDouble();
-                                monthFirstValue = edosUtil.getSectionData(ai064,monthFirstZero.getTime()).getPointValueInDouble();
-                                yearFirstValue = edosUtil.getSectionData(ai064,yearFirstZero.getTime()).getPointValueInDouble();
-
-                                rfdl = currentValue - samedayValue;
-                                yfdl = currentValue - monthFirstValue;
-                                nfdl = currentValue - yearFirstValue;
-                            }
-                            PointData fdlpointData = createPointData(fjfdl, rfdl);
-                            rfdlList.add(fdlpointData);
-
-                            PointData yfdlpointData = createPointData(fjyfdl, yfdl);
-
-                            yfdlList.add(yfdlpointData);
-
-                            PointData nfdlpointData = createPointData(fjnfdl, nfdl);
-                            yfdlList.add(nfdlpointData);
-                            //算平均风速
-                            List<PointData> ssfsList = edosUtil.getHistStat(fjssfs, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> ssfsFirst = ssfsList.stream().findFirst();
-                            if (ssfsFirst.isPresent()){
-                                PointData pointData = ssfsFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(aveSpeedPoint, pointData, inDouble);
-                                wtavespeedList.add(pointData);
-                            }
-                            //算月平均风速
-                            List<PointData> yssfsList = edosUtil.getHistStat(fjssfs, monthFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> yssfsFirst = yssfsList.stream().findFirst();
-                            if (yssfsFirst.isPresent()){
-                                PointData pointData = yssfsFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(monthAveSpeedPoint, pointData, inDouble);
-                                ywtavespeedList.add(pointData);
-                            }
-                            //算年平均风速
-                            List<PointData> nssfsList = edosUtil.getHistStat(fjssfs, yearFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> nssfsFirst = nssfsList.stream().findFirst();
-                            if (nssfsFirst.isPresent()){
-                                PointData pointData = nssfsFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(yearAveSpeedPoint, pointData, inDouble);
-                                nwtavespeedList.add(pointData);
-                            }
-                            //算平均功率
-                            List<PointData> ssglList = edosUtil.getHistStat(fjssgl, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> ssglFirst = ssglList.stream().findFirst();
-                            if (ssglFirst.isPresent()){
-                                PointData pointData = ssglFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(avePowerPoint, pointData, inDouble);
-                                wtavepowerList.add(pointData);
-                            }
-                            //算月平均功率
-                            List<PointData> yssglList = edosUtil.getHistStat(fjssgl, monthFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> yssglFirst = yssglList.stream().findFirst();
-                            if (yssglFirst.isPresent()){
-                                PointData pointData = yssglFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(yavePowerPoint, pointData, inDouble);
-                                ywtavepowerList.add(pointData);
-                            }
-                            //算年平均功率
-                            List<PointData> nssglList = edosUtil.getHistStat(fjssgl, yearFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> nssglFirst = nssglList.stream().findFirst();
-                            if (nssglFirst.isPresent()){
-                                PointData pointData = nssglFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(navePowerPoint, pointData, inDouble);
-                                nwtavepowerList.add(pointData);
+                    if (linewtmap.containsKey(line.getId())){
+                        List<Inverter> windturbines = linewtmap.get(line.getId());
+                        Map<String, Windpowerstationpointnew> linepointnewmap = linepointmap.get(line.getId());
+
+                        Windpowerstationpointnew linepowerpointnew = linepointnewmap.get(Contant.RPJGL);
+                        Windpowerstationpointnew ylinepowerpointnew = linepointnewmap.get(Contant.YPJGL);
+                        Windpowerstationpointnew nlinepowerpointnew = linepointnewmap.get(Contant.NPJGL);
+                        Windpowerstationpointnew linefdlpointnew = linepointnewmap.get(Contant.RFDL);
+                        Windpowerstationpointnew ylinefdlpointnew = linepointnewmap.get(Contant.YFDL);
+                        Windpowerstationpointnew nlinefdlpointnew = linepointnewmap.get(Contant.NFDL);
+                        Windpowerstationpointnew linefnlylpointnew = linepointnewmap.get(Contant.FNLYL);
+
+                        List<PointData> wtavepowerList = new ArrayList<>();
+                        List<PointData> ywtavepowerList = new ArrayList<>();
+                        List<PointData> nwtavepowerList = new ArrayList<>();
+                        List<PointData> rfdlList = new ArrayList<>();
+                        List<PointData> yfdlList = new ArrayList<>();
+                        List<PointData> nfdlList = new ArrayList<>();
+
+                        windturbines.stream().forEach(wt->{
+                            if (wtpAimap.containsKey(wt.getId())){
+                                Map<String, Photovoltaictestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
+
+                                Photovoltaictestingpointnew avePowerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
+                                Photovoltaictestingpointnew yavePowerPoint = windturbinetestingpointnewMap.get(Contant.YPJGL);
+                                Photovoltaictestingpointnew navePowerPoint = windturbinetestingpointnewMap.get(Contant.NPJGL);
+                                Photovoltaictestingpointnew fjssgl = windturbinetestingpointnewMap.get(Contant.AIG013);
+                                Photovoltaictestingpointnew ai064 = windturbinetestingpointnewMap.get(Contant.AI064);
+                                Photovoltaictestingpointnew fjfdl = windturbinetestingpointnewMap.get(Contant.RFDL);
+                                Photovoltaictestingpointnew fjyfdl = windturbinetestingpointnewMap.get(Contant.YFDL);
+                                Photovoltaictestingpointnew fjnfdl = windturbinetestingpointnewMap.get(Contant.NFDL);
+                                Photovoltaictestingpointnew ai138 = windturbinetestingpointnewMap.get(Contant.AI138);
+                                Photovoltaictestingpointnew ai139 = windturbinetestingpointnewMap.get(Contant.AI139);
+                                try {
+                                    //算发电量
+                                    Double rfdl = 0.0;
+                                    Double yfdl = 0.0;
+                                    Double nfdl = 0.0;
+                                    if (direct.contains(wt.getProjectid())){
+                                        rfdl = edosUtil.getSectionData(ai064,tomorrow.getTime()).getPointValueInDouble();
+                                        yfdl = edosUtil.getSectionData(ai138,tomorrow.getTime()).getPointValueInDouble();
+                                        nfdl = edosUtil.getSectionData(ai139,tomorrow.getTime()).getPointValueInDouble();
+                                    }else{
+                                        Double currentValue = 0.0;
+                                        Double samedayValue = 0.0;
+                                        Double monthFirstValue = 0.0;
+                                        Double yearFirstValue = 0.0;
+                                        PointData realData = edosUtil.getSectionData(ai064,tomorrow.getTime());
+                                        currentValue = realData.getPointValueInDouble();
+                                        samedayValue = edosUtil.getSectionData(ai064,samedayZero.getTime()).getPointValueInDouble();
+                                        monthFirstValue = edosUtil.getSectionData(ai064,monthFirstZero.getTime()).getPointValueInDouble();
+                                        yearFirstValue = edosUtil.getSectionData(ai064,yearFirstZero.getTime()).getPointValueInDouble();
+
+                                        rfdl = currentValue - samedayValue;
+                                        yfdl = currentValue - monthFirstValue;
+                                        nfdl = currentValue - yearFirstValue;
+                                    }
+                                    PointData fdlpointData = createPointData(fjfdl, rfdl);
+                                    rfdlList.add(fdlpointData);
+
+                                    PointData yfdlpointData = createPointData(fjyfdl, yfdl);
+
+                                    yfdlList.add(yfdlpointData);
+
+                                    PointData nfdlpointData = createPointData(fjnfdl, nfdl);
+                                    yfdlList.add(nfdlpointData);
+
+
+                                    //算平均功率
+                                    List<PointData> ssglList = edosUtil.getHistStat(fjssgl, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
+                                    Optional<PointData> ssglFirst = ssglList.stream().findFirst();
+                                    if (ssglFirst.isPresent()){
+                                        PointData pointData = ssglFirst.get();
+                                        double inDouble = pointData.getPointValueInDouble();
+                                        createWtPointData(avePowerPoint, pointData, inDouble);
+                                        wtavepowerList.add(pointData);
+                                    }
+                                    //算月平均功率
+                                    List<PointData> yssglList = edosUtil.getHistStat(fjssgl, monthFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
+                                    Optional<PointData> yssglFirst = yssglList.stream().findFirst();
+                                    if (yssglFirst.isPresent()){
+                                        PointData pointData = yssglFirst.get();
+                                        double inDouble = pointData.getPointValueInDouble();
+                                        createWtPointData(yavePowerPoint, pointData, inDouble);
+                                        ywtavepowerList.add(pointData);
+                                    }
+                                    //算年平均功率
+                                    List<PointData> nssglList = edosUtil.getHistStat(fjssgl, yearFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
+                                    Optional<PointData> nssglFirst = nssglList.stream().findFirst();
+                                    if (nssglFirst.isPresent()){
+                                        PointData pointData = nssglFirst.get();
+                                        double inDouble = pointData.getPointValueInDouble();
+                                        createWtPointData(navePowerPoint, pointData, inDouble);
+                                        nwtavepowerList.add(pointData);
+                                    }
+
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
                             }
 
+                        });
+                        resultList.addAll(wtavepowerList);
+                        resultList.addAll(ywtavepowerList);
+                        resultList.addAll(nwtavepowerList);
+                        resultList.addAll(rfdlList);
+                        resultList.addAll(yfdlList);
+                        resultList.addAll(nfdlList);
+                        double linefdl = rfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                        double lineyfdl = yfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                        double linenfdl = nfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                        PointData fdlpoint = createWpPointData(linefdlpointnew, linefdl);
+                        PointData yfdlpoint = createWpPointData(ylinefdlpointnew, lineyfdl);
+                        PointData nfdlpoint = createWpPointData(nlinefdlpointnew, linenfdl);
+                        linefdlList.add(fdlpoint);
+                        ylinefdlList.add(yfdlpoint);
+                        nlinefdlList.add(nfdlpoint);
+
+                        //算风能利用率
+
+                        List<String> pointList = new ArrayList<>();
+                        double ssdl = 0;
+                        Arrays.stream(monthbenchPoints.split(",")).forEach(code->{
+                            pointList.add(linepointnewmap.get(code).getCode());
+                        });
+                        try {
+                            List<PointData> ssdlList = edosUtil.getRealData(pointList);
+                            ssdl = ssdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
                         } catch (Exception e) {
                             e.printStackTrace();
                         }
-                    });
-                    resultList.addAll(wtavespeedList);
-                    resultList.addAll(ywtavespeedList);
-                    resultList.addAll(nwtavespeedList);
-                    resultList.addAll(wtavepowerList);
-                    resultList.addAll(ywtavepowerList);
-                    resultList.addAll(nwtavepowerList);
-                    resultList.addAll(rfdlList);
-                    resultList.addAll(yfdlList);
-                    resultList.addAll(nfdlList);
-                    double linefdl = rfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    double lineyfdl = yfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    double linenfdl = nfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    PointData fdlpoint = createWpPointData(linefdlpointnew, linefdl);
-                    PointData yfdlpoint = createWpPointData(ylinefdlpointnew, lineyfdl);
-                    PointData nfdlpoint = createWpPointData(nlinefdlpointnew, linenfdl);
-                    linefdlList.add(fdlpoint);
-                    ylinefdlList.add(yfdlpoint);
-                    nlinefdlList.add(nfdlpoint);
-
-                    //算风能利用率
-
-                    List<String> pointList = new ArrayList<>();
-                    double ssdl = 0;
-                    Arrays.stream(monthbenchPoints.split(",")).forEach(code->{
-                        pointList.add(linepointnewmap.get(code).getCode());
-                    });
-                    try {
-                        List<PointData> ssdlList = edosUtil.getRealData(pointList);
-                        ssdl = ssdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    double fnlyl = (ssdl+lineyfdl)!=0?lineyfdl/(ssdl+lineyfdl):0;
-                    PointData fnlylpoint = createWpPointData(linefnlylpointnew, fnlyl);
-                    resultList.add(fnlylpoint);
-
-                    OptionalDouble average = wtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                    if (average.isPresent()){
-                        double linespeed = average.getAsDouble();
-                        PointData pointData = createWpPointData(linepointnew, linespeed);
-                        lineavespeedList.add(pointData);
-                    }
-                    OptionalDouble yaverage = ywtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                    if (yaverage.isPresent()){
-                        double linespeed = yaverage.getAsDouble();
-                        PointData pointData = createWpPointData(ylinepointnew, linespeed);
-                        ylineavespeedList.add(pointData);
-                    }
-                    OptionalDouble naverage = nwtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                    if (naverage.isPresent()){
-                        double linespeed = naverage.getAsDouble();
-                        PointData pointData = createWpPointData(nlinepointnew, linespeed);
-                        nlineavespeedList.add(pointData);
-                    }
-                    Double poweraverage = wtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    PointData powerpointData = createWpPointData(linepowerpointnew, poweraverage);
-                    lineavepowerList.add(powerpointData);
+                        double fnlyl = (ssdl+lineyfdl)!=0?lineyfdl/(ssdl+lineyfdl):0;
+                        PointData fnlylpoint = createWpPointData(linefnlylpointnew, fnlyl);
+                        resultList.add(fnlylpoint);
+
+
+
+                        Double poweraverage = wtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                        PointData powerpointData = createWpPointData(linepowerpointnew, poweraverage);
+                        lineavepowerList.add(powerpointData);
 
-                    Double ypoweraverage = ywtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    PointData ypowerpointData = createWpPointData(ylinepowerpointnew, ypoweraverage);
-                    ylineavepowerList.add(ypowerpointData);
+                        Double ypoweraverage = ywtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                        PointData ypowerpointData = createWpPointData(ylinepowerpointnew, ypoweraverage);
+                        ylineavepowerList.add(ypowerpointData);
 
-                    Double npoweraverage = nwtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    PointData npowerpointData = createWpPointData(nlinepowerpointnew, npoweraverage);
-                    nlineavepowerList.add(npowerpointData);
+                        Double npoweraverage = nwtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                        PointData npowerpointData = createWpPointData(nlinepowerpointnew, npoweraverage);
+                        nlineavepowerList.add(npowerpointData);
+                    }
                 });
-                OptionalDouble average = lineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                OptionalDouble yaverage = ylineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                OptionalDouble naverage = nlineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
 
                 Double prorfdl = linefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
                 Double proyfdl = ylinefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
                 Double pronfdl = nlinefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                resultList.addAll(lineavespeedList);
-                resultList.addAll(ylineavespeedList);
-                resultList.addAll(nlineavespeedList);
+
                 resultList.addAll(lineavepowerList);
                 resultList.addAll(ylineavepowerList);
                 resultList.addAll(nlineavepowerList);
@@ -346,21 +287,7 @@ public class AverageAndGeneratingService {
                 projectfdlList.add(rfdlpointData);
                 projectyfdlList.add(yfdlpointData);
                 projectnfdlList.add(nfdlpointData);
-                if (average.isPresent()){
-                    double projectspeed = average.getAsDouble();
-                    PointData pointData = createWpPointData(projectpointnew, projectspeed);
-                    projectavespeedList.add(pointData);
-                }
-                if (yaverage.isPresent()){
-                    double projectspeed = yaverage.getAsDouble();
-                    PointData pointData = createWpPointData(yprojectpointnew, projectspeed);
-                    yprojectavespeedList.add(pointData);
-                }
-                if (naverage.isPresent()){
-                    double projectspeed = naverage.getAsDouble();
-                    PointData pointData = createWpPointData(nprojectpointnew, projectspeed);
-                    nprojectavespeedList.add(pointData);
-                }
+
 
                 Double poweraverage = lineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
                 Double ypoweraverage = ylineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
@@ -404,27 +331,8 @@ public class AverageAndGeneratingService {
             PointData nfdlpointData = createWpPointData(nfdlwppointnew, fcnfdl);
             resultList.add(nfdlpointData);
 
-            OptionalDouble average = projectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-            resultList.addAll(projectavespeedList);
-            if (average.isPresent()){
-                double wpspeed = average.getAsDouble();
-                PointData pointData = createWpPointData(wppointnew, wpspeed);
-                resultList.add(pointData);
-            }
-            OptionalDouble yaverage = yprojectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-            resultList.addAll(yprojectavespeedList);
-            if (yaverage.isPresent()){
-                double wpspeed = yaverage.getAsDouble();
-                PointData pointData = createWpPointData(ywppointnew, wpspeed);
-                resultList.add(pointData);
-            }
-            OptionalDouble naverage = nprojectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-            resultList.addAll(nprojectavespeedList);
-            if (naverage.isPresent()){
-                double wpspeed = naverage.getAsDouble();
-                PointData pointData = createWpPointData(nwppointnew, wpspeed);
-                resultList.add(pointData);
-            }
+
+
             Double poweraverage = projectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
             resultList.addAll(projectavepowerList);
             PointData powerpointData = createWpPointData(powerwppointnew, poweraverage);

+ 35 - 50
realtime/generationGF-service/src/main/java/com/gyee/generation/service/RealtimeSpeedPowerService.java

@@ -55,82 +55,67 @@ public class RealtimeSpeedPowerService {
         List<PointData> resultList = new ArrayList<>();
 
         wpls.stream().forEach(wp->{
-            AtomicReference<Double> wpSpeed = new AtomicReference<>(0.0);
             AtomicReference<Double> wpPower = new AtomicReference<>(0.0);
             Map<String, Windpowerstationpointnew> wppointnewMap = wppointmap.get(wp.getId());
-            Windpowerstationpointnew wpspeedpointnew = wppointnewMap.get(Contant.SSFS);
             Windpowerstationpointnew wppowerpointnew = wppointnewMap.get(Contant.SSZGL);
             AtomicReference<Double> wpcount = new AtomicReference<>(0.0);
             wppromap.get(wp.getId()).stream().forEach(project -> {
-                AtomicReference<Double> projectSpeed = new AtomicReference<>(0.0);
                 AtomicReference<Double> projectPower = new AtomicReference<>(0.0);
                 Map<String, Windpowerstationpointnew> propointnewMap = propointmap.get(project.getId());
-                Windpowerstationpointnew prospeedpointnew = propointnewMap.get(Contant.SSFS);
                 Windpowerstationpointnew propowerpointnew = propointnewMap.get(Contant.SSZGL);
                 AtomicReference<Double> procount = new AtomicReference<>(0.0);
                 prolinemap.get(project.getId()).stream().forEach(line->{
-                    AtomicReference<Double> lineSpeed = new AtomicReference<>(0.0);
                     AtomicReference<Double> linePower = new AtomicReference<>(0.0);
                     Map<String, Windpowerstationpointnew> linepointnewMap = linepointmap.get(line.getId());
-                    Windpowerstationpointnew linespeedpointnew = linepointnewMap.get(Contant.SSFS);
                     Windpowerstationpointnew linepowerpointnew = linepointnewMap.get(Contant.SSZGL);
                     AtomicReference<Double> count = new AtomicReference<>(0.0);
-                    linewtmap.get(line.getId()).stream().forEach(wt->{
-                        Map<String, Photovoltaictestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
-                        Photovoltaictestingpointnew speedpoint = windturbinetestingpointnewMap.get(Contant.AI022);
-                        Photovoltaictestingpointnew powerpoint = windturbinetestingpointnewMap.get(Contant.AI130);
-                        Photovoltaictestingpointnew ztpoint = windturbinetestingpointnewMap.get(Contant.ZTMX);
-                        Boolean isOffline = false;
-                        try {
-                            Double ztvalue  = edosUtil.getRealData(ztpoint).getPointValueInDouble();
-                            if (ztvalue == 12.0){
-                                isOffline = true;
-                            }
-                            if (! isOffline){
-                                count.getAndSet(count.get() + 1);
-                                procount.getAndSet(procount.get() + 1);
-                                wpcount.getAndSet(wpcount.get() + 1);
-                                Double wtspeed = 0.0;
-                                Double wtpower = 0.0;
-                                try {
-                                    wtspeed = edosUtil.getRealData(speedpoint).getPointValueInDouble();
-                                    Double finalWtspeed = wtspeed;
-                                    lineSpeed.updateAndGet(v -> new Double((double) (v + finalWtspeed)));
-                                    projectSpeed.updateAndGet(v -> new Double((double) (v + finalWtspeed)));
-                                    wpSpeed.updateAndGet(v -> new Double((double) (v + finalWtspeed)));
-
-                                    wtpower = edosUtil.getRealData(powerpoint).getPointValueInDouble();
-                                    Double finalWtpower = wtpower;
-                                    linePower.updateAndGet(v -> new Double((double) (v + finalWtpower)));
-                                    projectPower.updateAndGet(v -> new Double((double) (v + finalWtpower)));
-                                    wpPower.updateAndGet(v -> new Double((double) (v + finalWtpower)));
-                                } catch (Exception e) {
-                                    e.printStackTrace();
+                    if ( linewtmap.containsKey(line.getId())) {
+                        List<Inverter> inverters = linewtmap.get(line.getId());
+                        inverters.stream().forEach(wt -> {
+                            Map<String, Photovoltaictestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
+                            Photovoltaictestingpointnew powerpoint = windturbinetestingpointnewMap.get(Contant.AIG013);
+                            Photovoltaictestingpointnew ztpoint = windturbinetestingpointnewMap.get(Contant.ZTMX);
+                            Boolean isOffline = false;
+                            try {
+                                Double ztvalue = edosUtil.getRealData(ztpoint).getPointValueInDouble();
+                                if (ztvalue == 12.0) {
+                                    isOffline = true;
+                                }
+                                if (!isOffline) {
+                                    count.getAndSet(count.get() + 1);
+                                    procount.getAndSet(procount.get() + 1);
+                                    wpcount.getAndSet(wpcount.get() + 1);
+                                    Double wtpower = 0.0;
+                                    try {
+
+
+                                        wtpower = edosUtil.getRealData(powerpoint).getPointValueInDouble();
+                                        Double finalWtpower = wtpower;
+                                        linePower.updateAndGet(v -> new Double((double) (v + finalWtpower)));
+                                        projectPower.updateAndGet(v -> new Double((double) (v + finalWtpower)));
+                                        wpPower.updateAndGet(v -> new Double((double) (v + finalWtpower)));
+                                    } catch (Exception e) {
+                                        e.printStackTrace();
+                                    }
                                 }
+                            } catch (Exception e) {
+                                e.printStackTrace();
                             }
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
 
-                    });
-                    Double linespeedvalue = count.get()!=0 ? lineSpeed.get()/count.get() : 0.0;
-                    PointData linespeedPointData = createWpPointData(linespeedpointnew, linespeedvalue);
+                        });
+                    }else {
+
+                    }
                     PointData linepowerPointData = createWpPointData(linepowerpointnew, linePower.get());
-                    resultList.add(linespeedPointData);
                     resultList.add(linepowerPointData);
                 });
 
-                Double projectspeedvalue = procount.get()!=0 ? projectSpeed.get()/procount.get() : 0.0;
-                PointData projectspeedPointData = createWpPointData(prospeedpointnew, projectspeedvalue);
                 PointData projectpowerPointData = createWpPointData(propowerpointnew, projectPower.get());
-                resultList.add(projectspeedPointData);
                 resultList.add(projectpowerPointData);
             });
 
-            Double wpspeedvalue = wpcount.get()!=0 ? wpSpeed.get()/wpcount.get() : 0.0;
-            PointData wpspeedPointData = createWpPointData(wpspeedpointnew, wpspeedvalue);
+
             PointData wppowerPointData = createWpPointData(wppowerpointnew, wpPower.get());
-            resultList.add(wpspeedPointData);
             resultList.add(wppowerPointData);
 
         });

+ 4 - 4
realtime/generationGF-service/src/main/java/com/gyee/generation/service/StatusService.java

@@ -103,9 +103,9 @@ public class StatusService {
                         List<PointData> collect = interruptionRealData.stream().filter(i -> Math.abs(currentDate.getTime() - i.getPointTime()) / 1000 > Integer.parseInt(second)).collect(Collectors.toList());
                         if (collect.size()!=interruptionRealData.size()){
                             Double ztmx = edosUtil.getRealData(ztmxPoint).getPointValueInDouble();
-                            if (ztmx == 7 || ztmx == 9 || ztmx == 10 || ztmx == 11 || ztmx == 4 || ztmx == 5 ){     //手打状态
-                                mxstatus = ztmx;
-                            }
+//                            if (ztmx == 7 || ztmx == 9 || ztmx == 10 || ztmx == 11 || ztmx == 4 || ztmx == 5 ){     //手打状态
+//                                mxstatus = ztmx;
+//                            }
                             if (clauStatusAi.contains(wt.getProjectid())){
                                 //多状态根据一个点来判断
                                 Optional<Windturbinestatusdi> first = statusMap.get(wt.getId()).stream().filter(w -> w.getUniformcode().equals(Contant.AI422)).findFirst();
@@ -168,7 +168,7 @@ public class StatusService {
                             if (mxstatus == 2){
 //                                boolean isJcl = isJcl(wt, stringWindturbinetestingpointnewMap);
                                 double power = edosUtil.getRealData(ai130).getPointValueInDouble();
-                                if (power<=0){
+                                if (power<=1){
                                     mxstatus=0.0;}
 //                                }else if (isJcl){
 //                                    mxstatus = 3.0;

+ 23 - 23
realtime/generationGF-service/src/main/java/com/gyee/generation/task/SaticScheduleTask.java

@@ -106,30 +106,30 @@ public class SaticScheduleTask {
 
     }
 
-//    /**
-//     * 平均风速,平均功率,scada发电量计算
-//     * 每10分钟一次
-//     */
-//    @XxlJob("averageandGenerating-realtime")
-//    public void averageandGenerating() throws Exception {
-//            XxlJobHelper.log("平均风速,功率,scada发电量调度程序执行开始!........");
-//            averageAndGeneratingService.saveAvespeedAndAvepowerAndScada();
-//            XxlJobHelper.log("平均风速,功率,scada发电量调度程序执行完成!........");
-//    }
+    /**
+     * 平均风速,平均功率,scada发电量计算
+     * 每10分钟一次
+     */
+    @XxlJob("averageandGenerating-realtime")
+    public void averageandGenerating() throws Exception {
+            XxlJobHelper.log("平均风速,功率,scada发电量调度程序执行开始!........");
+            averageAndGeneratingService.saveAvespeedAndAvepowerAndScada();
+            XxlJobHelper.log("平均风速,功率,scada发电量调度程序执行完成!........");
+    }
 //
-//    /**
-//     * 实时风速功率
-//     * 只执行一次(死循环)
-//     * 2s
-//     */
-//    @XxlJob("speedAndPower-realtime")
-//    public void speedAndPower() throws Exception {
-////        while (true){
-//            XxlJobHelper.log("实时风速,实时功率调度程序执行开始!........");
-//            realtimeSpeedPowerService.calculateRealtimeSpeedPower();
-//            XxlJobHelper.log("实时风速,实时功率调度程序执行完成!........");
-////        }
-//    }
+    /**
+     * 实时风速功率
+     * 只执行一次(死循环)
+     * 2s
+     */
+    @XxlJob("speedAndPower-realtime")
+    public void speedAndPower() throws Exception {
+//        while (true){
+            XxlJobHelper.log("实时风速,实时功率调度程序执行开始!........");
+            realtimeSpeedPowerService.calculateRealtimeSpeedPower();
+            XxlJobHelper.log("实时风速,实时功率调度程序执行完成!........");
+//        }
+    }
 //
 //    /**
 //     * 拟合功率曲线,存储到数据库中

+ 1 - 0
realtime/generationregion-service/pom.xml

@@ -102,6 +102,7 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.6.2</version>
                 <executions>
                     <execution>
                         <goals>

+ 53 - 10
realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/service/RegionRealtimeService.java

@@ -40,7 +40,7 @@ public class RegionRealtimeService {
         Date samedayZero = DateUtils.getSamedayZero();
         Date addDays = DateUtils.addDays(samedayZero, 1);
 
-        companys.stream().forEach(region -> {
+        companys.stream().filter(region->!region.getId().equals("JN1")).forEach(region->{
             List<Windpowerstation> windpowerstations = wpls.stream().filter(wp -> wp.getCompanyid().equals(region.getId())).collect(Collectors.toList());
             Map<String, Windpowerstationpointnew> regionMap = wppointmap.get(region.getId()+type);
             if (type.equals("-1")){
@@ -1077,10 +1077,22 @@ public class RegionRealtimeService {
             resultList.add(createWpPoint(r4qfzt,regionMap.get(Contant.R4QFZT)));
 
             //算节能减排
-            double jpeyhl = yfdl.get() * 0.0059;
-            double jpeyht = yfdl.get() * 0.8568;
-            double jybm = yfdl.get() * 0.37;
-            double jys = yfdl.get() * 3.05;
+            double jpeyhl = 0;
+            double jpeyht = 0;
+            double jybm = 0;
+            double jys = 0;
+            if (!type.equals("-2")){
+                jpeyhl = 2131998.89 * 0.059;
+                jpeyht = 2131998.89 * 8.568;
+                jybm = 2131998.89 * 3.7;
+                jys = 2131998.89 * 30.5;
+            }else {
+                jpeyhl = yfdl.get() * 0.0059/1000;
+                jpeyht = yfdl.get() * 0.8568/1000;
+                jybm = yfdl.get() * 0.37/1000;
+                jys = yfdl.get() * 3.05/1000;
+            }
+
             resultList.add(createWpPoint(jpeyhl,regionMap.get(Contant.JPEYHL)));
             resultList.add(createWpPoint(jpeyht,regionMap.get(Contant.JPEYHT)));
             resultList.add(createWpPoint(jybm,regionMap.get(Contant.JYBM)));
@@ -2054,7 +2066,9 @@ public class RegionRealtimeService {
         if (size == 0) {
             size = 1;
         }
-        resultList.add(createWpPoint(aqts[0],regionMap.get(Contant.AQTS)));
+//        Windpowerstationpointnew aqtsPoint = regionMap.get(Contant.AQTS);
+//
+//        resultList.add(createWpPoint(aqts[0],regionMap.get(Contant.AQTS)));
         resultList.add(createWpPoint(rfdl,regionMap.get(Contant.RFDL)));
         resultList.add(createWpPoint(yfdl,regionMap.get(Contant.YFDL)));
         resultList.add(createWpPoint(nfdl,regionMap.get(Contant.NFDL)));
@@ -2148,10 +2162,22 @@ public class RegionRealtimeService {
         resultList.add(createWpPoint(r4qfzt,regionMap.get(Contant.R4QFZT)));
 
         //算节能减排
-        double jpeyhl = yfdl.get() * 0.0059;
-        double jpeyht = yfdl.get() * 0.8568;
-        double jybm = yfdl.get() * 0.37;
-        double jys = yfdl.get() * 3.05;
+        double jpeyhl = 0;
+        double jpeyht = 0;
+        double jybm = 0;
+        double jys = 0;
+        if (!type.equals("-2")){
+            jpeyhl = 2131998.89 * 0.059;
+            jpeyht = 2131998.89 * 8.568;
+            jybm = 2131998.89 * 3.7;
+            jys = 2131998.89 * 30.5;
+        }else {
+            jpeyhl = yfdl.get() * 0.0059/1000;
+            jpeyht = yfdl.get() * 0.8568/1000;
+            jybm = yfdl.get() * 0.37/1000;
+            jys = yfdl.get() * 3.05/1000;
+        }
+
         resultList.add(createWpPoint(jpeyhl,regionMap.get(Contant.JPEYHL)));
         resultList.add(createWpPoint(jpeyht,regionMap.get(Contant.JPEYHT)));
         resultList.add(createWpPoint(jybm,regionMap.get(Contant.JYBM)));
@@ -2175,6 +2201,23 @@ public class RegionRealtimeService {
     }
 
 
+    public void calAqts(String type) throws Exception {
+        List<PointData> resultList = new ArrayList<>();
+        Map<String, Map<String, Windpowerstationpointnew>> wppointmap = CacheContext.wppointmap;
+        Date samedayZero = DateUtils.getSamedayZero();
+        Date addDays = DateUtils.addDays(samedayZero, 1);
+
+
+        List<Windpowerstation> windpowerstations = CacheContext.wpls;
+        Map<String, Windpowerstationpointnew> regionMap = wppointmap.get("QY"+type);
+        Windpowerstationpointnew aqtsPoint = regionMap.get(Contant.AQTS);
+        double aqts = edosUtil.getRealData(aqtsPoint).getPointValueInDouble();
+        aqts ++ ;
+        PointData wpPoint = createWpPoint(aqts, aqtsPoint);
+        edosUtil.sendSinglePoint(wpPoint);
+    }
+
+
     private PointData createWpPoint(AtomicReference<Double> tjnum, Windpowerstationpointnew tjnumPoint) {
         Date currentDate = DateUtils.getCurrentDate();
         PointData pointData = new PointData();

+ 13 - 0
realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/task/SaticScheduleTask.java

@@ -56,6 +56,19 @@ public class SaticScheduleTask {
         XxlJobHelper.log("拟合功率曲线结束!........");
     }
 
+    @XxlJob("calAqts")
+    public void aqts()  {
+        XxlJobHelper.log("拟合功率曲线开始!........");
+        try {
+            regionRealtimeService.calAqts("-1");
+            regionRealtimeService.calAqts("-2");
+            regionRealtimeService.calAqts("0");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        XxlJobHelper.log("拟合功率曲线结束!........");
+    }
+
 
 
 

+ 1 - 1
web/monitor-web-sxjn/src/main/java/com/gyee/frame/common/spring/Constant.java

@@ -633,7 +633,7 @@ public static final String TPOINT_WT_60FX = "AI011";// 风机60秒风向
     };
 
     //逆变器支路测点
-    public static final String[] TPOINT_Inverter_Matrix = { "FJZT", "AIG013","AIG027","AIG026" };
+    public static final String[] TPOINT_Inverter_Matrix = { "FJZT", "AIG013","AI064","AIG009" };
     //逆变器支路测点
     public static final String[] TPOINT_Wt_Matrix = { "FJZT", "AI130","AI022","AI128" };