Переглянути джерело

平均风速,平均功率,发电量计算

xieshengjie 3 роки тому
батько
коміт
9a68ddc8f4

+ 13 - 2
common/src/main/java/com/gyee/common/contant/Contant.java

@@ -8,9 +8,9 @@ package com.gyee.common.contant;
  */
 
 public class Contant {
-
+    //五项损失
     public static String WXSS = "RFDL,AI022,RDJSSDL-ZS,RSTSSDL-ZS,RXNSSDL-ZS,RQXSSDL-ZS,RGZSSDL-ZS,NSZSSDL-ZS,RJXSSDL-ZS,RLZSSDL-ZS,RQFSSDL-ZS,RXDSSDL-ZS,RWZSSDL-ZS,RTZSSDL-ZS";
-
+    //操作指令
     public static String opePoints = "CI0668,CI0669,CI0670";
 
     public static String benchPoints = "RSDJZSDL,RSSTZSDL,RXNZSDL,RSQXZSDL,RGZZSDL,RSZZSDL,RJXZSDL,RLZZSDL,RQFZSDL,RXDZSDL,RWZZSDL,RTZZSDL";
@@ -19,6 +19,10 @@ public class Contant {
     public static String YFDLB = "YFDLB";//月发电量(升压站)
     public static String NFDLB = "NFDLB";//年发电量(升压站)
 
+    public static String RFDL = "RFDL"; //日发电量
+    public static String YFDL = "YFDL";//月发电量
+    public static String NFDL = "NFDL";//年发电量
+
     public static String SWDLB = "SWDLB"; //日上网发电量
     public static String SWDLY = "SWDLY"; //月上网发电量
     public static String SWDLN = "SWDLN"; //年上网发电量
@@ -36,10 +40,17 @@ public class Contant {
     public static String CYDLN="CYDLN";//年场用电量
 
     public static String RPJFS = "RPJFS"; //日平均风速
+    public static String YPJFS = "YPJFS"; //月平均风速
+    public static String NPJFS = "NPJFS";  //年平均风速
     public static String RPJGL = "RPJGL"; //日平均功率
+    public static String YPJGL = "YPJGL"; //月平均功率
+    public static String NPJGL = "NPJGL"; //年平均功率
 //    public static String SSFS = "SSFS"; //实时风速
     public static String AI022 = "AI022"; //风机实时风速
     public static String AI130 = "AI130"; //风机实时功率
+    public static String AI064 = "AI064"; //风机发电量
+
+
 
 
     public static final String TPOINT_WP_XDTS = "XDTS";// 限电台数

+ 272 - 60
realtime/generation-service/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java

@@ -54,7 +54,7 @@ public class AverageAndGeneratingService {
     }
 
     /**
-     * 保存风速,功率实时计算点
+     * 保存平均风速,平均功率,scada发电量实时计算点
      * @throws Exception
      */
     public  void saveAvespeedAndAvepowerAndScada() throws Exception {
@@ -64,139 +64,351 @@ public class AverageAndGeneratingService {
             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);
+            Windpowerstationpointnew fdlwppointnew = wppointnewmap.get(Contant.RFDL);
+            Windpowerstationpointnew yfdlwppointnew = wppointnewmap.get(Contant.YFDL);
+            Windpowerstationpointnew nfdlwppointnew = wppointnewmap.get(Contant.NFDL);
             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<>();
+            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);
                 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);
+                Windpowerstationpointnew fdlprojectpointnew = projectpointnewmap.get(Contant.RFDL);
+                Windpowerstationpointnew yfdlprojectpointnew = projectpointnewmap.get(Contant.YFDL);
+                Windpowerstationpointnew nfdlprojectpointnew = projectpointnewmap.get(Contant.NFDL);
                 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<>();
+                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 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);
                     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 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);
                         try {
+                            //算发电量
+                            Double currentValue = 0.0;
+                            Double samedayValue = 0.0;
+                            Double monthFirstValue = 0.0;
+                            Double yearFirstValue = 0.0;
+                            Optional<PointData> currentfirst = edosUtil.getHistoryDatasSnap(ai064, currentDate.getTime() / 1000, currentDate.getTime() / 1000, 1l, null).stream().findFirst();
+                            if (currentfirst.isPresent()){
+                                currentValue = currentfirst.get().getPointValueInDouble();
+                            }
+                            Optional<PointData> samedayfirst = edosUtil.getHistoryDatasSnap(ai064, samedayZero.getTime() / 1000, samedayZero.getTime() / 1000, 1l, null).stream().findFirst();
+                            if (samedayfirst.isPresent()){
+                                samedayValue = samedayfirst.get().getPointValueInDouble();
+                            }
+                            Optional<PointData> monthfirst = edosUtil.getHistoryDatasSnap(ai064, monthFirstZero.getTime() / 1000, monthFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
+                            if (monthfirst.isPresent()){
+                                monthFirstValue = monthfirst.get().getPointValueInDouble();
+                            }
+                            Optional<PointData> yearfirst = edosUtil.getHistoryDatasSnap(ai064, yearFirstZero.getTime() / 1000, yearFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
+                            if (yearfirst.isPresent()){
+                                yearFirstValue = yearfirst.get().getPointValueInDouble();
+                            }
+                            Double rfdl = currentValue - samedayValue;
+                            Double yfdl = currentValue - monthFirstValue;
+                            Double 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();
-                                pointData.setEdnaId(aveSpeedPoint.getCode());
-                                pointData.setPointName(aveSpeedPoint.getName());
-                                pointData.setPointValueInDouble(inDouble);
-                                pointData.setPointValue(String.valueOf(inDouble));
-                                pointData.setPointTime(currentDate.getTime());
+                                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();
-                                pointData.setEdnaId(avePowerPoint.getCode());
-                                pointData.setPointName(avePowerPoint.getName());
-                                pointData.setPointValueInDouble(inDouble);
-                                pointData.setPointValue(String.valueOf(inDouble));
-                                pointData.setPointTime(currentDate.getTime());
+                                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(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);
+
                     OptionalDouble average = wtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
                     if (average.isPresent()){
                         double linespeed = average.getAsDouble();
-                        PointData pointData = new PointData();
-                        pointData.setEdnaId(linepointnew.getCode());
-                        pointData.setPointTime(currentDate.getTime());
-                        pointData.setPointName(linepointnew.getName());
-                        pointData.setPointValue(String.valueOf(linespeed));
-                        pointData.setPointValueInDouble(linespeed);
+                        PointData pointData = createWpPointData(linepointnew, linespeed);
                         lineavespeedList.add(pointData);
                     }
-                    OptionalDouble poweraverage = wtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                    if (poweraverage.isPresent()){
-                        double linepower = poweraverage.getAsDouble();
-                        PointData pointData = new PointData();
-                        pointData.setEdnaId(linepowerpointnew.getCode());
-                        pointData.setPointTime(currentDate.getTime());
-                        pointData.setPointName(linepowerpointnew.getName());
-                        pointData.setPointValue(String.valueOf(linepower));
-                        pointData.setPointValueInDouble(linepower);
-                        lineavepowerList.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 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);
                 });
                 OptionalDouble average = lineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                OptionalDouble poweraverage = lineavepowerList.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);
