package com.ruoyi.predict.api;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.json.JSONObject;
import com.ruoyi.common.utils.DateTimeUtil;
import com.ruoyi.predict.domain.*;
import com.ruoyi.predict.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.*;

/**
 * @author hlf
 * @date 2022/8/18 9:37
 * 文件说明：全景功率
 */
@Api(value = "全景功率Controller", tags = {"全景功率操作接口"})
@Controller
@RequestMapping("/predict/api/ppc")
public class PanoramicPowerController extends BaseController {

    @Autowired
    private IWindplantService windplantService;

    @Autowired
    private IPvPowerStationService pvPowerStationService;

    @Autowired
    private IWfFileConfigService wfFileConfigService;

    @Autowired
    private INoscaleWfDaPfPeriodDataService noscaleWfDaPfPeriodDataService;

    @Autowired
    private IPvDaPfPeriodDataService pvDaPfPeriodDataService;

    @Autowired
    private IWfUspTsPeriodDataService wfUspTsPeriodDataService;

    @Autowired
    private IPvUspTsPeriodDataService pvUspTsPeriodDataService;

    @Autowired
    private IWfStatPeriodDataService wfStatPeriodDataService;

    @Autowired
    private IWfYcHistoryData1Service wfYcHistoryData1Service;

    @Autowired
    private IWfTheorypowerDataService wfTheorypowerDataService;

    @Autowired
    private IWpuspSvrParaService wpuspSvrParaService;

