瀏覽代碼

预测功率页面提交

wangb@gyee-china.com 1 年之前
父節點
當前提交
8b2d77cc7a

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

@@ -359,7 +359,7 @@ public class ContantXk {
     public static final String MX012 = "MX012";//通讯中断
     public static final String MX013 = "MX013";//设备离线
     public static final String FSYC="FSYC";
-    public static final String GZYC="GZYC";
+    public static final String GZYC = "GZYC";
 
 
 

+ 1 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/Forecast/ForecastController.java

@@ -1,7 +1,6 @@
 package com.gyee.runeconomy.controller.Forecast;
 
 import com.gyee.runeconomy.dto.AjaxResult;
-import com.gyee.runeconomy.dto.ForecastVo;
 import com.gyee.runeconomy.service.Forecast.ForecastService;
 import com.gyee.runeconomy.util.StringUtils;
 import io.swagger.annotations.Api;
@@ -14,9 +13,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
-import java.util.ArrayList;
 import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 
 @Controller
@@ -40,7 +37,7 @@ public class ForecastController {
     public AjaxResult forecast(String wpId, String beginDate,String endDate) throws Exception {
 
 
-        List<ForecastVo> resultList = new ArrayList<>();
+        Map<String, Object>  resultList = new LinkedHashMap<>();
         if (StringUtils.notEmp(wpId)) {
             resultList = forecastService.getcockpit(wpId,beginDate,endDate);
         }

+ 683 - 86
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Forecast/ForecastService.java

@@ -3,10 +3,12 @@ package com.gyee.runeconomy.service.Forecast;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.util.DateUtils;
+import com.gyee.common.util.SortUtils;
 import com.gyee.runeconomy.dto.ForecastVo;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
 import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
+import com.gyee.runeconomy.model.auto.ProBasicProject;
 import com.gyee.runeconomy.service.auto.IProBasicPowerstationPointService;
 import com.gyee.runeconomy.util.StringUtils;
 import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
@@ -23,36 +25,260 @@ public class ForecastService {
     @Resource
     private IProBasicPowerstationPointService proBasicPowerstationPointService;
 
-    public List<ForecastVo> getcockpit(String wpId, String beginDate, String endDate) throws Exception {
+    public Map<String, Object> getcockpit(String wpId, String beginDate, String endDate) throws Exception {
 
         Date starttime = DateUtils.parseDate(beginDate);
         Date endtime = DateUtils.parseDate(endDate);
 
-        List<ProBasicPowerstation> wpls = CacheContext.wpls;
+        List<ProBasicPowerstation> station = new ArrayList<>();
+        for (ProBasicPowerstation wp1 : CacheContext.wpls) {
+            if (wpId.equals(wp1.getId())) {
+                station.add(wp1);
+            }
+        }
 
-        List<ForecastVo> vos = new ArrayList<ForecastVo>();
+        List<ProBasicProject> pjls = CacheContext.pjls;
 
+        List<ProBasicProject> pjllist = new ArrayList<>();
 
-//            ForecastVo vo = new ForecastVo();
-//            vo.setPjfs(0.0); //平均风速
-//            vo.setSjgl(0.0); //实际功率
-//            vo.setDqglyc(0.0); //短期功率预测
-//            vo.setCdqglyc(0.0); //超短期功率预测
-//            vo.setRnycgl(0.0); //日内预测功率
-//            vo.setHours(i);  //时间戳
-//            vo.setName(wpId);
-//            vos.add(vo);
+        for (ProBasicProject pj : pjls) {
+            if (wpId.equals(pj.getWindpowerstationId())) {
+                pjllist.add(pj);
+            }
+        }
 
+        List<ForecastVo> vos = null;
+        Map<String, Object> map = new LinkedHashMap<>();
         ProBasicPowerstationPoint pjfs = null;
         ProBasicPowerstationPoint fsyc = null;
         ProBasicPowerstationPoint ycgl = null;
         ProBasicPowerstationPoint sjgl = null;
         ProBasicPowerstationPoint llgl = null;
 
-        for (ProBasicPowerstation wp : wpls) {
-            if (wpId.equals(wp.getId())) {
+        if (wpId.contains("PTZ") | wpId.contains("NJL") | wpId.contains("SY")) {
+            for (ProBasicProject wp : pjllist) {
+                vos = new ArrayList<>();
+                if (wpId.endsWith("FDC_STA")) {
+                    pjfs = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJFS15);
+                    ycgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.ZYCGL);
+                    sjgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJGL15);
+                    llgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.SSZLLGL);
+                    fsyc = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.FSYC);
+                }
+                if (wpId.endsWith("GDC_STA")) {
+                    pjfs = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJGZD15);
+                    fsyc = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.GZYC);
+                    ycgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.ZYCGL);
+                    sjgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJGL15);
+                    llgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.SSZLLGL);
+                }
+                List<PointData> pjfsls = edosUtil.getHistoryDatasSnap(pjfs, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                List<PointData> fsycls = edosUtil.getHistoryDatasSnap(fsyc, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                List<PointData> ycglls = edosUtil.getHistoryDatasSnap(ycgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                List<PointData> llglls = edosUtil.getHistoryDatasSnap(llgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                double temp1 = 0;
+                double temp2 = 0;
+                double temp3 = 0;
+                double temp4 = 0;
+                double temp5 = 0;
+                for (int i = 0; i < pjfsls.size(); i++) {
 
+                    ForecastVo vo = new ForecastVo();
+                    vo.setPjfs(0.0); //平均风速
+                    vo.setYcfs(0.0); //预测风速
+                    vo.setSjgl(0.0); //实际功率
+                    vo.setYcgl(0.0); //功率预测
+                    vo.setLlgl(0.0); //理论功率
+                    vo.setHours(2023L);  //时间戳
+                    vo.setName(wpId);
+
+                    temp1 = pjfsls.get(i).getPointValueInDouble();
+                    vo.setPjfs(StringUtils.round(temp1, 2));
+
+                    if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                        temp2 = fsycls.get(i).getPointValueInDouble();
+                        vo.setYcfs(StringUtils.round(temp2, 2));
+                    }
+                    temp3 = ycglls.get(i).getPointValueInDouble();
+                    vo.setYcgl(StringUtils.round(temp3, 2));
+
+                    temp4 = sjglls.get(i).getPointValueInDouble();
+                    vo.setSjgl(StringUtils.round(temp4 /1000, 2));
+
+                    temp5 = llglls.get(i).getPointValueInDouble();
+                    vo.setLlgl(StringUtils.round(temp5 /1000, 2));
 
+                    vo.setHours(pjfsls.get(i).getPointTime());
+
+                    vo.setName(wp.getAname());
+                    vo.setId(wpId);
+
+                    vos.add(vo);
+                }
+                map.put(wp.getId(), vos);
+            }
+
+
+        } else if (wpId.contains("GJY") | wpId.contains("TZ")) {
+            for (ProBasicProject wp : pjllist) {
+                List<ForecastVo> vos1 = new ArrayList<>();
+                List<ForecastVo> vos2 = new ArrayList<>();
+                if (wpId.endsWith("FDC_STA")) {
+                    pjfs = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJFS15);
+                    ycgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.ZYCGL);
+                    sjgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJGL15);
+                    llgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.SSZLLGL);
+                    fsyc = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.FSYC);
+                }
+                if (wpId.endsWith("GDC_STA")) {
+                    pjfs = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJGZD15);
+                    fsyc = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.GZYC);
+                    ycgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.ZYCGL);
+                    sjgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJGL15);
+                    llgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.SSZLLGL);
+                }
+                List<PointData> pjfsls = edosUtil.getHistoryDatasSnap(pjfs, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                List<PointData> fsycls = edosUtil.getHistoryDatasSnap(fsyc, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                List<PointData> ycglls = edosUtil.getHistoryDatasSnap(ycgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                List<PointData> llglls = edosUtil.getHistoryDatasSnap(llgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+
+
+                double temp1 = 0;
+                double temp2 = 0;
+                double temp3 = 0;
+                double temp4 = 0;
+                double temp5 = 0;
+
+                //不包含高家堰三期和天镇五期进入此循环(方便进行后续累加)
+                if (!wp.getId().equals("SXJ_KGDL_GJYF03_EG") && !wp.getId().equals("SXJ_KGDL_TZG05_EG")) {
+                    for (int i = 0; i < pjfsls.size(); i++) {
+                        ForecastVo vo = new ForecastVo();
+                        vo.setPjfs(0.0); //平均风速
+                        vo.setYcfs(0.0); //预测风速
+                        vo.setSjgl(0.0); //实际功率
+                        vo.setYcgl(0.0); //功率预测
+                        vo.setLlgl(0.0); //理论功率
+                        vo.setHours(2023L);  //时间戳
+                        vo.setName(wpId);
+
+                        vo.setHours(pjfsls.get(i).getPointTime());
+                        if (wpId.contains("GJY")) {
+                            vo.setName("平鲁高家堰一期项目");
+                        } else if (wpId.contains("TZ")) {
+                            vo.setName("天镇一期项目");
+                        }
+                        vo.setId(wpId);
+
+                        temp1 = pjfsls.get(i).getPointValueInDouble();
+                        vo.setPjfs(StringUtils.round(temp1, 2));
+
+                        temp3 = ycglls.get(i).getPointValueInDouble();
+                        vo.setYcgl(StringUtils.round(temp3, 2));
+
+                        temp4 = sjglls.get(i).getPointValueInDouble();
+                        vo.setSjgl(StringUtils.round(temp4 /1000, 2));
+
+                        temp5 = llglls.get(i).getPointValueInDouble();
+                        vo.setLlgl(StringUtils.round(temp5 /1000, 2));
+
+                        if (fsycls.size() == sjglls.size()) {
+                            if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                                temp2 = fsycls.get(i).getPointValueInDouble();
+                                vo.setYcfs(StringUtils.round(temp2, 2));
+                            }
+                        }
+
+                        vos1.add(vo);
+                    }
+                } else {
+                    for (int i = 0; i < pjfsls.size(); i++) {
+
+                        ForecastVo vo1 = new ForecastVo();
+                        vo1.setPjfs(0.0); //平均风速
+                        vo1.setYcfs(0.0); //预测风速
+                        vo1.setSjgl(0.0); //实际功率
+                        vo1.setYcgl(0.0); //功率预测
+                        vo1.setLlgl(0.0); //理论功率
+                        vo1.setHours(2023L);  //时间戳
+                        vo1.setName(wpId);
+
+                        vo1.setHours(pjfsls.get(i).getPointTime());
+                        vo1.setName(wp.getAname());
+                        vo1.setId(wpId);
+
+                        temp1 = pjfsls.get(i).getPointValueInDouble();
+                        vo1.setPjfs(StringUtils.round(temp1, 2));
+
+                        temp3 = ycglls.get(i).getPointValueInDouble();
+                        vo1.setYcgl(StringUtils.round(temp3, 2));
+
+                        temp4 = sjglls.get(i).getPointValueInDouble();
+                        vo1.setSjgl(StringUtils.round(temp4 /1000, 2));
+
+                        temp5 = llglls.get(i).getPointValueInDouble();
+                        vo1.setLlgl(StringUtils.round(temp5 /1000, 2));
+
+                        if (fsycls.size() == sjglls.size()) {
+                            if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                                temp2 = fsycls.get(i).getPointValueInDouble();
+                                vo1.setYcfs(StringUtils.round(temp2, 2));
+                            }
+                        }
+                        vos2.add(vo1);
+                    }
+                }
+
+
+                if (wpId.contains("GJY")) {
+                    if (map.containsKey("SXJ_KGDL_GJYF01_EG") && !wp.getId().equals("SXJ_KGDL_GJYF03_EG")) {
+                        List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_GJYF01_EG");
+                        for (int i = 0; i < vos1.size(); i++) {
+                            ForecastVo previousVo1 = previousVos1.get(i);
+                            ForecastVo currentVo1 = vos1.get(i);
+                            currentVo1.setPjfs(previousVo1.getPjfs() + currentVo1.getPjfs() / 2);
+                            currentVo1.setYcfs(previousVo1.getYcfs() + currentVo1.getYcfs());
+                            currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
+                            currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
+                            currentVo1.setLlgl(previousVo1.getLlgl() + currentVo1.getLlgl());
+                        }
+                    }
+                } else if (wpId.contains("TZ")) {
+                    if (map.containsKey("SXJ_KGDL_TZG01_EG") && !wp.getId().equals("SXJ_KGDL_TZG05_EG")) {
+                        List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_TZG01_EG");
+                        for (int i = 0; i < vos1.size(); i++) {
+                            ForecastVo previousVo1 = previousVos1.get(i);
+                            ForecastVo currentVo1 = vos1.get(i);
+                            currentVo1.setPjfs(previousVo1.getPjfs() + currentVo1.getPjfs() / 4);
+                            currentVo1.setYcfs(previousVo1.getYcfs() + currentVo1.getYcfs());
+                            currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
+                            currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
+                            currentVo1.setLlgl(previousVo1.getLlgl() + currentVo1.getLlgl());
+                        }
+                    }
+                }
+
+                if (wpId.contains("GJY")) {
+                    if (!wp.getId().equals("SXJ_KGDL_GJYF03_EG")) {
+                        map.put("SXJ_KGDL_GJYF01_EG", vos1);
+                    }
+                }
+
+                if (wpId.contains("TZ")) {
+                    if (!wp.getId().equals("SXJ_KGDL_TZG05_EG")) {
+                        map.put("SXJ_KGDL_TZG01_EG", vos1);
+                    }
+                }
+
+                if (wp.getId().equals("SXJ_KGDL_GJYF03_EG") | wp.getId().equals("SXJ_KGDL_TZG05_EG")) {
+                    map.put(wp.getId(), vos2);
+                }
+            }
+
+        } else {
+            for (ProBasicPowerstation wp : station) {
+                vos = new ArrayList<>();
                 if (wpId.endsWith("FDC_STA")) {
                     pjfs = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.PJFS15);
                     fsyc = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.FSYC);
@@ -91,17 +317,21 @@ public class ForecastService {
                     temp1 = pjfsls.get(i).getPointValueInDouble();
                     vo.setPjfs(StringUtils.round(temp1, 2));
 
-                    temp2 = fsycls.get(i).getPointValueInDouble();
-                    vo.setYcfs(StringUtils.round(temp2, 2));
+                    if (fsycls.size() == sjglls.size()) {
+                        if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                            temp2 = fsycls.get(i).getPointValueInDouble();
+                            vo.setYcfs(StringUtils.round(temp2, 2));
+                        }
+                    }
 
                     temp3 = ycglls.get(i).getPointValueInDouble();
                     vo.setYcgl(StringUtils.round(temp3, 2));
 
                     temp4 = sjglls.get(i).getPointValueInDouble();
-                    vo.setSjgl(StringUtils.round(temp4, 2));
+                    vo.setSjgl(StringUtils.round(temp4 /1000, 2));
 
                     temp5 = llglls.get(i).getPointValueInDouble();
-                    vo.setLlgl(StringUtils.round(temp5, 2));
+                    vo.setLlgl(StringUtils.round(temp5 /1000, 2));
 
                     vo.setHours(pjfsls.get(i).getPointTime());
 
@@ -110,9 +340,12 @@ public class ForecastService {
 
                     vos.add(vo);
                 }
+                map.put(wp.getId(), vos);
             }
         }
