Forráskód Böngészése

添加72小时功率预测

wangchangsheng 3 éve
szülő
commit
afbef664fa

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 9 - 1
src/main/java/com/gyee/frame/common/spring/Constant.java


+ 3 - 0
src/main/java/com/gyee/frame/common/spring/InitialRunner.java

@@ -115,10 +115,13 @@ public class InitialRunner implements CommandLineRunner {
         Map<String, Object> ycmap = new HashMap<>();
 
         String[] ycPoints3 = Constant.TPOINT_QS3_YGCL4.split(",");
+        String[] ycPoints72 = Constant.TPOINT_QS3_YGCL72.split(",");
         //添加预测风速第一个点,存储到当前的历史值
         ycmap.put("cdq1", "SLFGL.NX_GD_QSF_YC_P1_L1_001_CDQ001");
+        ycmap.put("dq1","SLFGL.NX_GD_QSF_YC_P1_L1_001_CDQ001");//SLFGL.NX_GD_QSF_YC_P1_L1_001_DQ0001
         //添加预测功率后续预测点字符串数组,实时数据
         ycmap.put("cdq2", ycPoints3);
+        ycmap.put("dq2", ycPoints72);
 
         appendYcglMap.put("QS_FDC", ycmap);
 

+ 294 - 117
src/main/java/com/gyee/frame/service/websocket/RealPowerPushService.java

@@ -106,7 +106,7 @@ public class RealPowerPushService {
 
             cal.setTime(currentDate);
 
-            if (cal.get(Calendar.MINUTE) > 30) {
+            if (cal.get(Calendar.MINUTE) > 45) {
                 cal.set(Calendar.MINUTE, 0);
                 cal.add(Calendar.HOUR_OF_DAY, 1);
             } else {
@@ -115,14 +115,18 @@ public class RealPowerPushService {
 
             Date endDate = cal.getTime();
 
-            long pried = 1800l;
-            long num = DateUtils.hoursDiff(beginDate, endDate) * 2;
-            int cdqyc = 8; //未来4小时超短期预测
+            long pried = 3600l;
+            long pried72 = 3600l;
+            long num = DateUtils.hoursDiff(beginDate, endDate);
+            int cdqyc = 4; //未来4小时超短期预测
             String[] ycPoints1 = Constant.TPOINT_WP_FGLYC.split(",");
             String[] ycPoints2 = Constant.TPOINT_WP_FGLYC2.split(",");
+
+            String[] ycPoints4 = Constant.TPOINT_WP_FGLYC4.split(",");
+            String[] ycPoints5 = Constant.TPOINT_WP_FGLYC5.split(",");
             //String[] ycPoints3 = Constant.TPOINT_QS3_YGCL.split(",");
 
-            int length = 48;
+            int length = 72;
 
             for (int i = 0; i < length; i++) {
 
@@ -134,7 +138,7 @@ public class RealPowerPushService {
 //                vo.setValue4(0.0);// 预测功率
 //                vo.setValue5(0.0);// 保证功率
 //                vo.setValue6(0.0);// 平均风速
-//                vo.setValue7(0.0);// 72小时预测功率
+//                vo.setValue8(0.0);// 72小时预测功率
 //                vo.setValue9(0.0);// 最优功率律
 
                 vos.add(vo);
@@ -167,97 +171,181 @@ public class RealPowerPushService {
 
                     if (num > 0) {
                         WindPowerStationTestingPoint2 ycgl1 = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints1[0]);
+                        WindPowerStationTestingPoint2 dqycgl1 = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints4[0]);
 
+                        List<PointData> ycgl1Datas = null;
+                        List<PointData> dqycglDatas = null;
                         if (null != ycgl1) {
-                            List<PointData> datas = realApiUtil.getHistoryDatasSnap(ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
-                            if (!datas.isEmpty()) {
+                           ycgl1Datas = realApiUtil.getHistoryDatasSnap(ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
+                        }
+                        if (null != dqycgl1) {
+                            dqycglDatas = realApiUtil.getHistoryDatasSnap(ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried72);
+                        }
 
-                                if (InitialRunner.appendYcglMap.containsKey(station.getId())) {
-                                    Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(station.getId());
-                                    if (ycmap.containsKey("cdq1")) {
-                                        String qs3_ycgl1 = (String) ycmap.get("cdq1");
 
-                                        List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
+                        if (!dqycglDatas.isEmpty()){
+                            if (InitialRunner.appendYcglMap.containsKey(station.getId())){
+                                Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(station.getId());
+                                if (ycmap.containsKey("dq1")) {
+                                    String qs3_dq_ycgl1 = (String) ycmap.get("dq1");
+
+                                    List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_dq_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried72);
 
-                                        for (int j = 0; j < datas.size(); j++) {
+                                    for (int j = 0; j < dqycglDatas.size(); j++) {
 
-                                            vos.get(j).setTime(datas.get(j).getPointTime() * 1000);
-                                            vos.get(j).setValue4(StringUtils.round(datas.get(j).getPointValueInDouble() + qs3_datas.get(j).getPointValueInDouble(), 2));
-                                            if (j == datas.size() - 1) {
-                                                cal.setTime(new Date(datas.get(j).getPointTime() * 1000));
-                                            }
+                                        vos.get(j).setTime(dqycglDatas.get(j).getPointTime() * 1000);
+                                        vos.get(j).setValue8(StringUtils.round(dqycglDatas.get(j).getPointValueInDouble() + qs3_datas.get(j).getPointValueInDouble(), 2));
+                                        if (j == dqycglDatas.size() - 1) {
+                                            cal.setTime(new Date(dqycglDatas.get(j).getPointTime() * 1000));
                                         }
                                     }
+                                }
 
-                                } else {
-                                    for (int j = 0; j < datas.size(); j++) {
+                            }else {
+                                for (int j = 0; j < dqycglDatas.size(); j++) {
 
-                                        vos.get(j).setTime(datas.get(j).getPointTime() * 1000);
+                                    vos.get(j).setTime(dqycglDatas.get(j).getPointTime() * 1000);
 
-                                        double ycgl = (vos.get(j).getValue4() == null ? 0.0 : vos.get(j).getValue4()) + (datas.get(j) == null ? 0.0 : datas.get(j).getPointValueInDouble());
+                                    double ycgl = (vos.get(j).getValue4() == null ? 0.0 : vos.get(j).getValue4()) + (dqycglDatas.get(j) == null ? 0.0 : dqycglDatas.get(j).getPointValueInDouble());
 
-                                        vos.get(j).setValue4(StringUtils.round(ycgl, 2));
+                                    vos.get(j).setValue8(StringUtils.round(ycgl, 2));
 
-                                        if (j == datas.size() - 1) {
-                                            cal.setTime(new Date(datas.get(j).getPointTime() * 1000));
-                                        }
+                                    if (j == dqycglDatas.size() - 1) {
+                                        cal.setTime(new Date(dqycglDatas.get(j).getPointTime() * 1000));
                                     }
                                 }
+                            }
 
-                                int subresult = 0;
-                                int total = 0;
+                            int dqsubresult = 0;
+                            int dqtotal = 0;
 
-                                if (length > datas.size()) {
-                                    subresult = length - datas.size();
-                                    if (subresult >= cdqyc) {
-                                        subresult = cdqyc;
-                                    }
+                            if (length > dqycglDatas.size()) {
+                                dqsubresult = length - dqycglDatas.size();
 
-                                    if (InitialRunner.appendYcglMap.containsKey(station.getId())) {
-                                        Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(station.getId());
-                                        if (ycmap.containsKey("cdq2")) {
-                                            String[] ycPoints3 = (String[]) ycmap.get("cdq2");
-                                            for (int i = 0; i < subresult; i++) {
-                                                cal.add(Calendar.MINUTE, 30);
-                                                vos.get(datas.size() + i).setTime(cal.getTime().getTime());
-                                                String qs3_ycgl = ycPoints3[i];
-                                                WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints2[i]);
-
-                                                vos.get(datas.size() + i).setValue4(StringUtils.round(realApiUtil.getRealData(ycglpoint).getPointValueInDouble() + realApiUtil.getRealData(qs3_ycgl).getPointValueInDouble(), 2));
-                                            }
+                                if (InitialRunner.appendYcglMap.containsKey(station.getId())) {
+                                    Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(station.getId());
+                                    if (ycmap.containsKey("dq2")) {
+                                        String[] ycPoints3 = (String[]) ycmap.get("dq2");
+                                        for (int i = 0; i < dqsubresult; i++) {
+                                            cal.add(Calendar.HOUR, 1);
+                                            vos.get(dqycglDatas.size() + i).setTime(cal.getTime().getTime());
+                                            String qs3_ycgl = ycPoints3[i];
+                                            WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints5[i]);
+                                            vos.get(dqycglDatas.size() + i).setValue8(StringUtils.round(realApiUtil.getRealData(ycglpoint).getPointValueInDouble() + realApiUtil.getRealData(qs3_ycgl).getPointValueInDouble(), 2));
                                         }
+                                    }
 
-                                    } else {
-                                        for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.MINUTE, 30);
-                                            vos.get(datas.size() + i).setTime(cal.getTime().getTime());
+                                }else {
+                                    for (int i = 0; i < dqsubresult; i++) {
+                                        cal.add(Calendar.HOUR, 1);
+                                        vos.get(dqycglDatas.size() + i).setTime(cal.getTime().getTime());
 
-                                            WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints2[i]);
+                                        WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints5[i]);
+
+                                        double ycgl = realApiUtil.getRealData(ycglpoint).getPointValueInDouble();
+
+                                        ycgl = (vos.get(dqycglDatas.size() + i).getValue8() == null ? 0.0 : vos.get(dqycglDatas.size() + i).getValue8()) + ycgl;
+
+                                        vos.get(dqycglDatas.size() + i).setValue8(StringUtils.round(ycgl, 2));
+                                    }
+                                }
+                                dqtotal = dqycglDatas.size() + dqsubresult;
+                                dqsubresult = length - dqtotal;
+
+                                if (dqsubresult > 0)
+                                    for (int i = 0; i < dqsubresult; i++) {
+                                        cal.add(Calendar.HOUR, 1);
+                                        vos.get(dqtotal + i).setTime(cal.getTime().getTime());
+                                        vos.get(dqtotal + i).setValue8(null);
+                                    }
+                            }
+                        }
 
-                                            double ycgl = realApiUtil.getRealData(ycglpoint).getPointValueInDouble();
+                        if (!ycgl1Datas.isEmpty()) {
 
-                                            ycgl = (vos.get(datas.size() + i).getValue4() == null ? 0.0 : vos.get(datas.size() + i).getValue4()) + ycgl;
+                            if (InitialRunner.appendYcglMap.containsKey(station.getId())) {
+                                Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(station.getId());
+                                if (ycmap.containsKey("cdq1")) {
+                                    String qs3_ycgl1 = (String) ycmap.get("cdq1");
 
-                                            vos.get(datas.size() + i).setValue4(StringUtils.round(ycgl, 2));
+                                    List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
+
+                                    for (int j = 0; j < ycgl1Datas.size(); j++) {
+
+                                        vos.get(j).setTime(ycgl1Datas.get(j).getPointTime() * 1000);
+                                        vos.get(j).setValue4(StringUtils.round(ycgl1Datas.get(j).getPointValueInDouble() + qs3_datas.get(j).getPointValueInDouble(), 2));
+                                        if (j == ycgl1Datas.size() - 1) {
+                                            cal.setTime(new Date(ycgl1Datas.get(j).getPointTime() * 1000));
                                         }
                                     }
+                                }
+
+                            } else {
+                                for (int j = 0; j < ycgl1Datas.size(); j++) {
+
+                                    vos.get(j).setTime(ycgl1Datas.get(j).getPointTime() * 1000);
+
+                                    double ycgl = (vos.get(j).getValue4() == null ? 0.0 : vos.get(j).getValue4()) + (ycgl1Datas.get(j) == null ? 0.0 : ycgl1Datas.get(j).getPointValueInDouble());
+
+                                    vos.get(j).setValue4(StringUtils.round(ycgl, 2));
+
+                                    if (j == ycgl1Datas.size() - 1) {
+                                        cal.setTime(new Date(ycgl1Datas.get(j).getPointTime() * 1000));
+                                    }
+                                }
+                            }
 
+                            int subresult = 0;
+                            int total = 0;
 
-                                    total = datas.size() + subresult;
-                                    subresult = length - (total);
+                            if (length > ycgl1Datas.size()) {
+                                subresult = length - ycgl1Datas.size();
+                                if (subresult >= cdqyc) {
+                                    subresult = cdqyc;
+                                }
 
-                                    if (subresult > 0)
+                                if (InitialRunner.appendYcglMap.containsKey(station.getId())) {
+                                    Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(station.getId());
+                                    if (ycmap.containsKey("cdq2")) {
+                                        String[] ycPoints3 = (String[]) ycmap.get("cdq2");
                                         for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.MINUTE, 30);
-                                            vos.get(total + i).setTime(cal.getTime().getTime());
-                                            vos.get(total + i).setValue4(null);
+                                            cal.add(Calendar.HOUR, 1);
+                                            vos.get(ycgl1Datas.size() + i).setTime(cal.getTime().getTime());
+                                            String qs3_ycgl = ycPoints3[i];
+                                            WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints2[i]);
+
+                                            vos.get(ycgl1Datas.size() + i).setValue4(StringUtils.round(realApiUtil.getRealData(ycglpoint).getPointValueInDouble() + realApiUtil.getRealData(qs3_ycgl).getPointValueInDouble(), 2));
                                         }
+                                    }
+
+                                } else {
+                                    for (int i = 0; i < subresult; i++) {
+                                        cal.add(Calendar.HOUR, 1);
+                                        vos.get(ycgl1Datas.size() + i).setTime(cal.getTime().getTime());
+
+                                        WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(station.getId(), ycPoints2[i]);
+
+                                        double ycgl = realApiUtil.getRealData(ycglpoint).getPointValueInDouble();
+
+                                        ycgl = (vos.get(ycgl1Datas.size() + i).getValue4() == null ? 0.0 : vos.get(ycgl1Datas.size() + i).getValue4()) + ycgl;
+
+                                        vos.get(ycgl1Datas.size() + i).setValue4(StringUtils.round(ycgl, 2));
+                                    }
                                 }
 
+
+                                total = ycgl1Datas.size() + subresult;
+                                subresult = length - (total);
+
+                                if (subresult > 0)
+                                    for (int i = 0; i < subresult; i++) {
+                                        cal.add(Calendar.HOUR, 1);
+                                        vos.get(total + i).setTime(cal.getTime().getTime());
+                                        vos.get(total + i).setValue4(null);
+                                    }
                             }
 
                         }
-
                     }
 
                 }
@@ -480,97 +568,183 @@ public class RealPowerPushService {
                     if (num > 0) {
                         WindPowerStationTestingPoint2 ycgl1 = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, ycPoints1[0]);
 
+                        WindPowerStationTestingPoint2 dqycgl1 = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, ycPoints4[0]);
+
+                        List<PointData> ycgl1Datas = null;
+                        List<PointData> dqycglDatas = null;
                         if (null != ycgl1) {
-                            List<PointData> datas = realApiUtil.getHistoryDatasSnap(ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
-                            if (!datas.isEmpty()) {
+                            ycgl1Datas = realApiUtil.getHistoryDatasSnap(ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
+                        }
+                        if (null != dqycgl1) {
+                            dqycglDatas = realApiUtil.getHistoryDatasSnap(ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried72);
+                        }
 
-                                if (InitialRunner.appendYcglMap.containsKey(id)) {
-                                    Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(id);
-                                    if (ycmap.containsKey("cdq1")) {
-                                        String qs3_ycgl1 = (String) ycmap.get("cdq1");
+                        if (!dqycglDatas.isEmpty()){
+                            if (InitialRunner.appendYcglMap.containsKey(id)) {
+                                Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(id);
+                                if (ycmap.containsKey("dq1")) {
+                                    String qs3_dq_ycgl1 = (String) ycmap.get("dq1");
 
-                                        List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
+                                    List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_dq_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num/2, pried72);
 
-                                        for (int j = 0; j < datas.size(); j++) {
+                                    for (int j = 0; j < dqycglDatas.size(); j++) {
 
-                                            vos.get(j).setTime(datas.get(j).getPointTime() * 1000);
-                                            vos.get(j).setValue4(StringUtils.round(datas.get(j).getPointValueInDouble() + qs3_datas.get(j).getPointValueInDouble(), 2));
-                                            if (j == datas.size() - 1) {
-                                                cal.setTime(new Date(datas.get(j).getPointTime() * 1000));
-                                            }
+                                        vos.get(j).setTime(dqycglDatas.get(j).getPointTime() * 1000);
+                                        vos.get(j).setValue8(StringUtils.round(dqycglDatas.get(j).getPointValueInDouble() + qs3_datas.get(j).getPointValueInDouble(), 2));
+                                        if (j == dqycglDatas.size() - 1) {
+                                            cal.setTime(new Date(dqycglDatas.get(j).getPointTime() * 1000));
                                         }
                                     }
+                                }
 
-                                } else {
-                                    for (int j = 0; j < datas.size(); j++) {
+                            }else {
+                                for (int j = 0; j < dqycglDatas.size(); j++) {
 
-                                        vos.get(j).setTime(datas.get(j).getPointTime() * 1000);
+                                    vos.get(j).setTime(dqycglDatas.get(j).getPointTime() * 1000);
 
-                                        double ycgl = (vos.get(j).getValue4() == null ? 0.0 : vos.get(j).getValue4()) + (datas.get(j) == null ? 0.0 : datas.get(j).getPointValueInDouble());
+                                    double ycgl = (vos.get(j).getValue4() == null ? 0.0 : vos.get(j).getValue4()) + (dqycglDatas.get(j) == null ? 0.0 : dqycglDatas.get(j).getPointValueInDouble());
 
-                                        vos.get(j).setValue4(StringUtils.round(ycgl, 2));
+                                    vos.get(j).setValue8(StringUtils.round(ycgl, 2));
 
-                                        if (j == datas.size() - 1) {
-                                            cal.setTime(new Date(datas.get(j).getPointTime() * 1000));
-                                        }
+                                    if (j == dqycglDatas.size() - 1) {
+                                        cal.setTime(new Date(dqycglDatas.get(j).getPointTime() * 1000));
                                     }
                                 }
+                            }
 
-                                int subresult = 0;
-                                int total = 0;
+                            int dqsubresult = 0;
+                            int dqtotal = 0;
 
-                                if (length > datas.size()) {
-                                    subresult = length - datas.size();
-                                    if (subresult >= cdqyc) {
-                                        subresult = cdqyc;
-                                    }
+                            if (length > dqycglDatas.size()) {
+                                dqsubresult = length - dqycglDatas.size();
 
-                                    if (InitialRunner.appendYcglMap.containsKey(id)) {
-                                        Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(id);
-                                        if (ycmap.containsKey("cdq2")) {
-                                            String[] ycPoints3 = (String[]) ycmap.get("cdq2");
-                                            for (int i = 0; i < subresult; i++) {
-                                                cal.add(Calendar.MINUTE, 30);
-                                                vos.get(datas.size() + i).setTime(cal.getTime().getTime());
-                                                String qs3_ycgl = ycPoints3[i];
-                                                WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, ycPoints2[i]);
-
-                                                vos.get(datas.size() + i).setValue4(StringUtils.round(realApiUtil.getRealData(ycglpoint).getPointValueInDouble() + realApiUtil.getRealData(qs3_ycgl).getPointValueInDouble(), 2));
-                                            }
+                                if (InitialRunner.appendYcglMap.containsKey(id)) {
+                                    Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(id);
+                                    if (ycmap.containsKey("dq2")) {
+                                        String[] ycPoints3 = (String[]) ycmap.get("dq2");
+                                        for (int i = 0; i < dqsubresult; i++) {
+                                            cal.add(Calendar.HOUR, 1);
+                                            vos.get(dqycglDatas.size() + i).setTime(cal.getTime().getTime());
+                                            String qs3_ycgl = ycPoints3[i];
+                                            WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, ycPoints5[i]);
+                                            vos.get(dqycglDatas.size() + i).setValue8(StringUtils.round(realApiUtil.getRealData(ycglpoint).getPointValueInDouble() + realApiUtil.getRealData(qs3_ycgl).getPointValueInDouble(), 2));
                                         }
+                                    }
 
-                                    } else {
-                                        for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.MINUTE, 30);
+                                }else {
+                                    for (int i = 0; i < dqsubresult; i++) {
+                                        cal.add(Calendar.HOUR, 1);
+                                        vos.get(dqycglDatas.size() + i).setTime(cal.getTime().getTime());
 
-                                            vos.get(datas.size() + i).setTime(cal.getTime().getTime());
+                                        WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, ycPoints5[i]);
 
-                                            WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, ycPoints2[i]);
+                                        double ycgl = realApiUtil.getRealData(ycglpoint).getPointValueInDouble();
+
+                                        ycgl = (vos.get(dqycglDatas.size() + i).getValue8() == null ? 0.0 : vos.get(dqycglDatas.size() + i).getValue8()) + ycgl;
+
+                                        vos.get(dqycglDatas.size() + i).setValue8(StringUtils.round(ycgl, 2));
+                                    }
+                                }
+                                dqtotal = dqycglDatas.size() + dqsubresult;
+                                dqsubresult = length - dqtotal;
+
+                                if (dqsubresult > 0)
+                                    for (int i = 0; i < dqsubresult; i++) {
+                                        cal.add(Calendar.HOUR, 1);
+                                        vos.get(dqtotal + i).setTime(cal.getTime().getTime());
+                                        vos.get(dqtotal + i).setValue8(null);
+                                    }
+                            }
+                        }
 
-                                            double ycgl = realApiUtil.getRealData(ycglpoint).getPointValueInDouble();
 
-                                            ycgl = (vos.get(datas.size() + i).getValue4() == null ? 0.0 : vos.get(datas.size() + i).getValue4()) + ycgl;
 
-                                            vos.get(datas.size() + i).setValue4(StringUtils.round(ycgl, 2));
+                        if (!ycgl1Datas.isEmpty()) {
+
+                            if (InitialRunner.appendYcglMap.containsKey(id)) {
+                                Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(id);
+                                if (ycmap.containsKey("cdq1")) {
+                                    String qs3_ycgl1 = (String) ycmap.get("cdq1");
+
+                                    List<PointData> qs3_datas = realApiUtil.getHistoryDatasSnap(qs3_ycgl1, beginDate.getTime() / 1000, endDate.getTime() / 1000, num, pried);
+
+                                    for (int j = 0; j < ycgl1Datas.size(); j++) {
+
+                                        vos.get(j).setTime(ycgl1Datas.get(j).getPointTime() * 1000);
+                                        vos.get(j).setValue4(StringUtils.round(ycgl1Datas.get(j).getPointValueInDouble() + qs3_datas.get(j).getPointValueInDouble(), 2));
+                                        if (j == ycgl1Datas.size() - 1) {
+                                            cal.setTime(new Date(ycgl1Datas.get(j).getPointTime() * 1000));
                                         }
                                     }
+                                }
+
+                            } else {
+                                for (int j = 0; j < ycgl1Datas.size(); j++) {
+
+                                    vos.get(j).setTime(ycgl1Datas.get(j).getPointTime() * 1000);
+
+                                    double ycgl = (vos.get(j).getValue4() == null ? 0.0 : vos.get(j).getValue4()) + (ycgl1Datas.get(j) == null ? 0.0 : ycgl1Datas.get(j).getPointValueInDouble());
+
+                                    vos.get(j).setValue4(StringUtils.round(ycgl, 2));
+
+                                    if (j == ycgl1Datas.size() - 1) {
+                                        cal.setTime(new Date(ycgl1Datas.get(j).getPointTime() * 1000));
+                                    }
+                                }
+                            }
 
+                            int subresult = 0;
+                            int total = 0;
 
-                                    total = datas.size() + subresult;
-                                    subresult = length - (total);
+                            if (length > ycgl1Datas.size()) {
+                                subresult = length - ycgl1Datas.size();
+                                if (subresult >= cdqyc) {
+                                    subresult = cdqyc;
+                                }
 
-                                    if (subresult > 0)
+                                if (InitialRunner.appendYcglMap.containsKey(id)) {
+                                    Map<String, Object> ycmap = InitialRunner.appendYcglMap.get(id);
+                                    if (ycmap.containsKey("cdq2")) {
+                                        String[] ycPoints3 = (String[]) ycmap.get("cdq2");
                                         for (int i = 0; i < subresult; i++) {
-                                            cal.add(Calendar.MINUTE, 30);
-                                            vos.get(total + i).setTime(cal.getTime().getTime());
-                                            vos.get(total + i).setValue4(null);
+                                            cal.add(Calendar.HOUR, 1);
+                                            vos.get(ycgl1Datas.size() + i).setTime(cal.getTime().getTime());
+                                            String qs3_ycgl = ycPoints3[i];
+                                            WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, ycPoints2[i]);
+
+                                            vos.get(ycgl1Datas.size() + i).setValue4(StringUtils.round(realApiUtil.getRealData(ycglpoint).getPointValueInDouble() + realApiUtil.getRealData(qs3_ycgl).getPointValueInDouble(), 2));
                                         }
+                                    }
+
+                                } else {
+                                    for (int i = 0; i < subresult; i++) {
+                                        cal.add(Calendar.HOUR, 1);
+
+                                        vos.get(ycgl1Datas.size() + i).setTime(cal.getTime().getTime());
+
+                                        WindPowerStationTestingPoint2 ycglpoint = windPowerstationTestingPointService.getWindPowerStationTestingPoint2(id, ycPoints2[i]);
+
+                                        double ycgl = realApiUtil.getRealData(ycglpoint).getPointValueInDouble();
+
+                                        ycgl = (vos.get(ycgl1Datas.size() + i).getValue4() == null ? 0.0 : vos.get(ycgl1Datas.size() + i).getValue4()) + ycgl;
+
+                                        vos.get(ycgl1Datas.size() + i).setValue4(StringUtils.round(ycgl, 2));
+                                    }
                                 }
 
+
+                                total = ycgl1Datas.size() + subresult;
+                                subresult = length - (total);
+
+                                if (subresult > 0)
+                                    for (int i = 0; i < subresult; i++) {
+                                        cal.add(Calendar.HOUR, 1);
+                                        vos.get(total + i).setTime(cal.getTime().getTime());
+                                        vos.get(total + i).setValue4(null);
+                                    }
                             }
 
                         }
-
                     }
                 }
 
@@ -623,7 +797,7 @@ public class RealPowerPushService {
                             }
 
                             if (!InitialRunner.wpmap.containsKey(id)) {
-                                cal.add(Calendar.MINUTE, 30);
+                                cal.add(Calendar.HOUR, 1);
                             }
                         }
 
@@ -785,6 +959,9 @@ public class RealPowerPushService {
     }
 
 
+
+
+
     public List<Object> findGLDetail(String id, String gltype) throws Exception {
 
         List<DataVo> vols = new ArrayList<DataVo>();