    @ApiOperation("全景功率")
    @GetMapping("/panoramicPower")
    @ResponseBody
    public AjaxResult panoramicPower() {
        JSONObject json = new JSONObject();
        //当日的开始时间
        Date beginOfDay = DateUtil.date(DateUtil.beginOfDay(DateUtil.date()).getTime() + 900000);
        //当日的结束时间
        Date endOfDay = DateUtil.date(DateUtil.endOfDay(DateUtil.date()).getTime() + 1000);
        //获取所有时间
        List<Date> dateList = DateTimeUtil.getDateList15(DateUtil.parse(DateUtil.formatDateTime(beginOfDay)), DateUtil.parse(DateUtil.formatDateTime(endOfDay)));
        //风电场站数量
        int modelCountFd = 0;
        Map<Integer, Windplant> mapFd = new HashMap<>();
        //光伏场站数量
        int modelCountGf = 0;
        Map<Integer, PvPowerStation> mapGf = new HashMap<>();
        //理论功率-风电
        LinkedMultiValueMap<String, Double> mapLlGlFd = new LinkedMultiValueMap<String, Double>();
        //可用功率-风电
        LinkedMultiValueMap<String, Double> mapKyGlFd = new LinkedMultiValueMap<String, Double>();
        //AGC-风电
        LinkedMultiValueMap<String, Double> mapAgcFd = new LinkedMultiValueMap<String, Double>();
        //短期预测-风电
        LinkedMultiValueMap<String, Double> mapDqYcFd = new LinkedMultiValueMap<String, Double>();
        //短超期预测-风电
        LinkedMultiValueMap<String, Double> mapCdqYcFd = new LinkedMultiValueMap<String, Double>();
        //实际-风电
        LinkedMultiValueMap<String, Double> mapSjFd = new LinkedMultiValueMap<String, Double>();
        //理论功率-光伏
        LinkedMultiValueMap<String, Double> mapLlGlGf = new LinkedMultiValueMap<String, Double>();
        //可用功率-光伏
        LinkedMultiValueMap<String, Double> mapKyGlGf = new LinkedMultiValueMap<String, Double>();
        //AGC-光伏
        LinkedMultiValueMap<String, Double> mapAgcGf = new LinkedMultiValueMap<String, Double>();
        //短期预测-光伏
        LinkedMultiValueMap<String, Double> mapDqYcGf = new LinkedMultiValueMap<String, Double>();
        //短超期预测-光伏
        LinkedMultiValueMap<String, Double> mapCdqYcGf = new LinkedMultiValueMap<String, Double>();
        //实际-光伏
        LinkedMultiValueMap<String, Double> mapSjGf = new LinkedMultiValueMap<String, Double>();
        Map<String, Object> params = new HashMap<>();
        params.put("beginDataTime", DateUtil.formatDateTime(beginOfDay));
        params.put("endDataTime", DateUtil.formatDateTime(endOfDay));
        List<Windplant> windplantList = windplantService.selectWindplantListByGlFlag();
        for (Windplant windplant : windplantList) {
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                mapFd.put(modelCountFd, windplant);
                /*理论功率、可用功率开始*/
                WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                wfTheorypowerData.setWindplantNo(windplant.getWindplantNo());
                wfTheorypowerData.setParams(params);
                List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                if (wfTheorypowerDataList.size() > 0) {
                    for (WfTheorypowerData w : wfTheorypowerDataList) {
                        String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapLlGlFd, w.getTheorypower(), dataTime, modelCountFd, windplantList.size());
                        ShareController.addMapValue(mapKyGlFd, w.getAvailablepower(), dataTime, modelCountFd, windplantList.size());
                    }
                }
                /*理论功率、可用功率结束*/
                /*AGC开始*/
                WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                    WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                    wfYcHistoryData1.setAnalogNo(wpuspSvrPara.getAvgWspeedYcNo());
                    wfYcHistoryData1.setParams(params);
                    List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                    if (wfYcHistoryData1List.size() > 0) {
                        for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapAgcFd, w.getYcVal(), dataTime, modelCountFd, windplantList.size());
                        }
                    }
                }
                /*AGC结束*/
                /*风电短期预测开始*/
                NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                //风电场编号
                noscaleWfDaPfPeriodData.setWindplantNo(windplant.getWindplantNo());
                //风电短期最优模型wpfmodelNo
                noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                noscaleWfDaPfPeriodData.setParams(params);
                List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                for (NoscaleWfDaPfPeriodData n : noscaleWfDaPfPeriodDataList) {
                    String dataTime = DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm");
                    ShareController.addMapValue(mapDqYcFd, n.getValue(), dataTime, modelCountFd, windplantList.size());
                }
                /*风电短期预测结束*/
                /*风电超短期预测开始*/
                WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                //风电场编号
                wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                //风电超短期最优模型uwpfmodelNo
                wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                //超前2小时 对应7
                wfUspTsPeriodData.setTimeScale((long) 0);
                wfUspTsPeriodData.setParams(params);
                List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                if (wfUspTsPeriodDataList.size() > 0) {
                    long num = 1;
                    for (Date dl : dateList) {
                        WfUspTsPeriodData obj = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(dl))).findAny().orElse(null);
                        if (ObjectUtil.isNotNull(obj)) {
                            String dataTime = DateUtil.format(obj.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqYcFd, obj.getModPower(), dataTime, modelCountFd, windplantList.size());
                        } else {
                            WfUspTsPeriodData obj1 = wfUspTsPeriodDataService.selectWfUspTsPeriodData(windplant.getWindplantNo(), wfFileConfig.getUwpfmodelNo(), num, dl);
                            if (ObjectUtil.isNotNull(obj1)) {
                                String dataTime = DateUtil.format(obj1.getDataTime(), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapCdqYcFd, obj1.getModPower(), dataTime, modelCountFd, windplantList.size());
                            } else {
                                NoscaleWfDaPfPeriodData obj2 = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), dl);
                                if (ObjectUtil.isNotNull(obj2)) {
                                    ShareController.addMapValue(mapCdqYcFd, obj2.getValue(), DateUtil.format(obj2.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountFd, windplantList.size());
                                }
                            }
                            num++;
                        }
                    }
                }
                /*风电超短期预测结束*/
                /*风电实际功率开始*/
                WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                //风电场编号
                wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                wfStatPeriodData.setParams(params);
                List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                for (WfStatPeriodData w : wfStatPeriodDataList) {
                    String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                    ShareController.addMapValue(mapSjFd, w.getP0(), dataTime, modelCountFd, windplantList.size());
                }
                /*风电实际功率结束*/
                modelCountFd++;
            }
        }
        List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
        for (PvPowerStation pvPowerStation : pvPowerStationList) {
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                mapGf.put(modelCountGf, pvPowerStation);
                /*理论功率、可用功率开始*/
                WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                wfTheorypowerData.setWindplantNo(pvPowerStation.getPvStationNo());
                wfTheorypowerData.setParams(params);
                List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                if (wfTheorypowerDataList.size() > 0) {
                    for (WfTheorypowerData w : wfTheorypowerDataList) {
                        String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapLlGlGf, w.getTheorypower(), dataTime, modelCountGf, pvPowerStationList.size());
                        ShareController.addMapValue(mapKyGlGf, w.getAvailablepower(), dataTime, modelCountGf, pvPowerStationList.size());
                    }
                }
                /*理论功率、可用功率结束*/
                /*AGC开始*/
                WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(pvPowerStation.getPvStationNo());
                if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                    WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                    wfYcHistoryData1.setAnalogNo(wpuspSvrPara.getAvgWspeedYcNo());
                    wfYcHistoryData1.setParams(params);
                    List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                    if (wfYcHistoryData1List.size() > 0) {
                        for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapAgcGf, w.getYcVal(), dataTime, modelCountGf, pvPowerStationList.size());
                        }
                    }
                }
                /*AGC结束*/
                /*光伏短期预测开始*/
                PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                //光伏场站编号
                pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                //光伏短期最优模型wpfmodelNo
                pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                pvDaPfPeriodData.setParams(params);
                List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                for (PvDaPfPeriodData p : pvDaPfPeriodDataList) {
                    String dataTime = DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm");
                    ShareController.addMapValue(mapDqYcGf, p.getPower(), dataTime, modelCountGf, pvPowerStationList.size());
                }
                /*光伏短期预测结束*/
                /*光伏超短期预测开始*/
                PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                //光伏场站编号
                pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                //光伏超短期最优模型uwpfmodelNo
                pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                pvUspTsPeriodData.setTimeScale((long) 0);
                pvUspTsPeriodData.setParams(params);
                List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                if (pvUspTsPeriodDataList.size() > 0) {
                    long num = 1;
                    for (Date dl : dateList) {
                        PvUspTsPeriodData obj = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(dl))).findAny().orElse(null);
                        if (ObjectUtil.isNotNull(obj)) {
                            String dataTime = DateUtil.format(obj.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqYcGf, obj.getPower(), dataTime, modelCountGf, pvPowerStationList.size());
                        } else {
                            PvUspTsPeriodData obj1 = pvUspTsPeriodDataService.selectPvUspTsPeriodData(pvPowerStation.getPvStationNo(), wfFileConfig.getUwpfmodelNo(), num, dl);
                            if (ObjectUtil.isNotNull(obj1)) {
                                String dataTime = DateUtil.format(obj1.getDataTime(), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapCdqYcGf, obj1.getPower(), dataTime, modelCountGf, pvPowerStationList.size());
                            } else {
                                PvDaPfPeriodData obj2 = pvDaPfPeriodDataService.selectPvDaPfPeriodData(pvPowerStation.getPvStationNo(), wfFileConfig.getWpfmodelNo(), dl);
                                if (ObjectUtil.isNotNull(obj2)) {
                                    String dataTime = DateUtil.format(obj2.getDataTime(), "yyyy-MM-dd HH:mm");
                                    ShareController.addMapValue(mapCdqYcGf, obj2.getPower(), dataTime, modelCountGf, pvPowerStationList.size());
                                }
                            }
                            num++;
                        }
                    }
                }
                /*光伏超短期预测结束*/
                /*光伏实际功率开始*/
                WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                wfYcHistoryData1.setParams(params);
                List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                    String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                    ShareController.addMapValue(mapSjGf, w.getYcVal(), dataTime, modelCountGf, pvPowerStationList.size());
                }
                /*光伏实际功率结束*/
                modelCountGf++;
            }
        }
        List<StationInformation> stationInformationList = new ArrayList<>();
        int count1 = dateList.size();
        for (int i = 0; i < modelCountFd; i++) {
            Double[] dataLl = new Double[count1];
            Double[] dataKy = new Double[count1];
            Double[] dataAgc = new Double[count1];
            Double[] dataDq = new Double[count1];
            Double[] dataCdq = new Double[count1];
            Double[] dataSj = new Double[count1];
            for (int k = 0; k < count1; k++) {
                String dataTime = DateUtil.format(dateList.get(k), "yyyy-MM-dd HH:mm");
                List<Double> entryLlGlFd = mapLlGlFd.get(dataTime);
                if (entryLlGlFd != null) {
                    if (entryLlGlFd.size() > i && entryLlGlFd.get(i) != null) {
                        dataLl[k] = entryLlGlFd.get(i);
                    }
                }
                List<Double> entryKyGlFd = mapKyGlFd.get(dataTime);
                if (entryKyGlFd != null) {
                    if (entryKyGlFd.size() > i && entryKyGlFd.get(i) != null) {
                        dataKy[k] = entryKyGlFd.get(i);
                    }
                }
                List<Double> entryAgcFd = mapAgcFd.get(dataTime);
                if (entryAgcFd != null) {
                    if (entryAgcFd.size() > i && entryAgcFd.get(i) != null) {
                        dataAgc[k] = entryAgcFd.get(i);
                    }
                }
                List<Double> entryDqYcFd = mapDqYcFd.get(dataTime);
                if (entryDqYcFd != null) {
                    if (entryDqYcFd.size() > i && entryDqYcFd.get(i) != null) {
                        dataDq[k] = entryDqYcFd.get(i);
                    }
                }
                List<Double> entryCdqYcFd = mapCdqYcFd.get(dataTime);
                if (entryCdqYcFd != null) {
                    if (entryCdqYcFd.size() > i && entryCdqYcFd.get(i) != null) {
                        dataCdq[k] = entryCdqYcFd.get(i);
                    }
                }
                List<Double> entrySjFd = mapSjFd.get(dataTime);
                if (entrySjFd != null) {
                    if (entrySjFd.size() > i && entrySjFd.get(i) != null) {
                        dataSj[k] = entrySjFd.get(i);
                    }
                }
            }
            List<DataFormat> dataFormatList = new ArrayList<>();
            DataFormat dataFormatLl = new DataFormat();
            dataFormatLl.setName("理论");
            dataFormatLl.setData(dataLl);
            dataFormatList.add(dataFormatLl);
            DataFormat dataFormatKy = new DataFormat();
            dataFormatKy.setName("可用");
            dataFormatKy.setData(dataKy);
            dataFormatList.add(dataFormatKy);
            DataFormat dataFormatAgc = new DataFormat();
            dataFormatAgc.setName("AGC");
            dataFormatAgc.setData(dataAgc);
            dataFormatList.add(dataFormatAgc);
            DataFormat dataFormatDq = new DataFormat();
            dataFormatDq.setName("短期");
            dataFormatDq.setData(dataDq);
            dataFormatList.add(dataFormatDq);
            DataFormat dataFormatCdq = new DataFormat();
            dataFormatCdq.setName("超短期");
            dataFormatCdq.setData(dataCdq);
            dataFormatList.add(dataFormatCdq);
            DataFormat dataFormatSj = new DataFormat();
            dataFormatSj.setName("实际");
            dataFormatSj.setData(dataSj);
            dataFormatList.add(dataFormatSj);
            Windplant windplant = mapFd.get(i);
            StationInformation stationInformation = new StationInformation();
            stationInformation.setDataFormatList(dataFormatList);
            stationInformation.setStationNumber(windplant.getWindplantNo());
            stationInformation.setName(windplant.getName());
            stationInformation.setItemVal(windplant.getItemVal());
            stationInformationList.add(stationInformation);
        }
        for (int v = 0; v < modelCountGf; v++) {
            Double[] dataLl = new Double[count1];
            Double[] dataKy = new Double[count1];
            Double[] dataAgc = new Double[count1];
            Double[] dataDq = new Double[count1];
            Double[] dataCdq = new Double[count1];
            Double[] dataSj = new Double[count1];
            for (int k = 0; k < count1; k++) {
                String dataTime = DateUtil.format(dateList.get(k), "yyyy-MM-dd HH:mm");
                List<Double> entryLlGlGf = mapLlGlGf.get(dataTime);
                if (entryLlGlGf != null) {
                    if (entryLlGlGf.size() > v && entryLlGlGf.get(v) != null) {
                        dataLl[k] = entryLlGlGf.get(v);
                    }
                }
                List<Double> entryKyGlGf = mapKyGlGf.get(dataTime);
                if (entryKyGlGf != null) {
                    if (entryKyGlGf.size() > v && entryKyGlGf.get(v) != null) {
                        dataKy[k] = entryKyGlGf.get(v);
                    }
                }
                List<Double> entryAgcGf = mapAgcGf.get(dataTime);
                if (entryAgcGf != null) {
                    if (entryAgcGf.size() > v && entryAgcGf.get(v) != null) {
                        dataAgc[k] = entryAgcGf.get(v);
                    }
                }
                List<Double> entryDqYcGf = mapDqYcGf.get(dataTime);
                if (entryDqYcGf != null) {
                    if (entryDqYcGf.size() > v && entryDqYcGf.get(v) != null) {
                        dataDq[k] = entryDqYcGf.get(v);
                    }
                }
                List<Double> entryCdqYcGf = mapCdqYcGf.get(dataTime);
                if (entryCdqYcGf != null) {
                    if (entryCdqYcGf.size() > v && entryCdqYcGf.get(v) != null) {
                        dataCdq[k] = entryCdqYcGf.get(v);
                    }
                }
                List<Double> entrySjGf = mapSjGf.get(dataTime);
                if (entrySjGf != null) {
                    if (entrySjGf.size() > v && entrySjGf.get(v) != null) {
                        dataSj[k] = entrySjGf.get(v);
                    }
                }
            }
            List<DataFormat> dataFormatList = new ArrayList<>();
            DataFormat dataFormatLl = new DataFormat();
            dataFormatLl.setName("理论");
            dataFormatLl.setData(dataLl);
            dataFormatList.add(dataFormatLl);
            DataFormat dataFormatKy = new DataFormat();
            dataFormatKy.setName("可用");
            dataFormatKy.setData(dataKy);
            dataFormatList.add(dataFormatKy);
            DataFormat dataFormatAgc = new DataFormat();
            dataFormatAgc.setName("AGC");
            dataFormatAgc.setData(dataAgc);
            dataFormatList.add(dataFormatAgc);
            DataFormat dataFormatDq = new DataFormat();
            dataFormatDq.setName("短期");
            dataFormatDq.setData(dataDq);
            dataFormatList.add(dataFormatDq);
            DataFormat dataFormatCdq = new DataFormat();
            dataFormatCdq.setName("超短期");
            dataFormatCdq.setData(dataCdq);
            dataFormatList.add(dataFormatCdq);
            DataFormat dataFormatSj = new DataFormat();
            dataFormatSj.setName("实际");
            dataFormatSj.setData(dataSj);
            dataFormatList.add(dataFormatSj);
            PvPowerStation pvPowerStation = mapGf.get(v);
            StationInformation stationInformation = new StationInformation();
            stationInformation.setDataFormatList(dataFormatList);
            stationInformation.setStationNumber(pvPowerStation.getPvStationNo());
            stationInformation.setName(pvPowerStation.getName());
            stationInformation.setItemVal(pvPowerStation.getItemVal());
            stationInformationList.add(stationInformation);
        }
        json.put("stationInformationList", stationInformationList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    private static class StationInformation {

        private List<DataFormat> dataFormatList;

        private Long stationNumber;

        private String name;

        private String itemVal;

        public List<DataFormat> getDataFormatList() {
            return dataFormatList;
        }

        public void setDataFormatList(List<DataFormat> dataFormatList) {
            this.dataFormatList = dataFormatList;
        }

        public Long getStationNumber() {
            return stationNumber;
        }

        public void setStationNumber(Long stationNumber) {
            this.stationNumber = stationNumber;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getItemVal() {
            return itemVal;
        }

        public void setItemVal(String itemVal) {
            this.itemVal = itemVal;
        }
    }
}