+                resultList.addAll(linefdlList);
+                resultList.addAll(ylinefdlList);
+                resultList.addAll(nlinefdlList);
+
+                PointData rfdlpointData = createWpPointData(fdlprojectpointnew, prorfdl);
+                PointData yfdlpointData = createWpPointData(yfdlprojectpointnew, proyfdl);
+                PointData nfdlpointData = createWpPointData(nfdlprojectpointnew, pronfdl);
+                projectfdlList.add(rfdlpointData);
+                projectyfdlList.add(yfdlpointData);
+                projectnfdlList.add(nfdlpointData);
                 if (average.isPresent()){
                     double projectspeed = average.getAsDouble();
-                    PointData pointData = new PointData();
-                    pointData.setEdnaId(projectpointnew.getCode());
-                    pointData.setPointTime(currentDate.getTime());
-                    pointData.setPointName(projectpointnew.getName());
-                    pointData.setPointValue(String.valueOf(projectspeed));
-                    pointData.setPointValueInDouble(projectspeed);
+                    PointData pointData = createWpPointData(projectpointnew, projectspeed);
                     projectavespeedList.add(pointData);
                 }
-                if (poweraverage.isPresent()){
-                    double projectpower = poweraverage.getAsDouble();
-                    PointData pointData = new PointData();
-                    pointData.setEdnaId(powerprojectpointnew.getCode());
-                    pointData.setPointTime(currentDate.getTime());
-                    pointData.setPointName(powerprojectpointnew.getName());
-                    pointData.setPointValue(String.valueOf(projectpower));
-                    pointData.setPointValueInDouble(projectpower);
-                    projectavepowerList.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();
+                Double npoweraverage = nlineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                PointData powerpointData = createWpPointData(powerprojectpointnew, poweraverage);
+                projectavepowerList.add(powerpointData);
+                PointData ypowerpointData = createWpPointData(ypowerprojectpointnew, ypoweraverage);
+                yprojectavepowerList.add(ypowerpointData);
+                PointData npowerpointData = createWpPointData(npowerprojectpointnew, npoweraverage);
+                nprojectavepowerList.add(npowerpointData);
             });
