package com.ruoyi.predict.api;

import cn.hutool.core.date.DateField;
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.core.text.Convert;
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.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.*;
import java.util.stream.Collectors;

/**
 * @author hlf
 * @date 2021/10/27 9:18
 * 文件说明：概要
 */
@Api(value = "概要Controller", tags = {"概要操作接口"})
@Controller
@RequestMapping("/predict/api/sc")
public class SummaryController 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 IWfNwpDataService wfNwpDataService;

    @Autowired
    private IPfEvaRulsDayDataService pfEvaRulsDayDataService;

    @Autowired
    private IPfEvaRulsMonthDataService pfEvaRulsMonthDataService;

    @Autowired
    private IWfTheorypowerDataService wfTheorypowerDataService;

    @Autowired
    private IWpuspSvrParaService wpuspSvrParaService;

    @Autowired
    private IWfProjectCwWtgService wfProjectCwWtgService;

    @Autowired
    private IWturService wturService;

    @Autowired
    private IPvImmbNwpService pvImmbNwpService;

    @ApiOperation("今日功率预测")
    @GetMapping("/todayPowerForecast")
    @ResponseBody
    public AjaxResult todayPowerForecast() {
        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 modelCount = 0;
        //理论功率
        LinkedMultiValueMap<String, Double> mapLlGl = new LinkedMultiValueMap<String, Double>();
        //可用功率
        LinkedMultiValueMap<String, Double> mapKyGl = new LinkedMultiValueMap<String, Double>();
        //AGC
        LinkedMultiValueMap<String, Double> mapAgc = new LinkedMultiValueMap<String, Double>();
        //短期预测
        LinkedMultiValueMap<String, Double> mapDqYc = new LinkedMultiValueMap<String, Double>();
        //短超期预测
        LinkedMultiValueMap<String, Double> mapCdqYc = new LinkedMultiValueMap<String, Double>();
        //实际
        LinkedMultiValueMap<String, Double> mapSj = 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)) {
                /*理论功率、可用功率开始*/
                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) {
                        ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                        ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, 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) {
                            ShareController.addMapValue(mapAgc, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, 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);
                if (noscaleWfDaPfPeriodDataList.size() > 0) {
                    for (NoscaleWfDaPfPeriodData n : noscaleWfDaPfPeriodDataList) {
                        ShareController.addMapValue(mapDqYc, n.getValue(), DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, 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)) {
                            ShareController.addMapValue(mapCdqYc, obj.getModPower(), DateUtil.format(obj.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                        } else {
                            WfUspTsPeriodData obj1 = wfUspTsPeriodDataService.selectWfUspTsPeriodData(windplant.getWindplantNo(), wfFileConfig.getUwpfmodelNo(), num, dl);
                            if (ObjectUtil.isNotNull(obj1)) {
                                ShareController.addMapValue(mapCdqYc, obj1.getModPower(), DateUtil.format(obj1.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                            } else {
                                NoscaleWfDaPfPeriodData obj2 = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), dl);
                                if (ObjectUtil.isNotNull(obj2)) {
                                    ShareController.addMapValue(mapCdqYc, obj2.getValue(), DateUtil.format(obj2.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                                }
                            }
                            num++;
                        }
                    }
                }
                /*风电超短期预测结束*/
                /*风电实际功率开始*/
                WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                //风电场编号
                wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                wfStatPeriodData.setParams(params);
                List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                if (wfStatPeriodDataList.size() > 0) {
                    for (WfStatPeriodData w : wfStatPeriodDataList) {
                        ShareController.addMapValue(mapSj, w.getP0(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                    }
                }
                modelCount++;
                /*风电实际功率结束*/
            }
        }
        List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
        for (PvPowerStation pvPowerStation : pvPowerStationList) {
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*理论功率、可用功率开始*/
                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) {
                        ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                        ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.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) {
                            ShareController.addMapValue(mapAgc, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                        }
                    }
                }
                /*AGC结束*/
                /*光伏短期预测开始*/
                PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                //光伏场站编号
                pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                //光伏短期最优模型wpfmodelNo
                pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                pvDaPfPeriodData.setParams(params);
                List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                if (pvDaPfPeriodDataList.size() > 0) {
                    for (PvDaPfPeriodData p : pvDaPfPeriodDataList) {
                        ShareController.addMapValue(mapDqYc, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size() + 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)) {
                            ShareController.addMapValue(mapCdqYc, obj.getPower(), DateUtil.format(obj.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size() + pvPowerStationList.size());
                        } else {
                            PvUspTsPeriodData obj1 = pvUspTsPeriodDataService.selectPvUspTsPeriodData(pvPowerStation.getPvStationNo(), wfFileConfig.getUwpfmodelNo(), num, dl);
                            if (ObjectUtil.isNotNull(obj1)) {
                                ShareController.addMapValue(mapCdqYc, obj1.getPower(), DateUtil.format(obj1.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size() + pvPowerStationList.size());
                            } else {
                                PvDaPfPeriodData obj2 = pvDaPfPeriodDataService.selectPvDaPfPeriodData(pvPowerStation.getPvStationNo(), wfFileConfig.getWpfmodelNo(), dl);
                                if (ObjectUtil.isNotNull(obj2)) {
                                    ShareController.addMapValue(mapCdqYc, obj2.getPower(), DateUtil.format(obj2.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size() + pvPowerStationList.size());
                                }
                            }
                            num++;
                        }
                    }
                    for (PvUspTsPeriodData p : pvUspTsPeriodDataList) {
                        ShareController.addMapValue(mapCdqYc, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size() + pvPowerStationList.size());
                    }
                }
                /*光伏超短期预测结束*/
                /*光伏实际功率开始*/
                WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                wfYcHistoryData1.setParams(params);
                List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                if (wfYcHistoryData1List.size() > 0) {
                    for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                        ShareController.addMapValue(mapSj, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size() + pvPowerStationList.size());
                    }
                }
                /*光伏实际功率结束*/
                modelCount++;
            }
        }
        List<DataFormat> dataFormatList = new ArrayList<>();
        int count1 = dateList.size();
        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 dk1 = DateUtil.format(dateList.get(k), "yyyy-MM-dd HH:mm");
            List<Double> entryLl = mapLlGl.get(dk1);
            if (entryLl != null) {
                double num = 0;
                for (int i = 0; i < modelCount; i++) {
                    if (entryLl.size() > i && entryLl.get(i) != null) {
                        num += entryLl.get(i);
                    }
                }
                dataLl[k] = num;
            }
            List<Double> entryKy = mapKyGl.get(dk1);
            if (entryKy != null) {
                double num = 0;
                for (int i = 0; i < modelCount; i++) {
                    if (entryKy.size() > i && entryKy.get(i) != null) {
                        num += entryKy.get(i);
                    }
                }
                dataKy[k] = num;
            }
            List<Double> entryAgc = mapAgc.get(dk1);
            if (entryAgc != null) {
                double num = 0;
                for (int i = 0; i < modelCount; i++) {
                    if (entryAgc.size() > i && entryAgc.get(i) != null) {
                        num += entryAgc.get(i);
                    }
                }
                dataAgc[k] = num;
            }
            List<Double> entryDq = mapDqYc.get(dk1);
            if (entryDq != null) {
                double num = 0;
                for (int i = 0; i < modelCount; i++) {
                    if (entryDq.size() > i && entryDq.get(i) != null) {
                        num += entryDq.get(i);
                    }
                }
                dataDq[k] = num;
            }
            List<Double> entryCDq = mapCdqYc.get(dk1);
            if (entryCDq != null) {
                double num = 0;
                for (int i = 0; i < modelCount; i++) {
                    if (entryCDq.size() > i && entryCDq.get(i) != null) {
                        num += entryCDq.get(i);
                    }
                }
                dataCdq[k] = num;
            }
            List<Double> entrySj = mapSj.get(dk1);
            if (entrySj != null) {
                entrySj.removeAll(Collections.singleton(null));
                if (entrySj.size() == modelCount) {
                    double num = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entrySj.size() > i && entrySj.get(i) != null) {
                            num += entrySj.get(i);
                        }
                    }
                    dataSj[k] = num;
                }
            }
        }
        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);
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("今日风速预测")
    @GetMapping("/todayWindSpeedForecast")
    @ResponseBody
    public AjaxResult todayWindSpeedForecast() {
        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)));
        Map<String, Object> params = new HashMap<>();
        params.put("beginDataTime", DateUtil.formatDateTime(beginOfDay));
        params.put("endDataTime", DateUtil.formatDateTime(endOfDay));
        List<DataFormat> dataFormatList = new ArrayList<>();
        int count1 = dateList.size();
        List<Windplant> windplantList = windplantService.selectWindplantListByGlFlag();
        for (Windplant windplant : windplantList) {
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(windplant.getWindplantNo());
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(params);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                Map<Date, List<WfNwpData>> map = wfNwpDataList.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                Double[] data = new Double[count1];
                int num = 0;
                for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                    List<WfNwpData> value = entry.getValue();
                    double windSpeed = 0;
                    if (value.size() > 0) {
                        //排序
                        value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                        windSpeed = value.get(0).getWindSpeed();
                    }
                    data[num] = windSpeed;
                    num++;
                }
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName(windplant.getName());
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("今日辐照度预测")
    @GetMapping("/todayIrradianceForecast")
    @ResponseBody
    public AjaxResult todayIrradianceForecast() {
        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)));
        Map<String, Object> params = new HashMap<>();
        params.put("beginDataTime", DateUtil.formatDateTime(beginOfDay));
        params.put("endDataTime", DateUtil.formatDateTime(endOfDay));
        List<DataFormat> dataFormatList = new ArrayList<>();
        int count1 = dateList.size();
        List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
        for (PvPowerStation pvPowerStation : pvPowerStationList) {
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(pvPowerStation.getPvStationNo());
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(params);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                Map<Date, List<PvImmbNwp>> map = pvImmbNwpList.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                Double[] data = new Double[count1];
                int num = 0;
                for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                    List<PvImmbNwp> value = entry.getValue();
                    if (value.size() > 0) {
                        //排序
                        value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                        data[num] = value.get(0).getSwRadiation();
                    }
                    num++;
                }
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName(pvPowerStation.getName());
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("功率统计")
    @GetMapping("/installedCapacity")
    @ResponseBody
    public AjaxResult installedCapacity() {
        JSONObject json = new JSONObject();
        List<DataFormat> dataFormatList = new ArrayList<>();
        double ratedPower = 0;
        double p0 = 0;
        double ycVal = 0;
        double availablepowerFd = 0;
        double availablepowerGf = 0;
        Map<String, Object> params = new HashMap<>();
        params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.date(DateUtil.beginOfDay(DateUtil.date()).getTime() + 900000)));
        params.put("endDataTime", DateUtil.formatDateTime(DateUtil.date(DateUtil.endOfDay(DateUtil.date()).getTime() + 1000)));
        //风电
        List<Windplant> windplantList = windplantService.selectWindplantListByGlFlag();
        for (Windplant windplant : windplantList) {
            //并网
            List<WfProjectCwWtg> wfProjectCwWtgList = wfProjectCwWtgService.selectWfProjectCwWtgByWindplantNo(windplant.getWindplantNo());
            for (WfProjectCwWtg wfProjectCwWtg : wfProjectCwWtgList) {
                if (wfProjectCwWtg.getMag() == 1) {//运行
                    Wtur wtur = wturService.selectWturById(wfProjectCwWtg.getWtgNo());
                    if (ObjectUtil.isNotNull(wtur)) {
                        ratedPower += wtur.getRatedPower();
                    }
                }
            }
            //实时
            WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
            wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
            wfStatPeriodData.setParams(params);
            List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
            if (wfStatPeriodDataList.size() > 0) {
                p0 += wfStatPeriodDataList.get(wfStatPeriodDataList.size() - 1).getP0();
            }
            //可用
            WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
            wfTheorypowerData.setWindplantNo(windplant.getWindplantNo());
            wfTheorypowerData.setParams(params);
            List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
            if (wfTheorypowerDataList.size() > 0) {
                availablepowerFd += wfTheorypowerDataList.get(wfTheorypowerDataList.size() - 1).getAvailablepower();
            }
        }
        //装机
        double installPower = windplantList.stream().mapToDouble(Windplant::getInstallPower).sum();
        //光伏
        List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
        for (PvPowerStation pvPowerStation : pvPowerStationList) {
            //实时
            WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
            wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
            wfYcHistoryData1.setParams(params);
            List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
            if (wfYcHistoryData1List.size() > 0) {
                ycVal += wfYcHistoryData1List.get(wfYcHistoryData1List.size() - 1).getYcVal();
            }
            //可用
            WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
            wfTheorypowerData.setWindplantNo(pvPowerStation.getPvStationNo());
            wfTheorypowerData.setParams(params);
            List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
            if (wfTheorypowerDataList.size() > 0) {
                availablepowerGf += wfTheorypowerDataList.get(wfTheorypowerDataList.size() - 1).getAvailablepower();
            }
        }
        //装机
        double ratingPower = pvPowerStationList.stream().mapToDouble(PvPowerStation::getRatingPower).sum();
        Double[] dataZj = new Double[2];
        dataZj[0] = installPower;
        dataZj[1] = ratingPower;
        DataFormat dataFormatZj = new DataFormat();
        dataFormatZj.setName("装机");
        dataFormatZj.setData(dataZj);
        dataFormatList.add(dataFormatZj);
        Double[] dataBw = new Double[2];
        dataBw[0] = ratedPower / 1000;
        DataFormat dataFormatBw = new DataFormat();
        dataFormatBw.setName("并网");
        dataFormatBw.setData(dataBw);
        dataFormatList.add(dataFormatBw);
        Double[] dataSs = new Double[2];
        dataSs[0] = p0;
        dataSs[1] = ycVal;
        DataFormat dataFormatSs = new DataFormat();
        dataFormatSs.setName("实时");
        dataFormatSs.setData(dataSs);
        dataFormatList.add(dataFormatSs);
        Double[] dataKy = new Double[2];
        dataKy[0] = availablepowerFd;
        dataKy[1] = availablepowerGf;
        DataFormat dataFormatKy = new DataFormat();
        dataFormatKy.setName("可用");
        dataFormatKy.setData(dataKy);
        dataFormatList.add(dataFormatKy);
        json.put("dataFormatList", dataFormatList);
        json.put("name", new String[]{"风电", "光伏"});
        return AjaxResult.success(json);
    }

    @ApiOperation("预测考核分数")
    @GetMapping("/predictedAssessmentScores")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "statisticType", value = "类型(0日统计 1月统计 2年统计)", required = true),
    })
    public AjaxResult predictedAssessmentScores(@RequestParam(value = "statisticType") int statisticType) {
        JSONObject json = new JSONObject();
        List<DataFormat> dataFormatList = new ArrayList<>();
        if (statisticType == 0) {//日统计
            List<Windplant> windplantList = windplantService.selectWindplantListByGlFlag();
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    double accuracyRateDlDq = 0;
                    double accuracyRateDlCdq = 0;
                    //短期type=-1 超短期type=7
                    long type;
                    long modelNo;
                    for (int i = 0; i < 2; i++) {
                        if (i == 0) {//短期
                            type = -1;
                            modelNo = wfFileConfig.getWpfmodelNo();
                        } else {//超短期
                            type = 7;
                            modelNo = wfFileConfig.getUwpfmodelNo();
                        }
                        PfEvaRulsDayData pfEvaRulsDayData = new PfEvaRulsDayData();
                        pfEvaRulsDayData.setRtuNo(windplant.getWindplantNo());
                        pfEvaRulsDayData.setModelNo(modelNo);
                        pfEvaRulsDayData.setType(type);
                        pfEvaRulsDayData.setDataTime(DateUtil.parse(DateUtil.formatDate(DateUtil.yesterday()), "yyyy-MM-dd"));
                        List<PfEvaRulsDayData> pfEvaRulsDayDataList = pfEvaRulsDayDataService.selectPfEvaRulsDayDataList(pfEvaRulsDayData);
                        if (pfEvaRulsDayDataList.size() > 0) {
                            if (i == 0) {
                                accuracyRateDlDq = pfEvaRulsDayDataList.get(0).getAccuracyRateDl();
                            } else {
                                accuracyRateDlCdq = pfEvaRulsDayDataList.get(0).getAccuracyRateDl();
                            }
                        }
                    }
                    Double[] data = new Double[2];
                    data[0] = accuracyRateDlDq;
                    data[1] = accuracyRateDlCdq;
                    DataFormat dataFormat = new DataFormat();
                    dataFormat.setName(windplant.getName());
                    dataFormat.setData(data);
                    dataFormatList.add(dataFormat);
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    double accuracyRateDlDq = 0;
                    double accuracyRateDlCdq = 0;
                    //短期type=-1 超短期type=7
                    long type;
                    long modelNo;
                    for (int i = 0; i < 2; i++) {
                        if (i == 0) {//短期
                            type = -1;
                            modelNo = wfFileConfig.getWpfmodelNo();
                        } else {//超短期
                            type = 7;
                            modelNo = wfFileConfig.getUwpfmodelNo();
                        }
                        PfEvaRulsDayData pfEvaRulsDayData = new PfEvaRulsDayData();
                        pfEvaRulsDayData.setRtuNo(pvPowerStation.getPvStationNo());
                        pfEvaRulsDayData.setModelNo(modelNo);
                        pfEvaRulsDayData.setType(type);
                        pfEvaRulsDayData.setDataTime(DateUtil.parse(DateUtil.formatDate(DateUtil.yesterday()), "yyyy-MM-dd"));
                        List<PfEvaRulsDayData> pfEvaRulsDayDataList = pfEvaRulsDayDataService.selectPfEvaRulsDayDataList(pfEvaRulsDayData);
                        if (pfEvaRulsDayDataList.size() > 0) {
                            if (i == 0) {
                                accuracyRateDlDq = pfEvaRulsDayDataList.get(0).getAccuracyRateDl();
                            } else {
                                accuracyRateDlCdq = pfEvaRulsDayDataList.get(0).getAccuracyRateDl();
                            }
                        }
                    }
                    Double[] data = new Double[2];
                    data[0] = accuracyRateDlDq;
                    data[1] = accuracyRateDlCdq;
                    DataFormat dataFormat = new DataFormat();
                    dataFormat.setName(pvPowerStation.getName());
                    dataFormat.setData(data);
                    dataFormatList.add(dataFormat);
                }
            }
        } else if (statisticType == 1) {//月统计
            //当月的开始时间
            Date beginOfYear = DateUtil.beginOfMonth(DateUtil.date());
            //昨日的结束时间
            Date endOfYear = DateUtil.endOfDay(DateUtil.yesterday());
            Map<String, Object> params = new HashMap<>();
            params.put("beginDataTime", DateUtil.formatDateTime(beginOfYear));
            params.put("endDataTime", DateUtil.formatDateTime(endOfYear));
            List<Windplant> windplantList = windplantService.selectWindplantListByGlFlag();
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    double accuracyRateDlDq = 0;
                    double accuracyRateDlCdq = 0;
                    //短期type=-1 超短期type=7
                    long type;
                    long modelNo;
                    for (int i = 0; i < 2; i++) {
                        if (i == 0) {//短期
                            type = -1;
                            modelNo = wfFileConfig.getWpfmodelNo();
                        } else {//超短期
                            type = 7;
                            modelNo = wfFileConfig.getUwpfmodelNo();
                        }
                        PfEvaRulsDayData pfEvaRulsDayData = new PfEvaRulsDayData();
                        pfEvaRulsDayData.setRtuNo(windplant.getWindplantNo());
                        pfEvaRulsDayData.setModelNo(modelNo);
                        pfEvaRulsDayData.setType(type);
                        pfEvaRulsDayData.setParams(params);
                        List<PfEvaRulsDayData> pfEvaRulsDayDataList = pfEvaRulsDayDataService.selectPfEvaRulsDayDataList(pfEvaRulsDayData);
                        if (pfEvaRulsDayDataList.size() > 0) {
                            if (i == 0) {
                                accuracyRateDlDq = pfEvaRulsDayDataList.stream().mapToDouble(PfEvaRulsDayData::getAccuracyRateDl).sum();
                            } else {
                                accuracyRateDlCdq = pfEvaRulsDayDataList.stream().mapToDouble(PfEvaRulsDayData::getAccuracyRateDl).sum();
                            }
                        }
                    }
                    Double[] data = new Double[2];
                    data[0] = accuracyRateDlDq;
                    data[1] = accuracyRateDlCdq;
                    DataFormat dataFormat = new DataFormat();
                    dataFormat.setName(windplant.getName());
                    dataFormat.setData(data);
                    dataFormatList.add(dataFormat);
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    double accuracyRateDlDq = 0;
                    double accuracyRateDlCdq = 0;
                    //短期type=-1 超短期type=7
                    long type;
                    long modelNo;
                    for (int i = 0; i < 2; i++) {
                        if (i == 0) {//短期
                            type = -1;
                            modelNo = wfFileConfig.getWpfmodelNo();
                        } else {//超短期
                            type = 7;
                            modelNo = wfFileConfig.getUwpfmodelNo();
                        }
                        PfEvaRulsDayData pfEvaRulsDayData = new PfEvaRulsDayData();
                        pfEvaRulsDayData.setRtuNo(pvPowerStation.getPvStationNo());
                        pfEvaRulsDayData.setModelNo(modelNo);
                        pfEvaRulsDayData.setType(type);
                        pfEvaRulsDayData.setParams(params);
                        List<PfEvaRulsDayData> pfEvaRulsDayDataList = pfEvaRulsDayDataService.selectPfEvaRulsDayDataList(pfEvaRulsDayData);
                        if (pfEvaRulsDayDataList.size() > 0) {
                            if (i == 0) {
                                accuracyRateDlDq = pfEvaRulsDayDataList.stream().mapToDouble(PfEvaRulsDayData::getAccuracyRateDl).sum();
                            } else {
                                accuracyRateDlCdq = pfEvaRulsDayDataList.stream().mapToDouble(PfEvaRulsDayData::getAccuracyRateDl).sum();
                            }
                        }
                    }
                    Double[] data = new Double[2];
                    data[0] = accuracyRateDlDq;
                    data[1] = accuracyRateDlCdq;
                    DataFormat dataFormat = new DataFormat();
                    dataFormat.setName(pvPowerStation.getName());
                    dataFormat.setData(data);
                    dataFormatList.add(dataFormat);
                }
            }
        } else if (statisticType == 2) {//年统计
            //当年的开始时间
            Date beginOfYear1 = DateUtil.beginOfYear(DateUtil.date());
            //当年的上月结束时间
            Date endOfYear1 = DateUtil.lastMonth();
            Map<String, Object> params1 = new HashMap<>();
            params1.put("beginDataTime", DateUtil.formatDateTime(beginOfYear1));
            params1.put("endDataTime", DateUtil.formatDateTime(endOfYear1));
            //当月的开始时间
            Date beginOfYear2 = DateUtil.beginOfMonth(DateUtil.date());
            //昨日的结束时间
            Date endOfYear2 = DateUtil.endOfDay(DateUtil.yesterday());
            Map<String, Object> params2 = new HashMap<>();
            params2.put("beginDataTime", DateUtil.formatDateTime(beginOfYear2));
            params2.put("endDataTime", DateUtil.formatDateTime(endOfYear2));
            List<Windplant> windplantList = windplantService.selectWindplantListByGlFlag();
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    double accuracyRateDlDq = 0;
                    double accuracyRateDlCdq = 0;
                    //短期type=-1 超短期type=7
                    long type;
                    long modelNo;
                    for (int i = 0; i < 2; i++) {
                        if (i == 0) {//短期
                            type = -1;
                            modelNo = wfFileConfig.getWpfmodelNo();
                        } else {//超短期
                            type = 7;
                            modelNo = wfFileConfig.getUwpfmodelNo();
                        }
                        PfEvaRulsMonthData pfEvaRulsMonthData = new PfEvaRulsMonthData();
                        pfEvaRulsMonthData.setRtuNo(windplant.getWindplantNo());
                        pfEvaRulsMonthData.setModelNo(modelNo);
                        pfEvaRulsMonthData.setType(type);
                        pfEvaRulsMonthData.setParams(params1);
                        List<PfEvaRulsMonthData> pfEvaRulsMonthDataList = pfEvaRulsMonthDataService.selectPfEvaRulsMonthDataList(pfEvaRulsMonthData);
                        if (pfEvaRulsMonthDataList.size() > 0) {
                            if (i == 0) {
                                accuracyRateDlDq = pfEvaRulsMonthDataList.stream().mapToDouble(PfEvaRulsMonthData::getAccuracyRateDl).sum();
                            } else {
                                accuracyRateDlCdq = pfEvaRulsMonthDataList.stream().mapToDouble(PfEvaRulsMonthData::getAccuracyRateDl).sum();
                            }
                        }
                        PfEvaRulsDayData pfEvaRulsDayData = new PfEvaRulsDayData();
                        pfEvaRulsDayData.setRtuNo(windplant.getWindplantNo());
                        pfEvaRulsDayData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pfEvaRulsDayData.setType(type);
                        pfEvaRulsDayData.setParams(params2);
                        List<PfEvaRulsDayData> pfEvaRulsDayDataList = pfEvaRulsDayDataService.selectPfEvaRulsDayDataList(pfEvaRulsDayData);
                        if (pfEvaRulsDayDataList.size() > 0) {
                            if (i == 0) {
                                accuracyRateDlDq += pfEvaRulsDayDataList.stream().mapToDouble(PfEvaRulsDayData::getAccuracyRateDl).sum();
                            } else {
                                accuracyRateDlCdq += pfEvaRulsDayDataList.stream().mapToDouble(PfEvaRulsDayData::getAccuracyRateDl).sum();
                            }
                        }
                    }
                    Double[] data = new Double[2];
                    data[0] = accuracyRateDlDq;
                    data[1] = accuracyRateDlCdq;
                    DataFormat dataFormat = new DataFormat();
                    dataFormat.setName(windplant.getName());
                    dataFormat.setData(data);
                    dataFormatList.add(dataFormat);
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    double accuracyRateDlDq = 0;
                    double accuracyRateDlCdq = 0;
                    //短期type=-1 超短期type=7
                    long type;
                    long modelNo;
                    for (int i = 0; i < 2; i++) {
                        if (i == 0) {//短期
                            type = -1;
                            modelNo = wfFileConfig.getWpfmodelNo();
                        } else {//超短期
                            type = 7;
                            modelNo = wfFileConfig.getUwpfmodelNo();
                        }
                        PfEvaRulsMonthData pfEvaRulsMonthData = new PfEvaRulsMonthData();
                        pfEvaRulsMonthData.setRtuNo(pvPowerStation.getPvStationNo());
                        pfEvaRulsMonthData.setModelNo(modelNo);
                        pfEvaRulsMonthData.setType(type);
                        pfEvaRulsMonthData.setParams(params1);
                        List<PfEvaRulsMonthData> pfEvaRulsMonthDataList = pfEvaRulsMonthDataService.selectPfEvaRulsMonthDataList(pfEvaRulsMonthData);
                        if (pfEvaRulsMonthDataList.size() > 0) {
                            if (i == 0) {
                                accuracyRateDlDq = pfEvaRulsMonthDataList.stream().mapToDouble(PfEvaRulsMonthData::getAccuracyRateDl).sum();
                            } else {
                                accuracyRateDlCdq = pfEvaRulsMonthDataList.stream().mapToDouble(PfEvaRulsMonthData::getAccuracyRateDl).sum();
                            }
                        }
                        PfEvaRulsDayData pfEvaRulsDayData = new PfEvaRulsDayData();
                        pfEvaRulsDayData.setRtuNo(pvPowerStation.getPvStationNo());
                        pfEvaRulsDayData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pfEvaRulsDayData.setType(type);
                        pfEvaRulsDayData.setParams(params2);
                        List<PfEvaRulsDayData> pfEvaRulsDayDataList = pfEvaRulsDayDataService.selectPfEvaRulsDayDataList(pfEvaRulsDayData);
                        if (pfEvaRulsDayDataList.size() > 0) {
                            if (i == 0) {
                                accuracyRateDlDq += pfEvaRulsDayDataList.stream().mapToDouble(PfEvaRulsDayData::getAccuracyRateDl).sum();
                            } else {
                                accuracyRateDlCdq += pfEvaRulsDayDataList.stream().mapToDouble(PfEvaRulsDayData::getAccuracyRateDl).sum();
                            }
                        }
                    }
                    Double[] data = new Double[2];
                    data[0] = accuracyRateDlDq;
                    data[1] = accuracyRateDlCdq;
                    DataFormat dataFormat = new DataFormat();
                    dataFormat.setName(pvPowerStation.getName());
                    dataFormat.setData(data);
                    dataFormatList.add(dataFormat);
                }
            }
        }
        json.put("dataFormatList", dataFormatList);
        json.put("name", new String[]{"短期考核", "超短期考核"});
        return AjaxResult.success(json);
    }

    @ApiOperation("Chart-全域功率预测")
    @GetMapping("/globalPowerPredictionChartData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
            @ApiImplicitParam(name = "timeType", value = "时间类型(10天内传1,10天外传2)", required = true),
            @ApiImplicitParam(name = "leadTime", value = "超前时间(默认传7)", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult globalPowerPredictionChartData(@RequestParam(value = "stationNumber") String stationNumber,
                                                     @RequestParam(value = "itemVal") int itemVal,
                                                     @RequestParam(value = "timeType") int timeType,
                                                     @RequestParam(value = "leadTime") String leadTime,
                                                     @RequestParam(value = "beginDataTime") String beginDataTime,
                                                     @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //获取所有时间
        List<Date> dateList = new ArrayList<>();
        //场站总数
        int modelCount = 0;
        //理论功率
        LinkedMultiValueMap<String, Double> mapLlGl = new LinkedMultiValueMap<String, Double>();
        //可用功率
        LinkedMultiValueMap<String, Double> mapKyGl = new LinkedMultiValueMap<String, Double>();
        //AGC
        LinkedMultiValueMap<String, Double> mapAgc = new LinkedMultiValueMap<String, Double>();
        //短期预测
        LinkedMultiValueMap<String, Double> mapDqYc = new LinkedMultiValueMap<String, Double>();
        //短超期预测
        LinkedMultiValueMap<String, Double> mapCdqYc = new LinkedMultiValueMap<String, Double>();
        //实际
        LinkedMultiValueMap<String, Double> mapSj = new LinkedMultiValueMap<String, Double>();
        if ("-1".equals(stationNumber)) {//全域数据
            //获取所有风场场站
            List<Windplant> windplantList = windplantService.selectWindplantListByGlFlag();
            //获取所有光伏场站
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            if (timeType == 1) {//10天内
                dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
                Map<String, Object> params = new HashMap<>();
                params.put("beginDataTime", beginDataTime);
                params.put("endDataTime", endDataTime);
                for (Windplant windplant : windplantList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        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) {
                                ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                                ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, 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) {
                                    ShareController.addMapValue(mapAgc, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, 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);
                        if (noscaleWfDaPfPeriodDataList.size() > 0) {
                            for (NoscaleWfDaPfPeriodData n : noscaleWfDaPfPeriodDataList) {
                                ShareController.addMapValue(mapDqYc, n.getValue(), DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                            }
                        }
                        /*风电短期预测结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(params);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        if (wfUspTsPeriodDataList.size() > 0) {
                            for (WfUspTsPeriodData w : wfUspTsPeriodDataList) {
                                ShareController.addMapValue(mapCdqYc, w.getModPower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                        wfStatPeriodData.setParams(params);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        if (wfStatPeriodDataList.size() > 0) {
                            for (WfStatPeriodData w : wfStatPeriodDataList) {
                                ShareController.addMapValue(mapSj, w.getP0(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                            }
                        }
                        /*风电实际功率结束*/
                        modelCount++;
                    }
                }
                for (PvPowerStation pvPowerStation : pvPowerStationList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        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) {
                                ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                                ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.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) {
                                    ShareController.addMapValue(mapAgc, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size());
                                }
                            }
                        }
                        /*AGC结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(params);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        if (pvDaPfPeriodDataList.size() > 0) {
                            for (PvDaPfPeriodData p : pvDaPfPeriodDataList) {
                                ShareController.addMapValue(mapDqYc, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏短期预测结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(params);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        if (pvUspTsPeriodDataList.size() > 0) {
                            for (PvUspTsPeriodData p : pvUspTsPeriodDataList) {
                                ShareController.addMapValue(mapCdqYc, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(params);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        if (wfYcHistoryData1List.size() > 0) {
                            for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                                ShareController.addMapValue(mapSj, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCount, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏实际功率结束*/
                        modelCount++;
                    }
                }
            } else if (timeType == 2) {//10天外
                Date bDT = DateUtil.parse(beginDataTime);
                Date eDT = DateUtil.parse(endDataTime);
                List<Date> dl = DateTimeUtil.getDayBetween(bDT, eDT);
                dateList.addAll(dl);
                Map<String, Object> params = new HashMap<>();
                params.put("beginDataTime", DateUtil.formatDateTime(bDT));
                params.put("endDataTime", DateUtil.formatDateTime(eDT));
                for (Windplant windplant : windplantList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(windplant.getWindplantNo());
                        wfTheorypowerData.setParams(params);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dl) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, modelCount, windplantList.size());
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, modelCount, 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 (Date date : dl) {
                                    String dataTime = DateUtil.formatDate(date);
                                    List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                    WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                    if (list.size() > 0) {
                                        double lastYcVal = 0;
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            lastYcVal = lastData.getYcVal();
                                        }
                                        double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                        ShareController.addMapValue(mapAgc, ycValCount / list.size(), dataTime, modelCount, 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);
                        if (noscaleWfDaPfPeriodDataList.size() > 0) {
                            for (Date date : dl) {
                                String dataTime = DateUtil.formatDate(date);
                                List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastValue = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastValue = lastData.getValue();
                                    }
                                    double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                    ShareController.addMapValue(mapDqYc, valueCount / list.size(), dataTime, modelCount, windplantList.size());
                                }
                            }
                        }
                        /*风电短期预测结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(params);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        if (wfUspTsPeriodDataList.size() > 0) {
                            for (Date date : dl) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastModPower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastModPower = lastData.getModPower();
                                    }
                                    double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                    ShareController.addMapValue(mapCdqYc, modPowerCount / list.size(), dataTime, modelCount, windplantList.size());
                                }
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                        wfStatPeriodData.setParams(params);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        if (wfStatPeriodDataList.size() > 0) {
                            for (Date date : dl) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastP0 = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastP0 = lastData.getP0();
                                    }
                                    double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                    ShareController.addMapValue(mapSj, p0Count / list.size(), dataTime, modelCount, windplantList.size());
                                }
                            }
                        }
                        /*风电实际功率结束*/
                        modelCount++;
                    }
                }
                for (PvPowerStation pvPowerStation : pvPowerStationList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(pvPowerStation.getPvStationNo());
                        wfTheorypowerData.setParams(params);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dl) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, modelCount, windplantList.size());
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, modelCount, windplantList.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 (Date date : dl) {
                                    String dataTime = DateUtil.formatDate(date);
                                    List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                    WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                    if (list.size() > 0) {
                                        double lastYcVal = 0;
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            lastYcVal = lastData.getYcVal();
                                        }
                                        double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                        ShareController.addMapValue(mapAgc, ycValCount / list.size(), dataTime, modelCount, windplantList.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 (Date date : dl) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYc, powerCount / list.size(), dataTime, modelCount, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏短期预测结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(params);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dl) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYc, powerCount / list.size(), dataTime, modelCount, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(params);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dl) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSj, ycValCount / list.size(), dataTime, modelCount, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏实际功率结束*/
                        modelCount++;
                    }
                }
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                if (timeType == 1) {//10天内
                    dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", beginDataTime);
                    params.put("endDataTime", endDataTime);
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(params);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (WfTheorypowerData w : wfTheorypowerDataList) {
                                ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                                ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*AGC开始*/
                        WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                        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) {
                                    ShareController.addMapValue(mapAgc, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                                }
                            }
                        }
                        /*AGC结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(params);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (NoscaleWfDaPfPeriodData n : noscaleWfDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYc, n.getValue(), DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*风电短期预测结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(params);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (WfUspTsPeriodData w : wfUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYc, w.getModPower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*风电超短期预测结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        wfStatPeriodData.setParams(params);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (WfStatPeriodData w : wfStatPeriodDataList) {
                            ShareController.addMapValue(mapSj, w.getP0(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*风电实际功率结束*/
                    }
                } else if (timeType == 2) {//10天外
                    Date bDT = DateUtil.parse(beginDataTime);
                    Date eDT = DateUtil.parse(endDataTime);
                    List<Date> dl = DateTimeUtil.getDayBetween(bDT, eDT);
                    dateList.addAll(dl);
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(bDT));
                    params.put("endDataTime", DateUtil.formatDateTime(eDT));
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(params);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dl) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, 0, 1);
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, 0, 1);
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*AGC开始*/
                        WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                        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 (Date date : dl) {
                                    String dataTime = DateUtil.formatDate(date);
                                    List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                    WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                    if (list.size() > 0) {
                                        double lastYcVal = 0;
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            lastYcVal = lastData.getYcVal();
                                        }
                                        double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                        ShareController.addMapValue(mapAgc, ycValCount / list.size(), dataTime, 0, 1);
                                    }
                                }
                            }
                        }
                        /*AGC结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(params);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dl) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYc, valueCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电短期预测结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(params);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dl) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYc, modPowerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        wfStatPeriodData.setParams(params);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dl) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSj, p0Count / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电实际功率结束*/
                    }
                }
            } else if (itemVal == 4) {//光伏电站
                PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                if (timeType == 1) {//10天内
                    dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", beginDataTime);
                    params.put("endDataTime", endDataTime);
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(params);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (WfTheorypowerData w : wfTheorypowerDataList) {
                                ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                                ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*AGC开始*/
                        WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                        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) {
                                    ShareController.addMapValue(mapAgc, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                                }
                            }
                        }
                        /*AGC结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(params);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (PvDaPfPeriodData p : pvDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYc, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*光伏短期预测结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(params);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (PvUspTsPeriodData p : pvUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYc, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*光伏超短期预测结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(params);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                            ShareController.addMapValue(mapSj, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*光伏实际功率结束*/
                    }
                } else if (timeType == 2) {//10天外
                    Date bDT = DateUtil.parse(beginDataTime);
                    Date eDT = DateUtil.parse(endDataTime);
                    List<Date> dl = DateTimeUtil.getDayBetween(bDT, eDT);
                    dateList.addAll(dl);
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(bDT));
                    params.put("endDataTime", DateUtil.formatDateTime(eDT));
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(params);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dl) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, 0, 1);
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, 0, 1);
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*AGC开始*/
                        WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                        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 (Date date : dl) {
                                    String dataTime = DateUtil.formatDate(date);
                                    List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                    WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                    if (list.size() > 0) {
                                        double lastYcVal = 0;
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            lastYcVal = lastData.getYcVal();
                                        }
                                        double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                        ShareController.addMapValue(mapAgc, ycValCount / list.size(), dataTime, 0, 1);
                                    }
                                }
                            }
                        }
                        /*AGC结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(params);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dl) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYc, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏短期预测结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(params);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dl) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYc, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(params);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dl) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSj, ycValCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏实际功率结束*/
                    }
                }
            }
        }
        List<DataFormat> dataFormatList = new ArrayList<>();
        int count1 = dateList.size();
        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++) {
            if ("-1".equals(stationNumber)) {//全域数据
                if (timeType == 1) {//10天内
                    String dk1 = DateUtil.format(dateList.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entryLl = mapLlGl.get(dk1);
                    if (entryLl != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryLl.size() > i && entryLl.get(i) != null) {
                                num += entryLl.get(i);
                            }
                        }
                        dataLl[k] = num;
                    }
                    List<Double> entryKy = mapKyGl.get(dk1);
                    if (entryKy != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryKy.size() > i && entryKy.get(i) != null) {
                                num += entryKy.get(i);
                            }
                        }
                        dataKy[k] = num;
                    }
                    List<Double> entryAgc = mapAgc.get(dk1);
                    if (entryAgc != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryAgc.size() > i && entryAgc.get(i) != null) {
                                num += entryAgc.get(i);
                            }
                        }
                        dataAgc[k] = num;
                    }
                    List<Double> entryDq = mapDqYc.get(dk1);
                    if (entryDq != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryDq.size() > i && entryDq.get(i) != null) {
                                num += entryDq.get(i);
                            }
                        }
                        dataDq[k] = num;
                    }
                    List<Double> entryCDq = mapCdqYc.get(dk1);
                    if (entryCDq != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryCDq.size() > i && entryCDq.get(i) != null) {
                                num += entryCDq.get(i);
                            }
                        }
                        dataCdq[k] = num;
                    }
                    List<Double> entrySj = mapSj.get(dk1);
                    if (entrySj != null) {
                        entrySj.removeAll(Collections.singleton(null));
                        if (entrySj.size() == modelCount) {
                            double num = 0;
                            for (int i = 0; i < modelCount; i++) {
                                if (entrySj.size() > i && entrySj.get(i) != null) {
                                    num += entrySj.get(i);
                                }
                            }
                            dataSj[k] = num;
                        }
                    }
                } else {//10天外
                    String dk2 = DateUtil.formatDate(dateList.get(k));
                    List<Double> entryLl = mapLlGl.get(dk2);
                    if (entryLl != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryLl.size() > i && entryLl.get(i) != null) {
                                num += entryLl.get(i);
                            }
                        }
                        dataLl[k] = num;
                    }
                    List<Double> entryKy = mapKyGl.get(dk2);
                    if (entryKy != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryKy.size() > i && entryKy.get(i) != null) {
                                num += entryKy.get(i);
                            }
                        }
                        dataKy[k] = num;
                    }
                    List<Double> entryAgc = mapAgc.get(dk2);
                    if (entryAgc != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryAgc.size() > i && entryAgc.get(i) != null) {
                                num += entryAgc.get(i);
                            }
                        }
                        dataAgc[k] = num;
                    }
                    List<Double> entryDq = mapDqYc.get(dk2);
                    if (entryDq != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryDq.size() > i && entryDq.get(i) != null) {
                                num += entryDq.get(i);
                            }
                        }
                        dataDq[k] = num;
                    }
                    List<Double> entryCDq = mapCdqYc.get(dk2);
                    if (entryCDq != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryCDq.size() > i && entryCDq.get(i) != null) {
                                num += entryCDq.get(i);
                            }
                        }
                        dataCdq[k] = num;
                    }
                    List<Double> entrySj = mapSj.get(dk2);
                    if (entrySj != null) {
                        entrySj.removeAll(Collections.singleton(null));
                        if (entrySj.size() == modelCount) {
                            double num = 0;
                            for (int i = 0; i < modelCount; i++) {
                                if (entrySj.size() > i && entrySj.get(i) != null) {
                                    num += entrySj.get(i);
                                }
                            }
                            dataSj[k] = num;
                        }
                    }
                }
            } else {//各个场站数据
                if (timeType == 1) {//10天内
                    String dk1 = DateUtil.format(dateList.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entryLl = mapLlGl.get(dk1);
                    if (entryLl != null) {
                        if (entryLl.size() >= 1) {
                            dataLl[k] = entryLl.get(0);
                        }
                    }
                    List<Double> entryKy = mapKyGl.get(dk1);
                    if (entryKy != null) {
                        if (entryKy.size() >= 1) {
                            dataKy[k] = entryKy.get(0);
                        }
                    }
                    List<Double> entryAgc = mapAgc.get(dk1);
                    if (entryAgc != null) {
                        if (entryAgc.size() >= 1) {
                            dataAgc[k] = entryAgc.get(0);
                        }
                    }
                    List<Double> entryDq = mapDqYc.get(dk1);
                    if (entryDq != null) {
                        if (entryDq.size() >= 1) {
                            dataDq[k] = entryDq.get(0);
                        }
                    }
                    List<Double> entryCDq = mapCdqYc.get(dk1);
                    if (entryCDq != null) {
                        if (entryCDq.size() >= 1) {
                            dataCdq[k] = entryCDq.get(0);
                        }
                    }
                    List<Double> entrySj = mapSj.get(dk1);
                    if (entrySj != null) {
                        if (entrySj.size() >= 1) {
                            dataSj[k] = entrySj.get(0);
                        }
                    }
                } else {//10天外
                    String dk2 = DateUtil.formatDate(dateList.get(k));
                    List<Double> entryLl = mapLlGl.get(dk2);
                    if (entryLl != null) {
                        if (entryLl.size() >= 1) {
                            dataLl[k] = entryLl.get(0);
                        }
                    }
                    List<Double> entryKy = mapKyGl.get(dk2);
                    if (entryKy != null) {
                        if (entryKy.size() >= 1) {
                            dataKy[k] = entryKy.get(0);
                        }
                    }
                    List<Double> entryAgc = mapAgc.get(dk2);
                    if (entryAgc != null) {
                        if (entryAgc.size() >= 1) {
                            dataAgc[k] = entryAgc.get(0);
                        }
                    }
                    List<Double> entryDq = mapDqYc.get(dk2);
                    if (entryDq != null) {
                        if (entryDq.size() >= 1) {
                            dataDq[k] = entryDq.get(0);
                        }
                    }
                    List<Double> entryCDq = mapCdqYc.get(dk2);
                    if (entryCDq != null) {
                        if (entryCDq.size() >= 1) {
                            dataCdq[k] = entryCDq.get(0);
                        }
                    }
                    List<Double> entrySj = mapSj.get(dk2);
                    if (entrySj != null) {
                        if (entrySj.size() >= 1) {
                            dataSj[k] = entrySj.get(0);
                        }
                    }
                }
            }
        }
        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);
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Table-全域功率预测")
    @GetMapping("/globalPowerPredictionTableData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
            @ApiImplicitParam(name = "timeType", value = "时间类型(10天内传1,10天至30天传2,30天外传3)", required = true),
            @ApiImplicitParam(name = "leadTime", value = "超前时间(默认传7)", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult globalPowerPredictionTableData(@RequestParam(value = "stationNumber") String stationNumber,
                                                     @RequestParam(value = "itemVal") int itemVal,
                                                     @RequestParam(value = "timeType") int timeType,
                                                     @RequestParam(value = "leadTime") String leadTime,
                                                     @RequestParam(value = "beginDataTime") String beginDataTime,
                                                     @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //获取所有时间
        List<Date> dateList = new ArrayList<>();
        //场站数量当期
        int modelCountDq = 0;
        //场站数量同期
        int modelCountTq = 0;
        //场站数量上月
        int modelCountSy = 0;
        //理论功率
        LinkedMultiValueMap<String, Double> mapLlGl = new LinkedMultiValueMap<String, Double>();
        //可用功率
        LinkedMultiValueMap<String, Double> mapKyGl = new LinkedMultiValueMap<String, Double>();
        //实际-当期
        LinkedMultiValueMap<String, Double> mapSjDq = new LinkedMultiValueMap<String, Double>();
        //短超期预测-当期
        LinkedMultiValueMap<String, Double> mapCdqYcDq = new LinkedMultiValueMap<String, Double>();
        //短期预测-当期
        LinkedMultiValueMap<String, Double> mapDqYcDq = new LinkedMultiValueMap<String, Double>();
        //实际-同期
        LinkedMultiValueMap<String, Double> mapSjTq = new LinkedMultiValueMap<String, Double>();
        //短超期预测-同期
        LinkedMultiValueMap<String, Double> mapCdqYcTq = new LinkedMultiValueMap<String, Double>();
        //短期预测-同期
        LinkedMultiValueMap<String, Double> mapDqYcTq = new LinkedMultiValueMap<String, Double>();
        //实际-上月
        LinkedMultiValueMap<String, Double> mapSjSy = new LinkedMultiValueMap<String, Double>();
        //短超期预测-上月
        LinkedMultiValueMap<String, Double> mapCdqYcSy = new LinkedMultiValueMap<String, Double>();
        //短期预测-上月
        LinkedMultiValueMap<String, Double> mapDqYcSy = new LinkedMultiValueMap<String, Double>();
        if ("-1".equals(stationNumber)) {//全域数据
            //获取所有风场场站
            List<Windplant> windplantList = windplantService.selectWindplantListByGlFlag();
            //获取所有光伏场站
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            if (timeType == 1) {//10天内
                dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
                /*当期数据开始*/
                Map<String, Object> paramsDq = new HashMap<>();
                paramsDq.put("beginDataTime", beginDataTime);
                paramsDq.put("endDataTime", endDataTime);
                for (Windplant windplant : windplantList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(windplant.getWindplantNo());
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (WfTheorypowerData w : wfTheorypowerDataList) {
                                ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size());
                                ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size());
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                        wfStatPeriodData.setParams(paramsDq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (WfStatPeriodData w : wfStatPeriodDataList) {
                            ShareController.addMapValue(mapSjDq, w.getP0(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size());
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsDq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (WfUspTsPeriodData w : wfUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYcDq, w.getModPower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size());
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsDq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (NoscaleWfDaPfPeriodData n : noscaleWfDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYcDq, n.getValue(), DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size());
                        }
                        /*风电短期预测结束*/
                        modelCountDq++;
                    }
                }
                for (PvPowerStation pvPowerStation : pvPowerStationList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(pvPowerStation.getPvStationNo());
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (WfTheorypowerData w : wfTheorypowerDataList) {
                                ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size() + pvPowerStationList.size());
                                ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsDq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                            ShareController.addMapValue(mapSjDq, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size() + pvPowerStationList.size());
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsDq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (PvUspTsPeriodData p : pvUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYcDq, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size() + pvPowerStationList.size());
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsDq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (PvDaPfPeriodData p : pvDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYcDq, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountDq, windplantList.size() + pvPowerStationList.size());
                        }
                        /*光伏短期预测结束*/
                        modelCountDq++;
                    }
                }
                /*当期数据结束*/
                /*同期数据开始*/
                Map<String, Object> paramsTq = new HashMap<>();
                paramsTq.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(beginDataTime), DateField.YEAR, -1)));
                paramsTq.put("endDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(endDataTime), DateField.YEAR, -1)));
                for (Windplant windplant : windplantList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                        wfStatPeriodData.setParams(paramsTq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (WfStatPeriodData w : wfStatPeriodDataList) {
                            ShareController.addMapValue(mapSjTq, w.getP0(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountTq, windplantList.size());
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsTq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (WfUspTsPeriodData w : wfUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYcTq, w.getModPower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountTq, windplantList.size());
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsTq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (NoscaleWfDaPfPeriodData n : noscaleWfDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYcTq, n.getValue(), DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountTq, windplantList.size());
                        }
                        /*风电短期预测结束*/
                        modelCountTq++;
                    }
                }
                for (PvPowerStation pvPowerStation : pvPowerStationList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsTq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                            ShareController.addMapValue(mapSjTq, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountTq, windplantList.size() + pvPowerStationList.size());
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsTq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (PvUspTsPeriodData p : pvUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYcTq, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountTq, windplantList.size() + pvPowerStationList.size());
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsTq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (PvDaPfPeriodData p : pvDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYcTq, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), modelCountTq, windplantList.size() + pvPowerStationList.size());
                        }
                        /*光伏短期预测结束*/
                        modelCountTq++;
                    }
                }
                /*同期数据结束*/
            } else if (timeType == 2) {//10天至30天
                /*当期数据开始*/
                Date bDTDq = DateUtil.parse(beginDataTime);
                Date eDTDq = DateUtil.parse(endDataTime);
                List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
                dateList.addAll(dlDq);
                Map<String, Object> paramsDq = new HashMap<>();
                paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
                paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
                for (Windplant windplant : windplantList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(windplant.getWindplantNo());
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dlDq) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, modelCountDq, windplantList.size());
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, modelCountDq, windplantList.size());
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                        wfStatPeriodData.setParams(paramsDq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjDq, p0Count / list.size(), dataTime, modelCountDq, windplantList.size());
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsDq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcDq, modPowerCount / list.size(), dataTime, modelCountDq, windplantList.size());
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsDq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcDq, valueCount / list.size(), dataTime, modelCountDq, windplantList.size());
                            }
                        }
                        /*风电短期预测结束*/
                        modelCountDq++;
                    }
                }
                for (PvPowerStation pvPowerStation : pvPowerStationList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(pvPowerStation.getPvStationNo());
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dlDq) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsDq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjDq, ycValCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsDq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcDq, powerCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsDq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcDq, powerCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏短期预测结束*/
                        modelCountDq++;
                    }
                }
                /*当期数据结束*/
                /*同期数据开始*/
                String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
                String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
                List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
                Map<String, Object> paramsTq = new HashMap<>();
                paramsTq.put("beginDataTime", bDTTq);
                paramsTq.put("endDataTime", eDTTq);
                for (Windplant windplant : windplantList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                        wfStatPeriodData.setParams(paramsTq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjTq, p0Count / list.size(), dataTime, modelCountTq, windplantList.size());
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsTq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcTq, modPowerCount / list.size(), dataTime, modelCountTq, windplantList.size());
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsTq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcTq, valueCount / list.size(), dataTime, modelCountTq, windplantList.size());
                            }
                        }
                        /*风电短期预测结束*/
                        modelCountTq++;
                    }
                }
                for (PvPowerStation pvPowerStation : pvPowerStationList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsTq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjTq, ycValCount / list.size(), dataTime, modelCountTq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsTq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcTq, powerCount / list.size(), dataTime, modelCountTq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsTq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcTq, powerCount / list.size(), dataTime, modelCountTq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏短期预测结束*/
                        modelCountTq++;
                    }
                }
                /*同期数据结束*/
            } else if (timeType == 3) {//30天外
                /*当期数据开始*/
                Date bDTDq = DateUtil.parse(beginDataTime);
                Date eDTDq = DateUtil.parse(endDataTime);
                List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
                dateList.addAll(dlDq);
                Map<String, Object> paramsDq = new HashMap<>();
                paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
                paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
                for (Windplant windplant : windplantList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(windplant.getWindplantNo());
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dlDq) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, modelCountDq, windplantList.size());
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, modelCountDq, windplantList.size());
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                        wfStatPeriodData.setParams(paramsDq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjDq, p0Count / list.size(), dataTime, modelCountDq, windplantList.size());
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsDq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcDq, modPowerCount / list.size(), dataTime, modelCountDq, windplantList.size());
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsDq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcDq, valueCount / list.size(), dataTime, modelCountDq, windplantList.size());
                            }
                        }
                        /*风电短期预测结束*/
                        modelCountDq++;
                    }
                }
                for (PvPowerStation pvPowerStation : pvPowerStationList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(pvPowerStation.getPvStationNo());
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dlDq) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsDq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjDq, ycValCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsDq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcDq, powerCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsDq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcDq, powerCount / list.size(), dataTime, modelCountDq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏短期预测结束*/
                        modelCountDq++;
                    }
                }
                /*当期数据结束*/
                /*同期数据开始*/
                String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
                String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
                List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
                Map<String, Object> paramsTq = new HashMap<>();
                paramsTq.put("beginDataTime", bDTTq);
                paramsTq.put("endDataTime", eDTTq);
                for (Windplant windplant : windplantList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                        wfStatPeriodData.setParams(paramsTq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjTq, p0Count / list.size(), dataTime, modelCountTq, windplantList.size());
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsTq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcTq, modPowerCount / list.size(), dataTime, modelCountTq, windplantList.size());
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsTq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcTq, valueCount / list.size(), dataTime, modelCountTq, windplantList.size());
                            }
                        }
                        /*风电短期预测结束*/
                        modelCountTq++;
                    }
                }
                for (PvPowerStation pvPowerStation : pvPowerStationList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsTq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjTq, ycValCount / list.size(), dataTime, modelCountTq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsTq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcTq, powerCount / list.size(), dataTime, modelCountTq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsTq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcTq, powerCount / list.size(), dataTime, modelCountTq, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏短期预测结束*/
                        modelCountTq++;
                    }
                }
                /*同期数据结束*/
                /*上月数据开始*/
                String bDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(bDTDq, -1));
                String eDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(eDTDq, -1));
                List<Date> dlSy = DateTimeUtil.getDayBetween(DateUtil.parse(bDTSy), DateUtil.parse(eDTSy));
                Map<String, Object> paramsSy = new HashMap<>();
                paramsSy.put("beginDataTime", bDTSy);
                paramsSy.put("endDataTime", eDTSy);
                for (Windplant windplant : windplantList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(windplant.getWindplantNo());
                        wfStatPeriodData.setParams(paramsSy);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjSy, p0Count / list.size(), dataTime, modelCountSy, windplantList.size());
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsSy);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcSy, modPowerCount / list.size(), dataTime, modelCountSy, windplantList.size());
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(windplant.getWindplantNo());
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsSy);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcSy, valueCount / list.size(), dataTime, modelCountSy, windplantList.size());
                            }
                        }
                        /*风电短期预测结束*/
                        modelCountSy++;
                    }
                }
                for (PvPowerStation pvPowerStation : pvPowerStationList) {
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(pvPowerStation.getPvStationNo());
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsSy);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjSy, ycValCount / list.size(), dataTime, modelCountSy, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsSy);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcSy, powerCount / list.size(), dataTime, modelCountSy, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(pvPowerStation.getPvStationNo());
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsSy);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcSy, powerCount / list.size(), dataTime, modelCountSy, windplantList.size() + pvPowerStationList.size());
                            }
                        }
                        /*光伏短期预测结束*/
                        modelCountSy++;
                    }
                }
                /*上月数据结束*/
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                if (timeType == 1) {//10天内
                    dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
                    /*当期数据开始*/
                    Map<String, Object> paramsDq = new HashMap<>();
                    paramsDq.put("beginDataTime", beginDataTime);
                    paramsDq.put("endDataTime", endDataTime);
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (WfTheorypowerData w : wfTheorypowerDataList) {
                                ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                                ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        wfStatPeriodData.setParams(paramsDq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (WfStatPeriodData w : wfStatPeriodDataList) {
                            ShareController.addMapValue(mapSjDq, w.getP0(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsDq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (WfUspTsPeriodData w : wfUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYcDq, w.getModPower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsDq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (NoscaleWfDaPfPeriodData n : noscaleWfDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYcDq, n.getValue(), DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*风电短期预测结束*/
                    }
                    /*当期数据结束*/
                    /*同期数据开始*/
                    Map<String, Object> paramsTq = new HashMap<>();
                    paramsTq.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(beginDataTime), DateField.YEAR, -1)));
                    paramsTq.put("endDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(endDataTime), DateField.YEAR, -1)));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        wfStatPeriodData.setParams(paramsTq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (WfStatPeriodData w : wfStatPeriodDataList) {
                            ShareController.addMapValue(mapSjTq, w.getP0(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsTq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (WfUspTsPeriodData w : wfUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYcTq, w.getModPower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsTq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (NoscaleWfDaPfPeriodData n : noscaleWfDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYcTq, n.getValue(), DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*风电短期预测结束*/
                    }
                    /*同期数据结束*/
                } else if (timeType == 2) {//10天至30天
                    /*当期数据开始*/
                    Date bDTDq = DateUtil.parse(beginDataTime);
                    Date eDTDq = DateUtil.parse(endDataTime);
                    List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
                    dateList.addAll(dlDq);
                    Map<String, Object> paramsDq = new HashMap<>();
                    paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
                    paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dlDq) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, 0, 1);
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, 0, 1);
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        wfStatPeriodData.setParams(paramsDq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjDq, p0Count / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsDq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcDq, modPowerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsDq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcDq, valueCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电短期预测结束*/
                    }
                    /*当期数据结束*/
                    /*同期数据开始*/
                    String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
                    String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
                    List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
                    Map<String, Object> paramsTq = new HashMap<>();
                    paramsTq.put("beginDataTime", bDTTq);
                    paramsTq.put("endDataTime", eDTTq);
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        wfStatPeriodData.setParams(paramsTq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjTq, p0Count / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsTq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcTq, modPowerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsTq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcTq, valueCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电短期预测结束*/
                    }
                    /*同期数据结束*/
                } else if (timeType == 3) {//30天外
                    /*当期数据开始*/
                    Date bDTDq = DateUtil.parse(beginDataTime);
                    Date eDTDq = DateUtil.parse(endDataTime);
                    List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
                    dateList.addAll(dlDq);
                    Map<String, Object> paramsDq = new HashMap<>();
                    paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
                    paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dlDq) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, 0, 1);
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, 0, 1);
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        wfStatPeriodData.setParams(paramsDq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjDq, p0Count / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsDq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcDq, modPowerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsDq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcDq, valueCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电短期预测结束*/
                    }
                    /*当期数据结束*/
                    /*同期数据开始*/
                    String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
                    String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
                    List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
                    Map<String, Object> paramsTq = new HashMap<>();
                    paramsTq.put("beginDataTime", bDTTq);
                    paramsTq.put("endDataTime", eDTTq);
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        wfStatPeriodData.setParams(paramsTq);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjTq, p0Count / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsTq);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcTq, modPowerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsTq);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcTq, valueCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电短期预测结束*/
                    }
                    /*同期数据结束*/
                    /*上月数据开始*/
                    String bDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(bDTDq, -1));
                    String eDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(eDTDq, -1));
                    List<Date> dlSy = DateTimeUtil.getDayBetween(DateUtil.parse(bDTSy), DateUtil.parse(eDTSy));
                    Map<String, Object> paramsSy = new HashMap<>();
                    paramsSy.put("beginDataTime", bDTSy);
                    paramsSy.put("endDataTime", eDTSy);
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*风电实际功率开始*/
                        WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                        //风电场编号
                        wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        wfStatPeriodData.setParams(paramsSy);
                        List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastP0 = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastP0 = lastData.getP0();
                                }
                                double p0Count = list.stream().mapToDouble(WfStatPeriodData::getP0).sum() - list.get(0).getP0() + lastP0;
                                ShareController.addMapValue(mapSjSy, p0Count / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电实际功率结束*/
                        /*风电超短期预测开始*/
                        WfUspTsPeriodData wfUspTsPeriodData = new WfUspTsPeriodData();
                        //风电场编号
                        wfUspTsPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电超短期最优模型uwpfmodelNo
                        wfUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        //超前2小时 对应7
                        wfUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        wfUspTsPeriodData.setParams(paramsSy);
                        List<WfUspTsPeriodData> wfUspTsPeriodDataList = wfUspTsPeriodDataService.selectWfUspTsPeriodDataList(wfUspTsPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsPeriodData> list = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsPeriodData lastData = wfUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModPower = lastData.getModPower();
                                }
                                double modPowerCount = list.stream().mapToDouble(WfUspTsPeriodData::getModPower).sum() - list.get(0).getModPower() + lastModPower;
                                ShareController.addMapValue(mapCdqYcSy, modPowerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电超短期预测结束*/
                        /*风电短期预测开始*/
                        NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = new NoscaleWfDaPfPeriodData();
                        //风电场编号
                        noscaleWfDaPfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                        //风电短期最优模型wpfmodelNo
                        noscaleWfDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        noscaleWfDaPfPeriodData.setParams(paramsSy);
                        List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(noscaleWfDaPfPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaPfPeriodData> list = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaPfPeriodData lastData = noscaleWfDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastValue = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastValue = lastData.getValue();
                                }
                                double valueCount = list.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDqYcSy, valueCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*风电短期预测结束*/
                    }
                    /*上月数据结束*/
                }
            } else if (itemVal == 4) {//光伏电站
                if (timeType == 1) {//10天内
                    dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
                    /*当期数据开始*/
                    Map<String, Object> paramsDq = new HashMap<>();
                    paramsDq.put("beginDataTime", beginDataTime);
                    paramsDq.put("endDataTime", endDataTime);
                    PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (WfTheorypowerData w : wfTheorypowerDataList) {
                                ShareController.addMapValue(mapLlGl, w.getTheorypower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                                ShareController.addMapValue(mapKyGl, w.getAvailablepower(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsDq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                            ShareController.addMapValue(mapSjDq, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsDq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (PvUspTsPeriodData p : pvUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYcDq, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsDq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (PvDaPfPeriodData p : pvDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYcDq, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*光伏短期预测结束*/
                    }
                    /*当期数据结束*/
                    /*同期数据开始*/
                    Map<String, Object> paramsTq = new HashMap<>();
                    paramsTq.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(beginDataTime), DateField.YEAR, -1)));
                    paramsTq.put("endDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(endDataTime), DateField.YEAR, -1)));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsTq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                            ShareController.addMapValue(mapSjTq, w.getYcVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsTq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (PvUspTsPeriodData p : pvUspTsPeriodDataList) {
                            ShareController.addMapValue(mapCdqYcTq, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsTq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (PvDaPfPeriodData p : pvDaPfPeriodDataList) {
                            ShareController.addMapValue(mapDqYcTq, p.getPower(), DateUtil.format(p.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                        }
                        /*光伏短期预测结束*/
                    }
                    /*同期数据结束*/
                } else if (timeType == 2) {//10天至30天
                    /*当期数据开始*/
                    Date bDTDq = DateUtil.parse(beginDataTime);
                    Date eDTDq = DateUtil.parse(endDataTime);
                    List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
                    dateList.addAll(dlDq);
                    Map<String, Object> paramsDq = new HashMap<>();
                    paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
                    paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
                    PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dlDq) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, 0, 1);
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, 0, 1);
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsDq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjDq, ycValCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsDq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcDq, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsDq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcDq, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏短期预测结束*/
                    }
                    /*当期数据结束*/
                    /*同期数据开始*/
                    String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
                    String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
                    List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
                    Map<String, Object> paramsTq = new HashMap<>();
                    paramsTq.put("beginDataTime", bDTTq);
                    paramsTq.put("endDataTime", eDTTq);
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsTq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjTq, ycValCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsTq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcTq, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsTq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcTq, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏短期预测结束*/
                    }
                    /*同期数据结束*/
                } else if (timeType == 3) {//30天外
                    /*当期数据开始*/
                    Date bDTDq = DateUtil.parse(beginDataTime);
                    Date eDTDq = DateUtil.parse(endDataTime);
                    List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
                    dateList.addAll(dlDq);
                    Map<String, Object> paramsDq = new HashMap<>();
                    paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
                    paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
                    PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                    WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*理论功率、可用功率开始*/
                        WfTheorypowerData wfTheorypowerData = new WfTheorypowerData();
                        wfTheorypowerData.setWindplantNo(Convert.toLong(stationNumber));
                        wfTheorypowerData.setParams(paramsDq);
                        List<WfTheorypowerData> wfTheorypowerDataList = wfTheorypowerDataService.selectWfTheorypowerDataList(wfTheorypowerData);
                        if (wfTheorypowerDataList.size() > 0) {
                            for (Date date : dlDq) {
                                String dataTime = DateUtil.formatDate(date);
                                List<WfTheorypowerData> list = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                                WfTheorypowerData lastData = wfTheorypowerDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                if (list.size() > 0) {
                                    double lastTheorypower = 0;
                                    double lastAvailablepower = 0;
                                    if (ObjectUtil.isNotNull(lastData)) {
                                        lastTheorypower = lastData.getTheorypower();
                                        lastAvailablepower = lastData.getAvailablepower();
                                    }
                                    double theorypowerCount = list.stream().mapToDouble(WfTheorypowerData::getTheorypower).sum() - list.get(0).getTheorypower() + lastTheorypower;
                                    double availablepowerCount = list.stream().mapToDouble(WfTheorypowerData::getAvailablepower).sum() - list.get(0).getAvailablepower() + lastAvailablepower;
                                    ShareController.addMapValue(mapLlGl, theorypowerCount / list.size(), dataTime, 0, 1);
                                    ShareController.addMapValue(mapKyGl, availablepowerCount / list.size(), dataTime, 0, 1);
                                }
                            }
                        }
                        /*理论功率、可用功率结束*/
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsDq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjDq, ycValCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsDq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcDq, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsDq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlDq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcDq, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏短期预测结束*/
                    }
                    /*当期数据结束*/
                    /*同期数据开始*/
                    String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
                    String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
                    List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
                    Map<String, Object> paramsTq = new HashMap<>();
                    paramsTq.put("beginDataTime", bDTTq);
                    paramsTq.put("endDataTime", eDTTq);
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsTq);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjTq, ycValCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsTq);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcTq, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsTq);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcTq, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏短期预测结束*/
                    }
                    /*同期数据结束*/
                    /*上月数据开始*/
                    String bDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(bDTDq, -1));
                    String eDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(eDTDq, -1));
                    List<Date> dlSy = DateTimeUtil.getDayBetween(DateUtil.parse(bDTSy), DateUtil.parse(eDTSy));
                    Map<String, Object> paramsSy = new HashMap<>();
                    paramsSy.put("beginDataTime", bDTSy);
                    paramsSy.put("endDataTime", eDTSy);
                    if (ObjectUtil.isNotNull(wfFileConfig)) {
                        /*光伏实际功率开始*/
                        WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                        wfYcHistoryData1.setAnalogNo(pvPowerStation.getApYcNo());
                        wfYcHistoryData1.setParams(paramsSy);
                        List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastYcVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcVal = lastData.getYcVal();
                                }
                                double ycValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcVal).sum() - list.get(0).getYcVal() + lastYcVal;
                                ShareController.addMapValue(mapSjSy, ycValCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏实际功率结束*/
                        /*光伏超短期预测开始*/
                        PvUspTsPeriodData pvUspTsPeriodData = new PvUspTsPeriodData();
                        //光伏场站编号
                        pvUspTsPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏超短期最优模型uwpfmodelNo
                        pvUspTsPeriodData.setModelNo(wfFileConfig.getUwpfmodelNo());
                        pvUspTsPeriodData.setTimeScale(Convert.toLong(leadTime));
                        pvUspTsPeriodData.setParams(paramsSy);
                        List<PvUspTsPeriodData> pvUspTsPeriodDataList = pvUspTsPeriodDataService.selectPvUspTsPeriodDataList(pvUspTsPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvUspTsPeriodData> list = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvUspTsPeriodData lastData = pvUspTsPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvUspTsPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapCdqYcSy, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏超短期预测结束*/
                        /*光伏短期预测开始*/
                        PvDaPfPeriodData pvDaPfPeriodData = new PvDaPfPeriodData();
                        //光伏场站编号
                        pvDaPfPeriodData.setPvNo(Convert.toLong(stationNumber));
                        //光伏短期最优模型wpfmodelNo
                        pvDaPfPeriodData.setModelNo(wfFileConfig.getWpfmodelNo());
                        pvDaPfPeriodData.setParams(paramsSy);
                        List<PvDaPfPeriodData> pvDaPfPeriodDataList = pvDaPfPeriodDataService.selectPvDaPfPeriodDataList(pvDaPfPeriodData);
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<PvDaPfPeriodData> list = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            PvDaPfPeriodData lastData = pvDaPfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastPower = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastPower = lastData.getPower();
                                }
                                double powerCount = list.stream().mapToDouble(PvDaPfPeriodData::getPower).sum() - list.get(0).getPower() + lastPower;
                                ShareController.addMapValue(mapDqYcSy, powerCount / list.size(), dataTime, 0, 1);
                            }
                        }
                        /*光伏短期预测结束*/
                    }
                    /*上月数据结束*/
                }
            }
        }
        List<TableField> tableFieldList = new ArrayList<>();
        for (Date date : dateList) {
            TableField tableField = new TableField();
            if ("-1".equals(stationNumber)) {//全域数据
                if (timeType == 1) {//10天内
                    String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                    String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                    tableField.setDataTime(stringDateTimeDq);
                    List<Double> entryLlGl = mapLlGl.get(stringDateTimeDq);
                    if (entryLlGl != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryLlGl.size() > i && entryLlGl.get(i) != null) {
                                count += entryLlGl.get(i);
                            }
                        }
                        tableField.setTheoreticalPower(count);
                    }
                    List<Double> entryKyGl = mapKyGl.get(stringDateTimeDq);
                    if (entryKyGl != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryKyGl.size() > i && entryKyGl.get(i) != null) {
                                count += entryKyGl.get(i);
                            }
                        }
                        tableField.setAvailablePower(count);
                    }
                    List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                    if (entrySjDq != null) {
                        entrySjDq.removeAll(Collections.singleton(null));
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entrySjDq.size() > i && entrySjDq.get(i) != null) {
                                count += entrySjDq.get(i);
                            }
                        }
                        tableField.setActualPowerDq(count);
                    }
                    List<Double> entryCdqYcDq = mapCdqYcDq.get(stringDateTimeDq);
                    if (entryCdqYcDq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryCdqYcDq.size() > i && entryCdqYcDq.get(i) != null) {
                                count += entryCdqYcDq.get(i);
                            }
                        }
                        tableField.setVeryShortTermForecastDq(count);
                    }
                    List<Double> entryDqYcDq = mapDqYcDq.get(stringDateTimeDq);
                    if (entryDqYcDq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryDqYcDq.size() > i && entryDqYcDq.get(i) != null) {
                                count += entryDqYcDq.get(i);
                            }
                        }
                        tableField.setShortTermForecastDq(count);
                    }
                    List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                    if (entrySjTq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountTq; i++) {
                            if (entrySjTq.size() > i && entrySjTq.get(i) != null) {
                                count += entrySjTq.get(i);
                            }
                        }
                        tableField.setActualPowerTq(count);
                    }
                    List<Double> entryCdqYcTq = mapCdqYcTq.get(stringDateTimeTq);
                    if (entryCdqYcTq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountTq; i++) {
                            if (entryCdqYcTq.size() > i && entryCdqYcTq.get(i) != null) {
                                count += entryCdqYcTq.get(i);
                            }
                        }
                        tableField.setVeryShortTermForecastTq(count);
                    }
                    List<Double> entryDqYcTq = mapDqYcTq.get(stringDateTimeTq);
                    if (entryDqYcTq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountTq; i++) {
                            if (entryDqYcTq.size() > i && entryDqYcTq.get(i) != null) {
                                count += entryDqYcTq.get(i);
                            }
                        }
                        tableField.setShortTermForecastTq(count);
                    }
                } else if (timeType == 2) {//10天至30天
                    String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd");
                    String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd");
                    tableField.setDataTime(stringDateTimeDq);
                    List<Double> entryLlGl = mapLlGl.get(stringDateTimeDq);
                    if (entryLlGl != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryLlGl.size() > i && entryLlGl.get(i) != null) {
                                count += entryLlGl.get(i);
                            }
                        }
                        tableField.setTheoreticalPower(count);
                    }
                    List<Double> entryKyGl = mapKyGl.get(stringDateTimeDq);
                    if (entryKyGl != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryKyGl.size() > i && entryKyGl.get(i) != null) {
                                count += entryKyGl.get(i);
                            }
                        }
                        tableField.setAvailablePower(count);
                    }
                    List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                    if (entrySjDq != null) {
                        entrySjDq.removeAll(Collections.singleton(null));
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entrySjDq.size() > i && entrySjDq.get(i) != null) {
                                count += entrySjDq.get(i);
                            }
                        }
                        tableField.setActualPowerDq(count);
                    }
                    List<Double> entryCdqYcDq = mapCdqYcDq.get(stringDateTimeDq);
                    if (entryCdqYcDq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryCdqYcDq.size() > i && entryCdqYcDq.get(i) != null) {
                                count += entryCdqYcDq.get(i);
                            }
                        }
                        tableField.setVeryShortTermForecastDq(count);
                    }
                    List<Double> entryDqYcDq = mapDqYcDq.get(stringDateTimeDq);
                    if (entryDqYcDq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryDqYcDq.size() > i && entryDqYcDq.get(i) != null) {
                                count += entryDqYcDq.get(i);
                            }
                        }
                        tableField.setShortTermForecastDq(count);
                    }
                    List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                    if (entrySjTq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountTq; i++) {
                            if (entrySjTq.size() > i && entrySjTq.get(i) != null) {
                                count += entrySjTq.get(i);
                            }
                        }
                        tableField.setActualPowerTq(count);
                    }
                    List<Double> entryCdqYcTq = mapCdqYcTq.get(stringDateTimeTq);
                    if (entryCdqYcTq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountTq; i++) {
                            if (entryCdqYcTq.size() > i && entryCdqYcTq.get(i) != null) {
                                count += entryCdqYcTq.get(i);
                            }
                        }
                        tableField.setVeryShortTermForecastTq(count);
                    }
                    List<Double> entryDqYcTq = mapDqYcTq.get(stringDateTimeTq);
                    if (entryDqYcTq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountTq; i++) {
                            if (entryDqYcTq.size() > i && entryDqYcTq.get(i) != null) {
                                count += entryDqYcTq.get(i);
                            }
                        }
                        tableField.setShortTermForecastTq(count);
                    }
                } else if (timeType == 3) {//30天外
                    String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd");
                    String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd");
                    String stringDateTimeSy = DateUtil.format(DateUtil.offsetMonth(date, -1), "yyyy-MM-dd");
                    tableField.setDataTime(stringDateTimeDq);
                    List<Double> entryLlGl = mapLlGl.get(stringDateTimeDq);
                    if (entryLlGl != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryLlGl.size() > i && entryLlGl.get(i) != null) {
                                count += entryLlGl.get(i);
                            }
                        }
                        tableField.setTheoreticalPower(count);
                    }
                    List<Double> entryKyGl = mapKyGl.get(stringDateTimeDq);
                    if (entryKyGl != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryKyGl.size() > i && entryKyGl.get(i) != null) {
                                count += entryKyGl.get(i);
                            }
                        }
                        tableField.setAvailablePower(count);
                    }
                    List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                    if (entrySjDq != null) {
                        entrySjDq.removeAll(Collections.singleton(null));
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entrySjDq.size() > i && entrySjDq.get(i) != null) {
                                count += entrySjDq.get(i);
                            }
                        }
                        tableField.setActualPowerDq(count);
                    }
                    List<Double> entryCdqYcDq = mapCdqYcDq.get(stringDateTimeDq);
                    if (entryCdqYcDq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryCdqYcDq.size() > i && entryCdqYcDq.get(i) != null) {
                                count += entryCdqYcDq.get(i);
                            }
                        }
                        tableField.setVeryShortTermForecastDq(count);
                    }
                    List<Double> entryDqYcDq = mapDqYcDq.get(stringDateTimeDq);
                    if (entryDqYcDq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountDq; i++) {
                            if (entryDqYcDq.size() > i && entryDqYcDq.get(i) != null) {
                                count += entryDqYcDq.get(i);
                            }
                        }
                        tableField.setShortTermForecastDq(count);
                    }
                    List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                    if (entrySjTq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountTq; i++) {
                            if (entrySjTq.size() > i && entrySjTq.get(i) != null) {
                                count += entrySjTq.get(i);
                            }
                        }
                        tableField.setActualPowerTq(count);
                    }
                    List<Double> entryCdqYcTq = mapCdqYcTq.get(stringDateTimeTq);
                    if (entryCdqYcTq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountTq; i++) {
                            if (entryCdqYcTq.size() > i && entryCdqYcTq.get(i) != null) {
                                count += entryCdqYcTq.get(i);
                            }
                        }
                        tableField.setVeryShortTermForecastTq(count);
                    }
                    List<Double> entryDqYcTq = mapDqYcTq.get(stringDateTimeTq);
                    if (entryDqYcTq != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountTq; i++) {
                            if (entryDqYcTq.size() > i && entryDqYcTq.get(i) != null) {
                                count += entryDqYcTq.get(i);
                            }
                        }
                        tableField.setShortTermForecastTq(count);
                    }
                    List<Double> entrySjSy = mapSjSy.get(stringDateTimeSy);
                    if (entrySjSy != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountSy; i++) {
                            if (entrySjSy.size() > i && entrySjSy.get(i) != null) {
                                count += entrySjSy.get(i);
                            }
                        }
                        tableField.setActualPowerSy(count);
                    }
                    List<Double> entryCdqYcSy = mapCdqYcSy.get(stringDateTimeSy);
                    if (entryCdqYcSy != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountSy; i++) {
                            if (entryCdqYcSy.size() > i && entryCdqYcSy.get(i) != null) {
                                count += entryCdqYcSy.get(i);
                            }
                        }
                        tableField.setVeryShortTermForecastSy(count);
                    }
                    List<Double> entryDqYcSy = mapDqYcSy.get(stringDateTimeSy);
                    if (entryDqYcSy != null) {
                        double count = 0;
                        for (int i = 0; i < modelCountSy; i++) {
                            if (entryDqYcSy.size() > i && entryDqYcSy.get(i) != null) {
                                count += entryDqYcSy.get(i);
                            }
                        }
                        tableField.setShortTermForecastSy(count);
                    }
                }
            } else {//各个场站数据
                if (timeType == 1) {//10天内
                    String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                    String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                    tableField.setDataTime(stringDateTimeDq);
                    List<Double> entryLlGl = mapLlGl.get(stringDateTimeDq);
                    if (entryLlGl != null) {
                        tableField.setTheoreticalPower(entryLlGl.get(0));
                    }
                    List<Double> entryKyGl = mapKyGl.get(stringDateTimeDq);
                    if (entryKyGl != null) {
                        tableField.setAvailablePower(entryKyGl.get(0));
                    }
                    List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                    if (entrySjDq != null) {
                        tableField.setActualPowerDq(entrySjDq.get(0));
                    }
                    List<Double> entryCdqYcDq = mapCdqYcDq.get(stringDateTimeDq);
                    if (entryCdqYcDq != null) {
                        tableField.setVeryShortTermForecastDq(entryCdqYcDq.get(0));
                    }
                    List<Double> entryDqYcDq = mapDqYcDq.get(stringDateTimeDq);
                    if (entryDqYcDq != null) {
                        tableField.setShortTermForecastDq(entryDqYcDq.get(0));
                    }
                    List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                    if (entrySjTq != null) {
                        tableField.setActualPowerTq(entrySjTq.get(0));
                    }
                    List<Double> entryCdqYcTq = mapCdqYcTq.get(stringDateTimeTq);
                    if (entryCdqYcTq != null) {
                        tableField.setVeryShortTermForecastTq(entryCdqYcTq.get(0));
                    }
                    List<Double> entryDqYcTq = mapDqYcTq.get(stringDateTimeTq);
                    if (entryDqYcTq != null) {
                        tableField.setShortTermForecastTq(entryDqYcTq.get(0));
                    }
                } else if (timeType == 2) {//10天至30天
                    String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd");
                    String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd");
                    tableField.setDataTime(stringDateTimeDq);
                    List<Double> entryLlGl = mapLlGl.get(stringDateTimeDq);
                    if (entryLlGl != null) {
                        tableField.setTheoreticalPower(entryLlGl.get(0));
                    }
                    List<Double> entryKyGl = mapKyGl.get(stringDateTimeDq);
                    if (entryKyGl != null) {
                        tableField.setAvailablePower(entryKyGl.get(0));
                    }
                    List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                    if (entrySjDq != null) {
                        tableField.setActualPowerDq(entrySjDq.get(0));
                    }
                    List<Double> entryCdqYcDq = mapCdqYcDq.get(stringDateTimeDq);
                    if (entryCdqYcDq != null) {
                        tableField.setVeryShortTermForecastDq(entryCdqYcDq.get(0));
                    }
                    List<Double> entryDqYcDq = mapDqYcDq.get(stringDateTimeDq);
                    if (entryDqYcDq != null) {
                        tableField.setShortTermForecastDq(entryDqYcDq.get(0));
                    }
                    List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                    if (entrySjTq != null) {
                        tableField.setActualPowerTq(entrySjTq.get(0));
                    }
                    List<Double> entryCdqYcTq = mapCdqYcTq.get(stringDateTimeTq);
                    if (entryCdqYcTq != null) {
                        tableField.setVeryShortTermForecastTq(entryCdqYcTq.get(0));
                    }
                    List<Double> entryDqYcTq = mapDqYcTq.get(stringDateTimeTq);
                    if (entryDqYcTq != null) {
                        tableField.setShortTermForecastTq(entryDqYcTq.get(0));
                    }
                } else if (timeType == 3) {//30天外
                    String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd");
                    String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd");
                    String stringDateTimeSy = DateUtil.format(DateUtil.offsetMonth(date, -1), "yyyy-MM-dd");
                    tableField.setDataTime(stringDateTimeDq);
                    List<Double> entryLlGl = mapLlGl.get(stringDateTimeDq);
                    if (entryLlGl != null) {
                        tableField.setTheoreticalPower(entryLlGl.get(0));
                    }
                    List<Double> entryKyGl = mapKyGl.get(stringDateTimeDq);
                    if (entryKyGl != null) {
                        tableField.setAvailablePower(entryKyGl.get(0));
                    }
                    List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                    if (entrySjDq != null) {
                        tableField.setActualPowerDq(entrySjDq.get(0));
                    }
                    List<Double> entryCdqYcDq = mapCdqYcDq.get(stringDateTimeDq);
                    if (entryCdqYcDq != null) {
                        tableField.setVeryShortTermForecastDq(entryCdqYcDq.get(0));
                    }
                    List<Double> entryDqYcDq = mapDqYcDq.get(stringDateTimeDq);
                    if (entryDqYcDq != null) {
                        tableField.setShortTermForecastDq(entryDqYcDq.get(0));
                    }
                    List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                    if (entrySjTq != null) {
                        tableField.setActualPowerTq(entrySjTq.get(0));
                    }
                    List<Double> entryCdqYcTq = mapCdqYcTq.get(stringDateTimeTq);
                    if (entryCdqYcTq != null) {
                        tableField.setVeryShortTermForecastTq(entryCdqYcTq.get(0));
                    }
                    List<Double> entryDqYcTq = mapDqYcTq.get(stringDateTimeTq);
                    if (entryDqYcTq != null) {
                        tableField.setShortTermForecastTq(entryDqYcTq.get(0));
                    }
                    List<Double> entrySjSy = mapSjSy.get(stringDateTimeSy);
                    if (entrySjSy != null) {
                        tableField.setActualPowerSy(entrySjSy.get(0));
                    }
                    List<Double> entryCdqYcSy = mapCdqYcSy.get(stringDateTimeSy);
                    if (entryCdqYcSy != null) {
                        tableField.setVeryShortTermForecastSy(entryCdqYcSy.get(0));
                    }
                    List<Double> entryDqYcSy = mapDqYcSy.get(stringDateTimeSy);
                    if (entryDqYcSy != null) {
                        tableField.setShortTermForecastSy(entryDqYcSy.get(0));
                    }
                }
            }
            tableFieldList.add(tableField);
        }
        json.put("dataFormatList", tableFieldList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Chart-全域风速预测")
    @GetMapping("/globalWindSpeedForecastChartData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(风场主键)", required = true),
            @ApiImplicitParam(name = "timeType", value = "时间类型(10天内传1,10天外传2)", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult globalWindSpeedForecastChartData(@RequestParam(value = "stationNumber") String stationNumber,
                                                       @RequestParam(value = "timeType") int timeType,
                                                       @RequestParam(value = "beginDataTime") String beginDataTime,
                                                       @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //获取所有时间
        List<Date> dateList = new ArrayList<>();
        List<DataFormat> dataFormatList = new ArrayList<>();
        if (timeType == 1) {//10天内
            dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
            int count1 = dateList.size();
            Map<String, Object> params = new HashMap<>();
            params.put("beginDataTime", beginDataTime);
            params.put("endDataTime", endDataTime);
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*预测风速开始*/
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(Convert.toLong(stationNumber));
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(params);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                Map<Date, List<WfNwpData>> map = wfNwpDataList.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                Double[] data = new Double[count1];
                int num = 0;
                for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                    List<WfNwpData> value = entry.getValue();
                    if (value.size() > 0) {
                        //排序
                        value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                        data[num] = value.get(0).getWindSpeed();
                    }
                    num++;
                }
                /*预测风速结束*/
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName("预测风速");
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
            /*实际风速开始*/
            WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
            wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
            wfStatPeriodData.setParams(params);
            List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
            Map<Date, List<WfStatPeriodData>> map = wfStatPeriodDataList.stream().collect(Collectors.groupingBy(WfStatPeriodData::getDataTime));
            TreeMap<Date, List<WfStatPeriodData>> treeMap = new TreeMap<Date, List<WfStatPeriodData>>(map);
            Double[] data = new Double[count1];
            int num = 0;
            for (Map.Entry<Date, List<WfStatPeriodData>> entry : treeMap.entrySet()) {
                List<WfStatPeriodData> value = entry.getValue();
                if (value.size() > 0) {
                    data[num] = value.get(0).getAvgWindSpeed();
                }
                num++;
            }
            /*实际风速结束*/
            DataFormat dataFormat = new DataFormat();
            dataFormat.setName("实际风速");
            dataFormat.setData(data);
            dataFormatList.add(dataFormat);
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(beginDataTime), DateField.YEAR, -1)));
            paramsTq.put("endDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(endDataTime), DateField.YEAR, -1)));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*同期实际数据开始*/
                WfStatPeriodData wfStatPeriodDataTq = new WfStatPeriodData();
                wfStatPeriodDataTq.setWindplantNo(Convert.toLong(stationNumber));
                wfStatPeriodDataTq.setParams(paramsTq);
                List<WfStatPeriodData> wfStatPeriodDataListTq = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodDataTq);
                Map<Date, List<WfStatPeriodData>> mapTq = wfStatPeriodDataListTq.stream().collect(Collectors.groupingBy(WfStatPeriodData::getDataTime));
                TreeMap<Date, List<WfStatPeriodData>> treeMapTq = new TreeMap<Date, List<WfStatPeriodData>>(mapTq);
                Double[] dataTq = new Double[count1];
                int numTq = 0;
                for (Map.Entry<Date, List<WfStatPeriodData>> entry : treeMapTq.entrySet()) {
                    List<WfStatPeriodData> value = entry.getValue();
                    if (value.size() > 0) {
                        dataTq[numTq] = value.get(0).getAvgWindSpeed();
                    }
                    numTq++;
                }
                /*同期实际数据结束*/
                DataFormat dataFormatTq = new DataFormat();
                dataFormatTq.setName("同期实际");
                dataFormatTq.setData(dataTq);
                dataFormatList.add(dataFormatTq);
            }
        } else if (timeType == 2) {//10天外
            Date bDT = DateUtil.parse(beginDataTime);
            Date eDT = DateUtil.parse(endDataTime);
            List<Date> dl = DateTimeUtil.getDayBetween(bDT, eDT);
            dateList.addAll(dl);
            int count1 = dateList.size();
            Map<String, Object> params = new HashMap<>();
            params.put("beginDataTime", DateUtil.formatDateTime(bDT));
            params.put("endDataTime", DateUtil.formatDateTime(eDT));
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*预测风速开始*/
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(Convert.toLong(stationNumber));
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(params);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                Double[] data = new Double[count1];
                for (int i = 0; i < count1; i++) {
                    String dataTime = DateUtil.formatDate(dateList.get(i));
                    List<WfNwpData> list = wfNwpDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(dateList.get(i), 1));
                    List<WfNwpData> lastData = wfNwpDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double windSpeed = 0;
                        Map<Date, List<WfNwpData>> map = list.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                        TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<WfNwpData> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    windSpeed += value.get(0).getWindSpeed();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            windSpeed += lastData.get(0).getWindSpeed();
                            num++;
                        }
                        data[i] = windSpeed / num;
                    }
                }
                /*预测风速结束*/
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName("预测风速");
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
            /*实际风速开始*/
            WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
            wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
            wfStatPeriodData.setParams(params);
            List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
            Double[] data = new Double[count1];
            for (int i = 0; i < count1; i++) {
                String dataTime = DateUtil.formatDate(dateList.get(i));
                List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(dateList.get(i), 1));
                WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                if (list.size() > 0) {
                    double lastAvgWindSpeed = 0;
                    if (ObjectUtil.isNotNull(lastData)) {
                        lastAvgWindSpeed = lastData.getAvgWindSpeed();
                    }
                    double avgWindSpeedCount = list.stream().mapToDouble(WfStatPeriodData::getAvgWindSpeed).sum() - list.get(0).getAvgWindSpeed() + lastAvgWindSpeed;
                    data[i] = avgWindSpeedCount / list.size();
                }
            }
            /*实际风速结束*/
            DataFormat dataFormat = new DataFormat();
            dataFormat.setName("实际风速");
            dataFormat.setData(data);
            dataFormatList.add(dataFormat);
            String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDT, DateField.YEAR, -1));
            String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDT, DateField.YEAR, -1));
            List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
            int count2 = dlTq.size();
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", bDTTq);
            paramsTq.put("endDataTime", eDTTq);
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*同期实际数据开始*/
                WfStatPeriodData wfStatPeriodDataTq = new WfStatPeriodData();
                wfStatPeriodDataTq.setWindplantNo(Convert.toLong(stationNumber));
                wfStatPeriodDataTq.setParams(paramsTq);
                List<WfStatPeriodData> wfStatPeriodDataListTq = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodDataTq);
                Double[] dataTq = new Double[count1];
                for (int i = 0; i < count2; i++) {
                    String dataTime = DateUtil.formatDate(dateList.get(i));
                    List<WfStatPeriodData> list = wfStatPeriodDataListTq.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(dateList.get(i), 1));
                    WfStatPeriodData lastData = wfStatPeriodDataListTq.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                    if (list.size() > 0) {
                        double lastAvgWindSpeed = 0;
                        if (ObjectUtil.isNotNull(lastData)) {
                            lastAvgWindSpeed = lastData.getAvgWindSpeed();
                        }
                        double avgWindSpeedCount = list.stream().mapToDouble(WfStatPeriodData::getAvgWindSpeed).sum() - list.get(0).getAvgWindSpeed() + lastAvgWindSpeed;
                        dataTq[i] = avgWindSpeedCount / list.size();
                    }
                }
                /*同期实际数据结束*/
                DataFormat dataFormatTq = new DataFormat();
                dataFormatTq.setName("同期实际");
                dataFormatTq.setData(dataTq);
                dataFormatList.add(dataFormatTq);
            }
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Table-全域风速预测")
    @GetMapping("/globalWindSpeedForecastTableData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(风场主键)", required = true),
            @ApiImplicitParam(name = "timeType", value = "时间类型(10天内传1,10天外传2)", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult globalWindSpeedForecastTableData(@RequestParam(value = "stationNumber") String stationNumber,
                                                       @RequestParam(value = "timeType") int timeType,
                                                       @RequestParam(value = "beginDataTime") String beginDataTime,
                                                       @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //获取所有时间
        List<Date> dateList = new ArrayList<>();
        //实际-当期
        LinkedMultiValueMap<String, Double> mapSjDq = new LinkedMultiValueMap<String, Double>();
        //预测-当期
        LinkedMultiValueMap<String, Double> mapYcDq = new LinkedMultiValueMap<String, Double>();
        //实际-同期
        LinkedMultiValueMap<String, Double> mapSjTq = new LinkedMultiValueMap<String, Double>();
        //预测-同期
        LinkedMultiValueMap<String, Double> mapYcTq = new LinkedMultiValueMap<String, Double>();
        //实际-上月
        LinkedMultiValueMap<String, Double> mapSjSy = new LinkedMultiValueMap<String, Double>();
        //预测-上月
        LinkedMultiValueMap<String, Double> mapYcSy = new LinkedMultiValueMap<String, Double>();
        if (timeType == 1) {//10天内
            dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
            /*当期数据开始*/
            Map<String, Object> paramsDq = new HashMap<>();
            paramsDq.put("beginDataTime", beginDataTime);
            paramsDq.put("endDataTime", endDataTime);
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际风速开始*/
                WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                wfStatPeriodData.setParams(paramsDq);
                List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                for (WfStatPeriodData w : wfStatPeriodDataList) {
                    ShareController.addMapValue(mapSjDq, w.getAvgWindSpeed(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                }
                /*实际风速结束*/
                /*预测风速开始*/
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(Convert.toLong(stationNumber));
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(paramsDq);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                Map<Date, List<WfNwpData>> map = wfNwpDataList.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                    List<WfNwpData> value = entry.getValue();
                    if (value.size() > 0) {
                        //排序
                        value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                        double windSpeed = value.get(0).getWindSpeed();
                        ShareController.addMapValue(mapYcDq, windSpeed, DateUtil.format(value.get(0).getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                    }
                }
                /*预测风速结束*/
            }
            /*当期数据结束*/
            /*同期数据开始*/
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(beginDataTime), DateField.YEAR, -1)));
            paramsTq.put("endDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(endDataTime), DateField.YEAR, -1)));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际风速开始*/
                WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                wfStatPeriodData.setParams(paramsTq);
                List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                for (WfStatPeriodData w : wfStatPeriodDataList) {
                    ShareController.addMapValue(mapSjTq, w.getAvgWindSpeed(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                }
                /*实际风速结束*/
                /*预测风速开始*/
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(Convert.toLong(stationNumber));
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(paramsTq);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                Map<Date, List<WfNwpData>> map = wfNwpDataList.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                    List<WfNwpData> value = entry.getValue();
                    if (value.size() > 0) {
                        //排序
                        value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                        double windSpeed = value.get(0).getWindSpeed();
                        ShareController.addMapValue(mapYcTq, windSpeed, DateUtil.format(value.get(0).getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                    }
                }
                /*预测风速结束*/
            }
            /*同期数据结束*/
        } else if (timeType == 2) {//10天至30天
            /*当期数据开始*/
            Date bDTDq = DateUtil.parse(beginDataTime);
            Date eDTDq = DateUtil.parse(endDataTime);
            List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
            dateList.addAll(dlDq);
            Map<String, Object> paramsDq = new HashMap<>();
            paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
            paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际风速开始*/
                WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                wfStatPeriodData.setParams(paramsDq);
                List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                for (Date date : dlDq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                    if (list.size() > 0) {
                        double lastAvgWindSpeed = 0;
                        if (ObjectUtil.isNotNull(lastData)) {
                            lastAvgWindSpeed = lastData.getAvgWindSpeed();
                        }
                        double avgWindSpeedCount = list.stream().mapToDouble(WfStatPeriodData::getAvgWindSpeed).sum() - list.get(0).getAvgWindSpeed() + lastAvgWindSpeed;
                        ShareController.addMapValue(mapSjDq, avgWindSpeedCount / list.size(), dataTime, 0, 1);
                    }
                }
                /*实际风速结束*/
                /*预测风速开始*/
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(Convert.toLong(stationNumber));
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(paramsDq);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                for (Date date : dlDq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfNwpData> list = wfNwpDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<WfNwpData> lastData = wfNwpDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double windSpeedCount = 0;
                        Map<Date, List<WfNwpData>> map = list.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                        TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<WfNwpData> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    windSpeedCount += value.get(0).getWindSpeed();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            windSpeedCount += lastData.get(0).getWindSpeed();
                            num++;
                        }
                        ShareController.addMapValue(mapYcDq, windSpeedCount / num, dataTime, 0, 1);
                    }
                }
                /*预测风速结束*/
            }
            /*当期数据结束*/
            /*同期数据开始*/
            String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
            String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
            List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", bDTTq);
            paramsTq.put("endDataTime", eDTTq);
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际风速开始*/
                WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                wfStatPeriodData.setParams(paramsTq);
                List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                for (Date date : dlTq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                    if (list.size() > 0) {
                        double lastAvgWindSpeed = 0;
                        if (ObjectUtil.isNotNull(lastData)) {
                            lastAvgWindSpeed = lastData.getAvgWindSpeed();
                        }
                        double avgWindSpeedCount = list.stream().mapToDouble(WfStatPeriodData::getAvgWindSpeed).sum() - list.get(0).getAvgWindSpeed() + lastAvgWindSpeed;
                        ShareController.addMapValue(mapSjTq, avgWindSpeedCount / list.size(), dataTime, 0, 1);
                    }
                }
                /*实际风速结束*/
                /*预测风速开始*/
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(Convert.toLong(stationNumber));
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(paramsTq);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                for (Date date : dlTq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfNwpData> list = wfNwpDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<WfNwpData> lastData = wfNwpDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double windSpeedCount = 0;
                        Map<Date, List<WfNwpData>> map = list.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                        TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<WfNwpData> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    windSpeedCount += value.get(0).getWindSpeed();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            windSpeedCount += lastData.get(0).getWindSpeed();
                            num++;
                        }
                        ShareController.addMapValue(mapYcTq, windSpeedCount / num, dataTime, 0, 1);
                    }
                }
                /*预测风速结束*/
            }
            /*同期数据结束*/
        } else if (timeType == 3) {//30天外
            /*当期数据开始*/
            Date bDTDq = DateUtil.parse(beginDataTime);
            Date eDTDq = DateUtil.parse(endDataTime);
            List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
            dateList.addAll(dlDq);
            Map<String, Object> paramsDq = new HashMap<>();
            paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
            paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际风速开始*/
                WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                wfStatPeriodData.setParams(paramsDq);
                List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                for (Date date : dlDq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                    if (list.size() > 0) {
                        double lastAvgWindSpeed = 0;
                        if (ObjectUtil.isNotNull(lastData)) {
                            lastAvgWindSpeed = lastData.getAvgWindSpeed();
                        }
                        double avgWindSpeedCount = list.stream().mapToDouble(WfStatPeriodData::getAvgWindSpeed).sum() - list.get(0).getAvgWindSpeed() + lastAvgWindSpeed;
                        ShareController.addMapValue(mapSjDq, avgWindSpeedCount / list.size(), dataTime, 0, 1);
                    }
                }
                /*实际风速结束*/
                /*预测风速开始*/
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(Convert.toLong(stationNumber));
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(paramsDq);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                for (Date date : dlDq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfNwpData> list = wfNwpDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<WfNwpData> lastData = wfNwpDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double windSpeedCount = 0;
                        Map<Date, List<WfNwpData>> map = list.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                        TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<WfNwpData> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    windSpeedCount += value.get(0).getWindSpeed();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            windSpeedCount += lastData.get(0).getWindSpeed();
                            num++;
                        }
                        ShareController.addMapValue(mapYcDq, windSpeedCount / num, dataTime, 0, 1);
                    }
                }
                /*预测风速结束*/
            }
            /*当期数据结束*/
            /*同期数据开始*/
            String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
            String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
            List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", bDTTq);
            paramsTq.put("endDataTime", eDTTq);
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际风速开始*/
                WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                wfStatPeriodData.setParams(paramsTq);
                List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                for (Date date : dlTq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                    if (list.size() > 0) {
                        double lastAvgWindSpeed = 0;
                        if (ObjectUtil.isNotNull(lastData)) {
                            lastAvgWindSpeed = lastData.getAvgWindSpeed();
                        }
                        double avgWindSpeedCount = list.stream().mapToDouble(WfStatPeriodData::getAvgWindSpeed).sum() - list.get(0).getAvgWindSpeed() + lastAvgWindSpeed;
                        ShareController.addMapValue(mapSjTq, avgWindSpeedCount / list.size(), dataTime, 0, 1);
                    }
                }
                /*实际风速结束*/
                /*预测风速开始*/
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(Convert.toLong(stationNumber));
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(paramsTq);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                for (Date date : dlTq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfNwpData> list = wfNwpDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<WfNwpData> lastData = wfNwpDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double windSpeedCount = 0;
                        Map<Date, List<WfNwpData>> map = list.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                        TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<WfNwpData> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    windSpeedCount += value.get(0).getWindSpeed();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            windSpeedCount += lastData.get(0).getWindSpeed();
                            num++;
                        }
                        ShareController.addMapValue(mapYcTq, windSpeedCount / num, dataTime, 0, 1);
                    }
                }
                /*预测风速结束*/
            }
            /*同期数据结束*/
            /*上月数据开始*/
            String bDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(bDTDq, -1));
            String eDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(eDTDq, -1));
            List<Date> dlSy = DateTimeUtil.getDayBetween(DateUtil.parse(bDTSy), DateUtil.parse(eDTSy));
            Map<String, Object> paramsSy = new HashMap<>();
            paramsSy.put("beginDataTime", bDTSy);
            paramsSy.put("endDataTime", eDTSy);
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际风速开始*/
                WfStatPeriodData wfStatPeriodData = new WfStatPeriodData();
                wfStatPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                wfStatPeriodData.setParams(paramsSy);
                List<WfStatPeriodData> wfStatPeriodDataList = wfStatPeriodDataService.selectWfStatPeriodDataList(wfStatPeriodData);
                for (Date date : dlSy) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfStatPeriodData> list = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    WfStatPeriodData lastData = wfStatPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                    if (list.size() > 0) {
                        double lastAvgWindSpeed = 0;
                        if (ObjectUtil.isNotNull(lastData)) {
                            lastAvgWindSpeed = lastData.getAvgWindSpeed();
                        }
                        double avgWindSpeedCount = list.stream().mapToDouble(WfStatPeriodData::getAvgWindSpeed).sum() - list.get(0).getAvgWindSpeed() + lastAvgWindSpeed;
                        ShareController.addMapValue(mapSjSy, avgWindSpeedCount / list.size(), dataTime, 0, 1);
                    }
                }
                /*实际风速结束*/
                /*预测风速开始*/
                WfNwpData wfNwpData = new WfNwpData();
                wfNwpData.setWindplantNo(Convert.toLong(stationNumber));
                wfNwpData.setNwpType(wfFileConfig.getUspNwpNo());
                wfNwpData.setParams(paramsSy);
                List<WfNwpData> wfNwpDataList = wfNwpDataService.selectWfNwpDataList(wfNwpData);
                for (Date date : dlSy) {
                    String dataTime = DateUtil.formatDate(date);
                    List<WfNwpData> list = wfNwpDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<WfNwpData> lastData = wfNwpDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double windSpeedCount = 0;
                        Map<Date, List<WfNwpData>> map = list.stream().collect(Collectors.groupingBy(WfNwpData::getDataTime));
                        TreeMap<Date, List<WfNwpData>> treeMap = new TreeMap<Date, List<WfNwpData>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<WfNwpData>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<WfNwpData> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    windSpeedCount += value.get(0).getWindSpeed();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            windSpeedCount += lastData.get(0).getWindSpeed();
                            num++;
                        }
                        ShareController.addMapValue(mapYcSy, windSpeedCount / num, dataTime, 0, 1);
                    }
                }
                /*预测风速结束*/
            }
            /*上月数据结束*/
        }
        List<TableField> tableFieldList = new ArrayList<>();
        for (Date date : dateList) {
            TableField tableField = new TableField();
            if (timeType == 1) {//10天内
                String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                tableField.setDataTime(stringDateTimeDq);
                List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    tableField.setActualWindSpeedDq(entrySjDq.get(0));
                }
                List<Double> entryYcDq = mapYcDq.get(stringDateTimeDq);
                if (entryYcDq != null) {
                    tableField.setForecastWindSpeedDq(entryYcDq.get(0));
                }
                List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    tableField.setActualWindSpeedTq(entrySjTq.get(0));
                }
                List<Double> entryYcTq = mapYcTq.get(stringDateTimeTq);
                if (entryYcTq != null) {
                    tableField.setForecastWindSpeedTq(entryYcTq.get(0));
                }
            } else if (timeType == 2) {//10天至30天
                String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd");
                String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd");
                tableField.setDataTime(stringDateTimeDq);
                List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    tableField.setActualWindSpeedDq(entrySjDq.get(0));
                }
                List<Double> entryYcDq = mapYcDq.get(stringDateTimeDq);
                if (entryYcDq != null) {
                    tableField.setForecastWindSpeedDq(entryYcDq.get(0));
                }
                List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    tableField.setActualWindSpeedTq(entrySjTq.get(0));
                }
                List<Double> entryYcTq = mapYcTq.get(stringDateTimeTq);
                if (entryYcTq != null) {
                    tableField.setForecastWindSpeedTq(entryYcTq.get(0));
                }
            } else if (timeType == 3) {//30天外
                String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd");
                String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd");
                String stringDateTimeSy = DateUtil.format(DateUtil.offsetMonth(date, -1), "yyyy-MM-dd");
                tableField.setDataTime(stringDateTimeDq);
                List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    tableField.setActualWindSpeedDq(entrySjDq.get(0));
                }
                List<Double> entryYcDq = mapYcDq.get(stringDateTimeDq);
                if (entryYcDq != null) {
                    tableField.setForecastWindSpeedDq(entryYcDq.get(0));
                }
                List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    tableField.setActualWindSpeedTq(entrySjTq.get(0));
                }
                List<Double> entryYcTq = mapYcTq.get(stringDateTimeTq);
                if (entryYcTq != null) {
                    tableField.setForecastWindSpeedTq(entryYcTq.get(0));
                }
                List<Double> entrySjSy = mapSjSy.get(stringDateTimeSy);
                if (entrySjSy != null) {
                    tableField.setActualWindSpeedSy(entrySjSy.get(0));
                }
                List<Double> entryYcSy = mapYcSy.get(stringDateTimeSy);
                if (entryYcSy != null) {
                    tableField.setForecastWindSpeedSy(entryYcSy.get(0));
                }
            }
            tableFieldList.add(tableField);
        }
        json.put("dataFormatList", tableFieldList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Chart-全域辐照度预测")
    @GetMapping("/globalIrradianceForecastChartData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(光伏主键)", required = true),
            @ApiImplicitParam(name = "timeType", value = "时间类型(10天内传1,10天外传2)", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult globalIrradianceForecastChartData(@RequestParam(value = "stationNumber") String stationNumber,
                                                        @RequestParam(value = "timeType") int timeType,
                                                        @RequestParam(value = "beginDataTime") String beginDataTime,
                                                        @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //获取所有时间
        List<Date> dateList = new ArrayList<>();
        List<DataFormat> dataFormatList = new ArrayList<>();
        if (timeType == 1) {//10天内
            dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
            int count1 = dateList.size();
            Map<String, Object> params = new HashMap<>();
            params.put("beginDataTime", beginDataTime);
            params.put("endDataTime", endDataTime);
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*预测辐照度开始*/
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(Convert.toLong(stationNumber));
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(params);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                Map<Date, List<PvImmbNwp>> map = pvImmbNwpList.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                Double[] data = new Double[count1];
                int num = 0;
                for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                    List<PvImmbNwp> value = entry.getValue();
                    if (value.size() > 0) {
                        //排序
                        value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                        data[num] = value.get(0).getSwRadiation();
                    }
                    num++;
                }
                /*预测辐照度结束*/
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName("预测辐照度");
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
            /*实际辐照度开始*/
            PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(pvPowerStation)) {
                WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                wfYcHistoryData1.setAnalogNo(pvPowerStation.getGhiYcNo());
                wfYcHistoryData1.setParams(params);
                List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                Double[] data = new Double[count1];
                int num = 0;
                for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                    data[num] = w.getYcRawVal();
                    num++;
                }
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName("实际辐照度");
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
            /*实际辐照度结束*/
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(beginDataTime), DateField.YEAR, -1)));
            paramsTq.put("endDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(endDataTime), DateField.YEAR, -1)));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*同期实际数据开始*/
                if (ObjectUtil.isNotNull(pvPowerStation)) {
                    WfYcHistoryData1 wfYcHistoryData1Tq = new WfYcHistoryData1();
                    wfYcHistoryData1Tq.setAnalogNo(pvPowerStation.getGhiYcNo());
                    wfYcHistoryData1Tq.setParams(paramsTq);
                    List<WfYcHistoryData1> wfYcHistoryData1ListTq = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1Tq);
                    Double[] dataTq = new Double[count1];
                    int numTq = 0;
                    for (WfYcHistoryData1 w : wfYcHistoryData1ListTq) {
                        dataTq[numTq] = w.getYcRawVal();
                        numTq++;
                    }
                    DataFormat dataFormatTq = new DataFormat();
                    dataFormatTq.setName("同期实际");
                    dataFormatTq.setData(dataTq);
                    dataFormatList.add(dataFormatTq);
                }
                /*同期实际数据结束*/
            }
        } else if (timeType == 2) {//10天外
            Date bDT = DateUtil.parse(beginDataTime);
            Date eDT = DateUtil.parse(endDataTime);
            List<Date> dl = DateTimeUtil.getDayBetween(bDT, eDT);
            dateList.addAll(dl);
            int count1 = dateList.size();
            Map<String, Object> params = new HashMap<>();
            params.put("beginDataTime", DateUtil.formatDateTime(bDT));
            params.put("endDataTime", DateUtil.formatDateTime(eDT));
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*预测辐照度开始*/
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(Convert.toLong(stationNumber));
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(params);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                Double[] data = new Double[count1];
                for (int i = 0; i < count1; i++) {
                    String dataTime = DateUtil.formatDate(dateList.get(i));
                    List<PvImmbNwp> list = pvImmbNwpList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(dateList.get(i), 1));
                    List<PvImmbNwp> lastData = pvImmbNwpList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double swRadiation = 0;
                        Map<Date, List<PvImmbNwp>> map = list.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                        TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<PvImmbNwp> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    swRadiation += value.get(0).getSwRadiation();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            swRadiation += lastData.get(0).getSwRadiation();
                            num++;
                        }
                        data[i] = swRadiation / num;
                    }
                }
                /*预测辐照度结束*/
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName("预测辐照度");
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
            /*实际辐照度开始*/
            PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(pvPowerStation)) {
                WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                wfYcHistoryData1.setAnalogNo(pvPowerStation.getGhiYcNo());
                wfYcHistoryData1.setParams(params);
                List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                Double[] data = new Double[count1];
                for (int i = 0; i < count1; i++) {
                    String dataTime = DateUtil.formatDate(dateList.get(i));
                    List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(dateList.get(i), 1));
                    WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                    if (list.size() > 0) {
                        double lastYcRawVal = 0;
                        if (ObjectUtil.isNotNull(lastData)) {
                            lastYcRawVal = lastData.getYcRawVal();
                        }
                        double ycRawValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcRawVal).sum() - list.get(0).getYcRawVal() + lastYcRawVal;
                        data[i] = ycRawValCount / list.size();
                    }
                }
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName("实际辐照度");
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
            /*实际辐照度结束*/
            String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDT, DateField.YEAR, -1));
            String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDT, DateField.YEAR, -1));
            List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
            int count2 = dlTq.size();
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", bDTTq);
            paramsTq.put("endDataTime", eDTTq);
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*同期实际数据开始*/
                if (ObjectUtil.isNotNull(pvPowerStation)) {
                    WfYcHistoryData1 wfYcHistoryData1Tq = new WfYcHistoryData1();
                    wfYcHistoryData1Tq.setAnalogNo(pvPowerStation.getGhiYcNo());
                    wfYcHistoryData1Tq.setParams(paramsTq);
                    List<WfYcHistoryData1> wfYcHistoryData1ListTq = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1Tq);
                    Double[] dataTq = new Double[count2];
                    for (int i = 0; i < count1; i++) {
                        String dataTime = DateUtil.formatDate(dateList.get(i));
                        List<WfYcHistoryData1> list = wfYcHistoryData1ListTq.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                        String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(dateList.get(i), 1));
                        WfYcHistoryData1 lastData = wfYcHistoryData1ListTq.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                        if (list.size() > 0) {
                            double lastYcRawVal = 0;
                            if (ObjectUtil.isNotNull(lastData)) {
                                lastYcRawVal = lastData.getYcRawVal();
                            }
                            double ycRawValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcRawVal).sum() - list.get(0).getYcRawVal() + lastYcRawVal;
                            dataTq[i] = ycRawValCount / list.size();
                        }
                    }
                    DataFormat dataFormatTq = new DataFormat();
                    dataFormatTq.setName("同期实际");
                    dataFormatTq.setData(dataTq);
                    dataFormatList.add(dataFormatTq);
                }
                /*同期实际数据结束*/
            }
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Table-全域辐照度预测")
    @GetMapping("/globalIrradianceForecastTableData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(光伏主键)", required = true),
            @ApiImplicitParam(name = "timeType", value = "时间类型(10天内传1,10天外传2)", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult globalIrradianceForecastTableData(@RequestParam(value = "stationNumber") String stationNumber,
                                                        @RequestParam(value = "timeType") int timeType,
                                                        @RequestParam(value = "beginDataTime") String beginDataTime,
                                                        @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //获取所有时间
        List<Date> dateList = new ArrayList<>();
        //实际-当期
        LinkedMultiValueMap<String, Double> mapSjDq = new LinkedMultiValueMap<String, Double>();
        //预测-当期
        LinkedMultiValueMap<String, Double> mapYcDq = new LinkedMultiValueMap<String, Double>();
        //实际-同期
        LinkedMultiValueMap<String, Double> mapSjTq = new LinkedMultiValueMap<String, Double>();
        //预测-同期
        LinkedMultiValueMap<String, Double> mapYcTq = new LinkedMultiValueMap<String, Double>();
        //实际-上月
        LinkedMultiValueMap<String, Double> mapSjSy = new LinkedMultiValueMap<String, Double>();
        //预测-上月
        LinkedMultiValueMap<String, Double> mapYcSy = new LinkedMultiValueMap<String, Double>();
        if (timeType == 1) {//10天内
            dateList.addAll(DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime)));
            /*当期数据开始*/
            Map<String, Object> paramsDq = new HashMap<>();
            paramsDq.put("beginDataTime", beginDataTime);
            paramsDq.put("endDataTime", endDataTime);
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际辐照度开始*/
                PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(pvPowerStation)) {
                    WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                    wfYcHistoryData1.setAnalogNo(pvPowerStation.getGhiYcNo());
                    wfYcHistoryData1.setParams(paramsDq);
                    List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                    for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                        ShareController.addMapValue(mapSjDq, w.getYcRawVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                    }
                }
                /*实际辐照度结束*/
                /*预测辐照度开始*/
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(Convert.toLong(stationNumber));
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(paramsDq);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                Map<Date, List<PvImmbNwp>> map = pvImmbNwpList.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                    List<PvImmbNwp> value = entry.getValue();
                    if (value.size() > 0) {
                        //排序
                        value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                        double swRadiation = value.get(0).getSwRadiation();
                        ShareController.addMapValue(mapYcDq, swRadiation, DateUtil.format(value.get(0).getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                    }
                }
                /*预测辐照度结束*/
            }
            /*当期数据结束*/
            /*同期数据开始*/
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(beginDataTime), DateField.YEAR, -1)));
            paramsTq.put("endDataTime", DateUtil.formatDateTime(DateUtil.offset(DateUtil.parse(endDataTime), DateField.YEAR, -1)));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际辐照度开始*/
                PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(pvPowerStation)) {
                    WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                    wfYcHistoryData1.setAnalogNo(pvPowerStation.getGhiYcNo());
                    wfYcHistoryData1.setParams(paramsTq);
                    List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                    for (WfYcHistoryData1 w : wfYcHistoryData1List) {
                        ShareController.addMapValue(mapSjTq, w.getYcRawVal(), DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                    }
                }
                /*实际辐照度结束*/
                /*预测辐照度开始*/
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(Convert.toLong(stationNumber));
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(paramsTq);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                Map<Date, List<PvImmbNwp>> map = pvImmbNwpList.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                    List<PvImmbNwp> value = entry.getValue();
                    if (value.size() > 0) {
                        //排序
                        value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                        double swRadiation = value.get(0).getSwRadiation();
                        ShareController.addMapValue(mapYcTq, swRadiation, DateUtil.format(value.get(0).getDataTime(), "yyyy-MM-dd HH:mm"), 0, 1);
                    }
                }
                /*预测辐照度结束*/
            }
            /*同期数据结束*/
        } else if (timeType == 2) {//10天至30天
            /*当期数据开始*/
            Date bDTDq = DateUtil.parse(beginDataTime);
            Date eDTDq = DateUtil.parse(endDataTime);
            List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
            dateList.addAll(dlDq);
            Map<String, Object> paramsDq = new HashMap<>();
            paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
            paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际辐照度开始*/
                PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(pvPowerStation)) {
                    WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                    wfYcHistoryData1.setAnalogNo(pvPowerStation.getGhiYcNo());
                    wfYcHistoryData1.setParams(paramsDq);
                    List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                    for (Date date : dlDq) {
                        String dataTime = DateUtil.formatDate(date);
                        List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                        String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                        WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                        if (list.size() > 0) {
                            double lastYcRawVal = 0;
                            if (ObjectUtil.isNotNull(lastData)) {
                                lastYcRawVal = lastData.getYcRawVal();
                            }
                            double ycRawValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcRawVal).sum() - list.get(0).getYcRawVal() + lastYcRawVal;
                            ShareController.addMapValue(mapSjDq, ycRawValCount / list.size(), dataTime, 0, 1);
                        }
                    }
                }
                /*实际辐照度结束*/
                /*预测辐照度开始*/
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(Convert.toLong(stationNumber));
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(paramsDq);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                for (Date date : dlDq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<PvImmbNwp> list = pvImmbNwpList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<PvImmbNwp> lastData = pvImmbNwpList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double swRadiationCount = 0;
                        Map<Date, List<PvImmbNwp>> map = list.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                        TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<PvImmbNwp> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    swRadiationCount += value.get(0).getSwRadiation();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            swRadiationCount += lastData.get(0).getSwRadiation();
                            num++;
                        }
                        ShareController.addMapValue(mapYcDq, swRadiationCount / num, dataTime, 0, 1);
                    }
                }
                /*预测辐照度结束*/
            }
            /*当期数据结束*/
            /*同期数据开始*/
            String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
            String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
            List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", bDTTq);
            paramsTq.put("endDataTime", eDTTq);
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际辐照度开始*/
                PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(pvPowerStation)) {
                    WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                    wfYcHistoryData1.setAnalogNo(pvPowerStation.getGhiYcNo());
                    wfYcHistoryData1.setParams(paramsTq);
                    List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                    for (Date date : dlTq) {
                        String dataTime = DateUtil.formatDate(date);
                        List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                        String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                        WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                        if (list.size() > 0) {
                            double lastYcRawVal = 0;
                            if (ObjectUtil.isNotNull(lastData)) {
                                lastYcRawVal = lastData.getYcRawVal();
                            }
                            double ycRawValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcRawVal).sum() - list.get(0).getYcRawVal() + lastYcRawVal;
                            ShareController.addMapValue(mapSjTq, ycRawValCount / list.size(), dataTime, 0, 1);
                        }
                    }
                }
                /*实际辐照度结束*/
                /*预测辐照度开始*/
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(Convert.toLong(stationNumber));
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(paramsTq);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                for (Date date : dlTq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<PvImmbNwp> list = pvImmbNwpList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<PvImmbNwp> lastData = pvImmbNwpList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double swRadiationCount = 0;
                        Map<Date, List<PvImmbNwp>> map = list.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                        TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<PvImmbNwp> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    swRadiationCount += value.get(0).getSwRadiation();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            swRadiationCount += lastData.get(0).getSwRadiation();
                            num++;
                        }
                        ShareController.addMapValue(mapYcTq, swRadiationCount / num, dataTime, 0, 1);
                    }
                }
                /*预测辐照度结束*/
            }
            /*同期数据结束*/
        } else if (timeType == 3) {//30天外
            /*当期数据开始*/
            Date bDTDq = DateUtil.parse(beginDataTime);
            Date eDTDq = DateUtil.parse(endDataTime);
            List<Date> dlDq = DateTimeUtil.getDayBetween(bDTDq, eDTDq);
            dateList.addAll(dlDq);
            Map<String, Object> paramsDq = new HashMap<>();
            paramsDq.put("beginDataTime", DateUtil.formatDateTime(bDTDq));
            paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
            WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际辐照度开始*/
                PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(pvPowerStation)) {
                    WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                    wfYcHistoryData1.setAnalogNo(pvPowerStation.getGhiYcNo());
                    wfYcHistoryData1.setParams(paramsDq);
                    List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                    for (Date date : dlDq) {
                        String dataTime = DateUtil.formatDate(date);
                        List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                        String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                        WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                        if (list.size() > 0) {
                            double lastYcRawVal = 0;
                            if (ObjectUtil.isNotNull(lastData)) {
                                lastYcRawVal = lastData.getYcRawVal();
                            }
                            double ycRawValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcRawVal).sum() - list.get(0).getYcRawVal() + lastYcRawVal;
                            ShareController.addMapValue(mapSjDq, ycRawValCount / list.size(), dataTime, 0, 1);
                        }
                    }
                }
                /*实际辐照度结束*/
                /*预测辐照度开始*/
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(Convert.toLong(stationNumber));
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(paramsDq);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                for (Date date : dlDq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<PvImmbNwp> list = pvImmbNwpList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<PvImmbNwp> lastData = pvImmbNwpList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double swRadiationCount = 0;
                        Map<Date, List<PvImmbNwp>> map = list.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                        TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<PvImmbNwp> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    swRadiationCount += value.get(0).getSwRadiation();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            swRadiationCount += lastData.get(0).getSwRadiation();
                            num++;
                        }
                        ShareController.addMapValue(mapYcDq, swRadiationCount / num, dataTime, 0, 1);
                    }
                }
                /*预测辐照度结束*/
            }
            /*当期数据结束*/
            /*同期数据开始*/
            String bDTTq = DateUtil.formatDateTime(DateUtil.offset(bDTDq, DateField.YEAR, -1));
            String eDTTq = DateUtil.formatDateTime(DateUtil.offset(eDTDq, DateField.YEAR, -1));
            List<Date> dlTq = DateTimeUtil.getDayBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
            Map<String, Object> paramsTq = new HashMap<>();
            paramsTq.put("beginDataTime", bDTTq);
            paramsTq.put("endDataTime", eDTTq);
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际辐照度开始*/
                PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(pvPowerStation)) {
                    WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                    wfYcHistoryData1.setAnalogNo(pvPowerStation.getGhiYcNo());
                    wfYcHistoryData1.setParams(paramsTq);
                    List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                    for (Date date : dlTq) {
                        String dataTime = DateUtil.formatDate(date);
                        List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                        String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                        WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                        if (list.size() > 0) {
                            double lastYcRawVal = 0;
                            if (ObjectUtil.isNotNull(lastData)) {
                                lastYcRawVal = lastData.getYcRawVal();
                            }
                            double ycRawValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcRawVal).sum() - list.get(0).getYcRawVal() + lastYcRawVal;
                            ShareController.addMapValue(mapSjTq, ycRawValCount / list.size(), dataTime, 0, 1);
                        }
                    }
                }
                /*实际辐照度结束*/
                /*预测辐照度开始*/
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(Convert.toLong(stationNumber));
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(paramsTq);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                for (Date date : dlTq) {
                    String dataTime = DateUtil.formatDate(date);
                    List<PvImmbNwp> list = pvImmbNwpList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<PvImmbNwp> lastData = pvImmbNwpList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double swRadiationCount = 0;
                        Map<Date, List<PvImmbNwp>> map = list.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                        TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<PvImmbNwp> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    swRadiationCount += value.get(0).getSwRadiation();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            swRadiationCount += lastData.get(0).getSwRadiation();
                            num++;
                        }
                        ShareController.addMapValue(mapYcTq, swRadiationCount / num, dataTime, 0, 1);
                    }
                }
                /*预测辐照度结束*/
            }
            /*同期数据结束*/
            /*上月数据开始*/
            String bDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(bDTDq, -1));
            String eDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(eDTDq, -1));
            List<Date> dlSy = DateTimeUtil.getDayBetween(DateUtil.parse(bDTSy), DateUtil.parse(eDTSy));
            Map<String, Object> paramsSy = new HashMap<>();
            paramsSy.put("beginDataTime", bDTSy);
            paramsSy.put("endDataTime", eDTSy);
            if (ObjectUtil.isNotNull(wfFileConfig)) {
                /*实际辐照度开始*/
                PvPowerStation pvPowerStation = pvPowerStationService.selectPvPowerStationById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(pvPowerStation)) {
                    WfYcHistoryData1 wfYcHistoryData1 = new WfYcHistoryData1();
                    wfYcHistoryData1.setAnalogNo(pvPowerStation.getGhiYcNo());
                    wfYcHistoryData1.setParams(paramsSy);
                    List<WfYcHistoryData1> wfYcHistoryData1List = wfYcHistoryData1Service.selectWfYcHistoryData1List(wfYcHistoryData1);
                    for (Date date : dlSy) {
                        String dataTime = DateUtil.formatDate(date);
                        List<WfYcHistoryData1> list = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                        String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                        WfYcHistoryData1 lastData = wfYcHistoryData1List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).findAny().orElse(null);
                        if (list.size() > 0) {
                            double lastYcRawVal = 0;
                            if (ObjectUtil.isNotNull(lastData)) {
                                lastYcRawVal = lastData.getYcRawVal();
                            }
                            double ycRawValCount = list.stream().mapToDouble(WfYcHistoryData1::getYcRawVal).sum() - list.get(0).getYcRawVal() + lastYcRawVal;
                            ShareController.addMapValue(mapSjSy, ycRawValCount / list.size(), dataTime, 0, 1);
                        }
                    }
                }
                /*实际辐照度结束*/
                /*预测辐照度开始*/
                PvImmbNwp pvImmbNwp = new PvImmbNwp();
                pvImmbNwp.setPvNo(Convert.toLong(stationNumber));
                pvImmbNwp.setNwpType(wfFileConfig.getUspNwpNo());
                pvImmbNwp.setParams(paramsSy);
                List<PvImmbNwp> pvImmbNwpList = pvImmbNwpService.selectPvImmbNwpList(pvImmbNwp);
                for (Date date : dlSy) {
                    String dataTime = DateUtil.formatDate(date);
                    List<PvImmbNwp> list = pvImmbNwpList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                    String lastTime = DateUtil.formatDateTime(DateUtil.offsetDay(date, 1));
                    List<PvImmbNwp> lastData = pvImmbNwpList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(lastTime)).collect(Collectors.toList());
                    if (list.size() > 0) {
                        double swRadiationCount = 0;
                        Map<Date, List<PvImmbNwp>> map = list.stream().collect(Collectors.groupingBy(PvImmbNwp::getDataTime));
                        TreeMap<Date, List<PvImmbNwp>> treeMap = new TreeMap<Date, List<PvImmbNwp>>(map);
                        int num = 0;
                        for (Map.Entry<Date, List<PvImmbNwp>> entry : treeMap.entrySet()) {
                            if (num != 0) {
                                List<PvImmbNwp> value = entry.getValue();
                                if (value.size() > 0) {
                                    //排序
                                    value.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                                    swRadiationCount += value.get(0).getSwRadiation();
                                }
                            }
                            num++;
                        }
                        if (lastData.size() > 0) {
                            lastData.sort((o1, o2) -> o2.getFileTime().compareTo(o1.getFileTime()));
                            swRadiationCount += lastData.get(0).getSwRadiation();
                            num++;
                        }
                        ShareController.addMapValue(mapYcSy, swRadiationCount / num, dataTime, 0, 1);
                    }
                }
                /*预测辐照度结束*/
            }
            /*上月数据结束*/
        }
        List<TableField> tableFieldList = new ArrayList<>();
        for (Date date : dateList) {
            TableField tableField = new TableField();
            if (timeType == 1) {//10天内
                String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                tableField.setDataTime(stringDateTimeDq);
                List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    tableField.setActualWindSpeedDq(entrySjDq.get(0));
                }
                List<Double> entryYcDq = mapYcDq.get(stringDateTimeDq);
                if (entryYcDq != null) {
                    tableField.setForecastWindSpeedDq(entryYcDq.get(0));
                }
                List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    tableField.setActualWindSpeedTq(entrySjTq.get(0));
                }
                List<Double> entryYcTq = mapYcTq.get(stringDateTimeTq);
                if (entryYcTq != null) {
                    tableField.setForecastWindSpeedTq(entryYcTq.get(0));
                }
            } else if (timeType == 2) {//10天至30天
                String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd");
                String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd");
                tableField.setDataTime(stringDateTimeDq);
                List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    tableField.setActualWindSpeedDq(entrySjDq.get(0));
                }
                List<Double> entryYcDq = mapYcDq.get(stringDateTimeDq);
                if (entryYcDq != null) {
                    tableField.setForecastWindSpeedDq(entryYcDq.get(0));
                }
                List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    tableField.setActualWindSpeedTq(entrySjTq.get(0));
                }
                List<Double> entryYcTq = mapYcTq.get(stringDateTimeTq);
                if (entryYcTq != null) {
                    tableField.setForecastWindSpeedTq(entryYcTq.get(0));
                }
            } else if (timeType == 3) {//30天外
                String stringDateTimeDq = DateUtil.format(date, "yyyy-MM-dd");
                String stringDateTimeTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM-dd");
                String stringDateTimeSy = DateUtil.format(DateUtil.offsetMonth(date, -1), "yyyy-MM-dd");
                tableField.setDataTime(stringDateTimeDq);
                List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    tableField.setActualWindSpeedDq(entrySjDq.get(0));
                }
                List<Double> entryYcDq = mapYcDq.get(stringDateTimeDq);
                if (entryYcDq != null) {
                    tableField.setForecastWindSpeedDq(entryYcDq.get(0));
                }
                List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    tableField.setActualWindSpeedTq(entrySjTq.get(0));
                }
                List<Double> entryYcTq = mapYcTq.get(stringDateTimeTq);
                if (entryYcTq != null) {
                    tableField.setForecastWindSpeedTq(entryYcTq.get(0));
                }
                List<Double> entrySjSy = mapSjSy.get(stringDateTimeSy);
                if (entrySjSy != null) {
                    tableField.setActualWindSpeedSy(entrySjSy.get(0));
                }
                List<Double> entryYcSy = mapYcSy.get(stringDateTimeSy);
                if (entryYcSy != null) {
                    tableField.setForecastWindSpeedSy(entryYcSy.get(0));
                }
            }
            tableFieldList.add(tableField);
        }
        json.put("dataFormatList", tableFieldList);
        return AjaxResult.success(json);
    }
}