소스 검색

历史功率预测查询列表实际功率

xusl 7 달 전
부모
커밋
4a2d223ab7

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

@@ -0,0 +1,62 @@
+package com.cpp.web.controller.stationDataQuery;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.IoUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.poi.excel.ExcelUtil;
+import cn.hutool.poi.excel.ExcelWriter;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.cpp.common.core.domain.R;
+import com.cpp.system.service.ISysConfigService;
+import com.cpp.web.service.station.PowerStationStatusDataService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.net.URLEncoder;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * idp_power_station_status_data
+ *
+ * @author whc
+ * @date 2022-03-18 15:49:20
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/powerstationstatusdata")
+@Api(value = "powerstationstatusdata", tags = "idp_power_station_status_data管理")
+public class PowerStationStatusDataController {
+    @Autowired
+    private ISysConfigService configService;
+    private final PowerStationStatusDataService powerStationStatusDataService;
+
+    @ApiOperation(value = "通过条件查询", notes = "通过条件查询")
+    @GetMapping("/queryDays")
+    public R queryDays() {
+        String queryDays = configService.selectConfigByKey("queryDays");
+        if (StrUtil.isBlankIfStr(queryDays)){
+            queryDays = "10";
+        }
+        return R.ok(queryDays);
+    }
+
+    @ApiOperation(value = "通过条件查询", notes = "通过条件查询")
+    @GetMapping("/getCompositeData")
+    public R getCompositeData(String stationCode,
+                                       Long startTime,
+                                       Long endTime) {
+        return R.ok(powerStationStatusDataService.getCompositeData(stationCode, startTime, endTime));
+    }
+}

+ 2 - 0
cpp-admin/src/main/java/com/cpp/web/domain/station/PowerStationStatusData.java