+
+            resultList.addAll(projectfdlList);
+            resultList.addAll(projectyfdlList);
+            resultList.addAll(projectnfdlList);
+            double fcrfdl = projectfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+            PointData fdlpointData = createWpPointData(fdlwppointnew, fcrfdl);
+            resultList.add(fdlpointData);
+
+            double fcyfdl = projectyfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+            PointData yfdlpointData = createWpPointData(yfdlwppointnew, fcyfdl);
+            resultList.add(yfdlpointData);
+
+            double fcnfdl = projectnfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+            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 = new PointData();
-                pointData.setEdnaId(wppointnew.getCode());
-                pointData.setPointTime(currentDate.getTime());
-                pointData.setPointName(wppointnew.getName());
-                pointData.setPointValue(String.valueOf(wpspeed));
-                pointData.setPointValueInDouble(wpspeed);
+                PointData pointData = createWpPointData(wppointnew, wpspeed);
                 resultList.add(pointData);
             }
-            OptionalDouble poweraverage = projectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-            resultList.addAll(projectavepowerList);
-            if (poweraverage.isPresent()){
-                double wppwer = poweraverage.getAsDouble();
-                PointData pointData = new PointData();
-                pointData.setEdnaId(powerwppointnew.getCode());
-                pointData.setPointTime(currentDate.getTime());
-                pointData.setPointName(powerwppointnew.getName());
-                pointData.setPointValue(String.valueOf(wppwer));
-                pointData.setPointValueInDouble(wppwer);
+            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);
+            resultList.add(powerpointData);
+
+            Double ypoweraverage = yprojectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+            resultList.addAll(yprojectavepowerList);
+            PointData ypowerpointData = createWpPointData(ypowerwppointnew, ypoweraverage);
+            resultList.add(ypowerpointData);
 
+            Double npoweraverage = nprojectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+            resultList.addAll(nprojectavepowerList);
+            PointData npowerpointData = createWpPointData(npowerwppointnew, npoweraverage);
+            resultList.add(npowerpointData);
+        });
         edosUtil.sendMultiPoint(resultList);
     }
+
+    private PointData createPointData(Windturbinetestingpointnew fjfdl, Double rfdl) {
+        PointData pointData = new PointData();
+        pointData.setEdnaId(fjfdl.getCode());
+        pointData.setPointName(fjfdl.getName());
+        pointData.setPointTime(currentDate.getTime());
+        pointData.setPointValueInDouble(rfdl);
+        pointData.setPointValue(String.valueOf(rfdl));
+        return pointData;
+    }
+
+    private PointData createWpPointData(Windpowerstationpointnew linepointnew, double linespeed) {
+        PointData pointData = new PointData();
+        pointData.setEdnaId(linepointnew.getCode());
+        pointData.setPointTime(currentDate.getTime());
+        pointData.setPointName(linepointnew.getName());
+        pointData.setPointValue(String.valueOf(linespeed));
+        pointData.setPointValueInDouble(linespeed);
+        return pointData;
+    }
+
+    private void createWtPointData(Windturbinetestingpointnew aveSpeedPoint, PointData pointData, double inDouble) {
+        pointData.setEdnaId(aveSpeedPoint.getCode());
+        pointData.setPointName(aveSpeedPoint.getName());
+        pointData.setPointValueInDouble(inDouble);
+        pointData.setPointValue(String.valueOf(inDouble));
+        pointData.setPointTime(currentDate.getTime());
+    }
 }

+ 2 - 3
realtime/generation-service/src/main/java/com/gyee/generation/task/SaticScheduleTask.java

@@ -55,7 +55,6 @@ public class SaticScheduleTask {
     public void history1()  {
 
         XxlJobHelper.log("电计量历史1调度程序执行开始!........");
-        String yesterdayStr = DateUtils.getYesterdayStr("yyyy-MM-dd");
         String date = DateUtils.toDate1(DateUtils.getCurrentDate());
         try {
             generationService.saveMeterpointValue(date,date);
@@ -72,7 +71,7 @@ public class SaticScheduleTask {
     @XxlJob("electricityMetering-history2")
     public void history2()  {
 
-        XxlJobHelper.log("电计量历史1调度程序执行开始!........");
+        XxlJobHelper.log("电计量历史2调度程序执行开始!........");
         String yesterdayStr = DateUtils.getYesterdayStr("yyyy-MM-dd");
         try {
             generationService.saveMeterpointValue(yesterdayStr,yesterdayStr);
@@ -80,7 +79,7 @@ public class SaticScheduleTask {
             e.printStackTrace();
         }
 
-        XxlJobHelper.log("电计量历史1调度任务处理完成!........");
+        XxlJobHelper.log("电计量历史2调度任务处理完成!........");
     }