package com.ruoyi.predict.api;

import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUnit;
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 2022/8/24 15:02
 * 文件说明：电量预测
 */
@Api(value = "电量预测Controller", tags = {"电量预测操作接口"})
@Controller
@RequestMapping("/predict/api/efc")
public class ElectricityForecastController extends BaseController {

    @Autowired
    private IWindplantService windplantService;

    @Autowired
    private IPvPowerStationService pvPowerStationService;

    @Autowired
    private IWfFileConfigService wfFileConfigService;

    @Autowired
    private INoscaleWfDaEfPeriodDataService noscaleWfDaEfPeriodDataService;

    @Autowired
    private IWfYcHistoryData2Service wfYcHistoryData2Service;

    @Autowired
    private IWpuspSvrParaService wpuspSvrParaService;

    @Autowired
    private IWfUspTsEfPeriodDataService wfUspTsEfPeriodDataService;

    @Autowired
    private IPlanpowerDistributionService planpowerDistributionService;

    @Autowired
    private IProjectplanService projectplanService;

    @Autowired
    private IWfTheoryenergyDataService wfTheoryenergyDataService;

    @Autowired
    private ILpWfMonthDataService lpWfMonthDataService;

    @Autowired
    private INoscaleWfDaPfPeriodDataService noscaleWfDaPfPeriodDataService;

