Sfoglia il codice sorgente

中心功率预测功能

tl 8 mesi fa
parent
commit
5ea15ecac7

+ 1 - 1
cpp-admin/src/main/java/com/cpp/web/controller/regulation/DqRegulationController.java

@@ -58,7 +58,7 @@ public class DqRegulationController {
 
         // 获取短期上报数据(原始数据)
         Map<String, Object> map = new HashMap<>();
-        List<ForecastPowerShortTermStation> forecastPowerShortTermStationList = forecastPowerShortTermStationService.findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(time, endTime, howLongAgo, stationCode);
+        List<ForecastPowerShortTermStation> forecastPowerShortTermStationList = forecastPowerShortTermStationService.findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(new Date(time), new Date(endTime), howLongAgo, stationCode);
         if (forecastPowerShortTermStationList.size()>0){
             Map<Long, BigDecimal> ysShortMap = new HashMap<>();
             for (ForecastPowerShortTermStation forecastPowerShortTermStation:forecastPowerShortTermStationList) {

+ 10 - 0
cpp-admin/src/main/java/com/cpp/web/controller/stationDataQuery/PowerStationStatusDataController.java

@@ -59,4 +59,14 @@ public class PowerStationStatusDataController {
                                        Long endTime) {
         return R.ok(powerStationStatusDataService.getCompositeData(stationCode, startTime, endTime));
     }
+
+
+    @ApiOperation(value = "中心测数据查询", notes = "中心测数据查询")
+    @GetMapping("/cloudDataQuery")
+    public R cloudDataQuery(Long startTime,
+                              Long endTime,
+                              Integer forecastHowLongAgo,
+                              String stationCode) {
+        return R.ok(powerStationStatusDataService.cloudDataQuery(new Date(startTime), new Date(endTime), forecastHowLongAgo, stationCode));
+    }
 }

+ 2 - 0
cpp-admin/src/main/java/com/cpp/web/service/cloud/ForecastPowerShortTermCloudService.java

@@ -27,4 +27,6 @@ public interface ForecastPowerShortTermCloudService extends IService<ForecastPow
     List<ForecastPowerShortTermCloud> findByStationCodeAndStartTimeAndEndTimeAndForecastManufactor(String stationCode, Date startTime, Date endTime, String forecastManufactor);
 
     List<ForecastPowerShortTermCloud> findByForecastTimeBetweenAndHowLongAgo(Date startTime, Date endTime, Integer howLongAgo);
+
+    List<ForecastPowerShortTermCloud> findByForecastTimeBetweenAndHowLongAgoAndStationCode(Date startTime, Date endTime, Integer howLongAgo, String stationCode);
 }

+ 14 - 1
cpp-admin/src/main/java/com/cpp/web/service/cloud/impl/ForecastPowerShortTermCloudServiceImpl.java

@@ -3,7 +3,6 @@ package com.cpp.web.service.cloud.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.cpp.web.domain.cloud.ForecastPowerShortTermCloud;
-import com.cpp.web.domain.cloud.ForecastPowerUltraShortTermCloud;
 import com.cpp.web.mapper.cloud.ForecastPowerShortTermCloudMapper;
 import com.cpp.web.service.cloud.ForecastPowerShortTermCloudService;
 import org.springframework.stereotype.Service;
@@ -60,4 +59,18 @@ public class ForecastPowerShortTermCloudServiceImpl extends ServiceImpl<Forecast
         return baseMapper.selectList(wrapper);
     }
 
+    @Override
+    public List<ForecastPowerShortTermCloud> findByForecastTimeBetweenAndHowLongAgoAndStationCode(Date startTime, Date endTime, Integer howLongAgo, String stationCode) {
+        QueryWrapper<ForecastPowerShortTermCloud> wrapper = new QueryWrapper<>();
+
+        if (stationCode != null && !stationCode.equals("")) {
+            wrapper.eq("station_code", stationCode);
+        }
+        if (startTime != null && !startTime.equals("") && endTime != null && !endTime.equals("")) {
+            wrapper.between("time", startTime, endTime);
+        }
+        wrapper.eq("forecast_how_long_ago", howLongAgo);
+        return list(wrapper);
+    }
+
 }

+ 1 - 1
cpp-admin/src/main/java/com/cpp/web/service/station/ForecastPowerShortTermStationService.java

@@ -33,7 +33,7 @@ public interface ForecastPowerShortTermStationService extends IService<ForecastP
      * @param stationCode 场站编号
      * @return
      */