@@ -3,6 +3,7 @@ package com.cpp.web.domain.station;
 import com.baomidou.mybatisplus.annotation.TableName;
 
 import com.cpp.web.domain.BaseCppEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -30,6 +31,7 @@ public class PowerStationStatusData extends BaseCppEntity {
      * 时间
      */
     @ApiModelProperty(value = "时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date time;
 
     /**

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

@@ -28,7 +28,7 @@ public interface PowerStationStatusDataService extends IService<PowerStationStat
 
     List<ArrayList<String>> timeStamp(Date startTime, Date endTime) throws ParseException;
 
-    Map<String, List> getCompositeData(String stationCode, Date startTime, Date endTime, String forecastManufactor, Integer cdqPoint, Integer dqPoint);
+    Map<String, List> getCompositeData(String stationCode, Long startTime, Long endTime);
     Map<String, List> getCenterData(Date startTime, Date endTime);
 
     List<PowerStationStatusData> findByTimeBetweenAndStationCode(Date pointStarTime, Date pointEndTime, String stationCode);

+ 107 - 406
cpp-admin/src/main/java/com/cpp/web/service/station/impl/PowerStationStatusDataServiceImpl.java

@@ -1,7 +1,9 @@
 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.web.domain.station.ElectricField;
 import com.cpp.web.domain.station.PowerStationStatusData;
 import com.cpp.web.mapper.station.PowerStationStatusDataMapper;
 import com.cpp.web.service.cloud.ForecastPowerShortTermCloudService;
@@ -11,6 +13,7 @@ import com.cpp.web.service.station.*;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -66,10 +69,7 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
         return dateList;
     }
 
-    @Override
-    public Map<String, List> getCompositeData(String stationCode, Date startTime, Date endTime, String forecastManufactor, Integer cdqPoint, Integer dqPoint) {
-        return null;
-    }
+
 
     @Override
     public Map<String, List> getCenterData(Date startTime, Date endTime) {
@@ -84,408 +84,109 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
         return sdf.format(date);
     }
 
-//    public Map<String, List> getCompositeData(String stationCode, Date startTime, Date endTime, String forecastManufactor, Integer cdqPoint, Integer dqPoint) {
-//        Long startDateTime = startTime.getTime();
-//        Long endDateTime = endTime.getTime();
-//        ElectricField electricField = electricFieldService.findByStationCode(stationCode);
-//        String station = "";
-//        String queryForecastManufactor ="";
-//        if (stationCode != null && !stationCode.equals("")) {
-//            station = electricField.getName();
-//        }
-//        List<ForecastManufactor> forecastManufactorList = forecastManufactorService.list();
-//
-//        // 页面查询预测厂家条件为空,需要查询场站信息下绑定的所有厂家
-//        if ("".equals(forecastManufactor)||forecastManufactor==null){
-//            queryForecastManufactor = electricField.getForecastManufactor();
-//        }
-//        else{
-//            // 查询页面条件选择的厂家
-//            queryForecastManufactor = forecastManufactor;
-//        }
-//
-//        // 封装列表头信息
-//        List headList = new ArrayList();
-//        Map<String,String> czmcHeadMap = new HashMap<>();
-//        czmcHeadMap.put("field", "czmc");
-//        czmcHeadMap.put("label", "场站名称");
-//        headList.add(czmcHeadMap);
-//        Map<String,String> timeHeadMap = new HashMap<>();
-//        timeHeadMap.put("field", "time");
-//        timeHeadMap.put("label", "时间");
-//        headList.add(timeHeadMap);
-//        Map<String,String> sjglHeadMap = new HashMap<>();
-//        sjglHeadMap.put("field", "sjgl");
-//        sjglHeadMap.put("label", "实际功率");
-//        headList.add(sjglHeadMap);
-//
-//
-//        String[] fm = queryForecastManufactor.split(",");
-//        // 按厂家过滤出数据
-//        Map<String,List> tempDqMap = new HashMap<>();
-//        Map<String,List> tableDqMap = new HashMap<>();
-//       if(dqPoint>0){
-//           // 获取短期数据
-//           List<ForecastPowerShortTermHis> forecastPowerShortTermHisList = forecastPowerShortTermHisService.findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(startTime.getTime(), endTime.getTime(),dqPoint,stationCode);
-//           for (int i=0;i<fm.length;i++){
-//               int finalI = i;
-//               List<ForecastPowerShortTermHis> result = forecastPowerShortTermHisList.stream().filter(c -> c.getForecastManufactor().equals(fm[finalI])).collect(Collectors.toList());
-//               Map<Long, String> dqMap = new HashMap<>();
-//               for (ForecastPowerShortTermHis forecastPowerShortTermHis : result) {
-//                   dqMap.put(forecastPowerShortTermHis.getForecastTime().getTime(), forecastPowerShortTermHis.getAbleValue().toString());
-//               }
-//               List tempdqList = new ArrayList();
-//               for (Long tempDateTime = startDateTime; tempDateTime < endDateTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
-//                   if (dqMap.get(tempDateTime) != null) {
-//                       tempdqList.add(dqMap.get(tempDateTime).toString());
-//                   } else {
-//                       tempdqList.add(null);
-//                   }
-//               }
-//               String manufactorName = "";
-//               for (ForecastManufactor forecastManufactor1:forecastManufactorList){
-//                   if (fm[finalI].equals(forecastManufactor1.getSign())){
-//                       manufactorName = forecastManufactor1.getName();
-//                       break;
-//                   }
-//               }
-//               if ("".equals(manufactorName)){
-//                   manufactorName = fm[finalI];
-//               }
-//               tempDqMap.put(manufactorName,tempdqList);
-//               tableDqMap.put(fm[finalI],tempdqList);
-//               Map<String,String> dqHeadMap = new HashMap<>();
-//               dqHeadMap.put("field", fm[finalI]+"DQ");
-//               dqHeadMap.put("label", manufactorName+"短期");
-//               headList.add(dqHeadMap);
-//           }
-//       }else {
-//           // 获取短期数据
-//           List<ForecastPowerShortTerm> forecastPowerShortTermList = forecastPowerShortTermService.findByStationCodeAndStartTimeAndEndTime(stationCode,startTime,endTime);
-//
-//
-//           for (int i=0;i<fm.length;i++){
-//               int finalI = i;
-//               List<ForecastPowerShortTerm> result = forecastPowerShortTermList.stream().filter(c -> c.getForecastManufactor().equals(fm[finalI])).collect(Collectors.toList());
-//               Map<Long, String> dqMap = new HashMap<>();
-//               for (ForecastPowerShortTerm forecastPowerShortTerm : result) {
-//                   dqMap.put(forecastPowerShortTerm.getForecastTime().getTime(), forecastPowerShortTerm.getFpValue().toString());
-//               }
-//               List tempdqList = new ArrayList();
-//               for (Long tempDateTime = startDateTime; tempDateTime < endDateTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
-//                   if (dqMap.get(tempDateTime) != null) {
-//                       tempdqList.add(dqMap.get(tempDateTime).toString());
-//                   } else {
-//                       tempdqList.add(null);
-//                   }
-//               }
-//               String manufactorName = "";
-//               for (ForecastManufactor forecastManufactor1:forecastManufactorList){
-//                   if (fm[finalI].equals(forecastManufactor1.getSign())){
-//                       manufactorName = forecastManufactor1.getName();
-//                       break;
-//                   }
-//               }
-//               if ("".equals(manufactorName)){
-//                   manufactorName = fm[finalI];
-//               }
-//               tempDqMap.put(manufactorName,tempdqList);
-//               tableDqMap.put(fm[finalI],tempdqList);
-//               Map<String,String> dqHeadMap = new HashMap<>();
-//               dqHeadMap.put("field", fm[finalI]+"DQ");
-//               dqHeadMap.put("label", manufactorName+"短期");
-//               headList.add(dqHeadMap);
-//           }
-//       }
-//
-//        Map<String,List> tempCdqMap = new HashMap<>();
-//        Map<String,List> tableCdqMap = new HashMap<>();
-//        if(cdqPoint>0){
-//            // 获取超短期数据
-//            List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = forecastPowerUltraShortTermHisService.findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(startTime.getTime(), endTime.getTime(), cdqPoint, stationCode);
-//            // 按厂家过滤出数据
-//            for (int i=0;i<fm.length;i++){
-//                int finalI = i;
-//                List<ForecastPowerUltraShortTermHis> result = forecastPowerUltraShortTermHisList.stream().filter(c -> c.getForecastManufactor().equals(fm[finalI])).collect(Collectors.toList());
-//                Map<Long, String> cdqMap = new HashMap<>();
-//                for (ForecastPowerUltraShortTermHis forecastPowerUltraShortTermHis : result) {
-//                    cdqMap.put(forecastPowerUltraShortTermHis.getForecastTime().getTime(), forecastPowerUltraShortTermHis.getAbleValue().toString());
-//                }
-//                List tempcdqList = new ArrayList();
-//                for (Long tempDateTime = startDateTime; tempDateTime < endDateTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
-//                    if (cdqMap.get(tempDateTime) != null) {
-//                        tempcdqList.add(cdqMap.get(tempDateTime).toString());
-//                    } else {
-//                        tempcdqList.add(null);
-//                    }
-//                }
-//                String manufactorName = "";
-//                for (ForecastManufactor forecastManufactor1:forecastManufactorList){
-//                    if (fm[finalI].equals(forecastManufactor1.getSign())){
-//                        manufactorName = forecastManufactor1.getName();
-//                        break;
-//                    }
-//                }
-//                if ("".equals(manufactorName)){
-//                    manufactorName = fm[finalI];
-//                }
-//                tempCdqMap.put(manufactorName,tempcdqList);
-//                tableCdqMap.put(fm[finalI],tempcdqList);
-//                Map<String,String> cdqHeadMap = new HashMap<>();
-//                cdqHeadMap.put("field", fm[finalI]+"CDQ");
-//                cdqHeadMap.put("label", manufactorName+"超短期");
-//                headList.add(cdqHeadMap);
-//            }
-//        }
-//        else{
-//            // 获取超短期实时数据
-//            List<ForecastPowerUltraShortTerm> forecastPowerUltraShortTermList = forecastPowerUltraShortTermService.findByStationCodeAndStartTimeAndEndTime(stationCode,startTime, endTime);
-//            // 按厂家过滤出数据
-//            for (int i=0;i<fm.length;i++){
-//                int finalI = i;
-//                List<ForecastPowerUltraShortTerm> result = forecastPowerUltraShortTermList.stream().filter(c -> c.getForecastManufactor().equals(fm[finalI])).collect(Collectors.toList());
-//                Map<Long, String> cdqMap = new HashMap<>();
-//                for (ForecastPowerUltraShortTerm forecastPowerUltraShortTerm : result) {
-//                    cdqMap.put(forecastPowerUltraShortTerm.getForecastTime().getTime(), forecastPowerUltraShortTerm.getFpValue().toString());
-//                }
-//                List tempcdqList = new ArrayList();
-//                for (Long tempDateTime = startDateTime; tempDateTime < endDateTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
-//                    if (cdqMap.get(tempDateTime) != null) {
-//                        tempcdqList.add(cdqMap.get(tempDateTime).toString());
-//                    } else {
-//                        tempcdqList.add(null);
-//                    }
-//                }
-//                String manufactorName = "";
-//                for (ForecastManufactor forecastManufactor1:forecastManufactorList){
-//                    if (fm[finalI].equals(forecastManufactor1.getSign())){
-//                        manufactorName = forecastManufactor1.getName();
-//                        break;
-//                    }
-//                }
-//                if ("".equals(manufactorName)){
-//                    manufactorName = fm[finalI];
-//                }
-//                tempCdqMap.put(manufactorName,tempcdqList);
-//                tableCdqMap.put(fm[finalI],tempcdqList);
-//                Map<String,String> cdqHeadMap = new HashMap<>();
-//                cdqHeadMap.put("field", fm[finalI]+"CDQ");
-//                cdqHeadMap.put("label", manufactorName+"超短期");
-//                headList.add(cdqHeadMap);
-//            }
-//        }
-//
-//        // 获取云端nwp
-//        Map<Long, String> nwpMap = new HashMap<>();
-//        QueryWrapper<Nwp> nwpWrapper = new QueryWrapper<>();
-//        nwpWrapper.between("pre_time", startTime, endTime);
-//        nwpWrapper.eq("station_code",stationCode);
-//        nwpWrapper.eq("forecast_manufactor","SYJY");
-//        List<Nwp> nwpDataList = nwpService.list(nwpWrapper);
-//        // 保存环境数据map
-//        Map<Long, String> hjsjMap = new HashMap<>();
-//        if ("1".equals(electricField.getElectricFieldTypeEnum())){
-//            for (Nwp nwp : nwpDataList) {
-//                nwpMap.put(nwp.getPreTime().getTime(), nwp.getSwr().toString());
-//            }
-//            QueryWrapper<WeatherStationStatusData> qxzWrapper = new QueryWrapper<>();
-//            qxzWrapper.between("time", startTime, endTime);
-//            qxzWrapper.eq("station_code",stationCode);
-//            List<WeatherStationStatusData> qxzDataList = weatherStationStatusDataService.list(qxzWrapper);
-//            for (WeatherStationStatusData weatherStationStatusData : qxzDataList) {
-//                hjsjMap.put(weatherStationStatusData.getTime().getTime(), weatherStationStatusData.getGlobalR().toString());
-//            }
-//        }
-//        else{
-//            int nwpHubHeight = Integer.parseInt(sysParameterService.getSysParameterAndStationCode("NWP_HubHeight", "100", stationCode));
-//            for (Nwp nwp : nwpDataList) {
-//                // 获取nwp轮毂风速
-//                if (nwpHubHeight==170){
-//                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs170().toString());
-//                }
-//                else if (nwpHubHeight==100){
-//                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs100().toString());
-//                }
-//                else if (nwpHubHeight==90){
-//                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs90().toString());
-//                }
-//                else if (nwpHubHeight==80){
-//                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs80().toString());
-//                }
-//                else if (nwpHubHeight==70){
-//                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs70().toString());
-//                }
-//                else if (nwpHubHeight==50){
-//                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs50().toString());
-//                }
-//                else if (nwpHubHeight==30){
-//                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs30().toString());
-//                }
-//                else if (nwpHubHeight==10){
-//                    nwpMap.put(nwp.getPreTime().getTime(), nwp.getWs10().toString());
-//                }
-//            }
-//
-//            // 获取测风塔轮毂风速
-//            QueryWrapper<WindTowerStatusData> cftWrapper = new QueryWrapper<>();
-//            cftWrapper.between("time", startTime, endTime);
-//            cftWrapper.eq("station_code",stationCode);
-//            List<WindTowerStatusData> cftDataList = windTowerStatusDataService.list(cftWrapper);
-//            for (WindTowerStatusData windTowerStatusData : cftDataList) {
-//                hjsjMap.put(windTowerStatusData.getTime().getTime(), windTowerStatusData.getWsInstHubHeight().toString());
-//            }
-//        }
-//
-//        List<String> timeList = new ArrayList<>();
-//        List<String> sjList = new ArrayList();
-//        List<String> nwpList = new ArrayList();
-//        List<String> hjsjList = new ArrayList();
-//        List<Map> dqList = new ArrayList();
-//        dqList.add(tempDqMap);
-//        List<Map> cdqList = new ArrayList();
-//        cdqList.add(tempCdqMap);
-//        // 获取实际功率
-//        Map<Long, String> sjMap = new HashMap<>();
-//        List<PowerStationStatusData> powerStationStatusDataList = findByStationCodeAndStartTimeAndEndTime(stationCode, startTime, endTime);
-//        for (PowerStationStatusData powerStationStatusData : powerStationStatusDataList) {
-//            sjMap.put(powerStationStatusData.getTime().toInstant(ZoneOffset.of("+8")).toEpochMilli(), powerStationStatusData.getRealValue().toString());
-//        }
-//        List<Map<String,Object>> tableList = new ArrayList();
-//        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//        int i=0;
-//        for (Long tempDateTime = startDateTime; tempDateTime < endDateTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
-//            // 封装实际功率list
-//            if (sjMap.get(tempDateTime) != null) {
-//                if (Double.parseDouble(sjMap.get(tempDateTime))==-99) {
-//                    sjList.add(null);
-//                }
-//                else{
-//                    sjList.add(sjMap.get(tempDateTime).toString());
-//                }
-//            } else {
-//                sjList.add(null);
-//            }
-//
-//            // 封装时间轴list
-//            String time = format.format(tempDateTime);
-//            timeList.add(time);
-//            // 封装列表的数据
-//            Map<String,Object> map1 = new HashMap<>();
-//            map1.put("czmc", station);
-//            map1.put("time", DateUtil.format(new Date(tempDateTime), "yyyy-MM-dd HH:mm"));
-//            map1.put("sjgl",sjMap.get(tempDateTime) != null?sjMap.get(tempDateTime).toString():null);
-//            // 遍历短期数据
-//            for (Map.Entry<String, List> entry : tableDqMap.entrySet()) {
-//                List tempdqList = entry.getValue();
-//                map1.put(entry.getKey()+"DQ",tempdqList.get(i));
-//            }
-//            // 遍历超短期数据
-//            for (Map.Entry<String, List> entry : tableCdqMap.entrySet()) {
-//                List tempcdqList = entry.getValue();
-//                map1.put(entry.getKey()+"CDQ",tempcdqList.get(i));
-//            }
-//
-//            if ("1".equals(electricField.getElectricFieldTypeEnum())){
-//                // 封装nwplist
-//                if (nwpMap.get(tempDateTime) != null) {
-//                    if (Double.parseDouble(nwpMap.get(tempDateTime))==-99) {
-//                        nwpList.add(null);
-//                        // 中心侧nwp总辐射
-//                        map1.put("ZXCNWPZFS","");
-//                    }
-//                    else{
-//                        nwpList.add(nwpMap.get(tempDateTime).toString());
-//                        map1.put("ZXCNWPZFS",nwpMap.get(tempDateTime).toString());
-//                    }
-//                } else {
-//                    nwpList.add(null);
-//                    map1.put("ZXCNWPZFS","");
-//                }
-//                // 封装qxzlist
-//                if (hjsjMap.get(tempDateTime) != null) {
-//                    if (Double.parseDouble(hjsjMap.get(tempDateTime))==-99) {
-//                        hjsjList.add(null);
-//                        map1.put("QXZZFS","");
-//                    }
-//                    else{
-//                        hjsjList.add(hjsjMap.get(tempDateTime).toString());
-//                        map1.put("QXZZFS",hjsjMap.get(tempDateTime).toString());
-//                    }
-//                } else {
-//                    hjsjList.add(null);
-//                    map1.put("QXZZFS","");
-//                }
-//            }
-//            else{
-//                // 封装nwplist
-//                if (nwpMap.get(tempDateTime) != null) {
-//                    if (Double.parseDouble(nwpMap.get(tempDateTime))==-99) {
-//                        nwpList.add(null);
-//                        map1.put("ZXCNWPWS","");
-//                    }
-//                    else{
-//                        nwpList.add(nwpMap.get(tempDateTime).toString());
-//                        map1.put("ZXCNWPWS",nwpMap.get(tempDateTime).toString());
-//                    }
-//                } else {
-//                    nwpList.add(null);
-//                    map1.put("ZXCNWPWS","");
-//                }
-//                // 封装cftlist
-//                if (hjsjMap.get(tempDateTime) != null) {
-//                    if (Double.parseDouble(hjsjMap.get(tempDateTime))==-99) {
-//                        hjsjList.add(null);
-//                        map1.put("CFTWS","");
-//                    }
-//                    else{
-//                        hjsjList.add(hjsjMap.get(tempDateTime).toString());
-//                        map1.put("CFTWS",hjsjMap.get(tempDateTime).toString());
-//                    }
-//                } else {
-//                    hjsjList.add(null);
-//                    map1.put("CFTWS","");
-//                }
-//            }
-//
-//            i++;
-//            tableList.add(map1);
-//        }
-//
-//        if ("1".equals(electricField.getElectricFieldTypeEnum())){
-//            Map<String,String> nwpHeadMap = new HashMap<>();
-//            nwpHeadMap.put("field", "ZXCNWPZFS");
-//            nwpHeadMap.put("label", "中心侧NWP总辐射");
-//            headList.add(nwpHeadMap);
-//
-//            Map<String,String> cftHeadMap = new HashMap<>();
-//            cftHeadMap.put("field", "QXZZFS");
-//            cftHeadMap.put("label", "气象站总辐射");
-//            headList.add(cftHeadMap);
-//        }
-//        else{
-//            Map<String,String> nwpHeadMap = new HashMap<>();
-//            nwpHeadMap.put("field", "ZXCNWPWS");
-//            nwpHeadMap.put("label", "中心侧NWP轮毂风速");
-//            headList.add(nwpHeadMap);
-//
-//            Map<String,String> cftHeadMap = new HashMap<>();
-//            cftHeadMap.put("field", "CFTWS");
-//            cftHeadMap.put("label", "测风塔轮毂风速");
-//            headList.add(cftHeadMap);
-//        }
-//
-//        Map<String, List> map = new HashMap<>();
-//        map.put("dq", dqList);
-//        map.put("cdq", cdqList);
-//        map.put("sj", sjList);
-//        map.put("nwp", nwpList);
-//        map.put("hjsj", hjsjList);
-//        map.put("time", timeList);
-//        map.put("fromHead", headList);
-//        map.put("tableList", tableList);
-//
-//        return map;
-//    }map
+    public Map<String, List> getCompositeData(String stationCode, Long startTime, Long endTime) {
+        ElectricField electricField = electricFieldService.findByStationCode(stationCode);
+        String station = "";
+
+        // 封装列表头信息
+        List headList = new ArrayList();
+        Map<String,String> czmcHeadMap = new HashMap<>();
+        czmcHeadMap.put("field", "czmc");
+        czmcHeadMap.put("label", "场站名称");
+        headList.add(czmcHeadMap);
+        Map<String,String> timeHeadMap = new HashMap<>();
+        timeHeadMap.put("field", "time");
+        timeHeadMap.put("label", "时间");
+        headList.add(timeHeadMap);
+        Map<String,String> sjglHeadMap = new HashMap<>();
+        sjglHeadMap.put("field", "sjgl");
+        sjglHeadMap.put("label", "实际功率");
+        headList.add(sjglHeadMap);
+        Map<String,String> kyglHeadMap = new HashMap<>();
+        kyglHeadMap.put("field", "kygl");
+        kyglHeadMap.put("label", "可用功率");
+        headList.add(kyglHeadMap);
+        Map<String,String> llglHeadMap = new HashMap<>();
+        llglHeadMap.put("field", "llgl");
+        llglHeadMap.put("label", "理论功率");
+        headList.add(llglHeadMap);
+
+
+        Map<String,List> tempCdqMap = new HashMap<>();
+        Map<String,List> tableCdqMap = new HashMap<>();
+
+
+
+        List<String> timeList = new ArrayList<>();
+        List<String> sjList = new ArrayList();
+        List<String> kyList = new ArrayList();
+        List<String> llList = new ArrayList();
+
+        // 获取实际功率
+        Map<Long, PowerStationStatusData> sjMap = new HashMap<>();
+        List<PowerStationStatusData> powerStationStatusDataList = findByStationCodeAndStartTimeAndEndTime(stationCode, new Date(startTime), new Date(endTime));
+        for (PowerStationStatusData powerStationStatusData : powerStationStatusDataList) {
+            sjMap.put(powerStationStatusData.getTime().getTime(), powerStationStatusData);
+        }
+        List<Map<String,Object>> tableList = new ArrayList();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        int i=0;
+        for (Long tempDateTime = startTime; tempDateTime < endTime; tempDateTime = tempDateTime + 15 * 60 * 1000) {
+            // 封装列表的数据
+            Map<String,Object> map1 = new HashMap<>();
+            map1.put("czmc", electricField.getName());
+            map1.put("time", DateUtil.format(new Date(tempDateTime), "yyyy-MM-dd HH:mm"));
+
+            // 封装实际功率list
+            if (sjMap.get(tempDateTime) != null) {
+                // 实际功率
+                PowerStationStatusData powerStationStatusData = sjMap.get(tempDateTime);
+                if (powerStationStatusData.getRealValue().compareTo(new BigDecimal("-99"))==0) {
+                    sjList.add(null);
+                    map1.put("sjgl",null);
+                }
+                else{
+                    sjList.add(powerStationStatusData.getRealValue().toString());
+                    map1.put("sjgl",powerStationStatusData.getRealValue().toString());
+                }
+                if (powerStationStatusData.getAbleValue().compareTo(new BigDecimal("-99"))==0) {
+                    kyList.add(null);
+                    map1.put("kygl",null);
+                }
+                else{
+                    kyList.add(powerStationStatusData.getAbleValue().toString());
+                    map1.put("kygl",powerStationStatusData.getAbleValue().toString());
+                }
+                if (powerStationStatusData.getTheoryValue().compareTo(new BigDecimal("-99"))==0) {
+                    llList.add(null);
+                    map1.put("llgl",null);
+                }
+                else{
+                    llList.add(powerStationStatusData.getTheoryValue().toString());
+                    map1.put("llgl",powerStationStatusData.getTheoryValue().toString());
+                }
+            } else {
+                sjList.add(null);
+                kyList.add(null);
+                llList.add(null);
+            }
+
+            // 封装时间轴list
+            String time = format.format(tempDateTime);
+            timeList.add(time);
+
+            i++;
+            tableList.add(map1);
+        }
+
+
+        Map<String, List> map = new HashMap<>();
+
+        map.put("fromHead", headList);
+        map.put("tableList", tableList);
+
+        return map;
+    }
 
     @Override
     public List<PowerStationStatusData> findByTimeBetweenAndStationCode(Date pointStarTime, Date pointEndTime, String stationCode) {