    @ApiOperation("今日发电量预测")
    @GetMapping("/todayPowerGenerationForecast")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
    })
    public AjaxResult todayPowerGenerationForecast(@RequestParam(value = "stationNumber") String stationNumber,
                                                   @RequestParam(value = "itemVal") int itemVal) {
        JSONObject json = new JSONObject();
        //当日的开始时间
        Date beginOfDay = DateUtil.date(DateUtil.beginOfDay(DateUtil.date()).getTime() + 600000);
        //当日的结束时间
        Date endOfDay = DateUtil.date(DateUtil.endOfDay(DateUtil.date()).getTime() + 1000);
        Map<String, Object> params = new HashMap<>();
        params.put("beginDataTime", DateUtil.formatDateTime(beginOfDay));
        params.put("endDataTime", DateUtil.formatDateTime(endOfDay));
        //场站名称
        String name = "";
        //计划
        double generatingcapacity = 0;
        //预测
        double countValue = 0;
        //实际
        double countYcRawVal = 0;
        if ("-1".equals(stationNumber)) {//全域数据
            name = "全域";
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById((long) -1);
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(beginOfDay), (long) DateUtil.month(endOfDay) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                Map<String, Object> params1 = new HashMap<>();
                                params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 1)));
                                params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 14)));
                                NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                obj.setWindplantNo(windplant.getWindplantNo());
                                obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                obj.setParams(params1);
                                obj.setCondition(1);
                                List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                long betweenDay = DateUtil.between(DateUtil.beginOfMonth(DateUtil.date()), DateUtil.endOfMonth(DateUtil.date()), DateUnit.DAY) + 1;
                                double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 1));
                                double value = 0;
                                if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                    if (noscaleWfDaPfPeriodData.getValue() != null) {
                                        value = noscaleWfDaPfPeriodData.getValue();
                                    }
                                }
                                if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                    double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                    double b = value / valueCount;
                                    generatingcapacity += a * b;
                                }
                            } else if (planpowerDistribution.getType() == 2) {//2为平分
                                Date date1 = DateUtil.beginOfMonth(DateUtil.date());
                                Date date2 = DateUtil.endOfMonth(DateUtil.date());
                                long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY) + 1;
                                generatingcapacity += generatingcapacityCount / betweenDay;
                            }
                        }
                    }
                    /*计划发电量结束*/
                    /*预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        countValue += noscaleWfDaEfPeriodDataList.stream().mapToDouble(NoscaleWfDaEfPeriodData::getValue).sum();
                    }
                    /*预测发电量结束*/
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            countYcRawVal += wfYcHistoryData2List.get(wfYcHistoryData2List.size() - 1).getYcRawVal();
                        }
                    }
                    /*实际发电量结束*/
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    name = wfFileConfig.getWindplantName();
                    /*计划发电量开始*/
                    PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(beginOfDay), (long) DateUtil.month(endOfDay) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                Map<String, Object> params1 = new HashMap<>();
                                params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 1)));
                                params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 14)));
                                NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                obj.setWindplantNo(Convert.toLong(stationNumber));
                                obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                obj.setParams(params1);
                                obj.setCondition(1);
                                List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                long betweenDay = DateUtil.between(DateUtil.beginOfMonth(DateUtil.date()), DateUtil.endOfMonth(DateUtil.date()), DateUnit.DAY) + 1;
                                double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(Convert.toLong(stationNumber), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 1));
                                double value = 0;
                                if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                    if (noscaleWfDaPfPeriodData.getValue() != null) {
                                        value = noscaleWfDaPfPeriodData.getValue();
                                    }
                                }
                                if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                    double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                    double b = value / valueCount;
                                    generatingcapacity += a * b;
                                }
                            } else if (planpowerDistribution.getType() == 2) {//2为平分
                                Date date1 = DateUtil.beginOfMonth(DateUtil.date());
                                Date date2 = DateUtil.endOfMonth(DateUtil.date());
                                long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY) + 1;
                                generatingcapacity += generatingcapacityCount / betweenDay;
                            }
                        }
                    }
                    /*计划发电量结束*/
                    /*预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        countValue += noscaleWfDaEfPeriodDataList.stream().mapToDouble(NoscaleWfDaEfPeriodData::getValue).sum();
                    }
                    /*预测发电量结束*/
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            countYcRawVal += wfYcHistoryData2List.get(wfYcHistoryData2List.size() - 1).getYcRawVal();
                        }
                    }
                    /*实际发电量结束*/
                }
            } else if (itemVal == 4) {//光伏场站
                //暂无 后补
            }
        }
        List<DataFormat> dataFormatList = new ArrayList<>();
        Double[] dataJh = new Double[1];
        dataJh[0] = generatingcapacity;
        DataFormat dataFormatJh = new DataFormat();
        dataFormatJh.setName("计划");
        dataFormatJh.setData(dataJh);
        dataFormatList.add(dataFormatJh);
        Double[] dataYc = new Double[1];
        dataYc[0] = countValue;
        DataFormat dataFormatYc = new DataFormat();
        dataFormatYc.setName("预测");
        dataFormatYc.setData(dataYc);
        dataFormatList.add(dataFormatYc);
        Double[] dataSj = new Double[1];
        dataSj[0] = countYcRawVal;
        DataFormat dataFormatSj = new DataFormat();
        dataFormatSj.setName("实际");
        dataFormatSj.setData(dataSj);
        dataFormatList.add(dataFormatSj);
        json.put("dataFormatList", dataFormatList);
        json.put("name", new String[]{name});
        return AjaxResult.success(json);
    }

    @ApiOperation("日发电量预测")
    @GetMapping("/dailyPowerGenerationForecast")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
    })
    public AjaxResult dailyPowerGenerationForecast(@RequestParam(value = "stationNumber") String stationNumber,
                                                   @RequestParam(value = "itemVal") int itemVal) {
        JSONObject json = new JSONObject();
        //当日的开始时间
        Date beginOfDay = DateUtil.date(DateUtil.beginOfDay(DateUtil.date()).getTime() + 600000);
        Date beginOfDay15 = DateUtil.date(DateUtil.beginOfDay(DateUtil.date()).getTime() + 900000);
        //当日的结束时间
        Date endOfDay = DateUtil.date(DateUtil.endOfDay(DateUtil.date()).getTime() + 1000);
        //获取所有时间
        List<Date> dateList = DateTimeUtil.getDateList10(DateUtil.parse(DateUtil.formatDateTime(beginOfDay)), DateUtil.parse(DateUtil.formatDateTime(endOfDay)));
        List<Date> dateList15 = DateTimeUtil.getDateList15(DateUtil.parse(DateUtil.formatDateTime(beginOfDay15)), DateUtil.parse(DateUtil.formatDateTime(endOfDay)));
        //场站总数
        int modelCount = 0;
        //实际发电
        LinkedMultiValueMap<String, Double> map = new LinkedMultiValueMap<String, Double>();
        //超短期发电
        LinkedMultiValueMap<String, Double> mapCdq = new LinkedMultiValueMap<String, Double>();
        //短期发电
        LinkedMultiValueMap<String, Double> mapDq = new LinkedMultiValueMap<String, Double>();
        //计划发电
        LinkedMultiValueMap<String, Double> mapJh = new LinkedMultiValueMap<String, Double>();
        Map<String, Object> params = new HashMap<>();
        params.put("beginDataTime", DateUtil.formatDateTime(beginOfDay));
        params.put("endDataTime", DateUtil.formatDateTime(endOfDay));
        if ("-1".equals(stationNumber)) {//全域数据
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById(Convert.toLong(stationNumber));
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            /*for (Date date : dateList15) {
                                if ("15".equals(DateUtil.formatDateTime(date).substring(14, 16))) {
                                    WfYcHistoryData2 data10 = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetMinute(date, -5)))).findAny().orElse(null);
                                    WfYcHistoryData2 data20 = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetMinute(date, 5)))).findAny().orElse(null);
                                    if (ObjectUtil.isNotNull(data10) && ObjectUtil.isNotNull(data20)) {
                                        double ycRawVal = data10.getYcRawVal() + (data20.getYcRawVal() / 2);
                                        String dataTime = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                                        ShareController.addMapValue(map, ycRawVal, dataTime, modelCount, windplantList.size());
                                    }
                                }
                            }*/
                            for (WfYcHistoryData2 w : wfYcHistoryData2List) {
                                String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map, w.getYcRawVal(), dataTime, modelCount, windplantList.size());
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale((long) 0);
                    wfUspTsEfPeriodData.setParams(params);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    if (wfUspTsEfPeriodDataList.size() > 0) {
                        double modEnergyCount = 0;
                        for (WfUspTsEfPeriodData w : wfUspTsEfPeriodDataList) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            modEnergyCount += w.getModEnergy();
                            ShareController.addMapValue(mapCdq, modEnergyCount, dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        double valueCount = 0;
                        for (NoscaleWfDaEfPeriodData n : noscaleWfDaEfPeriodDataList) {
                            String dataTime = DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm");
                            valueCount += n.getValue();
                            ShareController.addMapValue(mapDq, valueCount, dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*短期预测发电量结束*/
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        double generatingcapacity = 0;
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(beginOfDay), (long) DateUtil.month(endOfDay) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                Map<String, Object> params1 = new HashMap<>();
                                params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 1)));
                                params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 14)));
                                NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                obj.setWindplantNo(windplant.getWindplantNo());
                                obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                obj.setParams(params1);
                                obj.setCondition(1);
                                List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                long betweenDay = DateUtil.between(DateUtil.beginOfMonth(DateUtil.date()), DateUtil.endOfMonth(DateUtil.date()), DateUnit.DAY) + 1;
                                double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 1));
                                double value = 0;
                                if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                    if (noscaleWfDaPfPeriodData.getValue() != null) {
                                        value = noscaleWfDaPfPeriodData.getValue();
                                    }
                                }
                                if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                    double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                    double b = value / valueCount;
                                    generatingcapacity = a * b;
                                }
                            } else if (planpowerDistribution.getType() == 2) {//2为平分
                                Date date1 = DateUtil.beginOfMonth(DateUtil.date());
                                Date date2 = DateUtil.endOfMonth(DateUtil.date());
                                long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY) + 1;
                                generatingcapacity = generatingcapacityCount / betweenDay;
                            }
                            for (Date date : dateList) {
                                String dataTime = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapJh, generatingcapacity, dataTime, modelCount, windplantList.size());
                            }
                        }
                    }
                    /*计划发电量结束*/
                    modelCount++;
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        for (WfYcHistoryData2 w : wfYcHistoryData2List) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map, w.getYcRawVal(), dataTime, 0, 1);
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale((long) 0);
                    wfUspTsEfPeriodData.setParams(params);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    double modEnergyCount = 0;
                    for (WfUspTsEfPeriodData w : wfUspTsEfPeriodDataList) {
                        String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                        modEnergyCount += w.getModEnergy();
                        ShareController.addMapValue(map, modEnergyCount, dataTime, 1, 2);
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    double valueCount = 0;
                    for (NoscaleWfDaEfPeriodData n : noscaleWfDaEfPeriodDataList) {
                        String dataTime = DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm");
                        valueCount += n.getValue();
                        ShareController.addMapValue(map, valueCount, dataTime, 2, 3);
                    }
                    /*短期预测发电量结束*/
                    /*计划发电量开始*/
                    PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        double generatingcapacity = 0;
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(beginOfDay), (long) DateUtil.month(endOfDay) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                Map<String, Object> params1 = new HashMap<>();
                                params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 1)));
                                params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 14)));
                                NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                obj.setWindplantNo(Convert.toLong(stationNumber));
                                obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                obj.setParams(params1);
                                obj.setCondition(1);
                                List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                long betweenDay = DateUtil.between(DateUtil.beginOfMonth(DateUtil.date()), DateUtil.endOfMonth(DateUtil.date()), DateUnit.DAY) + 1;
                                double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(Convert.toLong(stationNumber), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.date()), 1));
                                double value = 0;
                                if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                    if (noscaleWfDaPfPeriodData.getValue() != null) {
                                        value = noscaleWfDaPfPeriodData.getValue();
                                    }
                                }
                                if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                    double valueCount1 = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                    double b = value / valueCount1;
                                    generatingcapacity = a * b;
                                }
                            } else if (planpowerDistribution.getType() == 2) {//2为平分
                                Date date1 = DateUtil.beginOfMonth(DateUtil.date());
                                Date date2 = DateUtil.endOfMonth(DateUtil.date());
                                long betweenDay = DateUtil.between(date1, date2, DateUnit.DAY) + 1;
                                generatingcapacity = generatingcapacityCount / betweenDay;
                            }
                            for (Date date : dateList) {
                                String dataTime = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map, generatingcapacity, dataTime, 3, 4);
                            }
                        }
                    }
                    /*计划发电量结束*/
                }
            } else if (itemVal == 4) {//光伏场站
                //暂无 后补
            }
        }
        List<DataFormat> dataFormatList = new ArrayList<>();
        String[] nameStr = {"实际发电量", "超短期预测", "短期预测", "计划发电量"};
        int count1 = dateList.size();
        int count2 = dateList15.size();
        if ("-1".equals(stationNumber)) {//全域数据
            //实际发电
            LinkedMultiValueMap<String, Double> map15 = new LinkedMultiValueMap<String, Double>();
            //超短期发电
            LinkedMultiValueMap<String, Double> mapCdq15 = new LinkedMultiValueMap<String, Double>();
            //短期发电
            LinkedMultiValueMap<String, Double> mapDq15 = new LinkedMultiValueMap<String, Double>();
            //计划发电
            LinkedMultiValueMap<String, Double> mapJh15 = new LinkedMultiValueMap<String, Double>();
            for (int k = 0; k < count2; k++) {
                if ("15".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entrySj1 = map.get(dk1);
                    List<Double> entrySj2 = map.get(dk2);
                    if (entrySj1 != null && entrySj2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entrySj1.size() > i && entrySj1.get(i) != null) {
                                ycRawVal10 = entrySj1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entrySj2.size() > i && entrySj2.get(i) != null) {
                                ycRawVal20 = entrySj2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdq1 = mapCdq.get(dk1);
                    List<Double> entryCdq2 = mapCdq.get(dk2);
                    if (entryCdq1 != null && entryCdq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entryCdq1.size() > i && entryCdq1.get(i) != null) {
                                ycRawVal10 = entryCdq1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entryCdq2.size() > i && entryCdq2.get(i) != null) {
                                ycRawVal20 = entryCdq2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDq1 = mapDq.get(dk1);
                    List<Double> entryDq2 = mapDq.get(dk2);
                    if (entryDq1 != null && entryDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entryDq1.size() > i && entryDq1.get(i) != null) {
                                ycRawVal10 = entryDq1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entryDq2.size() > i && entryDq2.get(i) != null) {
                                ycRawVal20 = entryDq2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryJh1 = mapJh.get(dk1);
                    List<Double> entryJh2 = mapJh.get(dk2);
                    if (entryJh1 != null && entryJh2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entryJh1.size() > i && entryJh1.get(i) != null) {
                                ycRawVal10 = entryJh1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entryJh2.size() > i && entryJh2.get(i) != null) {
                                ycRawVal20 = entryJh2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapJh15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                } else if ("30".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entrySj1 = map.get(dk1);
                    List<Double> entrySj2 = map.get(dk2);
                    if (entrySj1 != null && entrySj2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entrySj1.size() > i && entrySj1.get(i) != null) {
                                ycRawVal20 = entrySj1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entrySj2.size() > i && entrySj2.get(i) != null) {
                                ycRawVal30 = entrySj2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdq1 = mapCdq.get(dk1);
                    List<Double> entryCdq2 = mapCdq.get(dk2);
                    if (entryCdq1 != null && entryCdq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entryCdq1.size() > i && entryCdq1.get(i) != null) {
                                ycRawVal20 = entryCdq1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entryCdq2.size() > i && entryCdq2.get(i) != null) {
                                ycRawVal30 = entryCdq2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDq1 = mapDq.get(dk1);
                    List<Double> entryDq2 = mapDq.get(dk2);
                    if (entryDq1 != null && entryDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entryDq1.size() > i && entryDq1.get(i) != null) {
                                ycRawVal20 = entryDq1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entryDq2.size() > i && entryDq2.get(i) != null) {
                                ycRawVal30 = entryDq2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryJh1 = mapJh.get(dk1);
                    List<Double> entryJh2 = mapJh.get(dk2);
                    if (entryJh1 != null && entryJh2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entryJh1.size() > i && entryJh1.get(i) != null) {
                                ycRawVal20 = entryJh1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entryJh2.size() > i && entryJh2.get(i) != null) {
                                ycRawVal30 = entryJh2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapJh15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                } else if ("45".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entrySj1 = map.get(dk1);
                    List<Double> entrySj2 = map.get(dk2);
                    if (entrySj1 != null && entrySj2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entrySj1.size() > i && entrySj1.get(i) != null) {
                                ycRawVal40 = entrySj1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entrySj2.size() > i && entrySj2.get(i) != null) {
                                ycRawVal50 = entrySj2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdq1 = mapCdq.get(dk1);
                    List<Double> entryCdq2 = mapCdq.get(dk2);
                    if (entryCdq1 != null && entryCdq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entryCdq1.size() > i && entryCdq1.get(i) != null) {
                                ycRawVal40 = entryCdq1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entryCdq2.size() > i && entryCdq2.get(i) != null) {
                                ycRawVal50 = entryCdq2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDq1 = mapDq.get(dk1);
                    List<Double> entryDq2 = mapDq.get(dk2);
                    if (entryDq1 != null && entryDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entryDq1.size() > i && entryDq1.get(i) != null) {
                                ycRawVal40 = entryDq1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entryDq2.size() > i && entryDq2.get(i) != null) {
                                ycRawVal50 = entryDq2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryJh1 = mapJh.get(dk1);
                    List<Double> entryJh2 = mapJh.get(dk2);
                    if (entryJh1 != null && entryJh2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entryJh1.size() > i && entryJh1.get(i) != null) {
                                ycRawVal40 = entryJh1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entryJh2.size() > i && entryJh2.get(i) != null) {
                                ycRawVal50 = entryJh2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapJh15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                } else if ("00".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entrySj1 = map.get(dk1);
                    List<Double> entrySj2 = map.get(dk2);
                    if (entrySj1 != null && entrySj2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entrySj1.size() > i && entrySj1.get(i) != null) {
                                ycRawVal50 = entrySj1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entrySj2.size() > i && entrySj2.get(i) != null) {
                                ycRawVal00 = entrySj2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdq1 = mapCdq.get(dk1);
                    List<Double> entryCdq2 = mapCdq.get(dk2);
                    if (entryCdq1 != null && entryCdq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entryCdq1.size() > i && entryCdq1.get(i) != null) {
                                ycRawVal50 = entryCdq1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entryCdq2.size() > i && entryCdq2.get(i) != null) {
                                ycRawVal00 = entryCdq2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDq1 = mapDq.get(dk1);
                    List<Double> entryDq2 = mapDq.get(dk2);
                    if (entryDq1 != null && entryDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entryDq1.size() > i && entryDq1.get(i) != null) {
                                ycRawVal50 = entryDq1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entryDq2.size() > i && entryDq2.get(i) != null) {
                                ycRawVal00 = entryDq2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryJh1 = mapJh.get(dk1);
                    List<Double> entryJh2 = mapJh.get(dk2);
                    if (entryJh1 != null && entryJh2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entryJh1.size() > i && entryJh1.get(i) != null) {
                                ycRawVal50 = entryJh1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entryJh2.size() > i && entryJh2.get(i) != null) {
                                ycRawVal00 = entryJh2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapJh15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                }
            }
            Double[] dataSj = new Double[count1];
            Double[] dataCdq = new Double[count1];
            Double[] dataDq = new Double[count1];
            Double[] dataJh = new Double[count1];
            for (int k = 0; k < count2; k++) {
                String dk1 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                List<Double> entrySj = map15.get(dk1);
                if (entrySj != null) {
                    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;
                }
                List<Double> entryCdq = mapCdq15.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> entryDq = mapDq15.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> entryJh = mapJh15.get(dk1);
                if (entryJh != null) {
                    double num = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJh.size() > i && entryJh.get(i) != null) {
                            num += entryJh.get(i);
                        }
                    }
                    dataJh[k] = num;
                }
            }
            DataFormat dataFormatSj = new DataFormat();
            dataFormatSj.setName(nameStr[0]);
            dataFormatSj.setData(dataSj);
            dataFormatList.add(dataFormatSj);
            DataFormat dataFormatCdq = new DataFormat();
            dataFormatCdq.setName(nameStr[1]);
            dataFormatCdq.setData(dataCdq);
            dataFormatList.add(dataFormatCdq);
            DataFormat dataFormatDq = new DataFormat();
            dataFormatDq.setName(nameStr[2]);
            dataFormatDq.setData(dataDq);
            dataFormatList.add(dataFormatDq);
            DataFormat dataFormatJh = new DataFormat();
            dataFormatJh.setName(nameStr[3]);
            dataFormatJh.setData(dataJh);
            dataFormatList.add(dataFormatJh);
        } else {//各个场站数据
            LinkedMultiValueMap<String, Double> map15 = new LinkedMultiValueMap<String, Double>();
            for (int k = 0; k < count2; k++) {
                if ("15".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entry1 = map.get(dk1);
                    List<Double> entry2 = map.get(dk2);
                    if (entry1 != null && entry2 != null) {
                        for (int i = 0; i < 4; i++) {
                            double ycRawVal10 = 0;
                            if (entry1.size() > i && entry1.get(i) != null) {
                                ycRawVal10 = entry1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entry2.size() > i && entry2.get(i) != null) {
                                ycRawVal20 = entry2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map15, ycRawVal, dataTime, i, i + 1);
                        }
                    }
                } else if ("30".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entry1 = map.get(dk1);
                    List<Double> entry2 = map.get(dk2);
                    if (entry1 != null && entry2 != null) {
                        for (int i = 0; i < 4; i++) {
                            double ycRawVal20 = 0;
                            if (entry1.size() > i && entry1.get(i) != null) {
                                ycRawVal20 = entry1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entry2.size() > i && entry2.get(i) != null) {
                                ycRawVal30 = entry2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map15, ycRawVal, dataTime, i, i + 1);
                        }
                    }
                } else if ("45".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entry1 = map.get(dk1);
                    List<Double> entry2 = map.get(dk2);
                    if (entry1 != null && entry2 != null) {
                        for (int i = 0; i < 4; i++) {
                            double ycRawVal40 = 0;
                            if (entry1.size() > i && entry1.get(i) != null) {
                                ycRawVal40 = entry1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entry2.size() > i && entry2.get(i) != null) {
                                ycRawVal50 = entry2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map15, ycRawVal, dataTime, i, i + 1);
                        }
                    }
                } else if ("00".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entry1 = map.get(dk1);
                    List<Double> entry2 = map.get(dk2);
                    if (entry1 != null && entry2 != null) {
                        for (int i = 0; i < 4; i++) {
                            double ycRawVal50 = 0;
                            if (entry1.size() > i && entry1.get(i) != null) {
                                ycRawVal50 = entry1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entry2.size() > i && entry2.get(i) != null) {
                                ycRawVal00 = entry2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map15, ycRawVal, dataTime, i, i + 1);
                        }
                    }
                }
            }
            for (int i = 0; i < 4; i++) {
                Double[] data = new Double[count2];
                for (int k = 0; k < count2; k++) {
                    List<Double> entry = map15.get(DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm"));
                    if (entry != null) {
                        if (entry.size() > i && entry.get(i) != null) {
                            data[k] = entry.get(i);
                        }
                    }
                }
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName(nameStr[i]);
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList15);
        return AjaxResult.success(json);
    }

    @ApiOperation("月单日发电量预测")
    @GetMapping("/monthlyDailyPowerGenerationForecast")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
    })
    public AjaxResult monthlyDailyPowerGenerationForecast(@RequestParam(value = "stationNumber") String stationNumber,
                                                          @RequestParam(value = "itemVal") int itemVal) {
        JSONObject json = new JSONObject();
        //当月开始时间
        Date beginOfMonth = DateUtil.beginOfMonth(DateUtil.date());
        //当月结束时间
        Date endOfMonth = DateUtil.endOfMonth(DateUtil.date());
        //获取所有时间
        List<Date> dateList = DateTimeUtil.getDayBetween(DateUtil.parse(DateUtil.formatDateTime(beginOfMonth)), DateUtil.parse(DateUtil.formatDateTime(endOfMonth)));
        //场站总数
        int modelCount = 0;
        //实际发电
        LinkedMultiValueMap<String, Double> map = new LinkedMultiValueMap<String, Double>();
        //超短期发电
        LinkedMultiValueMap<String, Double> mapCdq = new LinkedMultiValueMap<String, Double>();
        //短期发电
        LinkedMultiValueMap<String, Double> mapDq = new LinkedMultiValueMap<String, Double>();
        //计划发电
        LinkedMultiValueMap<String, Double> mapJh = new LinkedMultiValueMap<String, Double>();
        Map<String, Object> params = new HashMap<>();
        params.put("beginDataTime", DateUtil.formatDateTime(beginOfMonth));
        params.put("endDataTime", DateUtil.formatDateTime(DateUtil.date(endOfMonth.getTime() + 1000)));
        if ("-1".equals(stationNumber)) {//全域数据
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById(Convert.toLong(stationNumber));
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dateList) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                    ShareController.addMapValue(map, lastYcRawVal, DateUtil.formatDate(date), modelCount, windplantList.size());
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                        ShareController.addMapValue(map, lastYcRawVal, DateUtil.formatDate(date), modelCount, windplantList.size());
                                    }
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale((long) 0);
                    wfUspTsEfPeriodData.setParams(params);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    if (wfUspTsEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsEfPeriodData> list = wfUspTsEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsEfPeriodData lastData = wfUspTsEfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModEnergy = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModEnergy = lastData.getModEnergy();
                                }
                                double modEnergyCount = list.stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum() - list.get(0).getModEnergy() + lastModEnergy;
                                ShareController.addMapValue(mapCdq, modEnergyCount, dataTime, modelCount, windplantList.size());
                            }
                        }
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDq, valueCount, dataTime, modelCount, windplantList.size());
                            }
                        }
                    }
                    /*短期预测发电量结束*/
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(beginOfMonth), (long) DateUtil.month(endOfMonth) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                for (Date date : dateList) {
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(date), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(date), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(windplant.getWindplantNo());
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(date), DateUtil.endOfMonth(date), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(date), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(mapJh, generatingcapacity, DateUtil.formatDate(date), modelCount, windplantList.size());
                                    }
                                }
                            } else if (planpowerDistribution.getType() == 2) {//2为平分
                                long betweenDay = DateUtil.between(beginOfMonth, endOfMonth, DateUnit.DAY) + 1;
                                double generatingcapacity = generatingcapacityCount / betweenDay;
                                for (Date date : dateList) {
                                    ShareController.addMapValue(mapJh, generatingcapacity, DateUtil.formatDate(date), modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                    modelCount++;
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dateList) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                    }
                                }
                                ShareController.addMapValue(map, lastYcRawVal, DateUtil.formatDate(date), 0, 1);
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale((long) 0);
                    wfUspTsEfPeriodData.setParams(params);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    if (wfUspTsEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsEfPeriodData> list = wfUspTsEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsEfPeriodData lastData = wfUspTsEfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModEnergy = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModEnergy = lastData.getModEnergy();
                                }
                                double modEnergyCount = list.stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum() - list.get(0).getModEnergy() + lastModEnergy;
                                ShareController.addMapValue(map, modEnergyCount, dataTime, 1, 2);
                            }
                        }
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(map, valueCount, dataTime, 2, 3);
                            }
                        }
                    }
                    /*短期预测发电量结束*/
                    /*计划发电量开始*/
                    PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(beginOfMonth), (long) DateUtil.month(endOfMonth) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                for (Date date : dateList) {
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(date), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(date), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(Convert.toLong(stationNumber));
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(date), DateUtil.endOfMonth(date), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(Convert.toLong(stationNumber), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(date), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(map, generatingcapacity, DateUtil.formatDate(date), 3, 4);
                                    }
                                }
                            } else if (planpowerDistribution.getType() == 2) {//2为平分
                                long betweenDay = DateUtil.between(beginOfMonth, endOfMonth, DateUnit.DAY) + 1;
                                double generatingcapacity = generatingcapacityCount / betweenDay;
                                for (Date date : dateList) {
                                    ShareController.addMapValue(map, generatingcapacity, DateUtil.formatDate(date), 3, 4);
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                }
            } else if (itemVal == 4) {//光伏场站
                //暂无 后补
            }
        }
        List<DataFormat> dataFormatList = new ArrayList<>();
        String[] nameStr = {"实际发电量", "超短期预测", "短期预测", "计划发电量"};
        int count1 = dateList.size();
        if ("-1".equals(stationNumber)) {//全域数据
            Double[] dataSj = new Double[count1];
            Double[] dataCdq = new Double[count1];
            Double[] dataDq = new Double[count1];
            Double[] dataJh = new Double[count1];
            for (int k = 0; k < count1; k++) {
                String dk1 = DateUtil.formatDate(dateList.get(k));
                List<Double> entrySj = map.get(dk1);
                if (entrySj != null) {
                    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;
                }
                List<Double> entryCdq = mapCdq.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> entryDq = mapDq.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> entryJh = mapJh.get(dk1);
                if (entryJh != null) {
                    double num = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJh.size() > i && entryJh.get(i) != null) {
                            num += entryJh.get(i);
                        }
                    }
                    dataJh[k] = num;
                }
            }
            DataFormat dataFormatSj = new DataFormat();
            dataFormatSj.setName(nameStr[0]);
            dataFormatSj.setData(dataSj);
            dataFormatList.add(dataFormatSj);
            DataFormat dataFormatCdq = new DataFormat();
            dataFormatCdq.setName(nameStr[1]);
            dataFormatCdq.setData(dataCdq);
            dataFormatList.add(dataFormatCdq);
            DataFormat dataFormatDq = new DataFormat();
            dataFormatDq.setName(nameStr[2]);
            dataFormatDq.setData(dataDq);
            dataFormatList.add(dataFormatDq);
            DataFormat dataFormatJh = new DataFormat();
            dataFormatJh.setName(nameStr[3]);
            dataFormatJh.setData(dataJh);
            dataFormatList.add(dataFormatJh);
        } else {//各个场站数据
            for (int i = 0; i < 4; i++) {
                Double[] data = new Double[count1];
                for (int k = 0; k < count1; k++) {
                    List<Double> entry = map.get(DateUtil.formatDate(dateList.get(k)));
                    if (entry != null) {
                        if (entry.size() > i && entry.get(i) != null) {
                            data[k] = entry.get(i);
                        }
                    }
                }
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName(nameStr[i]);
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("年月度发电量预测")
    @GetMapping("/annualMonthlyElectricityGenerationForecast")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
    })
    public AjaxResult annualMonthlyElectricityGenerationForecast(@RequestParam(value = "stationNumber") String stationNumber,
                                                                 @RequestParam(value = "itemVal") int itemVal) {
        JSONObject json = new JSONObject();
        //当年开始时间
        Date beginOfYear = DateUtil.beginOfYear(DateUtil.date());
        //当年结束时间
        Date endOfYear = DateUtil.endOfYear(DateUtil.date());
        //获取所有时间
        List<Date> dateList = DateTimeUtil.getMonthBetween(beginOfYear, endOfYear);
        //场站总数
        int modelCount = 0;
        //实际发电
        LinkedMultiValueMap<String, Double> mapSj = new LinkedMultiValueMap<String, Double>();
        //中长期发电
        LinkedMultiValueMap<String, Double> mapZcq = new LinkedMultiValueMap<String, Double>();
        //计划发电
        LinkedMultiValueMap<String, Double> mapJh = new LinkedMultiValueMap<String, Double>();
        if ("-1".equals(stationNumber)) {//全域数据
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dateList) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSj, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSj, ycRawValCount, dataTime, modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dateList.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dateList.get(dateList.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(windplant.getWindplantNo());
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcq, l.getPfGeneratingCapacity(), dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*中长期预测发电量结束*/
                    /*计划发电量开始*/
                    for (Date date : dateList) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJh, generatingcapacityCount, dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*计划发电量结束*/
                    modelCount++;
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dateList) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSj, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSj, ycRawValCount, dataTime, 0, 1);
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dateList.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dateList.get(dateList.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(Convert.toLong(stationNumber));
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcq, l.getPfGeneratingCapacity(), dataTime, 0, 1);
                        }
                    }
                    /*中长期预测发电量结束*/
                    /*计划发电量开始*/
                    for (Date date : dateList) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJh, generatingcapacityCount, dataTime, 0, 1);
                        }
                    }
                    /*计划发电量结束*/
                }
            } else if (itemVal == 4) {//光伏场站
                //暂无 后补
            }
        }
        List<DataFormat> dataFormatList = new ArrayList<>();
        String[] nameStr = {"实际发电量", "中长期预测", "计划发电量"};
        int count1 = dateList.size();
        if ("-1".equals(stationNumber)) {//全域数据
            Double[] dataSj = new Double[count1];
            Double[] dataZcq = new Double[count1];
            Double[] dataJh = new Double[count1];
            for (int k = 0; k < count1; k++) {
                String dk1 = DateUtil.format(dateList.get(k), "yyyy-MM");
                List<Double> entrySj = mapSj.get(dk1);
                if (entrySj != null) {
                    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;
                }
                List<Double> entryZcq = mapZcq.get(dk1);
                if (entryZcq != null) {
                    double num = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryZcq.size() > i && entryZcq.get(i) != null) {
                            num += entryZcq.get(i);
                        }
                    }
                    dataZcq[k] = num;
                }
                List<Double> entryJh = mapJh.get(dk1);
                if (entryJh != null) {
                    double num = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJh.size() > i && entryJh.get(i) != null) {
                            num += entryJh.get(i);
                        }
                    }
                    dataJh[k] = num;
                }
            }
            DataFormat dataFormatSj = new DataFormat();
            dataFormatSj.setName(nameStr[0]);
            dataFormatSj.setData(dataSj);
            dataFormatList.add(dataFormatSj);
            DataFormat dataFormatZcq = new DataFormat();
            dataFormatZcq.setName(nameStr[1]);
            dataFormatZcq.setData(dataZcq);
            dataFormatList.add(dataFormatZcq);
            DataFormat dataFormatJh = new DataFormat();
            dataFormatJh.setName(nameStr[2]);
            dataFormatJh.setData(dataJh);
            dataFormatList.add(dataFormatJh);
        } else {//各个场站数据
            Double[] dataSj = new Double[count1];
            Double[] dataZcq = new Double[count1];
            Double[] dataJh = new Double[count1];
            for (int k = 0; k < count1; k++) {
                String dk1 = DateUtil.format(dateList.get(k), "yyyy-MM");
                List<Double> entrySj = mapSj.get(dk1);
                if (entrySj != null) {
                    if (entrySj.size() > 0) {
                        dataSj[k] = entrySj.get(0);
                    }
                }
                List<Double> entryZcq = mapZcq.get(dk1);
                if (entryZcq != null) {
                    if (entryZcq.size() > 0) {
                        dataZcq[k] = entryZcq.get(0);
                    }
                }
                List<Double> entryJh = mapJh.get(dk1);
                if (entryJh != null) {
                    if (entryJh.size() > 0) {
                        dataJh[k] = entryJh.get(0);
                    }
                }
            }
            DataFormat dataFormatSj = new DataFormat();
            dataFormatSj.setName(nameStr[0]);
            dataFormatSj.setData(dataSj);
            dataFormatList.add(dataFormatSj);
            DataFormat dataFormatZcq = new DataFormat();
            dataFormatZcq.setName(nameStr[1]);
            dataFormatZcq.setData(dataZcq);
            dataFormatList.add(dataFormatZcq);
            DataFormat dataFormatJh = new DataFormat();
            dataFormatJh.setName(nameStr[2]);
            dataFormatJh.setData(dataJh);
            dataFormatList.add(dataFormatJh);
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Chart-日发电量预测对比")
    @GetMapping("/dailyPowerGenerationForecastComparisonChartData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
            @ApiImplicitParam(name = "leadTime", value = "超前时间(默认传7)", required = true),
            @ApiImplicitParam(name = "jg", value = "间隔(1-15分钟 2-1小时)", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
            @ApiImplicitParam(name = "beginDataTime15", value = "开始时间15", required = true),
            @ApiImplicitParam(name = "endDataTime15", value = "结束时间15", required = true),
    })
    public AjaxResult dailyPowerGenerationForecastComparisonChartData(@RequestParam(value = "stationNumber") String stationNumber,
                                                                      @RequestParam(value = "itemVal") int itemVal,
                                                                      @RequestParam(value = "leadTime") String leadTime,
                                                                      @RequestParam(value = "jg") int jg,
                                                                      @RequestParam(value = "beginDataTime") String beginDataTime,
                                                                      @RequestParam(value = "endDataTime") String endDataTime,
                                                                      @RequestParam(value = "beginDataTime15") String beginDataTime15,
                                                                      @RequestParam(value = "endDataTime15") String endDataTime15) {
        JSONObject json = new JSONObject();
        //获取所有时间
        List<Date> dateList = DateTimeUtil.getDateList10(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime));
        List<Date> dateList15 = DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime15), DateUtil.parse(endDataTime15));
        //场站总数
        int modelCount = 0;
        //实际发电
        LinkedMultiValueMap<String, Double> map = new LinkedMultiValueMap<String, Double>();
        //超短期发电
        LinkedMultiValueMap<String, Double> mapCdq = new LinkedMultiValueMap<String, Double>();
        //短期发电
        LinkedMultiValueMap<String, Double> mapDq = new LinkedMultiValueMap<String, Double>();
        //计划发电
        LinkedMultiValueMap<String, Double> mapJh = new LinkedMultiValueMap<String, Double>();
        Map<String, Object> params = new HashMap<>();
        params.put("beginDataTime", beginDataTime);
        params.put("endDataTime", endDataTime);
        if ("-1".equals(stationNumber)) {//全域数据
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById((long) -1);
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        for (WfYcHistoryData2 w : wfYcHistoryData2List) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map, w.getYcRawVal(), dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale(Convert.toLong(leadTime));
                    wfUspTsEfPeriodData.setParams(params);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    double modEnergyCount = 0;
                    for (WfUspTsEfPeriodData w : wfUspTsEfPeriodDataList) {
                        String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            modEnergyCount = w.getModEnergy();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(w.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            WfUspTsEfPeriodData beforeData = new WfUspTsEfPeriodData();
                            beforeData.setWindplantNo(windplant.getWindplantNo());
                            beforeData.setModelNo(wfFileConfig.getUwpfemodelNo());
                            beforeData.setTimeScale(Convert.toLong(leadTime));
                            beforeData.setParams(paramsF);
                            modEnergyCount = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(beforeData).stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum();
                        } else {
                            modEnergyCount += w.getModEnergy();
                        }
                        ShareController.addMapValue(mapCdq, modEnergyCount, dataTime, modelCount, windplantList.size());
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    double valueCount = 0;
                    for (NoscaleWfDaEfPeriodData n : noscaleWfDaEfPeriodDataList) {
                        String dataTime = DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            valueCount = n.getValue();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(n.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            NoscaleWfDaEfPeriodData beforeData = new NoscaleWfDaEfPeriodData();
                            beforeData.setWindplantNo(windplant.getWindplantNo());
                            beforeData.setModelNo(wfFileConfig.getWpfemodelNo());
                            beforeData.setParams(paramsF);
                            valueCount = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(beforeData).stream().mapToDouble(NoscaleWfDaEfPeriodData::getValue).sum();
                        } else {
                            valueCount += n.getValue();
                        }
                        ShareController.addMapValue(mapDq, valueCount, dataTime, modelCount, windplantList.size());
                    }
                    /*短期预测发电量结束*/
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        List<Date> dates = DateTimeUtil.getDayBetween(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime));
                        for (Date dl : dates) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(windplant.getWindplantNo());
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.parse(beginDataTime)), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount1 = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount1;
                                        double generatingcapacity = a * b;
                                        List<Date> d1 = DateTimeUtil.getDateList10(DateUtil.beginOfDay(dl), DateUtil.date(DateUtil.endOfDay(dl).getTime() + 1000));
                                        for (Date date : d1) {
                                            String dataTime = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                                            ShareController.addMapValue(mapJh, generatingcapacity, dataTime, modelCount, windplantList.size());
                                        }
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    List<Date> d1 = DateTimeUtil.getDateList10(DateUtil.beginOfDay(dl), DateUtil.date(DateUtil.endOfDay(dl).getTime() + 1000));
                                    for (Date date : d1) {
                                        String dataTime = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                                        ShareController.addMapValue(mapJh, generatingcapacity, dataTime, modelCount, windplantList.size());
                                    }
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                    modelCount++;
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        for (WfYcHistoryData2 w : wfYcHistoryData2List) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(map, w.getYcRawVal(), dataTime, 0, 1);
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale(Convert.toLong(leadTime));
                    wfUspTsEfPeriodData.setParams(params);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    double modEnergyCount = 0;
                    for (WfUspTsEfPeriodData w : wfUspTsEfPeriodDataList) {
                        String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            modEnergyCount = w.getModEnergy();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(w.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            WfUspTsEfPeriodData beforeData = new WfUspTsEfPeriodData();
                            beforeData.setWindplantNo(Convert.toLong(stationNumber));
                            beforeData.setModelNo(wfFileConfig.getUwpfemodelNo());
                            beforeData.setTimeScale(Convert.toLong(leadTime));
                            beforeData.setParams(paramsF);
                            modEnergyCount = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(beforeData).stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum();
                        } else {
                            modEnergyCount += w.getModEnergy();
                        }
                        ShareController.addMapValue(map, modEnergyCount, dataTime, 1, 2);
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    double valueCount = 0;
                    for (NoscaleWfDaEfPeriodData n : noscaleWfDaEfPeriodDataList) {
                        String dataTime = DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            valueCount = n.getValue();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(n.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            NoscaleWfDaEfPeriodData beforeData = new NoscaleWfDaEfPeriodData();
                            beforeData.setWindplantNo(Convert.toLong(stationNumber));
                            beforeData.setModelNo(wfFileConfig.getWpfemodelNo());
                            beforeData.setParams(paramsF);
                            valueCount = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(beforeData).stream().mapToDouble(NoscaleWfDaEfPeriodData::getValue).sum();
                        } else {
                            valueCount += n.getValue();
                        }
                        ShareController.addMapValue(map, valueCount, dataTime, 2, 3);
                    }
                    /*短期预测发电量结束*/
                    /*计划发电量开始*/
                    PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        List<Date> dates = DateTimeUtil.getDayBetween(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime));
                        for (Date dl : dates) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(Convert.toLong(stationNumber));
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(Convert.toLong(stationNumber), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount1 = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount1;
                                        double generatingcapacity = a * b;
                                        List<Date> d1 = DateTimeUtil.getDateList10(DateUtil.beginOfDay(dl), DateUtil.date(DateUtil.endOfDay(dl).getTime() + 1000));
                                        for (Date date : d1) {
                                            String dataTime = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                                            ShareController.addMapValue(map, generatingcapacity, dataTime, 3, 4);
                                        }
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    List<Date> d1 = DateTimeUtil.getDateList10(DateUtil.beginOfDay(dl), DateUtil.date(DateUtil.endOfDay(dl).getTime() + 1000));
                                    for (Date date : d1) {
                                        String dataTime = DateUtil.format(date, "yyyy-MM-dd HH:mm");
                                        ShareController.addMapValue(map, generatingcapacity, dataTime, 3, 4);
                                    }
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                }
            } else if (itemVal == 4) {//光伏电站
                //暂无 后补
            }
        }
        List<DataFormat> dataFormatList = new ArrayList<>();
        String[] nameStr = {"实际发电量", "超短期预测", "短期预测", "计划发电量"};
        int count1 = dateList.size();
        int count2 = dateList15.size();
        if (jg == 1) {//15分钟数据
            if ("-1".equals(stationNumber)) {//全域数据
                //实际发电
                LinkedMultiValueMap<String, Double> map15 = new LinkedMultiValueMap<String, Double>();
                //超短期发电
                LinkedMultiValueMap<String, Double> mapCdq15 = new LinkedMultiValueMap<String, Double>();
                //短期发电
                LinkedMultiValueMap<String, Double> mapDq15 = new LinkedMultiValueMap<String, Double>();
                //计划发电
                LinkedMultiValueMap<String, Double> mapJh15 = new LinkedMultiValueMap<String, Double>();
                for (int k = 0; k < count2; k++) {
                    if ("15".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                        String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                        String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                        List<Double> entrySj1 = map.get(dk1);
                        List<Double> entrySj2 = map.get(dk2);
                        if (entrySj1 != null && entrySj2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal10 = 0;
                                if (entrySj1.size() > i && entrySj1.get(i) != null) {
                                    ycRawVal10 = entrySj1.get(i);
                                }
                                double ycRawVal20 = 0;
                                if (entrySj2.size() > i && entrySj2.get(i) != null) {
                                    ycRawVal20 = entrySj2.get(i);
                                }
                                double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryCdq1 = mapCdq.get(dk1);
                        List<Double> entryCdq2 = mapCdq.get(dk2);
                        if (entryCdq1 != null && entryCdq2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal10 = 0;
                                if (entryCdq1.size() > i && entryCdq1.get(i) != null) {
                                    ycRawVal10 = entryCdq1.get(i);
                                }
                                double ycRawVal20 = 0;
                                if (entryCdq2.size() > i && entryCdq2.get(i) != null) {
                                    ycRawVal20 = entryCdq2.get(i);
                                }
                                double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapCdq15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryDq1 = mapDq.get(dk1);
                        List<Double> entryDq2 = mapDq.get(dk2);
                        if (entryDq1 != null && entryDq2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal10 = 0;
                                if (entryDq1.size() > i && entryDq1.get(i) != null) {
                                    ycRawVal10 = entryDq1.get(i);
                                }
                                double ycRawVal20 = 0;
                                if (entryDq2.size() > i && entryDq2.get(i) != null) {
                                    ycRawVal20 = entryDq2.get(i);
                                }
                                double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapDq15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryJh1 = mapJh.get(dk1);
                        List<Double> entryJh2 = mapJh.get(dk2);
                        if (entryJh1 != null && entryJh2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal10 = 0;
                                if (entryJh1.size() > i && entryJh1.get(i) != null) {
                                    ycRawVal10 = entryJh1.get(i);
                                }
                                double ycRawVal20 = 0;
                                if (entryJh2.size() > i && entryJh2.get(i) != null) {
                                    ycRawVal20 = entryJh2.get(i);
                                }
                                double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapJh15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                    } else if ("30".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                        String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                        String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        List<Double> entrySj1 = map.get(dk1);
                        List<Double> entrySj2 = map.get(dk2);
                        if (entrySj1 != null && entrySj2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal20 = 0;
                                if (entrySj1.size() > i && entrySj1.get(i) != null) {
                                    ycRawVal20 = entrySj1.get(i);
                                }
                                double ycRawVal30 = 0;
                                if (entrySj2.size() > i && entrySj2.get(i) != null) {
                                    ycRawVal30 = entrySj2.get(i);
                                }
                                double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryCdq1 = mapCdq.get(dk1);
                        List<Double> entryCdq2 = mapCdq.get(dk2);
                        if (entryCdq1 != null && entryCdq2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal20 = 0;
                                if (entryCdq1.size() > i && entryCdq1.get(i) != null) {
                                    ycRawVal20 = entryCdq1.get(i);
                                }
                                double ycRawVal30 = 0;
                                if (entryCdq2.size() > i && entryCdq2.get(i) != null) {
                                    ycRawVal30 = entryCdq2.get(i);
                                }
                                double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapCdq15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryDq1 = mapDq.get(dk1);
                        List<Double> entryDq2 = mapDq.get(dk2);
                        if (entryDq1 != null && entryDq2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal20 = 0;
                                if (entryDq1.size() > i && entryDq1.get(i) != null) {
                                    ycRawVal20 = entryDq1.get(i);
                                }
                                double ycRawVal30 = 0;
                                if (entryDq2.size() > i && entryDq2.get(i) != null) {
                                    ycRawVal30 = entryDq2.get(i);
                                }
                                double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapDq15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryJh1 = mapJh.get(dk1);
                        List<Double> entryJh2 = mapJh.get(dk2);
                        if (entryJh1 != null && entryJh2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal20 = 0;
                                if (entryJh1.size() > i && entryJh1.get(i) != null) {
                                    ycRawVal20 = entryJh1.get(i);
                                }
                                double ycRawVal30 = 0;
                                if (entryJh2.size() > i && entryJh2.get(i) != null) {
                                    ycRawVal30 = entryJh2.get(i);
                                }
                                double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapJh15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                    } else if ("45".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                        String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                        String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                        List<Double> entrySj1 = map.get(dk1);
                        List<Double> entrySj2 = map.get(dk2);
                        if (entrySj1 != null && entrySj2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal40 = 0;
                                if (entrySj1.size() > i && entrySj1.get(i) != null) {
                                    ycRawVal40 = entrySj1.get(i);
                                }
                                double ycRawVal50 = 0;
                                if (entrySj2.size() > i && entrySj2.get(i) != null) {
                                    ycRawVal50 = entrySj2.get(i);
                                }
                                double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryCdq1 = mapCdq.get(dk1);
                        List<Double> entryCdq2 = mapCdq.get(dk2);
                        if (entryCdq1 != null && entryCdq2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal40 = 0;
                                if (entryCdq1.size() > i && entryCdq1.get(i) != null) {
                                    ycRawVal40 = entryCdq1.get(i);
                                }
                                double ycRawVal50 = 0;
                                if (entryCdq2.size() > i && entryCdq2.get(i) != null) {
                                    ycRawVal50 = entryCdq2.get(i);
                                }
                                double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapCdq15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryDq1 = mapDq.get(dk1);
                        List<Double> entryDq2 = mapDq.get(dk2);
                        if (entryDq1 != null && entryDq2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal40 = 0;
                                if (entryDq1.size() > i && entryDq1.get(i) != null) {
                                    ycRawVal40 = entryDq1.get(i);
                                }
                                double ycRawVal50 = 0;
                                if (entryDq2.size() > i && entryDq2.get(i) != null) {
                                    ycRawVal50 = entryDq2.get(i);
                                }
                                double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapDq15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryJh1 = mapJh.get(dk1);
                        List<Double> entryJh2 = mapJh.get(dk2);
                        if (entryJh1 != null && entryJh2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal40 = 0;
                                if (entryJh1.size() > i && entryJh1.get(i) != null) {
                                    ycRawVal40 = entryJh1.get(i);
                                }
                                double ycRawVal50 = 0;
                                if (entryJh2.size() > i && entryJh2.get(i) != null) {
                                    ycRawVal50 = entryJh2.get(i);
                                }
                                double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapJh15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                    } else if ("00".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                        String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                        String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        List<Double> entrySj1 = map.get(dk1);
                        List<Double> entrySj2 = map.get(dk2);
                        if (entrySj1 != null && entrySj2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal50 = 0;
                                if (entrySj1.size() > i && entrySj1.get(i) != null) {
                                    ycRawVal50 = entrySj1.get(i);
                                }
                                double ycRawVal00 = 0;
                                if (entrySj2.size() > i && entrySj2.get(i) != null) {
                                    ycRawVal00 = entrySj2.get(i);
                                }
                                double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryCdq1 = mapCdq.get(dk1);
                        List<Double> entryCdq2 = mapCdq.get(dk2);
                        if (entryCdq1 != null && entryCdq2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal50 = 0;
                                if (entryCdq1.size() > i && entryCdq1.get(i) != null) {
                                    ycRawVal50 = entryCdq1.get(i);
                                }
                                double ycRawVal00 = 0;
                                if (entryCdq2.size() > i && entryCdq2.get(i) != null) {
                                    ycRawVal00 = entryCdq2.get(i);
                                }
                                double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapCdq15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryDq1 = mapDq.get(dk1);
                        List<Double> entryDq2 = mapDq.get(dk2);
                        if (entryDq1 != null && entryDq2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal50 = 0;
                                if (entryDq1.size() > i && entryDq1.get(i) != null) {
                                    ycRawVal50 = entryDq1.get(i);
                                }
                                double ycRawVal00 = 0;
                                if (entryDq2.size() > i && entryDq2.get(i) != null) {
                                    ycRawVal00 = entryDq2.get(i);
                                }
                                double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapDq15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                        List<Double> entryJh1 = mapJh.get(dk1);
                        List<Double> entryJh2 = mapJh.get(dk2);
                        if (entryJh1 != null && entryJh2 != null) {
                            for (int i = 0; i < modelCount; i++) {
                                double ycRawVal50 = 0;
                                if (entryJh1.size() > i && entryJh1.get(i) != null) {
                                    ycRawVal50 = entryJh1.get(i);
                                }
                                double ycRawVal00 = 0;
                                if (entryJh2.size() > i && entryJh2.get(i) != null) {
                                    ycRawVal00 = entryJh2.get(i);
                                }
                                double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(mapJh15, ycRawVal, dataTime, i, modelCount);
                            }
                        }
                    }
                }
                Double[] dataSj = new Double[count2];
                Double[] dataCdq = new Double[count2];
                Double[] dataDq = new Double[count2];
                Double[] dataJh = new Double[count2];
                for (int k = 0; k < count2; k++) {
                    String dk1 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entrySj = map15.get(dk1);
                    if (entrySj != null) {
                        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;
                    }
                    List<Double> entryCdq = mapCdq15.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> entryDq = mapDq15.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> entryJh = mapJh15.get(dk1);
                    if (entryJh != null) {
                        double num = 0;
                        for (int i = 0; i < modelCount; i++) {
                            if (entryJh.size() > i && entryJh.get(i) != null) {
                                num += entryJh.get(i);
                            }
                        }
                        dataJh[k] = num;
                    }
                }
                DataFormat dataFormatSj = new DataFormat();
                dataFormatSj.setName(nameStr[0]);
                dataFormatSj.setData(dataSj);
                dataFormatList.add(dataFormatSj);
                DataFormat dataFormatCdq = new DataFormat();
                dataFormatCdq.setName(nameStr[1]);
                dataFormatCdq.setData(dataCdq);
                dataFormatList.add(dataFormatCdq);
                DataFormat dataFormatDq = new DataFormat();
                dataFormatDq.setName(nameStr[2]);
                dataFormatDq.setData(dataDq);
                dataFormatList.add(dataFormatDq);
                DataFormat dataFormatJh = new DataFormat();
                dataFormatJh.setName(nameStr[3]);
                dataFormatJh.setData(dataJh);
                dataFormatList.add(dataFormatJh);
            } else {//各个场站数据
                LinkedMultiValueMap<String, Double> map15 = new LinkedMultiValueMap<String, Double>();
                for (int k = 0; k < count2; k++) {
                    if ("15".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                        String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                        String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                        List<Double> entry1 = map.get(dk1);
                        List<Double> entry2 = map.get(dk2);
                        if (entry1 != null && entry2 != null) {
                            for (int i = 0; i < 4; i++) {
                                double ycRawVal10 = 0;
                                if (entry1.size() > i && entry1.get(i) != null) {
                                    ycRawVal10 = entry1.get(i);
                                }
                                double ycRawVal20 = 0;
                                if (entry2.size() > i && entry2.get(i) != null) {
                                    ycRawVal20 = entry2.get(i);
                                }
                                double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map15, ycRawVal, dataTime, i, i + 1);
                            }
                        }
                    } else if ("30".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                        String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                        String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        List<Double> entry1 = map.get(dk1);
                        List<Double> entry2 = map.get(dk2);
                        if (entry1 != null && entry2 != null) {
                            for (int i = 0; i < 4; i++) {
                                double ycRawVal20 = 0;
                                if (entry1.size() > i && entry1.get(i) != null) {
                                    ycRawVal20 = entry1.get(i);
                                }
                                double ycRawVal30 = 0;
                                if (entry2.size() > i && entry2.get(i) != null) {
                                    ycRawVal30 = entry2.get(i);
                                }
                                double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map15, ycRawVal, dataTime, i, i + 1);
                            }
                        }
                    } else if ("45".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                        String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                        String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                        List<Double> entry1 = map.get(dk1);
                        List<Double> entry2 = map.get(dk2);
                        if (entry1 != null && entry2 != null) {
                            for (int i = 0; i < 4; i++) {
                                double ycRawVal40 = 0;
                                if (entry1.size() > i && entry1.get(i) != null) {
                                    ycRawVal40 = entry1.get(i);
                                }
                                double ycRawVal50 = 0;
                                if (entry2.size() > i && entry2.get(i) != null) {
                                    ycRawVal50 = entry2.get(i);
                                }
                                double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map15, ycRawVal, dataTime, i, i + 1);
                            }
                        }
                    } else if ("00".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                        String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                        String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        List<Double> entry1 = map.get(dk1);
                        List<Double> entry2 = map.get(dk2);
                        if (entry1 != null && entry2 != null) {
                            for (int i = 0; i < 4; i++) {
                                double ycRawVal50 = 0;
                                if (entry1.size() > i && entry1.get(i) != null) {
                                    ycRawVal50 = entry1.get(i);
                                }
                                double ycRawVal00 = 0;
                                if (entry2.size() > i && entry2.get(i) != null) {
                                    ycRawVal00 = entry2.get(i);
                                }
                                double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                                String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                                ShareController.addMapValue(map15, ycRawVal, dataTime, i, i + 1);
                            }
                        }
                    }
                }
                for (int i = 0; i < 4; i++) {
                    Double[] data = new Double[count2];
                    for (int k = 0; k < count2; k++) {
                        List<Double> entry = map15.get(DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm"));
                        if (entry != null) {
                            if (entry.size() > i && entry.get(i) != null) {
                                data[k] = entry.get(i);
                            }
                        }
                    }
                    DataFormat dataFormat = new DataFormat();
                    dataFormat.setName(nameStr[i]);
                    dataFormat.setData(data);
                    dataFormatList.add(dataFormat);
                }
            }
        } else if (jg == 2) {
            if ("-1".equals(stationNumber)) {//全域数据
                //实际发电
                LinkedMultiValueMap<String, Double> map1 = new LinkedMultiValueMap<String, Double>();
                //超短期发电
                LinkedMultiValueMap<String, Double> mapCdq1 = new LinkedMultiValueMap<String, Double>();
                //短期发电
                LinkedMultiValueMap<String, Double> mapDq1 = new LinkedMultiValueMap<String, Double>();
                //计划发电
                LinkedMultiValueMap<String, Double> mapJh1 = new LinkedMultiValueMap<String, Double>();
                List<Date> hourDateList = DateTimeUtil.getHourBetween(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime));
                for (Date dt : hourDateList){
                    Date bTime = DateUtil.offsetMinute(DateUtil.beginOfHour(dt), 10);
                    Date eTime = DateUtil.offsetSecond(DateUtil.endOfHour(dt), 1);
                    List<Date> minuteDateList = DateTimeUtil.getDateList10(bTime, eTime);
                    Double[] values = new Double[minuteDateList.size()];
                    for (Date dt1 : minuteDateList){
                        String dk1 = DateUtil.format(dt1, "yyyy-MM-dd HH:mm");
                        List<Double> entrySj = map.get(dk1);
                        System.out.println();
                    }
                }
                for (int k = 0; k < count2; k++) {

                }
            } else {//各个场站数据
                LinkedMultiValueMap<String, Double> map1 = new LinkedMultiValueMap<String, Double>();
                for (int k = 0; k < count2; k++) {

                }
            }
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList15);
        return AjaxResult.success(json);
    }

    @ApiOperation("Table-日发电量预测对比")
    @GetMapping("/dailyPowerGenerationForecastComparisonTableData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
            @ApiImplicitParam(name = "leadTime", value = "超前时间(默认传7)", required = true),
            @ApiImplicitParam(name = "jg", value = "间隔(1-15分钟 2-1小时)", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
            @ApiImplicitParam(name = "beginDataTime15", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime15", value = "结束时间", required = true),
    })
    public AjaxResult dailyPowerGenerationForecastComparisonTableData(@RequestParam(value = "stationNumber") String stationNumber,
                                                                      @RequestParam(value = "itemVal") int itemVal,
                                                                      @RequestParam(value = "leadTime") String leadTime,
                                                                      @RequestParam(value = "jg") int jg,
                                                                      @RequestParam(value = "beginDataTime") String beginDataTime,
                                                                      @RequestParam(value = "endDataTime") String endDataTime,
                                                                      @RequestParam(value = "beginDataTime15") String beginDataTime15,
                                                                      @RequestParam(value = "endDataTime15") String endDataTime15) {
        JSONObject json = new JSONObject();
        //获取所有时间
        //List<Date> dateList = DateTimeUtil.getDateList10(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime));
        List<Date> dateList15 = DateTimeUtil.getDateList15(DateUtil.parse(beginDataTime15), DateUtil.parse(endDataTime15));
        //场站总数
        int modelCount = 0;
        //理论电量
        LinkedMultiValueMap<String, Double> mapLlDl = new LinkedMultiValueMap<String, Double>();
        //可用电量
        LinkedMultiValueMap<String, Double> mapKyDl = new LinkedMultiValueMap<String, Double>();
        //实际发电-当期
        LinkedMultiValueMap<String, Double> mapSjDq = new LinkedMultiValueMap<String, Double>();
        //超短期发电-当期
        LinkedMultiValueMap<String, Double> mapCdqDq = new LinkedMultiValueMap<String, Double>();
        //短期发电-当期
        LinkedMultiValueMap<String, Double> mapDqDq = new LinkedMultiValueMap<String, Double>();
        //实际发电-同期
        LinkedMultiValueMap<String, Double> mapSjTq = new LinkedMultiValueMap<String, Double>();
        //超短期发电-同期
        LinkedMultiValueMap<String, Double> mapCdqTq = new LinkedMultiValueMap<String, Double>();
        //短期发电-同期
        LinkedMultiValueMap<String, Double> mapDqTq = new LinkedMultiValueMap<String, Double>();
        if ("-1".equals(stationNumber)) {//全域数据
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            for (Windplant windplant : windplantList) {
                /*当期数据开始*/
                Map<String, Object> paramsDq = new HashMap<>();
                paramsDq.put("beginDataTime", beginDataTime);
                paramsDq.put("endDataTime", endDataTime);
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*理论电量、可用电量开始*/
                    WfTheoryenergyData wfTheoryenergyData = new WfTheoryenergyData();
                    wfTheoryenergyData.setWindplantNo(windplant.getWindplantNo());
                    wfTheoryenergyData.setParams(paramsDq);
                    double theoryenergy = 0;
                    double availableenergy = 0;
                    List<WfTheoryenergyData> wfTheoryenergyDataList = wfTheoryenergyDataService.selectWfTheoryenergyDataList(wfTheoryenergyData);
                    if (wfTheoryenergyDataList.size() > 0) {
                        for (WfTheoryenergyData w : wfTheoryenergyDataList) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            if ("00:10".equals(dataTime.substring(11, 16))) {
                                theoryenergy = w.getTheoryenergy();
                                availableenergy = w.getAvailableenergy();
                            } else if (beginDataTime.equals(dataTime)) {
                                Map<String, Object> paramsF = new HashMap<>();
                                Date dTime;
                                if ("00:00".equals(dataTime.substring(11, 16))) {
                                    dTime = DateUtil.date(DateUtil.offsetDay(w.getDataTime(), -1).getTime() + 600000);
                                } else {
                                    dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                                }
                                paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                                paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                                WfTheoryenergyData beforeData = new WfTheoryenergyData();
                                beforeData.setWindplantNo(windplant.getWindplantNo());
                                beforeData.setParams(paramsF);
                                List<WfTheoryenergyData> list = wfTheoryenergyDataService.selectWfTheoryenergyDataList(beforeData);
                                theoryenergy = list.stream().mapToDouble(WfTheoryenergyData::getTheoryenergy).sum();
                                availableenergy = list.stream().mapToDouble(WfTheoryenergyData::getAvailableenergy).sum();
                            } else {
                                theoryenergy += w.getTheoryenergy();
                                availableenergy += w.getAvailableenergy();
                            }
                            ShareController.addMapValue(mapLlDl, theoryenergy, dataTime, modelCount, windplantList.size());
                            ShareController.addMapValue(mapKyDl, availableenergy, dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*理论电量、可用电量结束*/
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsDq);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        for (WfYcHistoryData2 w : wfYcHistoryData2List) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjDq, w.getYcRawVal(), dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale(Convert.toLong(leadTime));
                    wfUspTsEfPeriodData.setParams(paramsDq);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    double modEnergyCount = 0;
                    for (WfUspTsEfPeriodData w : wfUspTsEfPeriodDataList) {
                        String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            modEnergyCount = w.getModEnergy();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(w.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            WfUspTsEfPeriodData beforeData = new WfUspTsEfPeriodData();
                            beforeData.setWindplantNo(windplant.getWindplantNo());
                            beforeData.setModelNo(wfFileConfig.getUwpfemodelNo());
                            beforeData.setTimeScale(Convert.toLong(leadTime));
                            beforeData.setParams(paramsF);
                            modEnergyCount = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(beforeData).stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum();
                        } else {
                            modEnergyCount += w.getModEnergy();
                        }
                        ShareController.addMapValue(mapCdqDq, modEnergyCount, dataTime, modelCount, windplantList.size());
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsDq);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    double valueCount = 0;
                    for (NoscaleWfDaEfPeriodData n : noscaleWfDaEfPeriodDataList) {
                        String dataTime = DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            valueCount = n.getValue();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(n.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            NoscaleWfDaEfPeriodData beforeData = new NoscaleWfDaEfPeriodData();
                            beforeData.setWindplantNo(windplant.getWindplantNo());
                            beforeData.setModelNo(wfFileConfig.getWpfemodelNo());
                            beforeData.setParams(paramsF);
                            valueCount = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(beforeData).stream().mapToDouble(NoscaleWfDaEfPeriodData::getValue).sum();
                        } else {
                            valueCount += n.getValue();
                        }
                        ShareController.addMapValue(mapDqDq, valueCount, dataTime, modelCount, windplantList.size());
                    }
                    /*短期预测发电量结束*/
                }
                /*当期数据结束*/
                /*同期数据开始*/
                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)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsTq);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        for (WfYcHistoryData2 w : wfYcHistoryData2List) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjTq, w.getYcRawVal(), dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale(Convert.toLong(leadTime));
                    wfUspTsEfPeriodData.setParams(paramsTq);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    double modEnergyCount = 0;
                    for (WfUspTsEfPeriodData w : wfUspTsEfPeriodDataList) {
                        String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            modEnergyCount = w.getModEnergy();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(w.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            WfUspTsEfPeriodData beforeData = new WfUspTsEfPeriodData();
                            beforeData.setWindplantNo(windplant.getWindplantNo());
                            beforeData.setModelNo(wfFileConfig.getUwpfemodelNo());
                            beforeData.setTimeScale(Convert.toLong(leadTime));
                            beforeData.setParams(paramsF);
                            modEnergyCount = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(beforeData).stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum();
                        } else {
                            modEnergyCount += w.getModEnergy();
                        }
                        ShareController.addMapValue(mapCdqTq, modEnergyCount, dataTime, modelCount, windplantList.size());
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsTq);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    double valueCount = 0;
                    for (NoscaleWfDaEfPeriodData n : noscaleWfDaEfPeriodDataList) {
                        String dataTime = DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            valueCount = n.getValue();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(n.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            NoscaleWfDaEfPeriodData beforeData = new NoscaleWfDaEfPeriodData();
                            beforeData.setWindplantNo(windplant.getWindplantNo());
                            beforeData.setModelNo(wfFileConfig.getWpfemodelNo());
                            beforeData.setParams(paramsF);
                            valueCount = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(beforeData).stream().mapToDouble(NoscaleWfDaEfPeriodData::getValue).sum();
                        } else {
                            valueCount += n.getValue();
                        }
                        ShareController.addMapValue(mapDqTq, valueCount, dataTime, modelCount, windplantList.size());
                    }
                    /*短期预测发电量结束*/
                }
                /*同期数据结束*/
                modelCount++;
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                /*当期数据开始*/
                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)) {
                    /*理论电量、可用电量开始*/
                    WfTheoryenergyData wfTheoryenergyData = new WfTheoryenergyData();
                    wfTheoryenergyData.setWindplantNo(Convert.toLong(stationNumber));
                    wfTheoryenergyData.setParams(paramsDq);
                    double theoryenergy = 0;
                    double availableenergy = 0;
                    List<WfTheoryenergyData> wfTheoryenergyDataList = wfTheoryenergyDataService.selectWfTheoryenergyDataList(wfTheoryenergyData);
                    if (wfTheoryenergyDataList.size() > 0) {
                        for (WfTheoryenergyData w : wfTheoryenergyDataList) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            if ("00:10".equals(dataTime.substring(11, 16))) {
                                theoryenergy = w.getTheoryenergy();
                                availableenergy = w.getAvailableenergy();
                            } else if (beginDataTime.equals(dataTime)) {
                                Map<String, Object> paramsF = new HashMap<>();
                                Date dTime;
                                if ("00:00".equals(dataTime.substring(11, 16))) {
                                    dTime = DateUtil.date(DateUtil.offsetDay(w.getDataTime(), -1).getTime() + 600000);
                                } else {
                                    dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                                }
                                paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                                paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                                WfTheoryenergyData beforeData = new WfTheoryenergyData();
                                beforeData.setWindplantNo(Convert.toLong(stationNumber));
                                beforeData.setParams(paramsF);
                                List<WfTheoryenergyData> list = wfTheoryenergyDataService.selectWfTheoryenergyDataList(beforeData);
                                theoryenergy = list.stream().mapToDouble(WfTheoryenergyData::getTheoryenergy).sum();
                                availableenergy = list.stream().mapToDouble(WfTheoryenergyData::getAvailableenergy).sum();
                            } else {
                                theoryenergy += w.getTheoryenergy();
                                availableenergy += w.getAvailableenergy();
                            }
                            ShareController.addMapValue(mapLlDl, theoryenergy, dataTime, 0, 1);
                            ShareController.addMapValue(mapKyDl, availableenergy, dataTime, 0, 1);
                        }
                    }
                    /*理论电量、可用电量结束*/
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsDq);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        for (WfYcHistoryData2 w : wfYcHistoryData2List) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjDq, w.getYcRawVal(), dataTime, 0, 1);
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale(Convert.toLong(leadTime));
                    wfUspTsEfPeriodData.setParams(paramsDq);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    double modEnergyCount = 0;
                    for (WfUspTsEfPeriodData w : wfUspTsEfPeriodDataList) {
                        String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            modEnergyCount = w.getModEnergy();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(w.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            WfUspTsEfPeriodData beforeData = new WfUspTsEfPeriodData();
                            beforeData.setWindplantNo(Convert.toLong(stationNumber));
                            beforeData.setModelNo(wfFileConfig.getUwpfemodelNo());
                            beforeData.setTimeScale(Convert.toLong(leadTime));
                            beforeData.setParams(paramsF);
                            modEnergyCount = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(beforeData).stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum();
                        } else {
                            modEnergyCount += w.getModEnergy();
                        }
                        ShareController.addMapValue(mapCdqDq, modEnergyCount, dataTime, 0, 1);
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsDq);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    double valueCount = 0;
                    for (NoscaleWfDaEfPeriodData n : noscaleWfDaEfPeriodDataList) {
                        String dataTime = DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            valueCount = n.getValue();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(n.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            NoscaleWfDaEfPeriodData beforeData = new NoscaleWfDaEfPeriodData();
                            beforeData.setWindplantNo(Convert.toLong(stationNumber));
                            beforeData.setModelNo(wfFileConfig.getWpfemodelNo());
                            beforeData.setParams(paramsF);
                            valueCount = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(beforeData).stream().mapToDouble(NoscaleWfDaEfPeriodData::getValue).sum();
                        } else {
                            valueCount += n.getValue();
                        }
                        ShareController.addMapValue(mapDqDq, valueCount, dataTime, 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)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsTq);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        for (WfYcHistoryData2 w : wfYcHistoryData2List) {
                            String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjTq, w.getYcRawVal(), dataTime, 0, 1);
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale(Convert.toLong(leadTime));
                    wfUspTsEfPeriodData.setParams(paramsTq);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    double modEnergyCount = 0;
                    for (WfUspTsEfPeriodData w : wfUspTsEfPeriodDataList) {
                        String dataTime = DateUtil.format(w.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            modEnergyCount = w.getModEnergy();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(w.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            WfUspTsEfPeriodData beforeData = new WfUspTsEfPeriodData();
                            beforeData.setWindplantNo(Convert.toLong(stationNumber));
                            beforeData.setModelNo(wfFileConfig.getUwpfemodelNo());
                            beforeData.setTimeScale(Convert.toLong(leadTime));
                            beforeData.setParams(paramsF);
                            modEnergyCount = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(beforeData).stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum();
                        } else {
                            modEnergyCount += w.getModEnergy();
                        }
                        ShareController.addMapValue(mapCdqTq, modEnergyCount, dataTime, 0, 1);
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsTq);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    double valueCount = 0;
                    for (NoscaleWfDaEfPeriodData n : noscaleWfDaEfPeriodDataList) {
                        String dataTime = DateUtil.format(n.getDataTime(), "yyyy-MM-dd HH:mm");
                        if ("00:10".equals(dataTime.substring(11, 16))) {
                            valueCount = n.getValue();
                        } else if (beginDataTime.equals(dataTime)) {
                            Map<String, Object> paramsF = new HashMap<>();
                            Date dTime;
                            if ("00:00".equals(dataTime.substring(11, 16))) {
                                dTime = DateUtil.date(DateUtil.offsetDay(n.getDataTime(), -1).getTime() + 600000);
                            } else {
                                dTime = DateUtil.date(DateUtil.beginOfDay(DateUtil.parse(dataTime)).getTime() + 600000);
                            }
                            paramsF.put("beginDataTime", DateUtil.formatDateTime(dTime));
                            paramsF.put("endDataTime", DateUtil.formatDateTime(DateUtil.parse(dataTime)));
                            NoscaleWfDaEfPeriodData beforeData = new NoscaleWfDaEfPeriodData();
                            beforeData.setWindplantNo(Convert.toLong(stationNumber));
                            beforeData.setModelNo(wfFileConfig.getWpfemodelNo());
                            beforeData.setParams(paramsF);
                            valueCount = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(beforeData).stream().mapToDouble(NoscaleWfDaEfPeriodData::getValue).sum();
                        } else {
                            valueCount += n.getValue();
                        }
                        ShareController.addMapValue(mapDqTq, valueCount, dataTime, 0, 1);
                    }
                    /*短期预测发电量结束*/
                }
                /*同期数据结束*/
            } else if (itemVal == 4) {//光伏电站
                //暂无 后补
            }
        }
        //理论电量
        LinkedMultiValueMap<String, Double> mapLlDl15 = new LinkedMultiValueMap<String, Double>();
        //可用电量
        LinkedMultiValueMap<String, Double> mapKyDl15 = new LinkedMultiValueMap<String, Double>();
        //实际发电-当期
        LinkedMultiValueMap<String, Double> mapSjDq15 = new LinkedMultiValueMap<String, Double>();
        //超短期发电-当期
        LinkedMultiValueMap<String, Double> mapCdqDq15 = new LinkedMultiValueMap<String, Double>();
        //短期发电-当期
        LinkedMultiValueMap<String, Double> mapDqDq15 = new LinkedMultiValueMap<String, Double>();
        //实际发电-同期
        LinkedMultiValueMap<String, Double> mapSjTq15 = new LinkedMultiValueMap<String, Double>();
        //超短期发电-同期
        LinkedMultiValueMap<String, Double> mapCdqTq15 = new LinkedMultiValueMap<String, Double>();
        //短期发电-同期
        LinkedMultiValueMap<String, Double> mapDqTq15 = new LinkedMultiValueMap<String, Double>();
        int count2 = dateList15.size();
        if ("-1".equals(stationNumber)) {//全域数据
            for (int k = 0; k < count2; k++) {
                if ("15".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entryLlDl1 = mapLlDl.get(dk1);
                    List<Double> entryLlDl2 = mapLlDl.get(dk2);
                    if (entryLlDl1 != null && entryLlDl2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entryLlDl1.size() > i && entryLlDl1.get(i) != null) {
                                ycRawVal10 = entryLlDl1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entryLlDl2.size() > i && entryLlDl2.get(i) != null) {
                                ycRawVal20 = entryLlDl2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapLlDl15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryKyDl1 = mapKyDl.get(dk1);
                    List<Double> entryKyDl2 = mapKyDl.get(dk2);
                    if (entryKyDl1 != null && entryKyDl2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entryKyDl1.size() > i && entryKyDl1.get(i) != null) {
                                ycRawVal10 = entryKyDl1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entryKyDl2.size() > i && entryKyDl2.get(i) != null) {
                                ycRawVal20 = entryKyDl2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapKyDl15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entrySjDq1 = mapSjDq.get(dk1);
                    List<Double> entrySjDq2 = mapSjDq.get(dk2);
                    if (entrySjDq1 != null && entrySjDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entrySjDq1.size() > i && entrySjDq1.get(i) != null) {
                                ycRawVal10 = entrySjDq1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entrySjDq2.size() > i && entrySjDq2.get(i) != null) {
                                ycRawVal20 = entrySjDq2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdqDq1 = mapCdqDq.get(dk1);
                    List<Double> entryCdqDq2 = mapCdqDq.get(dk2);
                    if (entryCdqDq1 != null && entryCdqDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entryCdqDq1.size() > i && entryCdqDq1.get(i) != null) {
                                ycRawVal10 = entryCdqDq1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entryCdqDq2.size() > i && entryCdqDq2.get(i) != null) {
                                ycRawVal20 = entryCdqDq2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDqDq1 = mapDqDq.get(dk1);
                    List<Double> entryDqDq2 = mapDqDq.get(dk2);
                    if (entryDqDq1 != null && entryDqDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entryDqDq1.size() > i && entryDqDq1.get(i) != null) {
                                ycRawVal10 = entryDqDq1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entryDqDq2.size() > i && entryDqDq2.get(i) != null) {
                                ycRawVal20 = entryDqDq2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDqDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    String dk3 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), -5), "yyyy-MM-dd HH:mm");
                    String dk4 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entrySjTq1 = mapSjTq.get(dk3);
                    List<Double> entrySjTq2 = mapSjTq.get(dk4);
                    if (entrySjTq1 != null && entrySjTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entrySjTq1.size() > i && entrySjTq1.get(i) != null) {
                                ycRawVal10 = entrySjTq1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entrySjTq2.size() > i && entrySjTq2.get(i) != null) {
                                ycRawVal20 = entrySjTq2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdqTq1 = mapCdqTq.get(dk3);
                    List<Double> entryCdqTq2 = mapCdqTq.get(dk4);
                    if (entryCdqTq1 != null && entryCdqTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entryCdqTq1.size() > i && entryCdqTq1.get(i) != null) {
                                ycRawVal10 = entryCdqTq1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entryCdqTq2.size() > i && entryCdqTq2.get(i) != null) {
                                ycRawVal20 = entryCdqTq2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDqTq1 = mapDqTq.get(dk3);
                    List<Double> entryDqTq2 = mapDqTq.get(dk4);
                    if (entryDqTq1 != null && entryDqTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal10 = 0;
                            if (entryDqTq1.size() > i && entryDqTq1.get(i) != null) {
                                ycRawVal10 = entryDqTq1.get(i);
                            }
                            double ycRawVal20 = 0;
                            if (entryDqTq2.size() > i && entryDqTq2.get(i) != null) {
                                ycRawVal20 = entryDqTq2.get(i);
                            }
                            double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDqTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                } else if ("30".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entryLlDl1 = mapLlDl.get(dk1);
                    List<Double> entryLlDl2 = mapLlDl.get(dk2);
                    if (entryLlDl1 != null && entryLlDl2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entryLlDl1.size() > i && entryLlDl1.get(i) != null) {
                                ycRawVal20 = entryLlDl1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entryLlDl2.size() > i && entryLlDl2.get(i) != null) {
                                ycRawVal30 = entryLlDl2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapLlDl15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryKyDl1 = mapKyDl.get(dk1);
                    List<Double> entryKyDl2 = mapKyDl.get(dk2);
                    if (entryKyDl1 != null && entryKyDl2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entryKyDl1.size() > i && entryKyDl1.get(i) != null) {
                                ycRawVal20 = entryKyDl1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entryKyDl2.size() > i && entryKyDl2.get(i) != null) {
                                ycRawVal30 = entryKyDl2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapKyDl15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entrySjDq1 = mapSjDq.get(dk1);
                    List<Double> entrySjDq2 = mapSjDq.get(dk2);
                    if (entrySjDq1 != null && entrySjDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entrySjDq1.size() > i && entrySjDq1.get(i) != null) {
                                ycRawVal20 = entrySjDq1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entrySjDq2.size() > i && entrySjDq2.get(i) != null) {
                                ycRawVal30 = entrySjDq2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdqDq1 = mapCdqDq.get(dk1);
                    List<Double> entryCdqDq2 = mapCdqDq.get(dk2);
                    if (entryCdqDq1 != null && entryCdqDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entryCdqDq1.size() > i && entryCdqDq1.get(i) != null) {
                                ycRawVal20 = entryCdqDq1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entryCdqDq2.size() > i && entryCdqDq2.get(i) != null) {
                                ycRawVal30 = entryCdqDq2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDqDq1 = mapDqDq.get(dk1);
                    List<Double> entryDqDq2 = mapDqDq.get(dk2);
                    if (entryDqDq1 != null && entryDqDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entryDqDq1.size() > i && entryDqDq1.get(i) != null) {
                                ycRawVal20 = entryDqDq1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entryDqDq2.size() > i && entryDqDq2.get(i) != null) {
                                ycRawVal30 = entryDqDq2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDqDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    String dk3 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), -10), "yyyy-MM-dd HH:mm");
                    String dk4 = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                    List<Double> entrySjTq1 = mapSjTq.get(dk3);
                    List<Double> entrySjTq2 = mapSjTq.get(dk4);
                    if (entrySjTq1 != null && entrySjTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entrySjTq1.size() > i && entrySjTq1.get(i) != null) {
                                ycRawVal20 = entrySjTq1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entrySjTq2.size() > i && entrySjTq2.get(i) != null) {
                                ycRawVal30 = entrySjTq2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdqTq1 = mapCdqTq.get(dk3);
                    List<Double> entryCdqTq2 = mapCdqTq.get(dk4);
                    if (entryCdqTq1 != null && entryCdqTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entryCdqTq1.size() > i && entryCdqTq1.get(i) != null) {
                                ycRawVal20 = entryCdqTq1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entryCdqTq2.size() > i && entryCdqTq2.get(i) != null) {
                                ycRawVal30 = entryCdqTq2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDqTq1 = mapDqTq.get(dk3);
                    List<Double> entryDqTq2 = mapDqTq.get(dk4);
                    if (entryDqTq1 != null && entryDqTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal20 = 0;
                            if (entryDqTq1.size() > i && entryDqTq1.get(i) != null) {
                                ycRawVal20 = entryDqTq1.get(i);
                            }
                            double ycRawVal30 = 0;
                            if (entryDqTq2.size() > i && entryDqTq2.get(i) != null) {
                                ycRawVal30 = entryDqTq2.get(i);
                            }
                            double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDqTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                } else if ("45".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entryLlDl1 = mapLlDl.get(dk1);
                    List<Double> entryLlDl2 = mapLlDl.get(dk2);
                    if (entryLlDl1 != null && entryLlDl2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entryLlDl1.size() > i && entryLlDl1.get(i) != null) {
                                ycRawVal40 = entryLlDl1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entryLlDl2.size() > i && entryLlDl2.get(i) != null) {
                                ycRawVal50 = entryLlDl2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapLlDl15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryKyDl1 = mapKyDl.get(dk1);
                    List<Double> entryKyDl2 = mapKyDl.get(dk2);
                    if (entryKyDl1 != null && entryKyDl2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entryKyDl1.size() > i && entryKyDl1.get(i) != null) {
                                ycRawVal40 = entryKyDl1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entryKyDl2.size() > i && entryKyDl2.get(i) != null) {
                                ycRawVal50 = entryKyDl2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapKyDl15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entrySjDq1 = mapSjDq.get(dk1);
                    List<Double> entrySjDq2 = mapSjDq.get(dk2);
                    if (entrySjDq1 != null && entrySjDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entrySjDq1.size() > i && entrySjDq1.get(i) != null) {
                                ycRawVal40 = entrySjDq1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entrySjDq2.size() > i && entrySjDq2.get(i) != null) {
                                ycRawVal50 = entrySjDq2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdqDq1 = mapCdqDq.get(dk1);
                    List<Double> entryCdqDq2 = mapCdqDq.get(dk2);
                    if (entryCdqDq1 != null && entryCdqDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entryCdqDq1.size() > i && entryCdqDq1.get(i) != null) {
                                ycRawVal40 = entryCdqDq1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entryCdqDq2.size() > i && entryCdqDq2.get(i) != null) {
                                ycRawVal50 = entryCdqDq2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDqDq1 = mapDqDq.get(dk1);
                    List<Double> entryDqDq2 = mapDqDq.get(dk2);
                    if (entryDqDq1 != null && entryDqDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entryDqDq1.size() > i && entryDqDq1.get(i) != null) {
                                ycRawVal40 = entryDqDq1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entryDqDq2.size() > i && entryDqDq2.get(i) != null) {
                                ycRawVal50 = entryDqDq2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDqDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    String dk3 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), -5), "yyyy-MM-dd HH:mm");
                    String dk4 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entrySjTq1 = mapSjTq.get(dk3);
                    List<Double> entrySjTq2 = mapSjTq.get(dk4);
                    if (entrySjTq1 != null && entrySjTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entrySjTq1.size() > i && entrySjTq1.get(i) != null) {
                                ycRawVal40 = entrySjTq1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entrySjTq2.size() > i && entrySjTq2.get(i) != null) {
                                ycRawVal50 = entrySjTq2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdqTq1 = mapCdqTq.get(dk3);
                    List<Double> entryCdqTq2 = mapCdqTq.get(dk4);
                    if (entryCdqTq1 != null && entryCdqTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entryCdqTq1.size() > i && entryCdqTq1.get(i) != null) {
                                ycRawVal40 = entryCdqTq1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entryCdqTq2.size() > i && entryCdqTq2.get(i) != null) {
                                ycRawVal50 = entryCdqTq2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDqTq1 = mapDqTq.get(dk3);
                    List<Double> entryDqTq2 = mapDqTq.get(dk4);
                    if (entryDqTq1 != null && entryDqTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal40 = 0;
                            if (entryDqTq1.size() > i && entryDqTq1.get(i) != null) {
                                ycRawVal40 = entryDqTq1.get(i);
                            }
                            double ycRawVal50 = 0;
                            if (entryDqTq2.size() > i && entryDqTq2.get(i) != null) {
                                ycRawVal50 = entryDqTq2.get(i);
                            }
                            double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDqTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                } else if ("00".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entryLlDl1 = mapLlDl.get(dk1);
                    List<Double> entryLlDl2 = mapLlDl.get(dk2);
                    if (entryLlDl1 != null && entryLlDl2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entryLlDl1.size() > i && entryLlDl1.get(i) != null) {
                                ycRawVal50 = entryLlDl1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entryLlDl2.size() > i && entryLlDl2.get(i) != null) {
                                ycRawVal00 = entryLlDl2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapLlDl15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryKyDl1 = mapKyDl.get(dk1);
                    List<Double> entryKyDl2 = mapKyDl.get(dk2);
                    if (entryKyDl1 != null && entryKyDl2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entryKyDl1.size() > i && entryKyDl1.get(i) != null) {
                                ycRawVal50 = entryKyDl1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entryKyDl2.size() > i && entryKyDl2.get(i) != null) {
                                ycRawVal00 = entryKyDl2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapKyDl15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entrySjDq1 = mapSjDq.get(dk1);
                    List<Double> entrySjDq2 = mapSjDq.get(dk2);
                    if (entrySjDq1 != null && entrySjDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entrySjDq1.size() > i && entrySjDq1.get(i) != null) {
                                ycRawVal50 = entrySjDq1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entrySjDq2.size() > i && entrySjDq2.get(i) != null) {
                                ycRawVal00 = entrySjDq2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdqDq1 = mapCdqDq.get(dk1);
                    List<Double> entryCdqDq2 = mapCdqDq.get(dk2);
                    if (entryCdqDq1 != null && entryCdqDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entryCdqDq1.size() > i && entryCdqDq1.get(i) != null) {
                                ycRawVal50 = entryCdqDq1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entryCdqDq2.size() > i && entryCdqDq2.get(i) != null) {
                                ycRawVal00 = entryCdqDq2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDqDq1 = mapDqDq.get(dk1);
                    List<Double> entryDqDq2 = mapDqDq.get(dk2);
                    if (entryDqDq1 != null && entryDqDq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entryDqDq1.size() > i && entryDqDq1.get(i) != null) {
                                ycRawVal50 = entryDqDq1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entryDqDq2.size() > i && entryDqDq2.get(i) != null) {
                                ycRawVal00 = entryDqDq2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDqDq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    String dk3 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), -10), "yyyy-MM-dd HH:mm");
                    String dk4 = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                    List<Double> entrySjTq1 = mapSjTq.get(dk3);
                    List<Double> entrySjTq2 = mapSjTq.get(dk4);
                    if (entrySjTq1 != null && entrySjTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entrySjTq1.size() > i && entrySjTq1.get(i) != null) {
                                ycRawVal50 = entrySjTq1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entrySjTq2.size() > i && entrySjTq2.get(i) != null) {
                                ycRawVal00 = entrySjTq2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapSjTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryCdqTq1 = mapCdqTq.get(dk3);
                    List<Double> entryCdqTq2 = mapCdqTq.get(dk4);
                    if (entryCdqTq1 != null && entryCdqTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entryCdqTq1.size() > i && entryCdqTq1.get(i) != null) {
                                ycRawVal50 = entryCdqTq1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entryCdqTq2.size() > i && entryCdqTq2.get(i) != null) {
                                ycRawVal00 = entryCdqTq2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapCdqTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                    List<Double> entryDqTq1 = mapDqTq.get(dk3);
                    List<Double> entryDqTq2 = mapDqTq.get(dk4);
                    if (entryDqTq1 != null && entryDqTq2 != null) {
                        for (int i = 0; i < modelCount; i++) {
                            double ycRawVal50 = 0;
                            if (entryDqTq1.size() > i && entryDqTq1.get(i) != null) {
                                ycRawVal50 = entryDqTq1.get(i);
                            }
                            double ycRawVal00 = 0;
                            if (entryDqTq2.size() > i && entryDqTq2.get(i) != null) {
                                ycRawVal00 = entryDqTq2.get(i);
                            }
                            double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                            String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                            ShareController.addMapValue(mapDqTq15, ycRawVal, dataTime, i, modelCount);
                        }
                    }
                }
            }
        } else {//各个场站数据
            for (int k = 0; k < count2; k++) {
                if ("15".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entryLlDl1 = mapLlDl.get(dk1);
                    List<Double> entryLlDl2 = mapLlDl.get(dk2);
                    if (entryLlDl1 != null && entryLlDl2 != null) {
                        double ycRawVal10 = entryLlDl1.get(0);
                        double ycRawVal20 = entryLlDl2.get(0);
                        double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapLlDl15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryKyDl1 = mapKyDl.get(dk1);
                    List<Double> entryKyDl2 = mapKyDl.get(dk2);
                    if (entryKyDl1 != null && entryKyDl2 != null) {
                        double ycRawVal10 = entryKyDl1.get(0);
                        double ycRawVal20 = entryKyDl2.get(0);
                        double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapKyDl15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entrySjDq1 = mapSjDq.get(dk1);
                    List<Double> entrySjDq2 = mapSjDq.get(dk2);
                    if (entrySjDq1 != null && entrySjDq2 != null) {
                        double ycRawVal10 = entrySjDq1.get(0);
                        double ycRawVal20 = entrySjDq2.get(0);
                        double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapSjDq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryCdqDq1 = mapCdqDq.get(dk1);
                    List<Double> entryCdqDq2 = mapCdqDq.get(dk2);
                    if (entryCdqDq1 != null && entryCdqDq2 != null) {
                        double ycRawVal10 = entryCdqDq1.get(0);
                        double ycRawVal20 = entryCdqDq2.get(0);
                        double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapCdqDq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryDqDq1 = mapDqDq.get(dk1);
                    List<Double> entryDqDq2 = mapDqDq.get(dk2);
                    if (entryDqDq1 != null && entryDqDq2 != null) {
                        double ycRawVal10 = entryDqDq1.get(0);
                        double ycRawVal20 = entryDqDq2.get(0);
                        double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapDqDq15, ycRawVal, dataTime, 0, 1);
                    }
                    String dk3 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), -5), "yyyy-MM-dd HH:mm");
                    String dk4 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entrySjTq1 = mapSjTq.get(dk3);
                    List<Double> entrySjTq2 = mapSjTq.get(dk4);
                    if (entrySjTq1 != null && entrySjTq2 != null) {
                        double ycRawVal10 = entrySjTq1.get(0);
                        double ycRawVal20 = entrySjTq2.get(0);
                        double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapSjTq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryCdqTq1 = mapCdqTq.get(dk3);
                    List<Double> entryCdqTq2 = mapCdqTq.get(dk4);
                    if (entryCdqTq1 != null && entryCdqTq2 != null) {
                        double ycRawVal10 = entryCdqTq1.get(0);
                        double ycRawVal20 = entryCdqTq2.get(0);
                        double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapCdqTq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryDqTq1 = mapDqTq.get(dk3);
                    List<Double> entryDqTq2 = mapDqTq.get(dk4);
                    if (entryDqTq1 != null && entryDqTq2 != null) {
                        double ycRawVal10 = entryDqTq1.get(0);
                        double ycRawVal20 = entryDqTq2.get(0);
                        double ycRawVal = ycRawVal10 + (ycRawVal20 / 2);
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapDqTq15, ycRawVal, dataTime, 0, 1);
                    }
                } else if ("30".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entryLlDl1 = mapLlDl.get(dk1);
                    List<Double> entryLlDl2 = mapLlDl.get(dk2);
                    if (entryLlDl1 != null && entryLlDl2 != null) {
                        double ycRawVal20 = entryLlDl1.get(0);
                        double ycRawVal30 = entryLlDl2.get(0);
                        double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapLlDl15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryKyDl1 = mapKyDl.get(dk1);
                    List<Double> entryKyDl2 = mapKyDl.get(dk2);
                    if (entryKyDl1 != null && entryKyDl2 != null) {
                        double ycRawVal20 = entryKyDl1.get(0);
                        double ycRawVal30 = entryKyDl2.get(0);
                        double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapKyDl15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entrySjDq1 = mapSjDq.get(dk1);
                    List<Double> entrySjDq2 = mapSjDq.get(dk2);
                    if (entrySjDq1 != null && entrySjDq2 != null) {
                        double ycRawVal20 = entrySjDq1.get(0);
                        double ycRawVal30 = entrySjDq2.get(0);
                        double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapSjDq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryCdqDq1 = mapCdqDq.get(dk1);
                    List<Double> entryCdqDq2 = mapCdqDq.get(dk2);
                    if (entryCdqDq1 != null && entryCdqDq2 != null) {
                        double ycRawVal20 = entryCdqDq1.get(0);
                        double ycRawVal30 = entryCdqDq2.get(0);
                        double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapCdqDq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryDqDq1 = mapDqDq.get(dk1);
                    List<Double> entryDqDq2 = mapDqDq.get(dk2);
                    if (entryDqDq1 != null && entryDqDq2 != null) {
                        double ycRawVal20 = entryDqDq1.get(0);
                        double ycRawVal30 = entryDqDq2.get(0);
                        double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapDqDq15, ycRawVal, dataTime, 0, 1);
                    }
                    String dk3 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), -10), "yyyy-MM-dd HH:mm");
                    String dk4 = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                    List<Double> entrySjTq1 = mapSjTq.get(dk3);
                    List<Double> entrySjTq2 = mapSjTq.get(dk4);
                    if (entrySjTq1 != null && entrySjTq2 != null) {
                        double ycRawVal20 = entrySjTq1.get(0);
                        double ycRawVal30 = entrySjTq2.get(0);
                        double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapSjTq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryCdqTq1 = mapCdqTq.get(dk3);
                    List<Double> entryCdqTq2 = mapCdqTq.get(dk4);
                    if (entryCdqTq1 != null && entryCdqTq2 != null) {
                        double ycRawVal20 = entryCdqTq1.get(0);
                        double ycRawVal30 = entryCdqTq2.get(0);
                        double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapCdqTq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryDqTq1 = mapDqTq.get(dk3);
                    List<Double> entryDqTq2 = mapDqTq.get(dk4);
                    if (entryDqTq1 != null && entryDqTq2 != null) {
                        double ycRawVal20 = entryDqTq1.get(0);
                        double ycRawVal30 = entryDqTq2.get(0);
                        double ycRawVal = (ycRawVal20 / 2) + ycRawVal30;
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapDqTq15, ycRawVal, dataTime, 0, 1);
                    }
                } else if ("45".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -5), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entryLlDl1 = mapLlDl.get(dk1);
                    List<Double> entryLlDl2 = mapLlDl.get(dk2);
                    if (entryLlDl1 != null && entryLlDl2 != null) {
                        double ycRawVal40 = entryLlDl1.get(0);
                        double ycRawVal50 = entryLlDl2.get(0);
                        double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapLlDl15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryKyDl1 = mapKyDl.get(dk1);
                    List<Double> entryKyDl2 = mapKyDl.get(dk2);
                    if (entryKyDl1 != null && entryKyDl2 != null) {
                        double ycRawVal40 = entryKyDl1.get(0);
                        double ycRawVal50 = entryKyDl2.get(0);
                        double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapKyDl15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entrySjDq1 = mapSjDq.get(dk1);
                    List<Double> entrySjDq2 = mapSjDq.get(dk2);
                    if (entrySjDq1 != null && entrySjDq2 != null) {
                        double ycRawVal40 = entrySjDq1.get(0);
                        double ycRawVal50 = entrySjDq2.get(0);
                        double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapSjDq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryCdqDq1 = mapCdqDq.get(dk1);
                    List<Double> entryCdqDq2 = mapCdqDq.get(dk2);
                    if (entryCdqDq1 != null && entryCdqDq2 != null) {
                        double ycRawVal40 = entryCdqDq1.get(0);
                        double ycRawVal50 = entryCdqDq2.get(0);
                        double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapCdqDq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryDqDq1 = mapDqDq.get(dk1);
                    List<Double> entryDqDq2 = mapDqDq.get(dk2);
                    if (entryDqDq1 != null && entryDqDq2 != null) {
                        double ycRawVal40 = entryDqDq1.get(0);
                        double ycRawVal50 = entryDqDq2.get(0);
                        double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapDqDq15, ycRawVal, dataTime, 0, 1);
                    }
                    String dk3 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), -5), "yyyy-MM-dd HH:mm");
                    String dk4 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), 5), "yyyy-MM-dd HH:mm");
                    List<Double> entrySjTq1 = mapSjTq.get(dk3);
                    List<Double> entrySjTq2 = mapSjTq.get(dk4);
                    if (entrySjTq1 != null && entrySjTq2 != null) {
                        double ycRawVal40 = entrySjTq1.get(0);
                        double ycRawVal50 = entrySjTq2.get(0);
                        double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapSjTq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryCdqTq1 = mapCdqTq.get(dk3);
                    List<Double> entryCdqTq2 = mapCdqTq.get(dk4);
                    if (entryCdqTq1 != null && entryCdqTq2 != null) {
                        double ycRawVal40 = entryCdqTq1.get(0);
                        double ycRawVal50 = entryCdqTq2.get(0);
                        double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapCdqTq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryDqTq1 = mapDqTq.get(dk3);
                    List<Double> entryDqTq2 = mapDqTq.get(dk4);
                    if (entryDqTq1 != null && entryDqTq2 != null) {
                        double ycRawVal40 = entryDqTq1.get(0);
                        double ycRawVal50 = entryDqTq2.get(0);
                        double ycRawVal = ycRawVal40 + (ycRawVal50 / 2);
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapDqTq15, ycRawVal, dataTime, 0, 1);
                    }
                } else if ("00".equals(DateUtil.formatDateTime(dateList15.get(k)).substring(14, 16))) {
                    String dk1 = DateUtil.format(DateUtil.offsetMinute(dateList15.get(k), -10), "yyyy-MM-dd HH:mm");
                    String dk2 = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                    List<Double> entryLlDl1 = mapLlDl.get(dk1);
                    List<Double> entryLlDl2 = mapLlDl.get(dk2);
                    if (entryLlDl1 != null && entryLlDl2 != null) {
                        double ycRawVal50 = entryLlDl1.get(0);
                        double ycRawVal00 = entryLlDl2.get(0);
                        double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapLlDl15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryKyDl1 = mapKyDl.get(dk1);
                    List<Double> entryKyDl2 = mapKyDl.get(dk2);
                    if (entryKyDl1 != null && entryKyDl2 != null) {
                        double ycRawVal50 = entryKyDl1.get(0);
                        double ycRawVal00 = entryKyDl2.get(0);
                        double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapKyDl15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entrySjDq1 = mapSjDq.get(dk1);
                    List<Double> entrySjDq2 = mapSjDq.get(dk2);
                    if (entrySjDq1 != null && entrySjDq2 != null) {
                        double ycRawVal50 = entrySjDq1.get(0);
                        double ycRawVal00 = entrySjDq2.get(0);
                        double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapSjDq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryCdqDq1 = mapCdqDq.get(dk1);
                    List<Double> entryCdqDq2 = mapCdqDq.get(dk2);
                    if (entryCdqDq1 != null && entryCdqDq2 != null) {
                        double ycRawVal50 = entryCdqDq1.get(0);
                        double ycRawVal00 = entryCdqDq2.get(0);
                        double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapCdqDq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryDqDq1 = mapDqDq.get(dk1);
                    List<Double> entryDqDq2 = mapDqDq.get(dk2);
                    if (entryDqDq1 != null && entryDqDq2 != null) {
                        double ycRawVal50 = entryDqDq1.get(0);
                        double ycRawVal00 = entryDqDq2.get(0);
                        double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                        String dataTime = DateUtil.format(dateList15.get(k), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapDqDq15, ycRawVal, dataTime, 0, 1);
                    }
                    String dk3 = DateUtil.format(DateUtil.offsetMinute(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), -10), "yyyy-MM-dd HH:mm");
                    String dk4 = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                    List<Double> entrySjTq1 = mapSjTq.get(dk3);
                    List<Double> entrySjTq2 = mapSjTq.get(dk4);
                    if (entrySjTq1 != null && entrySjTq2 != null) {
                        double ycRawVal50 = entrySjTq1.get(0);
                        double ycRawVal00 = entrySjTq2.get(0);
                        double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapSjTq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryCdqTq1 = mapCdqTq.get(dk3);
                    List<Double> entryCdqTq2 = mapCdqTq.get(dk4);
                    if (entryCdqTq1 != null && entryCdqTq2 != null) {
                        double ycRawVal50 = entryCdqTq1.get(0);
                        double ycRawVal00 = entryCdqTq2.get(0);
                        double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapCdqTq15, ycRawVal, dataTime, 0, 1);
                    }
                    List<Double> entryDqTq1 = mapDqTq.get(dk3);
                    List<Double> entryDqTq2 = mapDqTq.get(dk4);
                    if (entryDqTq1 != null && entryDqTq2 != null) {
                        double ycRawVal50 = entryDqTq1.get(0);
                        double ycRawVal00 = entryDqTq2.get(0);
                        double ycRawVal = (ycRawVal50 / 2) + ycRawVal00;
                        String dataTime = DateUtil.format(DateUtil.offset(dateList15.get(k), DateField.YEAR, -1), "yyyy-MM-dd HH:mm");
                        ShareController.addMapValue(mapDqTq15, ycRawVal, dataTime, 0, 1);
                    }
                }
            }
        }
        List<TableField> tableFieldList = new ArrayList<>();
        for (Date date : dateList15) {
            TableField tableField = new TableField();
            if ("-1".equals(stationNumber)) {//全域数据
                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> entryLlDl = mapLlDl15.get(stringDateTimeDq);
                if (entryLlDl != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryLlDl.size() > i && entryLlDl.get(i) != null) {
                            count += entryLlDl.get(i);
                        }
                    }
                    tableField.setTheoreticalPower(count);
                }
                List<Double> entryKyDl = mapKyDl15.get(stringDateTimeDq);
                if (entryKyDl != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryKyDl.size() > i && entryKyDl.get(i) != null) {
                            count += entryKyDl.get(i);
                        }
                    }
                    tableField.setAvailablePower(count);
                }
                List<Double> entrySjDq = mapSjDq15.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entrySjDq.size() > i && entrySjDq.get(i) != null) {
                            count += entrySjDq.get(i);
                        }
                    }
                    tableField.setActualPowerDq(count);
                }
                List<Double> entryCdqDq = mapCdqDq15.get(stringDateTimeDq);
                if (entryCdqDq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryCdqDq.size() > i && entryCdqDq.get(i) != null) {
                            count += entryCdqDq.get(i);
                        }
                    }
                    tableField.setVeryShortTermForecastDq(count);
                }
                List<Double> entryDqDq = mapDqDq15.get(stringDateTimeDq);
                if (entryDqDq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryDqDq.size() > i && entryDqDq.get(i) != null) {
                            count += entryDqDq.get(i);
                        }
                    }
                    tableField.setShortTermForecastDq(count);
                }
                List<Double> entrySjTq = mapSjTq15.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entrySjTq.size() > i && entrySjTq.get(i) != null) {
                            count += entrySjTq.get(i);
                        }
                    }
                    tableField.setActualPowerTq(count);
                }
                List<Double> entryCdqTq = mapCdqTq15.get(stringDateTimeTq);
                if (entryCdqTq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryCdqTq.size() > i && entryCdqTq.get(i) != null) {
                            count += entryCdqTq.get(i);
                        }
                    }
                    tableField.setVeryShortTermForecastTq(count);
                }
                List<Double> entryDqTq = mapDqTq15.get(stringDateTimeTq);
                if (entryDqTq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryDqTq.size() > i && entryDqTq.get(i) != null) {
                            count += entryDqTq.get(i);
                        }
                    }
                    tableField.setShortTermForecastTq(count);
                }
            } else {//各个场站数据
                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> entryLlDl = mapLlDl15.get(stringDateTimeDq);
                if (entryLlDl != null) {
                    tableField.setTheoreticalPower(entryLlDl.get(0));
                }
                List<Double> entryKyDl = mapKyDl15.get(stringDateTimeDq);
                if (entryKyDl != null) {
                    tableField.setAvailablePower(entryKyDl.get(0));
                }
                List<Double> entrySjDq = mapSjDq15.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    tableField.setActualPowerDq(entrySjDq.get(0));
                }
                List<Double> entryCdqDq = mapCdqDq15.get(stringDateTimeDq);
                if (entryCdqDq != null) {
                    tableField.setVeryShortTermForecastDq(entryCdqDq.get(0));
                }
                List<Double> entryDqDq = mapDqDq15.get(stringDateTimeDq);
                if (entryDqDq != null) {
                    tableField.setShortTermForecastDq(entryDqDq.get(0));
                }
                List<Double> entrySjTq = mapSjTq15.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    tableField.setActualPowerTq(entrySjTq.get(0));
                }
                List<Double> entryCdqTq = mapCdqTq15.get(stringDateTimeTq);
                if (entryCdqTq != null) {
                    tableField.setVeryShortTermForecastTq(entryCdqTq.get(0));
                }
                List<Double> entryDqTq = mapDqTq15.get(stringDateTimeTq);
                if (entryDqTq != null) {
                    tableField.setShortTermForecastTq(entryDqTq.get(0));
                }
            }
            tableFieldList.add(tableField);
        }
        json.put("dataFormatList", tableFieldList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Chart-月单日发电量预测对比")
    @GetMapping("/monthlyDailyPowerGenerationForecastComparisonChartData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
            @ApiImplicitParam(name = "leadTime", value = "超前时间(默认传7)", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult monthlyDailyPowerGenerationForecastComparisonChartData(@RequestParam(value = "stationNumber") String stationNumber,
                                                                             @RequestParam(value = "itemVal") int itemVal,
                                                                             @RequestParam(value = "leadTime") String leadTime,
                                                                             @RequestParam(value = "beginDataTime") String beginDataTime,
                                                                             @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //获取所有时间
        List<Date> dateList = DateTimeUtil.getDayBetween(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime));
        //场站总数
        int modelCount = 0;
        //实际发电
        LinkedMultiValueMap<String, Double> map = new LinkedMultiValueMap<String, Double>();
        //超短期发电
        LinkedMultiValueMap<String, Double> mapCdq = new LinkedMultiValueMap<String, Double>();
        //短期发电
        LinkedMultiValueMap<String, Double> mapDq = new LinkedMultiValueMap<String, Double>();
        //计划发电
        LinkedMultiValueMap<String, Double> mapJh = new LinkedMultiValueMap<String, Double>();
        Map<String, Object> params = new HashMap<>();
        params.put("beginDataTime", beginDataTime + " 00:00:00");
        params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.parse(endDataTime), 1)));
        if ("-1".equals(stationNumber)) {//全域数据
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById((long) -1);
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dateList) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                    ShareController.addMapValue(map, lastYcRawVal, DateUtil.formatDate(date), modelCount, windplantList.size());
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                        ShareController.addMapValue(map, lastYcRawVal, DateUtil.formatDate(date), modelCount, windplantList.size());
                                    }
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale(Convert.toLong(leadTime));
                    wfUspTsEfPeriodData.setParams(params);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    if (wfUspTsEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsEfPeriodData> list = wfUspTsEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsEfPeriodData lastData = wfUspTsEfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModEnergy = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModEnergy = lastData.getModEnergy();
                                }
                                double modEnergyCount = list.stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum() - list.get(0).getModEnergy() + lastModEnergy;
                                ShareController.addMapValue(mapCdq, modEnergyCount, dataTime, modelCount, windplantList.size());
                            }
                        }
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapDq, valueCount, dataTime, modelCount, windplantList.size());
                            }
                        }
                    }
                    /*短期预测发电量结束*/
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        for (Date dl : dateList) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(windplant.getWindplantNo());
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(mapJh, generatingcapacity, DateUtil.formatDate(dl), modelCount, windplantList.size());
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    ShareController.addMapValue(mapJh, generatingcapacity, DateUtil.formatDate(dl), modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                    modelCount++;
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(params);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dateList) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                    ShareController.addMapValue(map, lastYcRawVal, DateUtil.formatDate(date), 0, 1);
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                        ShareController.addMapValue(map, lastYcRawVal, DateUtil.formatDate(date), 0, 1);
                                    }
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*超短期预测发电量开始*/
                    WfUspTsEfPeriodData wfUspTsEfPeriodData = new WfUspTsEfPeriodData();
                    wfUspTsEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量超短期最优模型
                    wfUspTsEfPeriodData.setModelNo(wfFileConfig.getUwpfemodelNo());
                    wfUspTsEfPeriodData.setTimeScale((long) 0);
                    wfUspTsEfPeriodData.setParams(params);
                    List<WfUspTsEfPeriodData> wfUspTsEfPeriodDataList = wfUspTsEfPeriodDataService.selectWfUspTsEfPeriodDataList(wfUspTsEfPeriodData);
                    if (wfUspTsEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<WfUspTsEfPeriodData> list = wfUspTsEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            WfUspTsEfPeriodData lastData = wfUspTsEfPeriodDataList.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                            if (list.size() > 0) {
                                double lastModEnergy = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastModEnergy = lastData.getModEnergy();
                                }
                                double modEnergyCount = list.stream().mapToDouble(WfUspTsEfPeriodData::getModEnergy).sum() - list.get(0).getModEnergy() + lastModEnergy;
                                ShareController.addMapValue(map, modEnergyCount, dataTime, 1, 2);
                            }
                        }
                    }
                    /*超短期预测发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(params);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(map, valueCount, dataTime, 2, 3);
                            }
                        }
                    }
                    /*短期预测发电量结束*/
                    /*计划发电量开始*/
                    PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        for (Date dl : dateList) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(Convert.toLong(stationNumber));
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(Convert.toLong(stationNumber), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(map, generatingcapacity, DateUtil.formatDate(dl), 3, 4);
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    ShareController.addMapValue(map, generatingcapacity, DateUtil.formatDate(dl), 3, 4);
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                }
            } else if (itemVal == 4) {//光伏电站
                //暂无 后补
            }
        }
        List<DataFormat> dataFormatList = new ArrayList<>();
        String[] nameStr = {"实际发电量", "超短期预测", "短期预测", "计划发电量"};
        int count1 = dateList.size();
        if ("-1".equals(stationNumber)) {//全域数据
            Double[] dataSj = new Double[count1];
            Double[] dataCdq = new Double[count1];
            Double[] dataDq = new Double[count1];
            Double[] dataJh = new Double[count1];
            for (int k = 0; k < count1; k++) {
                String dk1 = DateUtil.formatDate(dateList.get(k));
                List<Double> entrySj = map.get(dk1);
                if (entrySj != null) {
                    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;
                }
                List<Double> entryCdq = mapCdq.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> entryDq = mapDq.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> entryJh = mapJh.get(dk1);
                if (entryJh != null) {
                    double num = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJh.size() > i && entryJh.get(i) != null) {
                            num += entryJh.get(i);
                        }
                    }
                    dataJh[k] = num;
                }
            }
            DataFormat dataFormatSj = new DataFormat();
            dataFormatSj.setName(nameStr[0]);
            dataFormatSj.setData(dataSj);
            dataFormatList.add(dataFormatSj);
            DataFormat dataFormatCdq = new DataFormat();
            dataFormatCdq.setName(nameStr[1]);
            dataFormatCdq.setData(dataCdq);
            dataFormatList.add(dataFormatCdq);
            DataFormat dataFormatDq = new DataFormat();
            dataFormatDq.setName(nameStr[2]);
            dataFormatDq.setData(dataDq);
            dataFormatList.add(dataFormatDq);
            DataFormat dataFormatJh = new DataFormat();
            dataFormatJh.setName(nameStr[3]);
            dataFormatJh.setData(dataJh);
            dataFormatList.add(dataFormatJh);
        } else {//各个场站数据
            for (int i = 0; i < 4; i++) {
                Double[] data = new Double[count1];
                for (int k = 0; k < count1; k++) {
                    List<Double> entry = map.get(DateUtil.formatDate(dateList.get(k)));
                    if (entry != null) {
                        if (entry.size() > i && entry.get(i) != null) {
                            data[k] = entry.get(i);
                        }
                    }
                }
                DataFormat dataFormat = new DataFormat();
                dataFormat.setName(nameStr[i]);
                dataFormat.setData(data);
                dataFormatList.add(dataFormat);
            }
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Table-月单日发电量预测对比")
    @GetMapping("/monthlyDailyPowerGenerationForecastComparisonTableData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult monthlyDailyPowerGenerationForecastComparisonTableData(@RequestParam(value = "stationNumber") String stationNumber,
                                                                             @RequestParam(value = "itemVal") int itemVal,
                                                                             @RequestParam(value = "beginDataTime") String beginDataTime,
                                                                             @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //获取所有时间
        List<Date> dateList = DateTimeUtil.getDayBetween(DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime));
        //场站总数
        int modelCount = 0;
        //计划发电-当期
        LinkedMultiValueMap<String, Double> mapJhDq = new LinkedMultiValueMap<String, Double>();
        //实际发电-当期
        LinkedMultiValueMap<String, Double> mapSjDq = new LinkedMultiValueMap<String, Double>();
        //预测发电-当期
        LinkedMultiValueMap<String, Double> mapYcDq = new LinkedMultiValueMap<String, Double>();
        //计划发电-同期
        LinkedMultiValueMap<String, Double> mapJhTq = new LinkedMultiValueMap<String, Double>();
        //实际发电-同期
        LinkedMultiValueMap<String, Double> mapSjTq = new LinkedMultiValueMap<String, Double>();
        //预测发电-同期
        LinkedMultiValueMap<String, Double> mapYcTq = new LinkedMultiValueMap<String, Double>();
        //计划发电-上月
        LinkedMultiValueMap<String, Double> mapJhSy = new LinkedMultiValueMap<String, Double>();
        //实际发电-上月
        LinkedMultiValueMap<String, Double> mapSjSy = new LinkedMultiValueMap<String, Double>();
        //预测发电-上月
        LinkedMultiValueMap<String, Double> mapYcSy = new LinkedMultiValueMap<String, Double>();
        if ("-1".equals(stationNumber)) {//全域数据
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById((long) -1);
            for (Windplant windplant : windplantList) {
                /*当期数据开始*/
                Date bDTDq = DateUtil.parse(beginDataTime);
                Date eDTDq = DateUtil.offsetDay(DateUtil.parse(endDataTime), 1);
                Map<String, Object> paramsDq = new HashMap<>();
                paramsDq.put("beginDataTime", beginDataTime + " 00:00:00");
                paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        for (Date dl : dateList) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(windplant.getWindplantNo());
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(mapJhDq, generatingcapacity, DateUtil.formatDate(dl), modelCount, windplantList.size());
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    ShareController.addMapValue(mapJhDq, generatingcapacity, DateUtil.formatDate(dl), modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsDq);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dateList) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                    ShareController.addMapValue(mapSjDq, lastYcRawVal, DateUtil.formatDate(date), modelCount, windplantList.size());
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                        ShareController.addMapValue(mapSjDq, lastYcRawVal, DateUtil.formatDate(date), modelCount, windplantList.size());
                                    }
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsDq);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapYcDq, valueCount, dataTime, modelCount, windplantList.size());
                            }
                        }
                    }
                    /*短期预测发电量结束*/
                }
                /*当期数据结束*/
                /*同期数据开始*/
                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)) {
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        for (Date dl : dlTq) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(windplant.getWindplantNo());
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(mapJhTq, generatingcapacity, DateUtil.formatDate(dl), modelCount, windplantList.size());
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    ShareController.addMapValue(mapJhTq, generatingcapacity, DateUtil.formatDate(dl), modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsTq);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dlTq) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                    }
                                }
                                ShareController.addMapValue(mapSjTq, lastYcRawVal, DateUtil.formatDate(date), modelCount, windplantList.size());
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsTq);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapYcTq, valueCount, dataTime, modelCount, windplantList.size());
                            }
                        }
                    }
                    /*短期预测发电量结束*/
                }
                /*同期数据结束*/
                /*上月数据开始*/
                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)) {
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        for (Date dl : dlSy) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(windplant.getWindplantNo());
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(windplant.getWindplantNo(), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(mapJhSy, generatingcapacity, DateUtil.formatDate(dl), modelCount, windplantList.size());
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    ShareController.addMapValue(mapJhSy, generatingcapacity, DateUtil.formatDate(dl), modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsSy);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dlSy) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                    }
                                }
                                ShareController.addMapValue(mapSjSy, lastYcRawVal, DateUtil.formatDate(date), modelCount, windplantList.size());
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(windplant.getWindplantNo());
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsSy);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapYcSy, valueCount, dataTime, modelCount, windplantList.size());
                            }
                        }
                    }
                    /*短期预测发电量结束*/
                }
                /*上月数据结束*/
                modelCount++;
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                PlanpowerDistribution planpowerDistribution = planpowerDistributionService.selectPlanpowerDistributionById(Convert.toLong(stationNumber));
                /*当期数据开始*/
                Date bDTDq = DateUtil.parse(beginDataTime);
                Date eDTDq = DateUtil.offsetDay(DateUtil.parse(endDataTime), 1);
                Map<String, Object> paramsDq = new HashMap<>();
                paramsDq.put("beginDataTime", beginDataTime);
                paramsDq.put("endDataTime", DateUtil.formatDateTime(eDTDq));
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        for (Date dl : dateList) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(Convert.toLong(stationNumber));
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(Convert.toLong(stationNumber), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(mapJhDq, generatingcapacity, DateUtil.formatDate(dl), 0, 1);
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    ShareController.addMapValue(mapJhDq, generatingcapacity, DateUtil.formatDate(dl), 0, 1);
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsDq);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dateList) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                    }
                                }
                                ShareController.addMapValue(mapSjDq, lastYcRawVal, DateUtil.formatDate(date), 0, 1);
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsDq);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dateList) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapYcDq, valueCount, 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)) {
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        for (Date dl : dlTq) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(Convert.toLong(stationNumber));
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(Convert.toLong(stationNumber), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(mapJhTq, generatingcapacity, DateUtil.formatDate(dl), 0, 1);
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    ShareController.addMapValue(mapJhTq, generatingcapacity, DateUtil.formatDate(dl), 0, 1);
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsTq);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dlTq) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                    }
                                }
                                ShareController.addMapValue(mapSjTq, lastYcRawVal, DateUtil.formatDate(date), 0, 1);
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsTq);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dlTq) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapYcTq, valueCount, 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)) {
                    /*计划发电量开始*/
                    if (ObjectUtil.isNotNull(planpowerDistribution)) {
                        for (Date dl : dlSy) {
                            List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(dl), (long) DateUtil.month(dl) + 1);
                            if (projectplanList.size() > 0) {
                                double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                                if (planpowerDistribution.getType() == 1) {//1为按照去年同期实际发电量分配
                                    Map<String, Object> params1 = new HashMap<>();
                                    params1.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1)));
                                    params1.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(DateUtil.beginOfDay(dl), 14)));
                                    NoscaleWfDaPfPeriodData obj = new NoscaleWfDaPfPeriodData();
                                    obj.setWindplantNo(Convert.toLong(stationNumber));
                                    obj.setModelNo(wfFileConfig.getWpfmodelNo());
                                    obj.setParams(params1);
                                    obj.setCondition(1);
                                    List<NoscaleWfDaPfPeriodData> noscaleWfDaPfPeriodDataList = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataList(obj);
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double a = (double) 13 / (double) betweenDay * generatingcapacityCount;
                                    NoscaleWfDaPfPeriodData noscaleWfDaPfPeriodData = noscaleWfDaPfPeriodDataService.selectNoscaleWfDaPfPeriodDataByJh(Convert.toLong(stationNumber), wfFileConfig.getWpfmodelNo(), DateUtil.offsetDay(DateUtil.beginOfDay(dl), 1));
                                    double value = 0;
                                    if (ObjectUtil.isNotNull(noscaleWfDaPfPeriodData)) {
                                        if (noscaleWfDaPfPeriodData.getValue() != null) {
                                            value = noscaleWfDaPfPeriodData.getValue();
                                        }
                                    }
                                    if (noscaleWfDaPfPeriodDataList.size() > 0) {
                                        double valueCount = noscaleWfDaPfPeriodDataList.stream().mapToDouble(NoscaleWfDaPfPeriodData::getValue).sum();
                                        double b = value / valueCount;
                                        double generatingcapacity = a * b;
                                        ShareController.addMapValue(mapJhSy, generatingcapacity, DateUtil.formatDate(dl), 0, 1);
                                    }
                                } else if (planpowerDistribution.getType() == 2) {//2为平分
                                    long betweenDay = DateUtil.between(DateUtil.beginOfMonth(dl), DateUtil.endOfMonth(dl), DateUnit.DAY) + 1;
                                    double generatingcapacity = generatingcapacityCount / betweenDay;
                                    ShareController.addMapValue(mapJhSy, generatingcapacity, DateUtil.formatDate(dl), 0, 1);
                                }
                            }
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        WfYcHistoryData2 wfYcHistoryData2 = new WfYcHistoryData2();
                        wfYcHistoryData2.setAnalogNo(wpuspSvrPara.geteYcNo());
                        wfYcHistoryData2.setParams(paramsSy);
                        List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wfYcHistoryData2);
                        if (wfYcHistoryData2List.size() > 0) {
                            for (Date date : dlSy) {
                                WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(date, 1)))).findAny().orElse(null);
                                double lastYcRawVal = 0;
                                if (ObjectUtil.isNotNull(lastData)) {
                                    lastYcRawVal = lastData.getYcRawVal();
                                } else {
                                    List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(date))).collect(Collectors.toList());
                                    if (list.size() > 0) {
                                        lastYcRawVal = list.get(list.size() - 1).getYcRawVal();
                                    }
                                }
                                ShareController.addMapValue(mapSjSy, lastYcRawVal, DateUtil.formatDate(date), 0, 1);
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*短期预测发电量开始*/
                    NoscaleWfDaEfPeriodData noscaleWfDaEfPeriodData = new NoscaleWfDaEfPeriodData();
                    noscaleWfDaEfPeriodData.setWindplantNo(Convert.toLong(stationNumber));
                    //电量短期最优模型
                    noscaleWfDaEfPeriodData.setModelNo(wfFileConfig.getWpfemodelNo());
                    noscaleWfDaEfPeriodData.setParams(paramsSy);
                    List<NoscaleWfDaEfPeriodData> noscaleWfDaEfPeriodDataList = noscaleWfDaEfPeriodDataService.selectNoscaleWfDaEfPeriodDataList(noscaleWfDaEfPeriodData);
                    if (noscaleWfDaEfPeriodDataList.size() > 0) {
                        for (Date date : dlSy) {
                            String dataTime = DateUtil.formatDate(date);
                            List<NoscaleWfDaEfPeriodData> list = noscaleWfDaEfPeriodDataList.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(dataTime)).collect(Collectors.toList());
                            NoscaleWfDaEfPeriodData lastData = noscaleWfDaEfPeriodDataList.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(NoscaleWfDaEfPeriodData::getValue).sum() - list.get(0).getValue() + lastValue;
                                ShareController.addMapValue(mapYcSy, valueCount, dataTime, 0, 1);
                            }
                        }
                    }
                    /*短期预测发电量结束*/
                }
                /*上月数据结束*/
            } else if (itemVal == 4) {//光伏电站
                //暂无 后补
            }
        }
        List<TableField> tableFieldList = new ArrayList<>();
        for (Date date : dateList) {
            TableField tableField = new TableField();
            if ("-1".equals(stationNumber)) {//全域数据
                String stringDateTimeDq = DateUtil.formatDate(date);
                String stringDateTimeTq = DateUtil.formatDate(DateUtil.offset(date, DateField.YEAR, -1));
                String stringDateTimeSy = DateUtil.formatDate(DateUtil.offsetMonth(date, -1));
                tableField.setDataTime(DateUtil.formatDate(date));
                List<Double> entryJhDq = mapJhDq.get(stringDateTimeDq);
                if (entryJhDq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJhDq.size() > i && entryJhDq.get(i) != null) {
                            count += entryJhDq.get(i);
                        }
                    }
                    tableField.setVeryShortTermForecastDq(count);
                }
                List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entrySjDq.size() > i && entrySjDq.get(i) != null) {
                            count += entrySjDq.get(i);
                        }
                    }
                    tableField.setActualPowerDq(count);
                }
                List<Double> entryYcDq = mapYcDq.get(stringDateTimeDq);
                if (entryYcDq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryYcDq.size() > i && entryYcDq.get(i) != null) {
                            count += entryYcDq.get(i);
                        }
                    }
                    tableField.setShortTermForecastDq(count);
                }
                List<Double> entryJhTq = mapJhTq.get(stringDateTimeTq);
                if (entryJhTq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJhTq.size() > i && entryJhTq.get(i) != null) {
                            count += entryJhTq.get(i);
                        }
                    }
                    tableField.setVeryShortTermForecastTq(count);
                }
                List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entrySjTq.size() > i && entrySjTq.get(i) != null) {
                            count += entrySjTq.get(i);
                        }
                    }
                    tableField.setActualPowerTq(count);
                }
                List<Double> entryYcTq = mapYcTq.get(stringDateTimeTq);
                if (entryYcTq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryYcTq.size() > i && entryYcTq.get(i) != null) {
                            count += entryYcTq.get(i);
                        }
                    }
                    tableField.setShortTermForecastTq(count);
                }
                List<Double> entryJhSy = mapJhSy.get(stringDateTimeSy);
                if (entryJhSy != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJhSy.size() > i && entryJhSy.get(i) != null) {
                            count += entryJhSy.get(i);
                        }
                    }
                    tableField.setVeryShortTermForecastSy(count);
                }
                List<Double> entrySjSy = mapSjSy.get(stringDateTimeSy);
                if (entrySjSy != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entrySjSy.size() > i && entrySjSy.get(i) != null) {
                            count += entrySjSy.get(i);
                        }
                    }
                    tableField.setActualPowerSy(count);
                }
                List<Double> entryYcSy = mapYcSy.get(stringDateTimeSy);
                if (entryYcSy != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryYcSy.size() > i && entryYcSy.get(i) != null) {
                            count += entryYcSy.get(i);
                        }
                    }
                    tableField.setShortTermForecastSy(count);
                }
            } else {//各个场站数据
                String stringDateTimeDq = DateUtil.formatDate(date);
                String stringDateTimeTq = DateUtil.formatDate(DateUtil.offset(date, DateField.YEAR, -1));
                String stringDateTimeSy = DateUtil.formatDate(DateUtil.offsetMonth(date, -1));
                tableField.setDataTime(DateUtil.formatDate(date));
                List<Double> entryJhDq = mapJhDq.get(stringDateTimeDq);
                if (entryJhDq != null) {
                    tableField.setVeryShortTermForecastDq(entryJhDq.get(0));
                }
                List<Double> entrySjDq = mapSjDq.get(stringDateTimeDq);
                if (entrySjDq != null) {
                    tableField.setActualPowerDq(entrySjDq.get(0));
                }
                List<Double> entryYcDq = mapYcDq.get(stringDateTimeDq);
                if (entryYcDq != null) {
                    tableField.setShortTermForecastDq(entryYcDq.get(0));
                }
                List<Double> entryJhTq = mapJhTq.get(stringDateTimeTq);
                if (entryJhTq != null) {
                    tableField.setVeryShortTermForecastTq(entryJhTq.get(0));
                }
                List<Double> entrySjTq = mapSjTq.get(stringDateTimeTq);
                if (entrySjTq != null) {
                    tableField.setActualPowerTq(entrySjTq.get(0));
                }
                List<Double> entryYcTq = mapYcTq.get(stringDateTimeTq);
                if (entryYcTq != null) {
                    tableField.setShortTermForecastTq(entryYcTq.get(0));
                }
                List<Double> entryJhSy = mapJhSy.get(stringDateTimeSy);
                if (entryJhSy != null) {
                    tableField.setVeryShortTermForecastSy(entryJhSy.get(0));
                }
                List<Double> entrySjSy = mapSjSy.get(stringDateTimeSy);
                if (entrySjSy != null) {
                    tableField.setActualPowerSy(entrySjSy.get(0));
                }
                List<Double> entryYcSy = mapYcSy.get(stringDateTimeSy);
                if (entryYcSy != null) {
                    tableField.setShortTermForecastSy(entryYcSy.get(0));
                }
            }
            tableFieldList.add(tableField);
        }
        json.put("dataFormatList", tableFieldList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Chart-年月度发电量预测对比")
    @GetMapping("/annualMonthlyElectricityGenerationForecastComparisonChartData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult annualMonthlyElectricityGenerationForecastComparisonChartData(@RequestParam(value = "stationNumber") String stationNumber,
                                                                                    @RequestParam(value = "itemVal") int itemVal,
                                                                                    @RequestParam(value = "beginDataTime") String beginDataTime,
                                                                                    @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //筛选日期的开始时间
        Date beginOfYear = DateUtil.beginOfYear(DateUtil.parse(beginDataTime + "-01"));
        //筛选日期的结束时间
        Date endOfYear = DateUtil.endOfYear(DateUtil.parse(endDataTime + "-01"));
        //获取所有时间
        List<Date> dateList = DateTimeUtil.getMonthBetween(beginOfYear, endOfYear);
        //场站总数
        int modelCount = 0;
        //实际发电
        LinkedMultiValueMap<String, Double> mapSj = new LinkedMultiValueMap<String, Double>();
        //中长期发电
        LinkedMultiValueMap<String, Double> mapZcq = new LinkedMultiValueMap<String, Double>();
        //计划发电
        LinkedMultiValueMap<String, Double> mapJh = new LinkedMultiValueMap<String, Double>();
        if ("-1".equals(stationNumber)) {//全域数据
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            for (Windplant windplant : windplantList) {
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dateList) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSj, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSj, ycRawValCount, dataTime, modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dateList.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dateList.get(dateList.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(windplant.getWindplantNo());
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcq, l.getPfGeneratingCapacity(), dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*中长期预测发电量结束*/
                    /*计划发电量开始*/
                    for (Date date : dateList) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJh, generatingcapacityCount, dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*计划发电量结束*/
                    modelCount++;
                }
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*实际发电量开始*/
                    WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dateList) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSj, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSj, ycRawValCount, dataTime, 0, 1);
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dateList.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dateList.get(dateList.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(Convert.toLong(stationNumber));
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcq, l.getPfGeneratingCapacity(), dataTime, 0, 1);
                        }
                    }
                    /*中长期预测发电量结束*/
                    /*计划发电量开始*/
                    for (Date date : dateList) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJh, generatingcapacityCount, dataTime, 0, 1);
                        }
                    }
                    /*计划发电量结束*/
                }
            } else if (itemVal == 4) {//光伏电站
                //暂无 后补
            }
        }
        List<DataFormat> dataFormatList = new ArrayList<>();
        String[] nameStr = {"实际发电量", "中长期预测", "计划发电量"};
        int count1 = dateList.size();
        if ("-1".equals(stationNumber)) {//全域数据
            Double[] dataSj = new Double[count1];
            Double[] dataZcq = new Double[count1];
            Double[] dataJh = new Double[count1];
            for (int k = 0; k < count1; k++) {
                String dk1 = DateUtil.format(dateList.get(k), "yyyy-MM");
                List<Double> entrySj = mapSj.get(dk1);
                if (entrySj != null) {
                    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;
                }
                List<Double> entryZcq = mapZcq.get(dk1);
                if (entryZcq != null) {
                    double num = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryZcq.size() > i && entryZcq.get(i) != null) {
                            num += entryZcq.get(i);
                        }
                    }
                    dataZcq[k] = num;
                }
                List<Double> entryJh = mapJh.get(dk1);
                if (entryJh != null) {
                    double num = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJh.size() > i && entryJh.get(i) != null) {
                            num += entryJh.get(i);
                        }
                    }
                    dataJh[k] = num;
                }
            }
            DataFormat dataFormatSj = new DataFormat();
            dataFormatSj.setName(nameStr[0]);
            dataFormatSj.setData(dataSj);
            dataFormatList.add(dataFormatSj);
            DataFormat dataFormatZcq = new DataFormat();
            dataFormatZcq.setName(nameStr[1]);
            dataFormatZcq.setData(dataZcq);
            dataFormatList.add(dataFormatZcq);
            DataFormat dataFormatJh = new DataFormat();
            dataFormatJh.setName(nameStr[2]);
            dataFormatJh.setData(dataJh);
            dataFormatList.add(dataFormatJh);
        } else {//各个场站数据
            Double[] dataSj = new Double[count1];
            Double[] dataZcq = new Double[count1];
            Double[] dataJh = new Double[count1];
            for (int k = 0; k < count1; k++) {
                String dk1 = DateUtil.format(dateList.get(k), "yyyy-MM");
                List<Double> entrySj = mapSj.get(dk1);
                if (entrySj != null) {
                    if (entrySj.size() > 0) {
                        dataSj[k] = entrySj.get(0);
                    }
                }
                List<Double> entryZcq = mapZcq.get(dk1);
                if (entryZcq != null) {
                    if (entryZcq.size() > 0) {
                        dataZcq[k] = entryZcq.get(0);
                    }
                }
                List<Double> entryJh = mapJh.get(dk1);
                if (entryJh != null) {
                    if (entryJh.size() > 0) {
                        dataJh[k] = entryJh.get(0);
                    }
                }
            }
            DataFormat dataFormatSj = new DataFormat();
            dataFormatSj.setName(nameStr[0]);
            dataFormatSj.setData(dataSj);
            dataFormatList.add(dataFormatSj);
            DataFormat dataFormatZcq = new DataFormat();
            dataFormatZcq.setName(nameStr[1]);
            dataFormatZcq.setData(dataZcq);
            dataFormatList.add(dataFormatZcq);
            DataFormat dataFormatJh = new DataFormat();
            dataFormatJh.setName(nameStr[2]);
            dataFormatJh.setData(dataJh);
            dataFormatList.add(dataFormatJh);
        }
        json.put("dataFormatList", dataFormatList);
        json.put("dateList", dateList);
        return AjaxResult.success(json);
    }

    @ApiOperation("Table-年月度发电量预测对比")
    @GetMapping("/annualMonthlyElectricityGenerationForecastComparisonTableData")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationNumber", value = "场站编号(全域数据传-1,其他传主键)", required = true),
            @ApiImplicitParam(name = "itemVal", value = "场站类型", required = true),
            @ApiImplicitParam(name = "beginDataTime", value = "开始时间", required = true),
            @ApiImplicitParam(name = "endDataTime", value = "结束时间", required = true),
    })
    public AjaxResult annualMonthlyElectricityGenerationForecastComparisonTableData(@RequestParam(value = "stationNumber") String stationNumber,
                                                                                    @RequestParam(value = "itemVal") int itemVal,
                                                                                    @RequestParam(value = "beginDataTime") String beginDataTime,
                                                                                    @RequestParam(value = "endDataTime") String endDataTime) {
        JSONObject json = new JSONObject();
        //筛选日期的开始时间
        Date beginOfYear = DateUtil.beginOfYear(DateUtil.parse(beginDataTime + "-01"));
        //筛选日期的结束时间
        Date endOfYear = DateUtil.endOfYear(DateUtil.parse(endDataTime + "-01"));
        //获取所有时间
        List<Date> dateList = DateTimeUtil.getMonthBetween(beginOfYear, endOfYear);
        //场站总数
        int modelCount = 0;
        //计划发电-当期
        LinkedMultiValueMap<String, Double> mapJhDq = new LinkedMultiValueMap<String, Double>();
        //实际发电-当期
        LinkedMultiValueMap<String, Double> mapSjDq = new LinkedMultiValueMap<String, Double>();
        //中长期发电-当期
        LinkedMultiValueMap<String, Double> mapZcqDq = new LinkedMultiValueMap<String, Double>();
        //计划发电-同期
        LinkedMultiValueMap<String, Double> mapJhTq = new LinkedMultiValueMap<String, Double>();
        //实际发电-同期
        LinkedMultiValueMap<String, Double> mapSjTq = new LinkedMultiValueMap<String, Double>();
        //中长期发电-同期
        LinkedMultiValueMap<String, Double> mapZcqTq = new LinkedMultiValueMap<String, Double>();
        //计划发电-上月
        LinkedMultiValueMap<String, Double> mapJhSy = new LinkedMultiValueMap<String, Double>();
        //实际发电-上月
        LinkedMultiValueMap<String, Double> mapSjSy = new LinkedMultiValueMap<String, Double>();
        //中长期发电-上月
        LinkedMultiValueMap<String, Double> mapZcqSy = new LinkedMultiValueMap<String, Double>();
        if ("-1".equals(stationNumber)) {//全域数据
            List<Windplant> windplantList = windplantService.selectWindplantListByDlFlag();
            for (Windplant windplant : windplantList) {
                /*当期数据开始*/
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(windplant.getWindplantNo());
                WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(windplant.getWindplantNo());
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*计划发电量开始*/
                    for (Date date : dateList) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJhDq, generatingcapacityCount, dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dateList) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSjDq, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSjDq, ycRawValCount, dataTime, modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dateList.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dateList.get(dateList.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(windplant.getWindplantNo());
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcqDq, l.getPfGeneratingCapacity(), dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*中长期预测发电量结束*/
                }
                /*当期数据结束*/
                /*同期数据开始*/
                String bDTTq = DateUtil.formatDateTime(DateUtil.offset(beginOfYear, DateField.YEAR, -1));
                String eDTTq = DateUtil.formatDateTime(DateUtil.offset(endOfYear, DateField.YEAR, -1));
                List<Date> dlTq = DateTimeUtil.getMonthBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*计划发电量开始*/
                    for (Date date : dlTq) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJhTq, generatingcapacityCount, dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dlTq) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSjTq, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSjTq, ycRawValCount, dataTime, modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dlTq.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dlTq.get(dlTq.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(windplant.getWindplantNo());
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcqTq, l.getPfGeneratingCapacity(), dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*中长期预测发电量结束*/
                }
                /*同期数据结束*/
                /*上月数据开始*/
                String bDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(beginOfYear, -1));
                String eDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(endOfYear, -1));
                List<Date> dlSy = DateTimeUtil.getMonthBetween(DateUtil.parse(bDTSy), DateUtil.parse(eDTSy));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*计划发电量开始*/
                    for (Date date : dlSy) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(windplant.getWindplantNo(), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJhSy, generatingcapacityCount, dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dlSy) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSjSy, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSjSy, ycRawValCount, dataTime, modelCount, windplantList.size());
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dlSy.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dlSy.get(dlSy.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(windplant.getWindplantNo());
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcqSy, l.getPfGeneratingCapacity(), dataTime, modelCount, windplantList.size());
                        }
                    }
                    /*中长期预测发电量结束*/
                }
                /*上月数据结束*/
                modelCount++;
            }
            List<PvPowerStation> pvPowerStationList = pvPowerStationService.selectPvPowerStationList(new PvPowerStation());
            for (PvPowerStation pvPowerStation : pvPowerStationList) {
                //暂无 后补
            }
        } else {//各个场站数据
            if (itemVal == 0) {//风电场
                /*当期数据开始*/
                WfFileConfig wfFileConfig = wfFileConfigService.selectWfFileConfigById(Convert.toLong(stationNumber));
                WpuspSvrPara wpuspSvrPara = wpuspSvrParaService.selectWpuspSvrParaById(Convert.toLong(stationNumber));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*计划发电量开始*/
                    for (Date date : dateList) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJhDq, generatingcapacityCount, dataTime, 0, 1);
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dateList) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSjDq, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSjDq, ycRawValCount, dataTime, 0, 1);
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dateList.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dateList.get(dateList.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(Convert.toLong(stationNumber));
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcqDq, l.getPfGeneratingCapacity(), dataTime, 0, 1);
                        }
                    }
                    /*中长期预测发电量结束*/
                }
                /*当期数据结束*/
                /*同期数据开始*/
                String bDTTq = DateUtil.formatDateTime(DateUtil.offset(beginOfYear, DateField.YEAR, -1));
                String eDTTq = DateUtil.formatDateTime(DateUtil.offset(endOfYear, DateField.YEAR, -1));
                List<Date> dlTq = DateTimeUtil.getMonthBetween(DateUtil.parse(bDTTq), DateUtil.parse(eDTTq));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*计划发电量开始*/
                    for (Date date : dlTq) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJhTq, generatingcapacityCount, dataTime, 0, 1);
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dlTq) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSjTq, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSjTq, ycRawValCount, dataTime, 0, 1);
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dlTq.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dlTq.get(dlTq.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(Convert.toLong(stationNumber));
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcqTq, l.getPfGeneratingCapacity(), dataTime, 0, 1);
                        }
                    }
                    /*中长期预测发电量结束*/
                }
                /*同期数据结束*/
                /*上月数据开始*/
                String bDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(beginOfYear, -1));
                String eDTSy = DateUtil.formatDateTime(DateUtil.offsetMonth(endOfYear, -1));
                List<Date> dlSy = DateTimeUtil.getMonthBetween(DateUtil.parse(bDTSy), DateUtil.parse(eDTSy));
                if (ObjectUtil.isNotNull(wfFileConfig)) {
                    /*计划发电量开始*/
                    for (Date date : dlSy) {
                        List<Projectplan> projectplanList = projectplanService.selectProjectplan(Convert.toLong(stationNumber), (long) DateUtil.year(date), (long) DateUtil.month(date) + 1);
                        if (projectplanList.size() > 0) {
                            double generatingcapacityCount = projectplanList.stream().mapToDouble(Projectplan::getGeneratingcapacity).sum();
                            String dataTime = DateUtil.format(date, "yyyy-MM");
                            ShareController.addMapValue(mapJhSy, generatingcapacityCount, dataTime, 0, 1);
                        }
                    }
                    /*计划发电量结束*/
                    /*实际发电量开始*/
                    if (ObjectUtil.isNotNull(wpuspSvrPara)) {
                        for (Date date : dlSy) {
                            WfYcHistoryData2 wfYcHistoryData2 = wfYcHistoryData2Service.selectWfYcHistoryData2(wpuspSvrPara.getMeYcNo(), DateUtil.offsetMonth(date, 1));
                            if (ObjectUtil.isNotNull(wfYcHistoryData2)) {
                                String dataTime = DateUtil.format(date, "yyyy-MM");
                                ShareController.addMapValue(mapSjSy, wfYcHistoryData2.getYcRawVal(), dataTime, 0, 1);
                            } else {
                                Date beginOfMonth = DateUtil.beginOfMonth(date);
                                Date endOfMonth = DateUtil.offsetDay(DateUtil.date(DateUtil.endOfMonth(date).getTime() + 1000), -1);
                                Map<String, Object> params = new HashMap<>();
                                params.put("beginDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(beginOfMonth, 1)));
                                params.put("endDataTime", DateUtil.formatDateTime(DateUtil.offsetDay(endOfMonth, 1)));
                                WfYcHistoryData2 wyhd = new WfYcHistoryData2();
                                wyhd.setAnalogNo(wpuspSvrPara.geteYcNo());
                                wyhd.setParams(params);
                                List<WfYcHistoryData2> wfYcHistoryData2List = wfYcHistoryData2Service.selectWfYcHistoryData2List(wyhd);
                                if (wfYcHistoryData2List.size() > 0) {
                                    double ycRawValCount = 0;
                                    List<Date> dList = DateTimeUtil.getDayBetween(beginOfMonth, endOfMonth);
                                    for (Date d1 : dList) {
                                        WfYcHistoryData2 lastData = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDateTime(item.getDataTime()).equals(DateUtil.formatDateTime(DateUtil.offsetDay(d1, 1)))).findAny().orElse(null);
                                        if (ObjectUtil.isNotNull(lastData)) {
                                            ycRawValCount += lastData.getYcRawVal();
                                        } else {
                                            List<WfYcHistoryData2> list = wfYcHistoryData2List.stream().filter(item -> DateUtil.formatDate(item.getDataTime()).equals(DateUtil.formatDate(d1))).collect(Collectors.toList());
                                            if (list.size() > 0) {
                                                ycRawValCount += list.get(list.size() - 1).getYcRawVal();
                                            }
                                        }
                                    }
                                    String dataTime = DateUtil.format(date, "yyyy-MM");
                                    ShareController.addMapValue(mapSjSy, ycRawValCount, dataTime, 0, 1);
                                }
                            }
                        }
                    }
                    /*实际发电量结束*/
                    /*中长期预测发电量开始*/
                    Map<String, Object> params = new HashMap<>();
                    params.put("beginDataTime", DateUtil.formatDateTime(dlSy.get(0)));
                    params.put("endDataTime", DateUtil.formatDateTime(dlSy.get(dlSy.size() - 1)));
                    LpWfMonthData lpWfMonthData = new LpWfMonthData();
                    lpWfMonthData.setWfNo(Convert.toLong(stationNumber));
                    lpWfMonthData.setParams(params);
                    List<LpWfMonthData> lpWfMonthDataList = lpWfMonthDataService.selectLpWfMonthDataList(lpWfMonthData);
                    if (lpWfMonthDataList.size() > 0) {
                        for (LpWfMonthData l : lpWfMonthDataList) {
                            String dataTime = DateUtil.format(l.getDataTime(), "yyyy-MM");
                            ShareController.addMapValue(mapZcqSy, l.getPfGeneratingCapacity(), dataTime, 0, 1);
                        }
                    }
                    /*中长期预测发电量结束*/
                }
                /*上月数据结束*/
            } else if (itemVal == 4) {//光伏电站
                //暂无 后补
            }
        }
        List<TableField> tableFieldList = new ArrayList<>();
        for (Date date : dateList) {
            TableField tableField = new TableField();
            if ("-1".equals(stationNumber)) {//全域数据
                String dkDq = DateUtil.format(date, "yyyy-MM");
                String dkTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM");
                String dkSy = DateUtil.format(DateUtil.offsetMonth(date, -1), "yyyy-MM");
                tableField.setDataTime(DateUtil.formatDate(date));
                List<Double> entryJhDq = mapJhDq.get(dkDq);
                if (entryJhDq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJhDq.size() > i && entryJhDq.get(i) != null) {
                            count += entryJhDq.get(i);
                        }
                    }
                    tableField.setVeryShortTermForecastDq(count);
                }
                List<Double> entrySjDq = mapSjDq.get(dkDq);
                if (entrySjDq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entrySjDq.size() > i && entrySjDq.get(i) != null) {
                            count += entrySjDq.get(i);
                        }
                    }
                    tableField.setActualPowerDq(count);
                }
                List<Double> entryZcqDq = mapZcqDq.get(dkDq);
                if (entryZcqDq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryZcqDq.size() > i && entryZcqDq.get(i) != null) {
                            count += entryZcqDq.get(i);
                        }
                    }
                    tableField.setShortTermForecastDq(count);
                }
                List<Double> entryJhTq = mapJhTq.get(dkTq);
                if (entryJhTq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJhTq.size() > i && entryJhTq.get(i) != null) {
                            count += entryJhTq.get(i);
                        }
                    }
                    tableField.setVeryShortTermForecastTq(count);
                }
                List<Double> entrySjTq = mapSjTq.get(dkTq);
                if (entrySjTq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entrySjTq.size() > i && entrySjTq.get(i) != null) {
                            count += entrySjTq.get(i);
                        }
                    }
                    tableField.setActualPowerTq(count);
                }
                List<Double> entryZcqTq = mapZcqTq.get(dkTq);
                if (entryZcqTq != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryZcqTq.size() > i && entryZcqTq.get(i) != null) {
                            count += entryZcqTq.get(i);
                        }
                    }
                    tableField.setShortTermForecastTq(count);
                }
                List<Double> entryJhSy = mapJhSy.get(dkSy);
                if (entryJhSy != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryJhSy.size() > i && entryJhSy.get(i) != null) {
                            count += entryJhSy.get(i);
                        }
                    }
                    tableField.setVeryShortTermForecastSy(count);
                }
                List<Double> entrySjSy = mapSjSy.get(dkSy);
                if (entrySjSy != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entrySjSy.size() > i && entrySjSy.get(i) != null) {
                            count += entrySjSy.get(i);
                        }
                    }
                    tableField.setActualPowerSy(count);
                }
                List<Double> entryZcqSy = mapZcqSy.get(dkSy);
                if (entryZcqSy != null) {
                    double count = 0;
                    for (int i = 0; i < modelCount; i++) {
                        if (entryZcqSy.size() > i && entryZcqSy.get(i) != null) {
                            count += entryZcqSy.get(i);
                        }
                    }
                    tableField.setShortTermForecastSy(count);
                }
            } else {//各个场站数据
                String dkDq = DateUtil.format(date, "yyyy-MM");
                String dkTq = DateUtil.format(DateUtil.offset(date, DateField.YEAR, -1), "yyyy-MM");
                String dkSy = DateUtil.format(DateUtil.offsetMonth(date, -1), "yyyy-MM");
                tableField.setDataTime(DateUtil.formatDate(date));
                List<Double> entryJhDq = mapJhDq.get(dkDq);
                if (entryJhDq != null) {
                    tableField.setVeryShortTermForecastDq(entryJhDq.get(0));
                }
                List<Double> entrySjDq = mapSjDq.get(dkDq);
                if (entrySjDq != null) {
                    tableField.setActualPowerDq(entrySjDq.get(0));
                }
                List<Double> entryZcqDq = mapZcqDq.get(dkDq);
                if (entryZcqDq != null) {
                    tableField.setShortTermForecastDq(entryZcqDq.get(0));
                }
                List<Double> entryJhTq = mapJhTq.get(dkTq);
                if (entryJhTq != null) {
                    tableField.setVeryShortTermForecastTq(entryJhTq.get(0));
                }
                List<Double> entrySjTq = mapSjTq.get(dkTq);
                if (entrySjTq != null) {
                    tableField.setActualPowerTq(entrySjTq.get(0));
                }
                List<Double> entryZcqTq = mapZcqTq.get(dkTq);
                if (entryZcqTq != null) {
                    tableField.setShortTermForecastTq(entryZcqTq.get(0));
                }
                List<Double> entryJhSy = mapJhSy.get(dkSy);
                if (entryJhSy != null) {
                    tableField.setVeryShortTermForecastSy(entryJhSy.get(0));
                }
                List<Double> entrySjSy = mapSjSy.get(dkSy);
                if (entrySjSy != null) {
                    tableField.setActualPowerSy(entrySjSy.get(0));
                }
                List<Double> entryZcqSy = mapZcqSy.get(dkSy);
                if (entryZcqSy != null) {
                    tableField.setShortTermForecastSy(entryZcqSy.get(0));
                }
            }
            tableFieldList.add(tableField);
        }
        json.put("dataFormatList", tableFieldList);
        return AjaxResult.success(json);
    }
}