-    List<ForecastPowerShortTermStation> findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(Long startTime, Long endTime, Integer howLongAgo, String stationCode);
+    List<ForecastPowerShortTermStation> findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(Date startTime, Date endTime, Integer howLongAgo, String stationCode);
 
     /**
      * 根据时间 提前多久预测 场站编号 预测厂家查询数据

+ 2 - 0
cpp-admin/src/main/java/com/cpp/web/service/station/PowerStationStatusDataService.java

@@ -34,4 +34,6 @@ public interface PowerStationStatusDataService extends IService<PowerStationStat
     List<PowerStationStatusData> findByTimeBetweenAndStationCode(Date pointStarTime, Date pointEndTime, String stationCode);
 
     List<PowerStationStatusData> findByTimeBetween(Date starTime, Date endTime);
+
+    Map<String,Object> cloudDataQuery(Date startTime, Date endTime, Integer forecastHowLongAgo, String stationCode);
 }

+ 3 - 0
cpp-admin/src/main/java/com/cpp/web/service/station/WeatherStationStatusDataService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.cpp.web.domain.station.WeatherStationStatusData;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 
@@ -18,4 +19,6 @@ public interface WeatherStationStatusDataService extends IService<WeatherStation
     Map<String, Object> findByStationCodeAndeTimeBetweenAndEquipmentId(String stationCode, Date startTime, Date endTime, String equipmentId);
 
     QueryWrapper<WeatherStationStatusData> getPageByStationCodeAndeTimeBetweenAndEquipmentId(String stationCode, Date startTime, Date endTime, String equipmentId);
+
+    List<WeatherStationStatusData> findByBetweenTimeAndStationCode(Date startTime, Date endTime, String stationCode);
 }

+ 3 - 0
cpp-admin/src/main/java/com/cpp/web/service/station/WindTowerStatusDataService.java

@@ -20,4 +20,7 @@ public interface WindTowerStatusDataService extends IService<WindTowerStatusData
     QueryWrapper<WindTowerStatusData> getByBetweenTimeAndStationCode(Date startTime, Date endTime, String stationCode);
 
     Map<String, Object> queryCharts(String stationCode, Date startTime, Date endTime, String equipmentId) throws Exception;
+
+    List<WindTowerStatusData> findByBetweenTimeAndStationCode(Date startTime, Date endTime, String stationCode);
+
 }

+ 2 - 2
cpp-admin/src/main/java/com/cpp/web/service/station/impl/ForecastPowerShortTermStationServiceImpl.java

@@ -85,14 +85,14 @@ public class ForecastPowerShortTermStationServiceImpl extends ServiceImpl<Foreca
 
 
     @Override
-    public List<ForecastPowerShortTermStation> findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(Long startTime, Long endTime, Integer howLongAgo, String stationCode) {
+    public List<ForecastPowerShortTermStation> findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(Date startTime, Date endTime, Integer howLongAgo, String stationCode) {
         QueryWrapper<ForecastPowerShortTermStation> wrapper = new QueryWrapper<>();
 
         if (stationCode != null && !stationCode.equals("")) {
             wrapper.eq("station_code", stationCode);
         }
         if (startTime != null && endTime != null) {
-            wrapper.between("time", new Date(startTime), new Date(endTime));
+            wrapper.between("time", startTime, endTime);
         }
         wrapper.eq("forecast_how_long_ago", howLongAgo);
         return baseMapper.selectList(wrapper);

+ 198 - 119
cpp-admin/src/main/java/com/cpp/web/service/station/impl/PowerStationStatusDataServiceImpl.java

@@ -3,6 +3,8 @@ package com.cpp.web.service.station.impl;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cpp.common.core.domain.entity.SysDictData;
+import com.cpp.common.utils.DictUtils;
 import com.cpp.system.service.ISysConfigService;
 import com.cpp.web.domain.BaseCppEntity;
 import com.cpp.web.domain.cloud.ForecastPowerShortTermCloud;
@@ -12,7 +14,9 @@ import com.cpp.web.service.cloud.ForecastPowerShortTermCloudService;
 import com.cpp.web.service.cloud.ForecastPowerUltraShortTermCloudService;
 import com.cpp.web.service.cloud.NwpCloudService;
 import com.cpp.web.service.station.*;
+import lombok.Data;
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang3.time.DateFormatUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -20,6 +24,7 @@ import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * cpp_power_station_status_data
@@ -34,7 +39,6 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
     private final ForecastPowerUltraShortTermCloudService forecastPowerUltraShortTermCloudService;
     private final ForecastPowerShortTermCloudService forecastPowerShortTermCloudService;
     private final ElectricFieldService electricFieldService;
-//    private final ForecastManufactorService forecastManufactorService;
     private final ForecastPowerShortTermStationService forecastPowerShortTermStationService;
     private final ForecastPowerShortTermRegulationService forecastPowerShortTermRegulationService;
     private final ForecastPowerShortTermSendService forecastPowerShortTermSendService;
@@ -78,7 +82,6 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
     }
 
 
-
     @Override
     public Map<String, List> getCenterData(Date startTime, Date endTime) {
         return null;
@@ -98,20 +101,20 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
 
         // 封装列表头信息
         List headList = new ArrayList();
-        Map<String,String> czmcHeadMap = new HashMap<>();
+        Map<String, String> czmcHeadMap = new HashMap<>();
         czmcHeadMap.put("field", "czmc");
         czmcHeadMap.put("label", "场站名称");
         headList.add(czmcHeadMap);
-        Map<String,String> timeHeadMap = new HashMap<>();
+        Map<String, String> timeHeadMap = new HashMap<>();
         timeHeadMap.put("field", "time");
         timeHeadMap.put("label", "时间");
         headList.add(timeHeadMap);
-        Map<String,String> hjHeadMap = new HashMap<>();
+        Map<String, String> hjHeadMap = new HashMap<>();
         hjHeadMap.put("field", "hj");
 
         Map<Long, WeatherStationStatusData> qxzMap = new HashMap<>();
         Map<Long, WindTowerStatusData> cftMap = new HashMap<>();
-        if ("E1".equals(stationType)){
+        if ("E1".equals(stationType)) {
             // 光伏
             hjHeadMap.put("label", "气象站总辐射(W/㎡)");
             // 查询气象站数据
@@ -122,8 +125,7 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
             for (WeatherStationStatusData weatherStationStatusData : list) {
                 qxzMap.put(weatherStationStatusData.getTime().getTime(), weatherStationStatusData);
             }
-        }
-        else{
+        } else {
             hjHeadMap.put("label", "测风塔轮毂风速(m/s)");
             // 查询测风塔数据
             QueryWrapper<WindTowerStatusData> wrapper = new QueryWrapper<>();
@@ -135,35 +137,35 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
             }
         }
         headList.add(hjHeadMap);
-        Map<String,String> sjglHeadMap = new HashMap<>();
+        Map<String, String> sjglHeadMap = new HashMap<>();
         sjglHeadMap.put("field", "sjgl");
         sjglHeadMap.put("label", "实际功率(MW)");
         headList.add(sjglHeadMap);
-        Map<String,String> kyglHeadMap = new HashMap<>();
+        Map<String, String> kyglHeadMap = new HashMap<>();
         kyglHeadMap.put("field", "kygl");
         kyglHeadMap.put("label", "可用功率(MW)");
         headList.add(kyglHeadMap);
-        Map<String,String> llglHeadMap = new HashMap<>();
+        Map<String, String> llglHeadMap = new HashMap<>();
         llglHeadMap.put("field", "llgl");
         llglHeadMap.put("label", "理论功率(MW)");
         headList.add(llglHeadMap);
-        Map<String,String> cdqysHeadMap = new HashMap<>();
+        Map<String, String> cdqysHeadMap = new HashMap<>();
         cdqysHeadMap.put("field", "cdqys");
         cdqysHeadMap.put("label", "超短期(MW)");
         headList.add(cdqysHeadMap);
-        Map<String,String> dqysHeadMap = new HashMap<>();
+        Map<String, String> dqysHeadMap = new HashMap<>();
         dqysHeadMap.put("field", "dqys");
         dqysHeadMap.put("label", "短期原始(MW)");
         headList.add(dqysHeadMap);
-        Map<String,String> dqzxHeadMap = new HashMap<>();
+        Map<String, String> dqzxHeadMap = new HashMap<>();
         dqzxHeadMap.put("field", "dqzx");
         dqzxHeadMap.put("label", "短期调控(MW)");
         headList.add(dqzxHeadMap);
-        Map<String,String> dqsbHeadMap = new HashMap<>();
+        Map<String, String> dqsbHeadMap = new HashMap<>();
         dqsbHeadMap.put("field", "dqsb");
         dqsbHeadMap.put("label", "短期上报(MW)");
         headList.add(dqsbHeadMap);
-        Map<String,String> czHeadMap = new HashMap<>();
+        Map<String, String> czHeadMap = new HashMap<>();
         czHeadMap.put("field", "cz");
         czHeadMap.put("label", "下发与上报差值");
         headList.add(czHeadMap);
@@ -188,10 +190,10 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
         Map<Long, ForecastPowerShortTermStation> dqysMap = new HashMap<>();
         String dqHowLongAgo = configService.selectConfigByKey("dqHowLongAgo");
         QueryWrapper dqysWrapper = new QueryWrapper<>();
-        dqysWrapper.eq("forecast_how_long_ago",Integer.parseInt(dqHowLongAgo));
-        dqysWrapper.eq("station_code",stationCode);
+        dqysWrapper.eq("forecast_how_long_ago", Integer.parseInt(dqHowLongAgo));
+        dqysWrapper.eq("station_code", stationCode);
         dqysWrapper.between("time", new Date(startTime), new Date(endTime));
-        List<ForecastPowerShortTermStation> forecastPowerShortTermStationList =forecastPowerShortTermStationService.list(dqysWrapper);
+        List<ForecastPowerShortTermStation> forecastPowerShortTermStationList = forecastPowerShortTermStationService.list(dqysWrapper);
         for (ForecastPowerShortTermStation forecastPowerShortTermStation : forecastPowerShortTermStationList) {
             dqysMap.put(forecastPowerShortTermStation.getTime().getTime(), forecastPowerShortTermStation);
         }
@@ -199,74 +201,69 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
         Map<Long, ForecastPowerUltraShortTermStation> cdqysMap = new HashMap<>();
         String cdqHowLongAgo = configService.selectConfigByKey("cdqHowLongAgo");
         QueryWrapper cdqysWrapper = new QueryWrapper<>();
-        cdqysWrapper.eq("forecast_how_long_ago",Integer.parseInt(dqHowLongAgo));
-        cdqysWrapper.eq("station_code",stationCode);
+        cdqysWrapper.eq("forecast_how_long_ago", Integer.parseInt(dqHowLongAgo));
+        cdqysWrapper.eq("station_code", stationCode);
         cdqysWrapper.between("time", new Date(startTime), new Date(endTime));
-        List<ForecastPowerUltraShortTermStation> forecastPowerUltraShortTermStationList =forecastPowerUltraShortTermStationService.list(dqysWrapper);
+        List<ForecastPowerUltraShortTermStation> forecastPowerUltraShortTermStationList = forecastPowerUltraShortTermStationService.list(dqysWrapper);
         for (ForecastPowerUltraShortTermStation forecastPowerUltraShortTermStation : forecastPowerUltraShortTermStationList) {
             cdqysMap.put(forecastPowerUltraShortTermStation.getTime().getTime(), forecastPowerUltraShortTermStation);
         }
         // 获取短期上报曲线
         Map<Long, ForecastPowerShortTermRegulation> dqsbMap = new HashMap<>();
         QueryWrapper dqsbWrapper = new QueryWrapper<>();
-        dqsbWrapper.eq("forecast_how_long_ago",Integer.parseInt(dqHowLongAgo));
-        dqsbWrapper.eq("station_code",stationCode);
+        dqsbWrapper.eq("forecast_how_long_ago", Integer.parseInt(dqHowLongAgo));
+        dqsbWrapper.eq("station_code", stationCode);
         dqsbWrapper.between("time", new Date(startTime), new Date(endTime));
-        List<ForecastPowerShortTermRegulation> forecastPowerShortTermRegulationList =forecastPowerShortTermRegulationService.list(dqysWrapper);
+        List<ForecastPowerShortTermRegulation> forecastPowerShortTermRegulationList = forecastPowerShortTermRegulationService.list(dqysWrapper);
         for (ForecastPowerShortTermRegulation forecastPowerShortTermRegulation : forecastPowerShortTermRegulationList) {
             dqsbMap.put(forecastPowerShortTermRegulation.getTime().getTime(), forecastPowerShortTermRegulation);
         }
         // 获取短期调控下发的中心曲线
         Map<Long, ForecastPowerShortTermSend> dqzxMap = new HashMap<>();
         QueryWrapper dqzxWrapper = new QueryWrapper<>();
-        dqzxWrapper.eq("forecast_how_long_ago",Integer.parseInt(dqHowLongAgo));
-        dqzxWrapper.eq("station_code",stationCode);
+        dqzxWrapper.eq("forecast_how_long_ago", Integer.parseInt(dqHowLongAgo));
+        dqzxWrapper.eq("station_code", stationCode);
         dqzxWrapper.between("time", new Date(startTime), new Date(endTime));
-        List<ForecastPowerShortTermSend> forecastPowerShortTermSendList =forecastPowerShortTermSendService.list(dqysWrapper);
+        List<ForecastPowerShortTermSend> forecastPowerShortTermSendList = forecastPowerShortTermSendService.list(dqysWrapper);
         for (ForecastPowerShortTermSend forecastPowerShortTermSend : forecastPowerShortTermSendList) {
             dqzxMap.put(forecastPowerShortTermSend.getTime().getTime(), forecastPowerShortTermSend);
         }
 
 
-        List<Map<String,Object>> tableList = new ArrayList();
-        int i=0;
+        List<Map<String, Object>> tableList = new ArrayList();
+        int i = 0;
         for (Long tempDateTime = startTime; tempDateTime < endTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
             // 封装列表的数据
-            Map<String,Object> map1 = new HashMap<>();
+            Map<String, Object> map1 = new HashMap<>();
             map1.put("czmc", electricField.getName());
             map1.put("time", DateUtil.format(new Date(tempDateTime), "yyyy-MM-dd HH:mm"));
             // 气象站或者测风塔数据
-            if ("E1".equals(stationType)){
+            if ("E1".equals(stationType)) {
                 if (qxzMap.get(tempDateTime) != null) {
                     WeatherStationStatusData weatherStationStatusData = qxzMap.get(tempDateTime);
-                    if (weatherStationStatusData.getGlobalR().compareTo(new BigDecimal("-99"))==0) {
-                        map1.put("hj",null);
+                    if (weatherStationStatusData.getGlobalR().compareTo(new BigDecimal("-99")) == 0) {
+                        map1.put("hj", null);
                         hjList.add(null);
-                    }
-                    else{
-                        map1.put("hj",weatherStationStatusData.getGlobalR().toString());
+                    } else {
+                        map1.put("hj", weatherStationStatusData.getGlobalR().toString());
                         hjList.add(weatherStationStatusData.getGlobalR().toString());
                     }
-                }
-                else {
-                    map1.put("hj",null);
+                } else {
+                    map1.put("hj", null);
                     hjList.add(null);
                 }
-            }
-            else{
+            } else {
                 if (cftMap.get(tempDateTime) != null) {
                     WindTowerStatusData windTowerStatusData = cftMap.get(tempDateTime);
-                    if (windTowerStatusData.getWsHubHeight().compareTo(new BigDecimal("-99"))==0) {
-                        map1.put("hj",null);
+                    if (windTowerStatusData.getWsHubHeight().compareTo(new BigDecimal("-99")) == 0) {
+                        map1.put("hj", null);
                         hjList.add(null);
-                    }
-                    else{
-                        map1.put("hj",windTowerStatusData.getWsHubHeight().toString());
+                    } else {
+                        map1.put("hj", windTowerStatusData.getWsHubHeight().toString());
                         hjList.add(windTowerStatusData.getWsHubHeight().toString());
                     }
-                }
-                else {
-                    map1.put("hj",null);
+                } else {
+                    map1.put("hj", null);
                     hjList.add(null);
                 }
             }
@@ -275,110 +272,98 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
             if (sjMap.get(tempDateTime) != null) {
                 // 实际功率
                 PowerStationStatusData powerStationStatusData = sjMap.get(tempDateTime);
-                if (powerStationStatusData.getRealValue().compareTo(new BigDecimal("-99"))==0) {
+                if (powerStationStatusData.getRealValue().compareTo(new BigDecimal("-99")) == 0) {
                     sjList.add(null);
-                    map1.put("sjgl",null);
-                }
-                else{
+                    map1.put("sjgl", null);
+                } else {
                     sjList.add(powerStationStatusData.getRealValue().toString());
-                    map1.put("sjgl",powerStationStatusData.getRealValue().toString());
+                    map1.put("sjgl", powerStationStatusData.getRealValue().toString());
                 }
-                if (powerStationStatusData.getAbleValue().compareTo(new BigDecimal("-99"))==0) {
+                if (powerStationStatusData.getAbleValue().compareTo(new BigDecimal("-99")) == 0) {
                     kyList.add(null);
-                    map1.put("kygl",null);
-                }
-                else{
+                    map1.put("kygl", null);
+                } else {
                     kyList.add(powerStationStatusData.getAbleValue().toString());
-                    map1.put("kygl",powerStationStatusData.getAbleValue().toString());
+                    map1.put("kygl", powerStationStatusData.getAbleValue().toString());
                 }
-                if (powerStationStatusData.getTheoryValue().compareTo(new BigDecimal("-99"))==0) {
+                if (powerStationStatusData.getTheoryValue().compareTo(new BigDecimal("-99")) == 0) {
                     llList.add(null);
-                    map1.put("llgl",null);
-                }
-                else{
+                    map1.put("llgl", null);
+                } else {
                     llList.add(powerStationStatusData.getTheoryValue().toString());
-                    map1.put("llgl",powerStationStatusData.getTheoryValue().toString());
+                    map1.put("llgl", powerStationStatusData.getTheoryValue().toString());
                 }
             } else {
-                map1.put("sjgl",null);
-                map1.put("kygl",null);
-                map1.put("llgl",null);
+                map1.put("sjgl", null);
+                map1.put("kygl", null);
+                map1.put("llgl", null);
                 sjList.add(null);
                 kyList.add(null);
                 llList.add(null);
             }
             // 封装超短期原始曲线list
-            if (cdqysMap.get(tempDateTime) !=null){
+            if (cdqysMap.get(tempDateTime) != null) {
                 ForecastPowerUltraShortTermStation forecastPowerUltraShortTermStation = cdqysMap.get(tempDateTime);
-                if (forecastPowerUltraShortTermStation.getFpValue().compareTo(new BigDecimal("-99"))==0) {
+                if (forecastPowerUltraShortTermStation.getFpValue().compareTo(new BigDecimal("-99")) == 0) {
                     cdqysList.add(null);
-                    map1.put("cdqys",null);
-                }
-                else{
+                    map1.put("cdqys", null);
+                } else {
                     cdqysList.add(forecastPowerUltraShortTermStation.getFpValue().toString());
-                    map1.put("cdqys",forecastPowerUltraShortTermStation.getFpValue().toString());
+                    map1.put("cdqys", forecastPowerUltraShortTermStation.getFpValue().toString());
                 }
-            }
-            else {
+            } else {
                 cdqysList.add(null);
             }
 
             // 封装短期原始曲线list
-            if (dqysMap.get(tempDateTime) !=null){
+            if (dqysMap.get(tempDateTime) != null) {
                 ForecastPowerShortTermStation forecastPowerShortTermStation = dqysMap.get(tempDateTime);
-                if (forecastPowerShortTermStation.getFpValue().compareTo(new BigDecimal("-99"))==0) {
+                if (forecastPowerShortTermStation.getFpValue().compareTo(new BigDecimal("-99")) == 0) {
                     dqysList.add(null);
-                    map1.put("dqys",null);
-                }
-                else{
+                    map1.put("dqys", null);
+                } else {
                     dqysList.add(forecastPowerShortTermStation.getFpValue().toString());
-                    map1.put("dqys",forecastPowerShortTermStation.getFpValue().toString());
+                    map1.put("dqys", forecastPowerShortTermStation.getFpValue().toString());
                 }
-            }
-            else {
+            } else {
                 dqysList.add(null);
             }
             // 封装短期上报曲线list
-            if (dqsbMap.get(tempDateTime) !=null){
+            if (dqsbMap.get(tempDateTime) != null) {
                 ForecastPowerShortTermRegulation forecastPowerShortTermRegulation = dqsbMap.get(tempDateTime);
-                if (forecastPowerShortTermRegulation.getFpValue().compareTo(new BigDecimal("-99"))==0) {
+                if (forecastPowerShortTermRegulation.getFpValue().compareTo(new BigDecimal("-99")) == 0) {
                     dqsbList.add(null);
-                    map1.put("dqsb",null);
-                    map1.put("cz",null);
-                }
-                else{
+                    map1.put("dqsb", null);
+                    map1.put("cz", null);
+                } else {
                     dqsbList.add(forecastPowerShortTermRegulation.getFpValue().toString());
-                    map1.put("dqsb",forecastPowerShortTermRegulation.getFpValue().toString());
+                    map1.put("dqsb", forecastPowerShortTermRegulation.getFpValue().toString());
                     // 站端上报了短期,再判断短期下发的值是否为空
-                    if (dqzxMap.get(tempDateTime) !=null){
+                    if (dqzxMap.get(tempDateTime) != null) {
                         // 需要计算差值,下发减上报差值
                         ForecastPowerShortTermSend forecastPowerShortTermSend = dqzxMap.get(tempDateTime);
-                        map1.put("cz",forecastPowerShortTermSend.getFpValue().subtract(forecastPowerShortTermRegulation.getFpValue()).toString());
-                    }
-                    else{
+                        map1.put("cz", forecastPowerShortTermSend.getFpValue().subtract(forecastPowerShortTermRegulation.getFpValue()).toString());
+                    } else {
                         // 中心没有调控下发,则差值字段正常就是空
-                        map1.put("cz",null);
+                        map1.put("cz", null);
                     }
                 }
-            }
-            else {
+            } else {
                 dqsbList.add(null);
                 // 站端没有上报短期,差值字段为空
-                map1.put("cz","—");
+                map1.put("cz", "—");
             }
             // 封装短期中心调控下发曲线list
-            if (dqzxMap.get(tempDateTime) !=null){
+            if (dqzxMap.get(tempDateTime) != null) {
                 ForecastPowerShortTermSend forecastPowerShortTermSend = dqzxMap.get(tempDateTime);
-                if (forecastPowerShortTermSend.getFpValue().compareTo(new BigDecimal("-99"))==0) {
+                if (forecastPowerShortTermSend.getFpValue().compareTo(new BigDecimal("-99")) == 0) {
                     dqzxList.add(null);
-                    map1.put("dqzx",null);
-                }
-                else{
+                    map1.put("dqzx", null);
+                } else {
                     dqzxList.add(forecastPowerShortTermSend.getFpValue().toString());
-                    map1.put("dqzx",forecastPowerShortTermSend.getFpValue().toString());
+                    map1.put("dqzx", forecastPowerShortTermSend.getFpValue().toString());
                 }
-            }
-            else {
+            } else {
                 dqzxList.add(null);
             }
 
@@ -406,10 +391,9 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
         zhMap.put("短期原始", dqysList);
         zhMap.put("短期调控", dqzxList);
         zhMap.put("短期上报", dqsbList);
-        if ("E1".equals(stationType)){
+        if ("E1".equals(stationType)) {
             zhMap.put("气象站总辐射", hjList);
-        }
-        else{
+        } else {
             zhMap.put("测风塔轮毂风速", hjList);
         }
         map.put("stationType", stationType);
@@ -432,12 +416,13 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
     }
 
 
-    /**
-     * 中心侧预测数据统计,查询短期、超短期实时表厂家是SYJY的,每个点位值累加一起展示
-     * @param startTime
-     * @param endTime
-     * @return
-     */
+    //    /**
+//     * 中心侧预测数据统计,查询短期、超短期实时表厂家是SYJY的,每个点位值累加一起展示
+//     *
+//     * @param startTime
+//     * @param endTime
+//     * @return
+//     */
 //    public Map<String, List> getCenterData(Date startTime, Date endTime) {
 //        Long startDateTime = startTime.getTime();
 //        Long endDateTime = endTime.getTime();