-        return vos;
+
+
+        return map;
 
     }
 
@@ -121,86 +354,450 @@ public class ForecastService {
 
         Date starttime = DateUtils.parseDate(beginDate);
         Date endtime = DateUtils.parseDate(endDate);
-        Map<String, Object> map = new LinkedHashMap<>();
 
-        Map<String, Object> map1 = new LinkedHashMap<>();
+        String wpId = null;
+
+
+        List<ProBasicProject> pjls = CacheContext.pjls;
 
+        List<ProBasicProject> pjllist = null;
 
+        List<ProBasicPowerstation> wplLs = CacheContext.wpls;
+        SortUtils.sort(wplLs, "orderNum", SortUtils.ASC);
+
+        List<ForecastVo> vos = null;
+        Map<String, Object> map = new LinkedHashMap<>();
         ProBasicPowerstationPoint pjfs = null;
         ProBasicPowerstationPoint fsyc = null;
         ProBasicPowerstationPoint ycgl = null;
         ProBasicPowerstationPoint sjgl = null;
         ProBasicPowerstationPoint llgl = null;
 
+        for (ProBasicPowerstation Wp : wplLs) {
+            wpId = Wp.getId();
+            pjllist = new  ArrayList();
+            //得到此循环场站期次
+            for (ProBasicProject pj : pjls) {
+                if (wpId.equals(pj.getWindpowerstationId())) {
+                    pjllist.add(pj);
+                }
+            }
 
-        List<ProBasicPowerstation> wpls = CacheContext.wpls;
+            List<ProBasicPowerstation> station = new ArrayList<>();
+            for (ProBasicPowerstation wp1 : CacheContext.wpls) {
+                if (wpId.equals(wp1.getId())) {
+                    station.add(wp1);
+                }
+            }
 
-        String wpId = null;
+            if (wpId.contains("GJY") | wpId.contains("TZ_GDC_STA") | wpId.contains("PTZ_FDC_STA") | wpId.contains("NJL") | wpId.contains("SY")) {
+                for (ProBasicProject wp : pjllist) {
+                    List<ForecastVo> vos1 = new ArrayList<>();
+                    List<ForecastVo> vos2 = new ArrayList<>();
+                    List<ForecastVo> vos3 = new ArrayList<>();
+                    List<ForecastVo> vos4 = new ArrayList<>();
+                    List<ForecastVo> vos5 = new ArrayList<>();
+
+                    // 在每次循环开始前将变量置为null
+                    pjfs = null;
+                    fsyc = null;
+                    ycgl = null;
+                    sjgl = null;
+                    llgl = null;
+
+                    if (wpId.endsWith("FDC_STA") && type.equals("F")) {
+                        pjfs = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJFS15);
+                        ycgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.ZYCGL);
+                        sjgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJGL15);
+                        llgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.SSZLLGL);
+                        fsyc = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.FSYC);
+                    }
+                    if (wpId.endsWith("GDC_STA") && type.equals("G")) {
+                        pjfs = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJGZD15);
+                        fsyc = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.GZYC);
+                        ycgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.ZYCGL);
+                        sjgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.PJGL15);
+                        llgl = proBasicPowerstationPointService.getPowerstationPoint(wp.getId(), ContantXk.SSZLLGL);
+                    }
+
+                    if (pjfs != null && sjgl != null) {
+                        List<PointData> pjfsls = edosUtil.getHistoryDatasSnap(pjfs, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                        List<PointData> fsycls = edosUtil.getHistoryDatasSnap(fsyc, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                        List<PointData> ycglls = edosUtil.getHistoryDatasSnap(ycgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                        List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                        List<PointData> llglls = edosUtil.getHistoryDatasSnap(llgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+
+
+                        double temp1 = 0;
+                        double temp2 = 0;
+                        double temp3 = 0;
+                        double temp4 = 0;
+                        double temp5 = 0;
+
+                        if (wpId.contains("GJY")) {
+                            for (int i = 0; i < pjfsls.size(); i++) {
+                                ForecastVo vo = new ForecastVo();
+                                vo.setPjfs(0.0); //平均风速
+                                vo.setYcfs(0.0); //预测风速
+                                vo.setSjgl(0.0); //实际功率
+                                vo.setYcgl(0.0); //功率预测
+                                vo.setLlgl(0.0); //理论功率
+                                vo.setHours(2023L);  //时间戳
+                                vo.setName(wpId);
+
+                                vo.setHours(pjfsls.get(i).getPointTime());
+                                vo.setName("平鲁高家堰风电场");
+
+                                vo.setId(wpId);
+
+                                temp1 = pjfsls.get(i).getPointValueInDouble();
+                                vo.setPjfs(StringUtils.round(temp1, 2));
+
+                                temp3 = ycglls.get(i).getPointValueInDouble();
+                                vo.setYcgl(StringUtils.round(temp3, 2));
+
+                                temp4 = sjglls.get(i).getPointValueInDouble();
+                                vo.setSjgl(StringUtils.round(temp4 /1000, 2));
+
+                                temp5 = llglls.get(i).getPointValueInDouble();
+                                vo.setLlgl(StringUtils.round(temp5 /1000, 2));
+
+                                if (fsycls.size() == sjglls.size()) {
+                                    if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                                        temp2 = fsycls.get(i).getPointValueInDouble();
+                                        vo.setYcfs(StringUtils.round(temp2, 2));
+                                    }
+                                }
+
+                                vos1.add(vo);
+                            }
+                        }
+
+                        if (wpId.contains("TZ_GDC_STA")) {
+                            for (int i = 0; i < pjfsls.size(); i++) {
+                                ForecastVo vo2 = new ForecastVo();
+                                vo2.setPjfs(0.0); //平均风速
+                                vo2.setYcfs(0.0); //预测风速
+                                vo2.setSjgl(0.0); //实际功率
+                                vo2.setYcgl(0.0); //功率预测
+                                vo2.setLlgl(0.0); //理论功率
+                                vo2.setHours(2023L);  //时间戳
+                                vo2.setName(wpId);
+
+                                vo2.setHours(pjfsls.get(i).getPointTime());
+                                vo2.setName("天镇电站");
+                                vo2.setId(wpId);
+
+                                temp1 = pjfsls.get(i).getPointValueInDouble();
+                                vo2.setPjfs(StringUtils.round(temp1, 2));
+
+                                temp3 = ycglls.get(i).getPointValueInDouble();
+                                vo2.setYcgl(StringUtils.round(temp3, 2));
+
+                                temp4 = sjglls.get(i).getPointValueInDouble();
+                                vo2.setSjgl(StringUtils.round(temp4 /1000, 2));
+
+                                temp5 = llglls.get(i).getPointValueInDouble();
+                                vo2.setLlgl(StringUtils.round(temp5 /1000, 2));
+
+                                if (fsycls.size() == sjglls.size()) {
+                                    if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                                        temp2 = fsycls.get(i).getPointValueInDouble();
+                                        vo2.setYcfs(StringUtils.round(temp2, 2));
+                                    }
+                                }
+
+                                vos2.add(vo2);
+                            }
+                        }
+
+                        if (wpId.contains("PTZ_FDC_STA")) {
+                            for (int i = 0; i < pjfsls.size(); i++) {
+                                ForecastVo vo3 = new ForecastVo();
+                                vo3.setPjfs(0.0); //平均风速
+                                vo3.setYcfs(0.0); //预测风速
+                                vo3.setSjgl(0.0); //实际功率
+                                vo3.setYcgl(0.0); //功率预测
+                                vo3.setLlgl(0.0); //理论功率
+                                vo3.setHours(2023L);  //时间戳
+                                vo3.setName(wpId);
+
+                                vo3.setHours(pjfsls.get(i).getPointTime());
+
+                                vo3.setName("寿阳平头镇风电场");
+
+                                vo3.setId(wpId);
+
+                                temp1 = pjfsls.get(i).getPointValueInDouble();
+                                vo3.setPjfs(StringUtils.round(temp1, 2));
+
+                                temp3 = ycglls.get(i).getPointValueInDouble();
+                                vo3.setYcgl(StringUtils.round(temp3, 2));
+
+                                temp4 = sjglls.get(i).getPointValueInDouble();
+                                vo3.setSjgl(StringUtils.round(temp4 /1000, 2));
+
+                                temp5 = llglls.get(i).getPointValueInDouble();
+                                vo3.setLlgl(StringUtils.round(temp5 /1000, 2));
+
+                                if (fsycls.size() == sjglls.size()) {
+                                    if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                                        temp2 = fsycls.get(i).getPointValueInDouble();
+                                        vo3.setYcfs(StringUtils.round(temp2, 2));
+                                    }
+                                }
+
+                                vos3.add(vo3);
+                            }
+                        }
+
+                        if (wpId.contains("NJL")) {
+                            for (int i = 0; i < pjfsls.size(); i++) {
+                                ForecastVo vo4 = new ForecastVo();
+                                vo4.setPjfs(0.0); //平均风速
+                                vo4.setYcfs(0.0); //预测风速
+                                vo4.setSjgl(0.0); //实际功率
+                                vo4.setYcgl(0.0); //功率预测
+                                vo4.setLlgl(0.0); //理论功率
+                                vo4.setHours(2023L);  //时间戳
+                                vo4.setName(wpId);
+
+                                vo4.setHours(pjfsls.get(i).getPointTime());
+
+                                vo4.setName("朔城牛家岭风电场");
+
+                                vo4.setId(wpId);
+
+                                temp1 = pjfsls.get(i).getPointValueInDouble();
+                                vo4.setPjfs(StringUtils.round(temp1, 2));
+
+                                temp3 = ycglls.get(i).getPointValueInDouble();
+                                vo4.setYcgl(StringUtils.round(temp3, 2));
+
+                                temp4 = sjglls.get(i).getPointValueInDouble();
+                                vo4.setSjgl(StringUtils.round(temp4 /1000, 2));
+
+                                temp5 = llglls.get(i).getPointValueInDouble();
+                                vo4.setLlgl(StringUtils.round(temp5 /1000, 2));
+
+                                if (fsycls.size() == sjglls.size()) {
+                                    if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                                        temp2 = fsycls.get(i).getPointValueInDouble();
+                                        vo4.setYcfs(StringUtils.round(temp2, 2));
+                                    }
+                                }
+
+                                vos4.add(vo4);
+                            }
+                        }
+
+                        if (wpId.contains("SY")) {
+                            for (int i = 0; i < pjfsls.size(); i++) {
+                                ForecastVo vo5 = new ForecastVo();
+                                vo5.setPjfs(0.0); //平均风速
+                                vo5.setYcfs(0.0); //预测风速
+                                vo5.setSjgl(0.0); //实际功率
+                                vo5.setYcgl(0.0); //功率预测
+                                vo5.setLlgl(0.0); //理论功率
+                                vo5.setHours(2023L);  //时间戳
+                                vo5.setName(wpId);
+
+                                vo5.setHours(pjfsls.get(i).getPointTime());
+                                vo5.setName("山阴电站");
+                                vo5.setId(wpId);
+
+                                temp1 = pjfsls.get(i).getPointValueInDouble();
+                                vo5.setPjfs(StringUtils.round(temp1, 2));
+
+                                temp3 = ycglls.get(i).getPointValueInDouble();
+                                vo5.setYcgl(StringUtils.round(temp3, 2));
+
+                                temp4 = sjglls.get(i).getPointValueInDouble();
+                                vo5.setSjgl(StringUtils.round(temp4 /1000, 2));
+
+                                temp5 = llglls.get(i).getPointValueInDouble();
+                                vo5.setLlgl(StringUtils.round(temp5 /1000, 2));
+
+                                if (fsycls.size() == sjglls.size()) {
+                                    if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                                        temp2 = fsycls.get(i).getPointValueInDouble();
+                                        vo5.setYcfs(StringUtils.round(temp2, 2));
+                                    }
+                                }
+
+                                vos5.add(vo5);
+                            }
+                        }
+
+
+                        if (wpId.contains("GJY")) {
+                            if (map.containsKey("SXJ_KGDL_GJYF01_EG")) {
+                                List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_GJYF01_EG");
+                                for (int i = 0; i < vos1.size(); i++) {
+                                    ForecastVo previousVo1 = previousVos1.get(i);
+                                    ForecastVo currentVo1 = vos1.get(i);
+                                    currentVo1.setPjfs((previousVo1.getPjfs() + currentVo1.getPjfs()) / 3);
+                                    currentVo1.setYcfs((previousVo1.getYcfs() + currentVo1.getYcfs()) / 2);
+                                    currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
+                                    currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
+                                    currentVo1.setLlgl(previousVo1.getLlgl() + currentVo1.getLlgl());
+                                }
+                            }
+                        } else if (wpId.contains("TZ_GDC_STA")) {
+                            if (map.containsKey("SXJ_KGDL_TZG01_EG")) {
+                                List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_TZG01_EG");
+                                for (int i = 0; i < vos2.size(); i++) {
+                                    ForecastVo previousVo1 = previousVos1.get(i);
+                                    ForecastVo currentVo1 = vos2.get(i);
+                                    currentVo1.setPjfs((previousVo1.getPjfs() + currentVo1.getPjfs()) / 5);
+                                    currentVo1.setYcfs((previousVo1.getYcfs() + currentVo1.getYcfs()) / 5);
+                                    currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
+                                    currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
+                                    currentVo1.setLlgl(previousVo1.getLlgl() + currentVo1.getLlgl());
+                                }
+                            }
+                        } else if (wpId.contains("SY")) {
+                            if (map.containsKey("SXJ_KGDL_SYG01_EG")) {
+                                List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_SYG01_EG");
+                                for (int i = 0; i < vos5.size(); i++) {
+                                    ForecastVo previousVo1 = previousVos1.get(i);
+                                    ForecastVo currentVo1 = vos5.get(i);
+                                    currentVo1.setPjfs((previousVo1.getPjfs() + currentVo1.getPjfs()) / 2);
+                                    currentVo1.setYcfs((previousVo1.getYcfs() + currentVo1.getYcfs()) / 2);
+                                    currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
+                                    currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
+                                    currentVo1.setLlgl(previousVo1.getLlgl() + currentVo1.getLlgl());
+                                }
+                            }
+                        } else if (wpId.contains("NJL")) {
+                            if (map.containsKey("SXJ_KGDL_NJLF01_EG")) {
+                                List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_NJLF01_EG");
+                                for (int i = 0; i < vos4.size(); i++) {
+                                    ForecastVo previousVo1 = previousVos1.get(i);
+                                    ForecastVo currentVo1 = vos4.get(i);
+                                    currentVo1.setPjfs((previousVo1.getPjfs() + currentVo1.getPjfs()) / 2);
+                                    currentVo1.setYcfs((previousVo1.getYcfs() + currentVo1.getYcfs()) / 2);
+                                    currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
+                                    currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
+                                    currentVo1.setLlgl(previousVo1.getLlgl() + currentVo1.getLlgl());
+                                }
+                            }
+                        } else if (wpId.contains("PTZ_FDC_STA")) {
+                            if (map.containsKey("SXJ_KGDL_PTZF01_EG")) {
+                                List<ForecastVo> previousVos1 = (List<ForecastVo>) map.get("SXJ_KGDL_PTZF01_EG");
+                                for (int i = 0; i < vos3.size(); i++) {
+                                    ForecastVo previousVo1 = previousVos1.get(i);
+                                    ForecastVo currentVo1 = vos3.get(i);
+                                    currentVo1.setPjfs((previousVo1.getPjfs() + currentVo1.getPjfs()) / 2);
+                                    currentVo1.setYcfs((previousVo1.getYcfs() + currentVo1.getYcfs()) / 2);
+                                    currentVo1.setSjgl(previousVo1.getSjgl() + currentVo1.getSjgl());
+                                    currentVo1.setYcgl(previousVo1.getYcgl() + currentVo1.getYcgl());
+                                    currentVo1.setLlgl(previousVo1.getLlgl() + currentVo1.getLlgl());
+                                }
+                            }
+                        }
+
+                        if (wpId.contains("GJY")) {
+                            map.put("SXJ_KGDL_GJY_FDC_STA", vos1);
+
+                        }
+                        if (wpId.contains("NJL")) {
+                            map.put("SXJ_KGDL_NJL_FDC_STA", vos4);
+
+                        }
+                        if (wpId.contains("PTZ_FDC_STA")) {
+                            map.put("SXJ_KGDL_PTZ_FDC_STA", vos3);
+
+                        }
+
+                        if (wpId.contains("TZ_GDC_STA")) {
+                            map.put("SXJ_KGDL_TZ_GDC_STA", vos2);
+                        }
+
+                        if (wpId.contains("SY")) {
+                            map.put("SXJ_KGDL_SY_FDC_STA", vos5);
+                        }
+
+                    }
+                }
 
-        for (ProBasicPowerstation wp : wpls) {
-            if (wp.getId().contains("MLJ")) continue;
-            wpId = wp.getId();
-            List<ForecastVo> vos = new ArrayList<ForecastVo>();
-
-            if (wpId.endsWith("FDC_STA") && type.equals("F")) {
-                pjfs = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.PJFS15);
-//            fsyc = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.FSYC);
-                ycgl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.ZYCGL);
-                sjgl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.PJGL15);
-                llgl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZLLGL);
-            }
-            if (wpId.endsWith("GDC_STA") && type.equals("G")) {
-                pjfs = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.PJGZD15);
-                fsyc = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.GZYC);
-                ycgl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.ZYCGL);
-                sjgl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.PJGL15);
-                llgl = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZLLGL);
-            }
-            List<PointData> pjfsls = edosUtil.getHistoryDatasSnap(pjfs, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
-//        List<PointData> fsycls = edosUtil.getHistoryDatasSnap(fsyc, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
-            List<PointData> ycglls = edosUtil.getHistoryDatasSnap(ycgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
-            List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
-            List<PointData> llglls = edosUtil.getHistoryDatasSnap(llgl, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
-            double temp1 = 0;
-            double temp2 = 0;
-            double temp3 = 0;
-            double temp4 = 0;
-            double temp5 = 0;
-            for (int i = 0; i < pjfsls.size(); i++) {
-
-                ForecastVo vo = new ForecastVo();
-                vo.setPjfs(0.0); //平均风速
-                vo.setYcfs(0.0); //平均风速
-                vo.setSjgl(0.0); //实际功率
-                vo.setYcgl(0.0); //功率预测
-                vo.setLlgl(0.0); //超短期功率预测
-                vo.setHours(2023L);  //时间戳
-                vo.setName("wpId");
-                vo.setId(wpId);
-
-                temp1 = pjfsls.get(i).getPointValueInDouble();
-                vo.setPjfs(StringUtils.round(temp1, 2));
-
-//            temp2 = fsycls.get(i).getPointValueInDouble();
-//            vo.setYcfs(StringUtils.round(temp2, 2));
-
-                temp3 = ycglls.get(i).getPointValueInDouble();
-                vo.setYcgl(StringUtils.round(temp3, 2));
-
-                temp4 = sjglls.get(i).getPointValueInDouble();
-                vo.setSjgl(StringUtils.round(temp4, 2));
-
-                temp5 = llglls.get(i).getPointValueInDouble();
-                vo.setLlgl(StringUtils.round(temp5, 2));
-
-                vo.setHours(pjfsls.get(i).getPointTime());
-
-                vo.setName(wp.getAname());
-
-                vo.setId(wp.getNemCode());
-                vos.add(vo);
+            } else {
+                for (ProBasicPowerstation wp : station) {
+                    vos = new ArrayList<>();
+
+                    ProBasicPowerstationPoint pjfs1 = null;
+                    ProBasicPowerstationPoint fsyc1 = null;
+                    ProBasicPowerstationPoint ycgl1 = null;
+                    ProBasicPowerstationPoint sjgl1 = null;
+                    ProBasicPowerstationPoint llgl1 = null;
+
+                    if (wpId.endsWith("FDC_STA") && type.equals("F")) {
+                        pjfs1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.PJFS15);
+                        fsyc1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.FSYC);
+                        ycgl1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.ZYCGL);
+                        sjgl1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.PJGL15);
+                        llgl1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZLLGL);
+                    }
+                    if (wpId.endsWith("GDC_STA") && type.equals("G")) {
+                        pjfs1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.PJGZD15);
+                        fsyc1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.GZYC);
+                        ycgl1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.ZYCGL);
+                        sjgl1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.PJGL15);
+                        llgl1 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.SSZLLGL);
+                    }
+                    if (pjfs1 != null && sjgl1 != null) {
+                        List<PointData> pjfsls = edosUtil.getHistoryDatasSnap(pjfs1, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                        List<PointData> fsycls = edosUtil.getHistoryDatasSnap(fsyc1, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                        List<PointData> ycglls = edosUtil.getHistoryDatasSnap(ycgl1, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                        List<PointData> sjglls = edosUtil.getHistoryDatasSnap(sjgl1, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                        List<PointData> llglls = edosUtil.getHistoryDatasSnap(llgl1, starttime.getTime() / 1000, endtime.getTime() / 1000, null, 900L);
+                        double temp1 = 0;
+                        double temp2 = 0;
+                        double temp3 = 0;
+                        double temp4 = 0;
+                        double temp5 = 0;
+                        for (int i = 0; i < pjfsls.size(); i++) {
+
+                            ForecastVo vo = new ForecastVo();
+                            vo.setPjfs(0.0); //平均风速
+                            vo.setYcfs(0.0); //平均风速
+                            vo.setSjgl(0.0); //实际功率
+                            vo.setYcgl(0.0); //功率预测
+                            vo.setLlgl(0.0); //超短期功率预测
+                            vo.setHours(2023L);  //时间戳
+                            vo.setName(wpId);
+
+                            temp1 = pjfsls.get(i).getPointValueInDouble();
+                            vo.setPjfs(StringUtils.round(temp1, 2));
+
+                            if (fsycls.size() == sjglls.size()) {
+                                if (fsycls != null && !fsycls.isEmpty() && fsycls.get(0).getPointName() != null) {
+                                    temp2 = fsycls.get(i).getPointValueInDouble();
+                                    vo.setYcfs(StringUtils.round(temp2, 2));
+                                }
+                            }
+
+                            temp3 = ycglls.get(i).getPointValueInDouble();
+                            vo.setYcgl(StringUtils.round(temp3, 2));
+
+                            temp4 = sjglls.get(i).getPointValueInDouble();
+                            vo.setSjgl(StringUtils.round(temp4 /1000, 2));
+
+                            temp5 = llglls.get(i).getPointValueInDouble();
+                            vo.setLlgl(StringUtils.round(temp5 /1000, 2));
+
+                            vo.setHours(pjfsls.get(i).getPointTime());
+
+                            vo.setName(wp.getAname());
+                            vo.setId(wpId);
+
+                            vos.add(vo);
+                        }
+                        map.put(wp.getId(), vos);
+
+                    }
+                }
             }
-            map.put(wp.getId(), vos);
         }
         return map;
     }