@@ -525,9 +510,6 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
 //
 //        return map;
 //    }
-
-
-
     @Override
     public List<PowerStationStatusData> findByTimeBetween(Date starTime, Date endTime) {
         QueryWrapper<PowerStationStatusData> wrapper = new QueryWrapper<>();
@@ -538,4 +520,101 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
         return baseMapper.selectList(wrapper);
     }
 
+
+    /**
+     * 中心侧数据查询
+     *
+     * @param startTime
+     * @param endTime
+     * @param forecastHowLongAgo
+     * @param stationCode
+     * @return
+     */
+    public Map<String, Object> cloudDataQuery(Date startTime, Date endTime, Integer forecastHowLongAgo, String stationCode) {
+        Map<String, Object> map = new HashMap<>();
+        //表数据
+        map.put("tableData", new ArrayList<Map<String, Object>>());
+
+        Map<String, Map<Date, List<ForecastPowerShortTermCloud>>> forecastPowerShortTermCloudModelTimeMap = forecastPowerShortTermCloudService.findByForecastTimeBetweenAndHowLongAgoAndStationCode(startTime, endTime, forecastHowLongAgo, stationCode).stream().collect(Collectors.groupingBy(ForecastPowerShortTermCloud::getForecastModel, Collectors.groupingBy(ForecastPowerShortTermCloud::getTime, Collectors.toList())));
+        Map<Date, List<ForecastPowerShortTermStation>> forecastPowerShortTermStationTimeMap = forecastPowerShortTermStationService.findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(startTime, endTime, forecastHowLongAgo, stationCode).stream().collect(Collectors.groupingBy(ForecastPowerShortTermStation::getTime, Collectors.toList()));
+
+        Map<Date, List<PowerStationStatusData>> powerStationStatusDataTimeMap = findByTimeBetweenAndStationCode(startTime, endTime, stationCode).stream().collect(Collectors.groupingBy(PowerStationStatusData::getTime, Collectors.toList()));
+
+        ElectricField electricField = electricFieldService.findByStationCode(stationCode);
+        String electricFieldType = electricField.getElectricFieldTypeEnum();
+        List<TableFiled> tableFields = new ArrayList<>();
+
+        tableFields.addAll(Arrays.asList(new TableFiled("时间", "time"), new TableFiled("实际功率", "realPower"), new TableFiled("可用功率", "ablePower"), new TableFiled("理论功率", "theoryPower"),new TableFiled("站端", "fpValue")));
+
+        Map<String, String> forecastModelMap = new HashMap<>();
+
+        for (SysDictData sysDictData : DictUtils.getDictCache("forecast_model")) {
+            forecastModelMap.put(sysDictData.getDictLabel(), sysDictData.getDictValue());
+            tableFields.add(new TableFiled(sysDictData.getDictLabel(), sysDictData.getDictValue()));
+        }
+
+        Map<Date, List<BaseCppEntity>> enStatusDataMap;
+        if (electricFieldType.equals("E1")) {
+            tableFields.add(new TableFiled("总辐射", "globalR"));
+            enStatusDataMap = weatherStationStatusDataService.findByBetweenTimeAndStationCode(startTime, endTime, stationCode).stream().collect(Collectors.groupingBy(WeatherStationStatusData::getTime, Collectors.toList()));
+        } else {
+            tableFields.add(new TableFiled("轮毂风速", "wsHubHeight"));
+            enStatusDataMap = windTowerStatusDataService.findByBetweenTimeAndStationCode(startTime, endTime, stationCode).stream().collect(Collectors.groupingBy(WindTowerStatusData::getTime, Collectors.toList()));
+        }
+
+
+        List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("tableData");
+
+        for (long l = startTime.getTime(); l < endTime.getTime(); l += 900000L) {
+            Map<String, Object> dataMap = new HashMap<>();
+            Date time = new Date(l);
+            dataMap.put("time", DateFormatUtils.format(time,"yyyy-MM-dd HH:mm"));
+            PowerStationStatusData powerStationStatusData = Optional.ofNullable(powerStationStatusDataTimeMap.containsKey(time) ? powerStationStatusDataTimeMap.get(time).get(0) : null).orElse(new PowerStationStatusData());
+            dataMap.put("realPower", powerStationStatusData.getRealValue());
+            dataMap.put("ablePower", powerStationStatusData.getAbleValue());
+            dataMap.put("theoryPower", powerStationStatusData.getTheoryValue());
+
+            if (electricFieldType.equals("E1")) {
+                WeatherStationStatusData weatherStationStatusData = Optional.ofNullable(enStatusDataMap.containsKey(time) ? (WeatherStationStatusData) enStatusDataMap.get(time).get(0) : null).orElse(new WeatherStationStatusData());
+                dataMap.put("globalR", weatherStationStatusData.getGlobalR());
+
+            } else {
+                WindTowerStatusData windTowerStatusData = Optional.ofNullable(enStatusDataMap.containsKey(time) ? (WindTowerStatusData) enStatusDataMap.get(time).get(0) : null).orElse(new WindTowerStatusData());
+                dataMap.put("wsHubHeight", windTowerStatusData.getWsHubHeight());
+            }
+
+            ForecastPowerShortTermStation forecastPowerShortTermStation = Optional.ofNullable(forecastPowerShortTermStationTimeMap.containsKey(time) ?  forecastPowerShortTermStationTimeMap.get(time).get(0) : null).orElse(new ForecastPowerShortTermStation());
+            dataMap.put("fpValue", forecastPowerShortTermStation.getFpValue());
+
+
+            for (Map.Entry<String, String> stringStringEntry : forecastModelMap.entrySet()) {
+                ForecastPowerShortTermCloud forecastPowerShortTermCloud = new ForecastPowerShortTermCloud();
+                if (forecastPowerShortTermCloudModelTimeMap.containsKey(stringStringEntry.getValue())) {
+                    Map<Date, List<ForecastPowerShortTermCloud>> dateListMap = forecastPowerShortTermCloudModelTimeMap.get(stringStringEntry.getValue());
+                    forecastPowerShortTermCloud = Optional.ofNullable(dateListMap.containsKey(time) ? dateListMap.get(time).get(0) : null).orElse(new ForecastPowerShortTermCloud());
+                }
+                dataMap.put(stringStringEntry.getValue(), forecastPowerShortTermCloud.getFpValue());
+            }
+
+
+            list.add(dataMap);
+        }
+
+        //表头
+        map.put("tableField", tableFields);
+        return map;
+    }
+
+
+    @Data
+    public class TableFiled {
+        private String title;
+        private String field;
+
+        public TableFiled(String title, String field) {
+            this.title = title;
+            this.field = field;
+        }
+    }
+
 }

+ 14 - 0
cpp-admin/src/main/java/com/cpp/web/service/station/impl/WeatherStationStatusDataServiceImpl.java

@@ -36,6 +36,20 @@ public class WeatherStationStatusDataServiceImpl extends ServiceImpl<WeatherStat
         return wrapper;
     }
 
+    @Override
+    public List<WeatherStationStatusData> findByBetweenTimeAndStationCode(Date startTime, Date endTime, String stationCode) {
+        QueryWrapper<WeatherStationStatusData> wrapper = new QueryWrapper<>();
+
+        if (stationCode != null && !stationCode.equals("")) {
+            wrapper.eq("station_code", stationCode);
+        }
+        if (startTime != null && !startTime.equals("") && endTime != null && !endTime.equals("")) {
+            wrapper.between("time", startTime, endTime);
+        }
+
+        return list(wrapper);
+    }
+
     public List<WeatherStationStatusData> getByStationCodeAndTimeAndEndTimeAndEquipmentId(String stationCode, Date startTime, Date endTime, String equipmentId) {
         QueryWrapper<WeatherStationStatusData> wrapper = new QueryWrapper<>();
         if (stationCode != null && !stationCode.equals("")) {

+ 13 - 0
cpp-admin/src/main/java/com/cpp/web/service/station/impl/WindTowerStatusDataServiceImpl.java

@@ -3,6 +3,7 @@ package com.cpp.web.service.station.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.cpp.web.domain.datafactory.ParsingCft;
 import com.cpp.web.domain.station.WindTowerStatusData;
@@ -355,6 +356,18 @@ public class WindTowerStatusDataServiceImpl extends ServiceImpl<WindTowerStatusD
         return map;
     }
 
+    @Override
+    public List<WindTowerStatusData> findByBetweenTimeAndStationCode(Date startTime, Date endTime, String stationCode) {
+        QueryWrapper<WindTowerStatusData> wrapper = new QueryWrapper<>();
+        if (stationCode != null && !stationCode.equals("")) {
+            wrapper.eq("station_code", stationCode);
+        }
+        if (startTime != null && !startTime.equals("") && endTime != null && !endTime.equals("")) {
+            wrapper.between("time", startTime, endTime);
+        }
+        return list(wrapper);
+    }
+
 //    public List<String> getTableHead(String stationCode, List<TunnelGatherDataPoint> tunnelGatherDataPointList) {
 //        List<String> allAttributeName = new ArrayList<>();
 //        List<EquipmentAttribute> byEquipmentType = equipmentAttributeService.getByEquipmentType("WINDTOWER");

+ 975 - 0
cpp-ui/src/views/cloudDataQuery/index.vue

@@ -0,0 +1,975 @@
+<template>
+  <div class="app-container">
+    <div class="dark-el-input dark-el-button">
+      <el-form ref="queryForm" size="small" :inline="true">
+        <el-form-item label="时间">
+          <el-date-picker
+            :clearable="false"
+            v-model="dateTime"
+            type="datetimerange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            :default-time="['00:00:00', '23:45:00']" popper-class="cpp-popper"
+          />
+        </el-form-item>
+        <el-form-item label="场站名称">
+          <el-select v-model="stationCode" placeholder="请选择" popper-class="cpp-popper">
+            <el-option
+              v-for="item in stationList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="预测D+">
+          <el-select v-model="forecastHowLongAgo" placeholder="请选择" popper-class="cpp-popper">
+            <el-option
+              v-for="item in this.points()"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" style="margin-left: 5px" icon="el-icon-search" @click="dataQuery">查询
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div style="padding-top: 10px">
+      <el-tabs type="card" v-model="activeName" @tab-click="tabClick">
+        <el-tab-pane label="列表" name="first">
+          <vxe-table
+            align="center"
+            :loading="loading"
+            ref="xTable"
+            auto-resize
+            border
+            resizable
+            highlight-current-row
+            show-overflow
+            :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"
+            :cell-class-name="cellClassName"
+          >
+            <vxe-table-column
+              v-for="(item, index) in fromHead"
+              :key="index"
+              align="center"
+              :title="item.title"
+              :field="item.field"
+            ></vxe-table-column>
+          </vxe-table>
+          <vxe-pager
+            perfect
+            :current-page.sync="currentPage"
+            :page-size.sync="pageSize"
+            :total="total"
+            :page-sizes=[10,50,100]
+            :layouts="['PrevJump', 'PrevPage','JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']"
+            @page-change="handlePageChange"
+          >
+          </vxe-pager>
+        </el-tab-pane>
+        <el-tab-pane label="图表" name="second">
+          <div v-loading="loading" style="float:left;width: 95%;height: 550px" id="zhxCharts"></div>
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+  </div>
+</template>
+
+<script>
+import * as echarts from "echarts";
+
+export default {
+  name: 'inverterinfo',
+  data() {
+    return {
+      fromHead: [],
+      zhxChart: null,
+      wdChart: null,
+      activeName: 'first',
+      dateTime: [new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime() + (60 * 60 * 24 * 1000) - 1],
+      total: 0,
+      sortOrder: 'asc',
+      pageSize: 10,
+      currentPage: 1,
+      stationList: [],
+      stationCode: [],
+      tableData: [],
+      nameList: [],
+      loading: false,
+      modId: '',//备用id
+      itemStyle: [
+        {
+          itemStyle: {
+            normal: {
+              lineStyle: {
+                color: '#4A99FF',
+                // shadowColor: '#4A99FF',
+                // shadowBlur: 10,
+              },
+              shadowColor: '#4A99FF',
+              shadowBlur: 10,
+            },
+          },
+          areaStyle: {
+            normal: { // 单项区域填充样式
+              color: {
+                type: 'linear',
+                x: 0, //右
+                y: 0, //下
+                x2: 1, //左
+                y2: 1, //上
+                colorStops: [{
+                  offset: 0,
+                  color: '#4A99FF'
+                }, {
+                  offset: 0.5,
+                  color: 'rgba(0,0,0,0)'
+                }, {
+                  offset: 1,
+                  color: '#4A99FF'
+                }],
+                globalCoord: false
+              },
+              opacity: 1 // 区域透明度
+            }
+          }
+        },
+        {
+          itemStyle: {
+            normal: {
+              lineStyle: {
+                color: '#4BFFFC',
+                // shadowColor: '#4BFFFC',
+                // shadowBlur: 10,
+              },
+              shadowColor: '#4BFFFC',
+              shadowBlur: 10,
+            },
+          },
+          areaStyle: {
+            normal: { // 单项区域填充样式
+              color: {
+                type: 'linear',
+                x: 0, //右
+                y: 0, //下
+                x2: 1, //左
+                y2: 1, //上
+                colorStops: [{
+                  offset: 0,
+                  color: '#4BFFFC'
+                }, {
+                  offset: 0.5,
+                  color: 'rgba(0,0,0,0)'
+                }, {
+                  offset: 1,
+                  color: '#4BFFFC'
+                }],
+                globalCoord: false
+              },
+              opacity: 1 // 区域透明度
+            }
+          }
+        },
+        {
+          itemStyle: {
+            normal: {
+              lineStyle: {
+                color: '#ff654a',
+                // shadowColor: '#4A99FF',
+                // shadowBlur: 10,
+              },
+              shadowColor: '#ff654a',
+              shadowBlur: 10,
+            },
+          },
+          areaStyle: {
+            normal: { // 单项区域填充样式
+              color: {
+                type: 'linear',
+                x: 0, //右
+                y: 0, //下
+                x2: 1, //左
+                y2: 1, //上
+                colorStops: [{
+                  offset: 0,
+                  color: '#ff654a'
+                }, {
+                  offset: 0.5,
+                  color: 'rgba(0,0,0,0)'
+                }, {
+                  offset: 1,
+                  color: '#ff654a'
+                }],
+                globalCoord: false
+              },
+              opacity: 1 // 区域透明度
+            }
+          }
+        },
+        {
+          itemStyle: {
+            normal: {
+              lineStyle: {
+                color: '#edff4a',
+                // shadowColor: '#4A99FF',
+                // shadowBlur: 10,
+              },
+              shadowColor: '#edff4a',
+              shadowBlur: 10,
+            },
+          },
+          areaStyle: {
+            normal: { // 单项区域填充样式
+              color: {
+                type: 'linear',
+                x: 0, //右
+                y: 0, //下
+                x2: 1, //左
+                y2: 1, //上
+                colorStops: [{
+                  offset: 0,
+                  color: '#edff4a'
+                }, {
+                  offset: 0.5,
+                  color: 'rgba(0,0,0,0)'
+                }, {
+                  offset: 1,
+                  color: '#edff4a'
+                }],
+                globalCoord: false
+              },
+              opacity: 1 // 区域透明度
+            }
+          }
+        },
+        {
+          itemStyle: {
+            normal: {
+              lineStyle: {
+                color: '#65ff4a',
+                // shadowColor: '#4A99FF',
+                // shadowBlur: 10,
+              },
+              shadowColor: '#65ff4a',
+              shadowBlur: 10,
+            },
+          },
+          areaStyle: {
+            normal: { // 单项区域填充样式
+              color: {
+                type: 'linear',
+                x: 0, //右
+                y: 0, //下
+                x2: 1, //左
+                y2: 1, //上
+                colorStops: [{
+                  offset: 0,
+                  color: '#65ff4a'
+                }, {
+                  offset: 0.5,
+                  color: 'rgba(0,0,0,0)'
+                }, {
+                  offset: 1,
+                  color: '#65ff4a'
+                }],
+                globalCoord: false
+              },
+              opacity: 1 // 区域透明度
+            }
+          }
+        },
+        {
+          itemStyle: {
+            normal: {
+              lineStyle: {
+                color: '#4affea',
+                // shadowColor: '#4A99FF',
+                // shadowBlur: 10,
+              },
+              shadowColor: '#4affea',
+              shadowBlur: 10,
+            },
+          },
+          areaStyle: {
+            normal: { // 单项区域填充样式
+              color: {
+                type: 'linear',
+                x: 0, //右
+                y: 0, //下
+                x2: 1, //左
+                y2: 1, //上
+                colorStops: [{
+                  offset: 0,
+                  color: '#4affea'
+                }, {
+                  offset: 0.5,
+                  color: 'rgba(0,0,0,0)'
+                }, {
+                  offset: 1,
+                  color: '#4affea'
+                }],
+                globalCoord: false
+              },
+              opacity: 1 // 区域透明度
+            }
+          }
+        },
+        {
+          itemStyle: {
+            normal: {
+              lineStyle: {
+                color: '#894aff',
+                // shadowColor: '#4A99FF',
+                // shadowBlur: 10,
+              },
+              shadowColor: '#894aff',
+              shadowBlur: 10,
+            },
+          },
+          areaStyle: {
+            normal: { // 单项区域填充样式
+              color: {
+                type: 'linear',
+                x: 0, //右
+                y: 0, //下
+                x2: 1, //左
+                y2: 1, //上
+                colorStops: [{
+                  offset: 0,
+                  color: '#894aff'
+                }, {
+                  offset: 0.5,
+                  color: 'rgba(0,0,0,0)'
+                }, {
+                  offset: 1,
+                  color: '#894aff'
+                }],
+                globalCoord: false
+              },
+              opacity: 1 // 区域透明度
+            }
+          }
+        },
+        {
+          itemStyle: {
+            normal: {
+              lineStyle: {
+                color: '#d84aff',
+                // shadowColor: '#4A99FF',
+                // shadowBlur: 10,
+              },
+              shadowColor: '#d84aff',
+              shadowBlur: 10,
+            },
+          },
+          areaStyle: {
+            normal: { // 单项区域填充样式
+              color: {
+                type: 'linear',
+                x: 0, //右
+                y: 0, //下
+                x2: 1, //左
+                y2: 1, //上
+                colorStops: [{
+                  offset: 0,
+                  color: '#d84aff'
+                }, {
+                  offset: 0.5,
+                  color: 'rgba(0,0,0,0)'
+                }, {
+                  offset: 1,
+                  color: '#d84aff'
+                }],
+                globalCoord: false
+              },
+              opacity: 1 // 区域透明度
+            }
+          }
+        },
+        {
+          itemStyle: {
+            normal: {
+              lineStyle: {
+                color: '#ff4aae',
+                // shadowColor: '#4A99FF',
+                // shadowBlur: 10,
+              },
+              shadowColor: '#ff4aae',
+              shadowBlur: 10,
+            },
+          },
+          areaStyle: {
+            normal: { // 单项区域填充样式
+              color: {
+                type: 'linear',
+                x: 0, //右
+                y: 0, //下
+                x2: 1, //左
+                y2: 1, //上
+                colorStops: [{
+                  offset: 0,
+                  color: '#ff4aae'
+                }, {
+                  offset: 0.5,
+                  color: 'rgba(0,0,0,0)'
+                }, {
+                  offset: 1,
+                  color: '#ff4aae'
+                }],
+                globalCoord: false
+              },
+              opacity: 1 // 区域透明度
+            }
+          }
+        },
+
+      ],
+      colorArr: [
+        {
+          start: "rgba(155, 101, 229,",
+          end: "rgba(219,44,44,0.5)"
+        },
+        {
+          start: "rgba(71, 173, 245,",
+          end: "rgba(231,132,46,0.5)"
+        },
+        {
+          start: "rgba(82, 249, 107,",
+          end: "rgba(190,229,50,0.5)"
+        },
+        {
+          start: "rgba(82, 249, 107,",
+          end: "rgba(44,214,140,0.5)"
+        },
+        {
+          start: "rgba(82, 249, 107,",
+          end: "rgba(43,73,221,0.5)"
+        },
+        {
+          start: "rgba(82, 249, 107,",
+          end: "rgba(40,203,203,0.5)"
+        },
+        {
+          start: "rgba(82, 249, 107,",
+          end: "rgba(195,42,180,0.5)"
+        },
+        {
+          start: "rgba(82, 249, 107,",
+          end: "rgba(231,45,119,0.5)"
+        },
+        {
+          start: "rgba(82, 249, 107,",
+          end: "rgba(229,46,46,0.5)"
+        },
+      ],
+      lineStyle: [
+        {
+          areaStyle: {
+            normal: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                offset: 0,
+                color: 'rgba(219,50,51,0.3)'
+              }, {
+                offset: 0.8,
+                color: 'rgba(219, 50, 51, 0)'
+              }], false),
+              shadowColor: 'rgba(0, 0, 0, 0.1)',
+              shadowBlur: 10
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: 'rgb(219,50,51)',
+              borderColor: 'rgba(219,50,51,0.2)',
+              borderWidth: 12
+            }
+          },
+        },
+        {
+          areaStyle: {
+            normal: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                offset: 0,
+                color: 'rgba(219,196,50,0.3)'
+              }, {
+                offset: 0.8,
+                color: 'rgba(219, 50, 51, 0)'
+              }], false),
+              shadowColor: 'rgba(0, 0, 0, 0.1)',
+              shadowBlur: 10
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: 'rgb(219,196,50)',
+              borderColor: 'rgba(219,196,50,0.2)',
+              borderWidth: 12
+            }
+          },
+        },
+        {
+          areaStyle: {
+            normal: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                offset: 0,
+                color: 'rgba(101,219,50,0.3)'
+              }, {
+                offset: 0.8,
+                color: 'rgba(219, 50, 51, 0)'
+              }], false),
+              shadowColor: 'rgba(0, 0, 0, 0.1)',
+              shadowBlur: 10
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: 'rgb(101,219,50)',
+              borderColor: 'rgba(101,219,50,0.2)',
+              borderWidth: 12
+            }
+          },
+        },
+        {
+          areaStyle: {
+            normal: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                offset: 0,
+                color: 'rgba(50,219,171,0.3)'
+              }, {
+                offset: 0.8,
+                color: 'rgba(219, 50, 51, 0)'
+              }], false),
+              shadowColor: 'rgba(0, 0, 0, 0.1)',
+              shadowBlur: 10
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: 'rgb(50,219,171)',
+              borderColor: 'rgba(50,219,171,0.2)',
+              borderWidth: 12
+            }
+          },
+        },
+        {
+          areaStyle: {
+            normal: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                offset: 0,
+                color: 'rgba(50,118,219,0.3)'
+              }, {
+                offset: 0.8,
+                color: 'rgba(219, 50, 51, 0)'
+              }], false),
+              shadowColor: 'rgba(0, 0, 0, 0.1)',
+              shadowBlur: 10
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: 'rgb(50,118,219)',
+              borderColor: 'rgba(50,118,219,0.2)',
+              borderWidth: 12
+            }
+          },
+        },
+        {
+          areaStyle: {
+            normal: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                offset: 0,
+                color: 'rgba(140,50,219,0.3)'
+              }, {
+                offset: 0.8,
+                color: 'rgba(219, 50, 51, 0)'
+              }], false),
+              shadowColor: 'rgba(0, 0, 0, 0.1)',
+              shadowBlur: 10
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: 'rgb(140,50,219)',
+              borderColor: 'rgba(140,50,219,0.2)',
+              borderWidth: 12
+            }
+          },
+        },
+        {
+          areaStyle: {
+            normal: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                offset: 0,
+                color: 'rgba(202,50,219,0.3)'
+              }, {
+                offset: 0.8,
+                color: 'rgba(219, 50, 51, 0)'
+              }], false),
+              shadowColor: 'rgba(0, 0, 0, 0.1)',
+              shadowBlur: 10
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: 'rgb(202,50,219)',
+              borderColor: 'rgba(202,50,219,0.2)',
+              borderWidth: 12
+            }
+          },
+        },
+        {
+          areaStyle: {
+            normal: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                offset: 0,
+                color: 'rgba(50,199,219,0.3)'
+              }, {
+                offset: 0.8,
+                color: 'rgba(219, 50, 51, 0)'
+              }], false),
+              shadowColor: 'rgba(0, 0, 0, 0.1)',
+              shadowBlur: 10
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: 'rgb(50,199,219)',
+              borderColor: 'rgba(50,199,219,0.2)',
+              borderWidth: 12
+            }
+          },
+        },
+        {
+          areaStyle: {
+            normal: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                offset: 0,
+                color: 'rgba(219,143,50,0.3)'
+              }, {
+                offset: 0.8,
+                color: 'rgba(219, 50, 51, 0)'
+              }], false),
+              shadowColor: 'rgba(0, 0, 0, 0.1)',
+              shadowBlur: 10
+            }
+          },
+          itemStyle: {
+            normal: {
+              color: 'rgb(219,143,50)',
+              borderColor: 'rgba(219,143,50,0.2)',
+              borderWidth: 12
+            }
+          },
+        }
+      ],
+      lineColor: '#3b3b3b',
+      forecastHowLongAgo: 1
+    }
+  },
+  created() {
+    this.getStationCode()
+  },
+  mounted() {
+  },
+  beforeDestroy() {
+    if (!this.zhxChart) {
+      return
+    }
+    this.zhxChart.dispose()
+    this.zhxChart = null
+  },
+  computed: {},
+  methods: {
+    cellClassName({row, rowIndex, column, columnIndex}) {
+      if (columnIndex == 10) {
+        if (row.cz === '—') {
+          return "class-style-yellow"
+        }
+        if (row.cz != '' && row.cz != undefined && row.cz != 0) {
+          return "class-style-red"
+        }
+      }
+    },
+    tabClick(tab) {
+      if (this.activeName == 'second') {
+        this.$nextTick(function () {
+          this.zhxChart.resize();
+        })
+      }
+    },
+    nameFormat({cellValue, row, column}) {
+      const item = this.nameList.find(item => item.value === cellValue)
+      return item ? item.label : ''
+    },
+    stationCodeFormat({cellValue, row, column}) {
+      const item = this.stationList.find(item => item.value === cellValue)
+      return item ? item.label : ''
+    },
+    handlePageChange({currentPage, pageSize}) {
+      this.currentPage = currentPage
+      this.pageSize = pageSize
+    },
+    async dataQuery() {
+      let startTime = Math.round(this.dateTime[0])
+      let endTime = Math.round(this.dateTime[1])
+      if (endTime <= startTime) {
+        this.$message.warning("开始时间不能大于结束时间")
+        return
+      }
+      if (endTime - startTime > 60 * 60 * 24 * 1000 * 15) {
+        this.$message.warning("查询数据不能超过15天!")
+        return
+      }
+      let queryParams = {
+        "stationCode": this.stationCode,
+        "startTime": startTime,
+        "endTime": endTime,
+        "forecastHowLongAgo": this.forecastHowLongAgo
+      }
+
+      this.loading = true
+      this.$axios.get('/powerstationstatusdata/cloudDataQuery', {params: queryParams}).then(res => {
+        this.fromHead = res.data.tableField
+        this.tableData = res.data.tableData
+        this.total = res.data.tableData.length
+
+        const zhMap = {}
+        let stationType = 'E1'
+
+
+        this.fromHead.forEach((item) => {
+
+          if(item.field != 'time'){
+            zhMap[item.title] = []
+          }
+          if (item.field == 'wsHubHeight'){
+            stationType = 'E2'
+          }
+        });
+
+
+        let timeList = []
+        this.tableData.forEach((item) => {
+          this.fromHead.forEach((item1) => {
+            if(item1.title != '时间'){
+              zhMap[item1.title].push(item[item1.field])
+            }else {
+              timeList.push(item[item1.field])
+            }
+          });
+        });
+        this.$nextTick(function () {
+          this.zhxChart.resize();
+        })
+        this.zhDraw(timeList, zhMap, stationType)
+        this.loading = false
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+    async getStationCode() {
+      await this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
+        this.stationList = response.data
+        if (this.stationList.length > 0) {
+          this.stationCode = this.stationList[0].value
+          this.dataQuery()
+        }
+      })
+    },
+    zhDraw(timeList, zhMap, stationType) {
+      this.zhxChart = echarts.init(document.getElementById('zhxCharts'), 'dark', {renderer: 'svg'})
+      let option = {
+        backgroundColor: 'transparent',
+        title: {
+          top: 20,
+          text: '中心功率预测',
+          textStyle: {
+            fontWeight: 'normal',
+            fontSize: 16,
+            // color: this.lineColor
+          },
+          left: '1%'
+        },
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            lineStyle: {
+              color: '#57617B'
+            }
+          }
+        },
+        legend: {
+          top: 20,
+          width: '70%',
+          icon: 'rect',
+          itemWidth: 14,
+          itemHeight: 5,
+          itemGap: 13,
+          data: [],
+          right: '4%',
+          textStyle: {
+            fontSize: 12,
+            // color: this.lineColor
+          },
+          selected: {}
+        },
+        dataZoom: [{
+          show: true,
+          realtime: true,
+          start: 0,
+          end: 100,
+          left: "15%",
+          right: "15%",
+          // textStyle: {
+          // color: this.lineColor
+          // }
+        }, {
+          type: 'inside'
+        }],
+        grid: {
+          top: 100,
+          left: '2%',
+          right: '2%',
+          bottom: '10%',
+          containLabel: true
+        },
+        xAxis: [{
+          type: 'category',
+          boundaryGap: false,
+          // axisLine: {
+          //   lineStyle: {
+          //     color: this.lineColor
+          //   }
+          // },
+          data: []
+        }],
+        yAxis: [{
+          type: 'value',
+          name: 'MW',
+          axisTick: {
+            show: false
+          },
+          // axisLine: {
+          //   lineStyle: {
+          //     color: this.lineColor
+          //   }
+          // },
+          axisLabel: {
+            margin: 10,
+            textStyle: {
+              fontSize: 14,
+              // color: this.lineColor
+            },
+            formatter: '{value}',
+          },
+          splitLine: {
+            lineStyle: {
+              color: '#57617B'
+            }
+          }
+        }, {
+          type: 'value',
+          name: '',
+          axisTick: {
+            show: false
+          },
+          // axisLine: {
+          //   lineStyle: {
+          //     color: this.lineColor
+          //   }
+          // },
+
+          axisLabel: {
+            margin: 10,
+            textStyle: {
+              fontSize: 14,
+              // color: this.lineColor
+            },
+            formatter: '{value}',
+          },
+          splitLine: {
+            lineStyle: {
+              color: '#57617B'
+            }
+          }
+        }],
+        series: []
+      }
+      option.xAxis[0].data = timeList
+      if (stationType == 'E1') {
+        option.yAxis[1].name = 'W/㎡'
+      } else {
+        option.yAxis[1].name = 'm/s'
+      }
+
+      let index = 0;
+      for (let key in zhMap) {
+        for (let i = 0; i < zhMap[key].length; i++) {
+          zhMap[key][i] = zhMap[key][i] == -99 ? null : zhMap[key][i]
+        }
+        option.legend.data.push(key)
+
+        let sValue = {
+          name: key,
+          type: 'line',
+          yAxisIndex: 0,
+          smooth: false,
+          symbol: 'circle',
+          symbolSize: 5,
+          showSymbol: false,
+          lineStyle: {
+            normal: {
+              width: 2
+            }
+          },
+          itemStyle: this.lineStyle[index].itemStyle,
+          data: zhMap[key]
+        }
+        if (key == '轮毂风速' || key == '总辐射') {
+          sValue.yAxisIndex = 1
+        }
+        option.series.push(sValue)
+        index++;
+      }
+
+      this.zhxChart.setOption(option, true)
+      var _this = this
+      window.addEventListener("resize", function () {
+        _this.zhxChart.resize();
+      });
+    },
+    points() {
+      let points = []
+      if (this.forecastType == 'dq') {
+        for (let i = 1; i < 11; i++) {
+          points.push({label: i + "", value: i})
+        }
+      } else {
+        for (let i = 1; i < 17; i++) {
+          points.push({label: i + "", value: i})
+        }
+      }
+      return points
+    }
+  },
+}
+</script>
+
+<style scoped>
+/* //然后给对应的单元格样式 */
+>>> .vxe-table .vxe-body--row .vxe-body--column.class-style-yellow {
+
+  color: #FFFF00;
+}
+
+>>> .vxe-table .vxe-body--row .vxe-body--column.class-style-red {
+  color: #FF0000;
+}
+</style>
+<!--&gt;>>.vxe-table .vxe-body&#45;&#45;row .vxe-body&#45;&#45;column.class-style .vxe-cell .vxe-cell&#45;&#45;label{-->