package com.gyee.generation.task;


import com.gyee.common.util.DateUtils;
import com.gyee.generation.service.*;
import com.gyee.generation.service.StationPower.StationPowerService;
import com.gyee.generation.service.auto.IProEconAnalysisSubtableBottomService;
import com.gyee.generation.util.SpringUtils;
import com.gyee.generation.util.math.AvailablePowerAccuracyCalculator;
import com.gyee.generation.util.math.PowerPredictionErrorCalculator;
import com.gyee.generation.util.math.ShortTermPowerPredictionAccuracyCalculator;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @ClassName : SaticScheduleTask
 * @Description : 调度
 */


@Component
public class SaticSchedulePgTask {

    private static Logger logger = LoggerFactory.getLogger(SaticSchedulePgTask.class);

    @Resource
    private InputOrOutPutService inputOrOutPutService;
    @Resource
    private LimitEventnewService limitEventnewService;
    @Resource
    private PowerCurveFittingByTimeService powerCurveFittingByTimeService;
    @Resource
    private ShutdownnewService shutdownnewService;
    @Resource
    private WindPowerInfo1Service windPowerInfo1Service;
    @Resource
    private WindPowerInfo2Service windPowerInfo2Service;
    @Resource
    private WindPowerInfo3Service windPowerInfo3Service;
    @Resource
    private WindPowerInfo4Service windPowerInfo4Service;
    @Resource
    private WindPowerInfo5Service windPowerInfo5Service;
    @Resource
    private WindPowerInfo6Service windPowerInfo6Service;
    @Resource
    private EquipmentInfo1Service equipmentInfo1Service;
    @Resource
    private EquipmentInfo2Service equipmentInfo2Service;
    @Resource
    private EquipmentInfo3Service equipmentInfo3Service;
    @Resource
    private EquipmentInfo4Service equipmentInfo4Service;
    @Resource
    private EquipmentInfo5Service equipmentInfo5Service;
    @Resource
    private EquipmentInfoDayTopService equipmentInfoDayTopService;

    @Resource
    private WindturbineGoodnessService windturbineGoodnessService;

    @Resource
    private WtAlysisDayService wtAlysisDayService;

    @Resource
    private WpwindDayInfoService wpwindDayInfoService;

    @Resource
    private WtwindDayInfoService wtwindDayInfoService;

    @Resource
    private PowerCurveFittingByTimeGfService powerCurveFittingByTimeGfService;


    @Resource
    private EquipmentInfo15minuteService equipmentInfo15minuteService;

    @Resource
    private TimelinessRateService timelinessRateService;
    @Resource
    private WindDeviationService windDeviationService;


    @Resource
    private InitialRedisService initialRedisService;

    @Resource
    private ShortTermPowerPredictionAccuracyCalculator shortTermPowerPredictionAccuracyCalculator;

    @Resource
    private StationPowerService powerService;

    @Resource
    private AnalysisNewService analysisNewService;


    @Resource
    private WindPowerInfo5UpdateService windPowerInfo5UpdateService;

    @Resource
    private IProEconAnalysisSubtableBottomService iProEconAnalysisSubtableBottomService;


    @XxlJob("windPowerInfo5Update")
    public void windPowerInfo5Update() {


        XxlJobHelper.log("同步电计量电量调度程序执行开始!........");
        try {
            Calendar c = Calendar.getInstance();
            windPowerInfo5UpdateService.calProjectInfoDay(c.getTime());
            windPowerInfo5UpdateService.calWindpowerInfoDay(c.getTime());

            windPowerInfo5UpdateService.calWindpowerInfoDayCurry();
            windPowerInfo5UpdateService.calProjectInfoDayCurry();
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("同步电计量电量调度任务处理完成!........");
    }

    /**
     * 缓存Redis散点图数据
     * 每天执行一次
     */

    @XxlJob("initialRedis_PG")
    public void initialRedis_PG() {


        XxlJobHelper.log("缓存Redis散点图数据调度程序执行开始!........");
        try {
            //            initialRedisService.initialRedisAll();
            initialRedisService.intialWtScatter();
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("缓存Redis散点图数据调度任务处理完成!........");
    }


    /**
     * 故障转换率
     * 每15钟执行一次
     */

    @XxlJob("calFailRate_PG")
    public void calFailRate_PG() {


        XxlJobHelper.log("故障转换率记录调度程序执行开始!........");
        try {
            timelinessRateService.failRate(new Date());
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("故障转换率记录调度任务处理完成!........");
    }

    //3.添加定时任务

    /**
     * 15分钟数据统计
     * 每15分钟执行一次
     */

    @XxlJob("calEquipmentInfo15minute_PG")
    public void calEquipmentInfo15minute_PG() {


        XxlJobHelper.log("15分钟数据统计记录调度程序执行开始!........");
        try {
            equipmentInfo15minuteService.calEquipmentInfo15minute(new Date());
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("15分钟数据统计记录调度任务处理完成!........");
    }

    //3.添加定时任务

    /**
     * 切入切出统计
     * 每5分钟执行一次
     */

    @XxlJob("inputOrOutPutSpeed_PG")
    public void inputOrOutPutSpeed_PG() {


        XxlJobHelper.log("切入切出状态切换记录调度程序执行开始!........");
        try {
            inputOrOutPutService.inputOrOutputSpeed(new Date());
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("切入切出状态切换记录调度任务处理完成!........");
    }

    //3.添加定时任务

    /**
     * 切入切出统计
     * 每天1点执行一次
     */

    @XxlJob("inputOrOutPut_PG")
    public void inputOrOutPut_PG() {


        XxlJobHelper.log("切入切出统计调度程序执行开始!........");
        try {
            inputOrOutPutService.inputOrOutput(new Date());
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("切入切出统计调度任务处理完成!........");
    }

    /**
     * 停机记录
     * 每5分钟执行一次
     */
    @XxlJob("shutdown_PG")
    public void shutdown_PG() {

        XxlJobHelper.log("停机记录调度程序执行开始!........");

        try {
            while (true) {
                Date begin = new Date();
                System.out.println("停机记录调度程序执行开始!。。。。。。");

                shutdownnewService.execShutdown(new Date());


                Date end = new Date();
                System.out.println("执行用时" + DateUtils.secondsDiff(begin, end) + "秒");
                System.out.println("停机记录调度调度程序执行结束!。。。。。。");

                Thread.sleep(2000);
            }


        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("停机记录调度任务处理完成!........");
    }

    /**
     * 限电停机记录
     * 每5分钟执行一次
     */
    @XxlJob("brownouts_PG")
    public void brownouts_PG() {

        XxlJobHelper.log("限电停机记录调度程序执行开始!........");

        try {
            limitEventnewService.execBrownouts(new Date());

        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("限电停机记录调度任务处理完成!........");
    }

    /**
     * 日、月、年功率曲线拟合
     * 每天执行一次
     */
        @XxlJob("powerCurveFittingnew_PG")
        public void powerCurveFittingnew_PG()  {

            XxlJobHelper.log("日、月、年功率曲线拟合调度程序执行开始!........");

            Date date=new Date();
            try {
//                XxlJobHelper.log("日序执行开始!........");
//                powerCurveFittingByTimeService.cureFittingDay(date);
//                XxlJobHelper.log("日处理完成!........");

                XxlJobHelper.log("月序执行开始!........");
                powerCurveFittingByTimeService.cureFittingMonth(date,"0",null);
                XxlJobHelper.log("月处理完成!........");

//                XxlJobHelper.log("年序执行开始!........");
//                powerCurveFittingByTimeService.cureFittingYear(date);
//                XxlJobHelper.log("年处理完成!........");

    //            powerCurveFittingByTimeGfService.cureFittingDay(date);
//                powerCurveFittingByTimeGfService.cureFittingMonth(date,"0");
    //            powerCurveFittingByTimeGfService.cureFittingYear(date);



            } catch (Exception e) {
                e.printStackTrace();
                XxlJobHelper.log(e.getMessage());
            }

            XxlJobHelper.log("日、月、年功率曲线拟合调度任务处理完成!........");
        }


    /**
     * 惠安风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_NX_FGS_HA_FDC_STA")
    public void shutdown_NX_FGS_HA_FDC_STA() {

        XxlJobHelper.log("惠安风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "NX_FGS_HA_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "NX_FGS_HA_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            XxlJobHelper.log("年序执行开始!........");
            powerCurveFittingByTimeService.cureFittingYear(date, "NX_FGS_HA_FDC_STA");
            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }

        XxlJobHelper.log("惠安风电场功率预测调度任务处理完成!........");
    }


    /**
     * 平鲁高家堰风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_GJY_FDC_STA")
    public void shutdown_SXJ_KGDL_GJY_FDC_STA() {

        XxlJobHelper.log("平鲁高家堰风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_GJY_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_GJY_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_GJY_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }

        XxlJobHelper.log("平鲁高家堰风电场功率预测调度任务处理完成!........");
    }

    /**
     * 平鲁败虎堡风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_BHB_FDC_STA")
    public void shutdown_SXJ_KGDL_BHB_FDC_STA() {

        XxlJobHelper.log("平鲁败虎堡风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_BHB_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_BHB_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_BHB_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("平鲁败虎堡风电场功率预测调度任务处理完成!........");
    }

    /**
     * 平鲁红石峁风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_HSM_FDC_STA")
    public void shutdown_SXJ_KGDL_HSM_FDC_STA() {

        XxlJobHelper.log("平鲁红石峁风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_HSM_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_HSM_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_HSM_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("平鲁红石峁风电场功率预测调度任务处理完成!........");
    }

    /**
     * 寿阳羊头崖风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_YTY_FDC_STA")
    public void shutdown_SXJ_KGDL_YTY_FDC_STA() {

        XxlJobHelper.log("寿阳羊头崖风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_YTY_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_YTY_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_YTY_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("寿阳羊头崖风电场功率预测调度任务处理完成!........");
    }


    /**
     * 平鲁败虎堡三期风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_BHB3_FDC_STA")
    public void shutdown_SXJ_KGDL_BHB3_FDC_STA() {

        XxlJobHelper.log("平鲁败虎堡三期风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_BHB3_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_BHB3_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_BHB3_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("平鲁败虎堡三期风电场功率预测调度任务处理完成!........");
    }


    /**
     * 宁武盘道梁风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_PDL_FDC_STA")
    public void shutdown_SXJ_KGDL_PDL_FDC_STA() {

        XxlJobHelper.log("宁武盘道梁风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_PDL_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_PDL_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_PDL_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("宁武盘道梁风电场功率预测调度任务处理完成!........");
    }

    /**
     * 朔城区牛家岭风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_NJL_FDC_STA")
    public void shutdown_SXJ_KGDL_NJL_FDC_STA() {

        XxlJobHelper.log("朔城区牛家岭风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_NJL_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_NJL_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_NJL_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("朔城区牛家岭风电场功率预测调度任务处理完成!........");
    }


    /**
     * 寿阳尹灵芝风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_YLZ_FDC_STA")
    public void shutdown_SXJ_KGDL_YLZ_FDC_STA() {

        XxlJobHelper.log("寿阳尹灵芝风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_YLZ_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_YLZ_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_YLZ_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }

        XxlJobHelper.log("寿阳尹灵芝风电场功率预测调度任务处理完成!........");
    }


    /**
     * 平鲁禹丰风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_YF_FDC_STA")
    public void shutdown_SXJ_KGDL_YF_FDC_STA() {

        XxlJobHelper.log("平鲁禹丰风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_YF_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_YF_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_YF_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("平鲁禹丰风电场功率预测调度任务处理完成!........");
    }

    /**
     * 寿阳平头镇风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_PTZ_FDC_STA")
    public void shutdown_SXJ_KGDL_PTZ_FDC_STA() {

        XxlJobHelper.log("寿阳平头镇风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_PTZ_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_PTZ_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_PTZ_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("寿阳平头镇风电场功率预测调度任务处理完成!........");
    }

    /**
     * 右玉小五台风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_XWT_FDC_STA")
    public void shutdown_SXJ_KGDL_XWT_FDC_STA() {

        XxlJobHelper.log("右玉小五台风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_XWT_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_XWT_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_XWT_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("右玉小五台风电场功率预测调度任务处理完成!........");
    }


    /**
     * 右玉丁家窑风电场功率预测
     * 每天一次
     */
    @XxlJob("shutdown_SXJ_KGDL_DJY_FDC_STA")
    public void shutdown_SXJ_KGDL_DJY_FDC_STA() {

        XxlJobHelper.log("右玉丁家窑风电场功率预测调度程序执行开始!........");

        Date date = new Date();
        try {
            XxlJobHelper.log("日序执行开始!........");
            powerCurveFittingByTimeService.cureFittingDay(date, "SXJ_KGDL_DJY_FDC_STA");
            XxlJobHelper.log("日处理完成!........");

            XxlJobHelper.log("月序执行开始!........");
            powerCurveFittingByTimeService.cureFittingMonth(date, "0", "SXJ_KGDL_DJY_FDC_STA");
            XxlJobHelper.log("月处理完成!........");

            //            XxlJobHelper.log("年序执行开始!........");
            //            powerCurveFittingByTimeService.cureFittingYear(date, "SXJ_KGDL_DJY_FDC_STA");
            //            XxlJobHelper.log("年处理完成!........");


        } catch (Exception e) {
            e.printStackTrace();
            XxlJobHelper.log(e.getMessage());
        }
        XxlJobHelper.log("右玉丁家窑风电场功率预测调度任务处理完成!........");
    }

    /**
     * 场站1表
     * 15分钟只执行一次
     */
    @XxlJob("windPowerInfo1_PG")
    public void windPowerInfo1_PG() throws Exception {

        XxlJobHelper.log("场站指标1调度程序执行开始!........");

        Date date = new Date();

        windPowerInfo1Service.calLineInfoDay(date);
        windPowerInfo1Service.calProjectInfoDay(date);
        windPowerInfo1Service.calWindpowerInfoDay(date);
        windPowerInfo1Service.calCompanyInfoDay(date);
        windPowerInfo1Service.calRegionInfoDay(date);

        XxlJobHelper.log("场站指标1指标调度程序执行完成!........");

    }


    /**
     * 场站2表
     * 15分钟只执行一次
     */
    @XxlJob("windPowerInfo2_PG")
    public void windPowerInfo2_PG() throws Exception {

        XxlJobHelper.log("场站指标2调度程序执行开始!........");

        Date date = new Date();

        windPowerInfo2Service.calLineInfoDay(date);
        windPowerInfo2Service.calProjectInfoDay(date);
        windPowerInfo2Service.calWindpowerInfoDay(date);
        windPowerInfo2Service.calCompanyInfoDay(date);
        windPowerInfo2Service.calRegionInfoDay(date);

        XxlJobHelper.log("场站指标2指标调度程序执行完成!........");

    }


    /**
     * 场站3表
     * 15分钟只执行一次
     */
    @XxlJob("windPowerInfo3_PG")
    public void windPowerInfo3_PG() throws Exception {

        XxlJobHelper.log("场站指标3调度程序执行开始!........");

        Date date = new Date();

        windPowerInfo3Service.calLineInfoDay(date);
        windPowerInfo3Service.calProjectInfoDay(date);
        windPowerInfo3Service.calWindpowerInfoDay(date);
        windPowerInfo3Service.calCompanyInfoDay(date);
        windPowerInfo3Service.calRegionInfoDay(date);

        XxlJobHelper.log("场站指标3指标调度程序执行完成!........");

    }

    /**
     * 场站4表
     * 15分钟只执行一次
     */
    @XxlJob("windPowerInfo4_PG")
    public void windPowerInfo4_PG() throws Exception {

        XxlJobHelper.log("场站指标4调度程序执行开始!........");

        Date date = new Date();

        windPowerInfo4Service.calLineInfoDay(date);
        windPowerInfo4Service.calProjectInfoDay(date);
        windPowerInfo4Service.calWindpowerInfoDay(date);
        windPowerInfo4Service.calCompanyInfoDay(date);
        windPowerInfo4Service.calRegionInfoDay(date);

        XxlJobHelper.log("场站指标4指标调度程序执行完成!........");

    }

    /**
     * 场站5表
     * 15分钟只执行一次
     */
    @XxlJob("windPowerInfo5_PG")
    public void windPowerInfo5_PG() throws Exception {

        XxlJobHelper.log("场站指标5调度程序执行开始!........");

        Date date = new Date();

        windPowerInfo5Service.calLineInfoDay(date);
        windPowerInfo5Service.calProjectInfoDay(date);
        windPowerInfo5Service.calWindpowerInfoDay(date);
        windPowerInfo5Service.calCompanyInfoDay(date);
        windPowerInfo5Service.calRegionInfoDay(date);

        XxlJobHelper.log("场站指标5指标调度程序执行完成!........");

    }


    /**
     * 场站6表
     * 15分钟只执行一次
     */
    @XxlJob("windPowerInfo6_PG")
    public void windPowerInfo6_PG() throws Exception {

        XxlJobHelper.log("场站指标6调度程序执行开始!........");

        Date date = new Date();

        windPowerInfo6Service.calLineInfoDay(date);
        windPowerInfo6Service.calProjectInfoDay(date);
        windPowerInfo6Service.calWindpowerInfoDay(date);
        windPowerInfo6Service.calCompanyInfoDay(date);
        windPowerInfo6Service.calRegionInfoDay(date);

        XxlJobHelper.log("场站指标6指标调度程序执行完成!........");

    }

    /**
     * 设备1-5表
     * 15分钟只执行一次
     */
    @XxlJob("equipment_PowerInfo1_PG")
    public void equipment_PowerInfo1_PG() throws Exception {

        XxlJobHelper.log("设备指标1调度程序执行开始!........");

        Date date = new Date();


        equipmentInfo1Service.calEquipmentInfoDay(date);


        XxlJobHelper.log("设备指标1调度程序执行完成!........");

    }

    /**
     * 设备2表
     * 15分钟只执行一次
     */
    @XxlJob("equipment_PowerInfo2_PG")
    public void equipment_PowerInfo2_PG() throws Exception {

        XxlJobHelper.log("设备指标2调度程序执行开始!........");

        Date date = new Date();

        equipmentInfo2Service.calEquipmentInfoDay(date);


        XxlJobHelper.log("设备指标2调度程序执行完成!........");

    }


    /**
     * 设备3表
     * 15分钟只执行一次
     */
    @XxlJob("equipment_PowerInfo3_PG")
    public void equipment_PowerInfo3_PG() throws Exception {

        XxlJobHelper.log("设备指标3调度程序执行开始!........");

        Date date = new Date();


        equipmentInfo3Service.calEquipmentInfoDay(date);


        XxlJobHelper.log("设备指标3调度程序执行完成!........");

    }


    /**
     * 设备3表
     * 15分钟只执行一次
     */
    @XxlJob("equipment_PowerInfo4_PG")
    public void equipment_PowerInfo4_PG() throws Exception {

        XxlJobHelper.log("设备指标4调度程序执行开始!........");

        Date date = new Date();


        equipmentInfo4Service.calEquipmentInfoDay(date);


        XxlJobHelper.log("设备指标调度4程序执行完成!........");

    }

    /**
     * 设备5表
     * 15分钟只执行一次
     */
    @XxlJob("equipment_PowerInfo5_PG")
    public void equipment_PowerInfo5_PG() throws Exception {

        XxlJobHelper.log("设备指标5调度程序执行开始!........");

        Date date = new Date();


        equipmentInfo5Service.calEquipmentInfoDay(date);


        XxlJobHelper.log("设备指标调度5程序执行完成!........");

    }


    /**
     * 风电设备调度
     * 执行一次
     */
    @XxlJob("equipment_PowerInfoAll_FD")
    public void equipment_PowerInfoAll_FD() throws Exception {

        XxlJobHelper.log("风电设备调度调度程序执行开始!........");

        Calendar c = Calendar.getInstance();


        while (true) {

            Date begin = new Date();
            Date end = null;
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            System.out.println(df.format(c.getTime()).toString());


            EquipmentInfo1Service equipmentInfo1Service = SpringUtils.getBean("equipmentInfo1Service");
            EquipmentInfo2Service equipmentInfo2Service = SpringUtils.getBean("equipmentInfo2Service");
            EquipmentInfo3Service equipmentInfo3Service = SpringUtils.getBean("equipmentInfo3Service");

            EquipmentInfo5Service equipmentInfo5Service = SpringUtils.getBean("equipmentInfo5Service");
            EquipmentInfo4Service equipmentInfo4Service = SpringUtils.getBean("equipmentInfo4Service");

            equipmentInfo1Service.calEquipmentInfoDay(begin);
            equipmentInfo2Service.calEquipmentInfoDay(begin);
            equipmentInfo3Service.calEquipmentInfoDay(begin);

            equipmentInfo5Service.calEquipmentInfoDay(begin);
            equipmentInfo4Service.calEquipmentInfoDay(begin);


            end = new Date();
            System.out.println(end);
            System.out.println("完成一次!。。。。。。");
            System.out.println("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");
            Thread.sleep(200);
        }

    }


    /**
     * 光伏设备调度
     * 执行一次
     */
    @XxlJob("equipment_PowerInfoAll_GD")
    public void equipment_PowerInfoAll_GD() throws Exception {

        XxlJobHelper.log("风电设备调度调度程序执行开始!........");

        Calendar c = Calendar.getInstance();


        while (true) {

            Date begin = new Date();
            Date end = null;
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            System.out.println(df.format(c.getTime()).toString());


            EquipmentInfo1Service equipmentInfo1Service = SpringUtils.getBean("equipmentInfo1Service");
            EquipmentInfo2Service equipmentInfo2Service = SpringUtils.getBean("equipmentInfo2Service");
            EquipmentInfo3Service equipmentInfo3Service = SpringUtils.getBean("equipmentInfo3Service");


            equipmentInfo1Service.calEquipmentInfoDay(begin);
            equipmentInfo2Service.calEquipmentInfoDay(begin);
            equipmentInfo3Service.calEquipmentInfoDay(begin);


            end = new Date();
            System.out.println(end);
            System.out.println("完成一次!。。。。。。");
            System.out.println("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");

            Thread.sleep(200);
        }

    }

    /**
     * 等级评估统计
     * 每天执行一次
     */

    @XxlJob("equipmentInfoDayTop_PG")
    public void equipmentInfoDayTop_PG() {


        XxlJobHelper.log("等级评估统计调度程序执行开始!........");
        try {
            equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
            equipmentInfoDayTopService.calEquipmentInfoMonthTop(new Date());
            equipmentInfoDayTopService.calEquipmentInfoYearTop(new Date());
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("等级评估统计调度任务处理完成!........");
    }

    /**
     * 功率一致性系数和拟合优度
     * 每天2点执行一次
     */

    @XxlJob("windturbineGoodness_PG")
    public void windturbineGoodness_PG() {


        XxlJobHelper.log("功率一致性系数和拟合优度统计调度程序执行开始!........");
        try {
            windturbineGoodnessService.calWindturbineGoodness(new Date());
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("功率一致性系数和拟合优度统计调度任务处理完成!........");
    }


    @XxlJob("wtAlysisDay_PG")
    public void wtAlysisDay_PG() {


        XxlJobHelper.log("分析数据统计调度程序执行开始!........");
        try {
            wtAlysisDayService.calEquipmentInfoDay(new Date());
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("分析数据统计调度任务处理完成!........");
    }

    /**
     * 设备风资源统计调度
     * 每天2点执行一次
     */
    @XxlJob("wtwindDayInfo_PG")
    public void wtwindDayInfo_PG() {


        XxlJobHelper.log("设备风资源统计调度程序执行开始!........");
        try {
            wpwindDayInfoService.calWpwindDayInfo(new Date());
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("设备风资源统计调度任务处理完成!........");
    }

    /**
     * 场站风资源统计调度
     * 每天2点执行一次
     */
    @XxlJob("wpwindDayInfo_PG")
    public void wpwindDayInfo_PG() {


        XxlJobHelper.log("场站风资源统计调度程序执行开始!........");
        try {
            wtwindDayInfoService.calWtwindDayInfo(new Date());
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("场站风资源统计调度任务处理完成!........");
    }

    /**
     * 对风偏差率
     * 每日0点15执行
     */

    @XxlJob("calWindDeviation_PG")
    public void calWindDeviation_PG() {


        XxlJobHelper.log("对风偏差率调度程序执行开始!........");
        String yesterdayStr = DateUtils.getYesterdayStr("yyyy-MM-dd");
        try {
            windDeviationService.save(yesterdayStr, yesterdayStr);
        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("对风偏差率调度任务处理完成!........");
    }


    //    /**
    //     * 天镇光电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_TZ_GDC_STA")
    //    public void shutdown_SXJ_KGDL_TZ_GDC_STA()  {
    //
    //        XxlJobHelper.log("天镇光电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_TZ_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("天镇光电站停机记录调度任务处理完成!........");
    //    }
    //
    //
    //    /**
    //     * 平遥朱坑风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_ZK_FDC_STA")
    //    public void shutdown_SXJ_KGDL_ZK_FDC_STA()  {
    //
    //        XxlJobHelper.log("平遥朱坑风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_ZK_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("平遥朱坑风电场停机记录调度任务处理完成!........");
    //    }
    //
    //
    //    /**
    //     * 山阴荣新光电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_SY_GDC_STA")
    //    public void shutdown_SXJ_KGDL_SY_GDC_STA()  {
    //
    //        XxlJobHelper.log("山阴荣新光电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_SY_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("山阴荣新光电站停机记录调度任务处理完成!........");
    //    }
    //
    //
    //    /**
    //     * 平鲁高家堰风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_GJY_FDC_STA")
    //    public void shutdown_SXJ_KGDL_GJY_FDC_STA()  {
    //
    //        XxlJobHelper.log("平鲁高家堰风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_GJY_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("平鲁高家堰风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 平鲁败虎堡风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_BHB_FDC_STA")
    //    public void shutdown_SXJ_KGDL_BHB_FDC_STA()  {
    //
    //        XxlJobHelper.log("平鲁败虎堡风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_BHB_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("平鲁败虎堡风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 平鲁红石峁风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_HSM_FDC_STA")
    //    public void shutdown_SXJ_KGDL_HSM_FDC_STA()  {
    //
    //        XxlJobHelper.log("平鲁红石峁风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_HSM_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("平鲁红石峁风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 寿阳羊头崖风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_YTY_FDC_STA")
    //    public void shutdown_SXJ_KGDL_YTY_FDC_STA()  {
    //
    //        XxlJobHelper.log("寿阳羊头崖风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_YTY_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("寿阳羊头崖风电场停机记录调度任务处理完成!........");
    //    }
    //
    //
    //    /**
    //     * 平鲁败虎堡三期风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_BHB3_FDC_STA")
    //    public void shutdown_SXJ_KGDL_BHB3_FDC_STA()  {
    //
    //        XxlJobHelper.log("平鲁败虎堡三期风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_BHB3_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("平鲁败虎堡三期风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 繁峙均然光伏电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_JR_GDC_STA")
    //    public void shutdown_SXJ_KGDL_JR_GDC_STA()  {
    //
    //        XxlJobHelper.log("繁峙均然光伏电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_JR_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("繁峙均然光伏电站停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 宁武盘道梁风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_PDL_FDC_STA")
    //    public void shutdown_SXJ_KGDL_PDL_FDC_STA()  {
    //
    //        XxlJobHelper.log("宁武盘道梁风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_PDL_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("宁武盘道梁风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 朔城区牛家岭风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_NJL_FDC_STA")
    //    public void shutdown_SXJ_KGDL_NJL_FDC_STA()  {
    //
    //        XxlJobHelper.log("朔城区牛家岭风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_NJL_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("朔城区牛家岭风电场停机记录调度任务处理完成!........");
    //    }
    //
    //
    //    /**
    //     * 寿阳尹灵芝风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_YLZ_FDC_STA")
    //    public void shutdown_SXJ_KGDL_YLZ_FDC_STA()  {
    //
    //        XxlJobHelper.log("寿阳尹灵芝风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_YLZ_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("寿阳尹灵芝风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 阳高蔚家堡光伏电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_YG_GDC_STA")
    //    public void shutdown_SXJ_KGDL_YG_GDC_STA()  {
    //
    //        XxlJobHelper.log("阳高蔚家堡光伏电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_YG_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("阳高蔚家堡光伏电站停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 平鲁禹丰风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_YF_FDC_STA")
    //    public void shutdown_SXJ_KGDL_YF_FDC_STA()  {
    //
    //        XxlJobHelper.log("平鲁禹丰风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_YF_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("平鲁禹丰风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 寿阳平头镇风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_PTZ_FDC_STA")
    //    public void shutdown_SXJ_KGDL_PTZ_FDC_STA()  {
    //
    //        XxlJobHelper.log("寿阳平头镇风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_PTZ_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("寿阳平头镇风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 右玉小五台风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_XWT_FDC_STA")
    //    public void shutdown_SXJ_KGDL_XWT_FDC_STA()  {
    //
    //        XxlJobHelper.log("右玉小五台风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_XWT_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("右玉小五台风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 方山孙家山光伏电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_FS_GDC_STA")
    //    public void shutdown_SXJ_KGDL_FS_GDC_STA()  {
    //
    //        XxlJobHelper.log("方山孙家山光伏电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_FS_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("方山孙家山光伏电站停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 右玉丁家窑风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_DJY_FDC_STA")
    //    public void shutdown_SXJ_KGDL_DJY_FDC_STA()  {
    //
    //        XxlJobHelper.log("右玉丁家窑风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_DJY_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("右玉丁家窑风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 怀仁初晨光伏电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_HR_GDC_STA")
    //    public void shutdown_SXJ_KGDL_HR_GDC_STA()  {
    //
    //        XxlJobHelper.log("怀仁初晨光伏电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_HR_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("怀仁初晨光伏电站停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 应县晶辉光伏电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_YX_GDC_STA")
    //    public void shutdown_SXJ_KGDL_YX_GDC_STA()  {
    //
    //        XxlJobHelper.log("应县晶辉光伏电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_YX_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("应县晶辉光伏电站停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 右玉右卫光伏电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_YY_GDC_STA")
    //    public void shutdown_SXJ_KGDL_YY_GDC_STA()  {
    //
    //        XxlJobHelper.log("右玉右卫光伏电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_YY_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("右玉右卫光伏电站停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 平鲁阻虎光伏电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_PL_GDC_STA")
    //    public void shutdown_SXJ_KGDL_PL_GDC_STA()  {
    //
    //        XxlJobHelper.log("平鲁阻虎光伏电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_PL_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("平鲁阻虎光伏电站停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 内蒙米粮局风电场停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_NMM_KGDL_MLJ_FDC_STA")
    //    public void shutdown_NMM_KGDL_MLJ_FDC_STA()  {
    //
    //        XxlJobHelper.log("内蒙米粮局风电场停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"NMM_KGDL_MLJ_FDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("内蒙米粮局风电场停机记录调度任务处理完成!........");
    //    }
    //
    //    /**
    //     * 屯留吾元光伏电站停机记录
    //     * 每两秒执行一次
    //     */
    //    @XxlJob("shutdown_SXJ_KGDL_TL_GDC_STA")
    //    public void shutdown_SXJ_KGDL_TL_GDC_STA()  {
    //
    //        XxlJobHelper.log("屯留吾元光伏电站停机记录调度程序执行开始!........");
    //
    //        try {
    //            shutdownnewService.execShutdown(new Date(),"SXJ_KGDL_TL_GDC_STA");
    //
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("屯留吾元光伏电站停机记录调度任务处理完成!........");
    //    }

    /**
     * 短期功率预测精度计算
     * 每两秒执行一次
     */
    @XxlJob("shorttermpowerpredictionaccuracycalculator")
    public void shorttermpowerpredictionaccuracycalculator() {

        XxlJobHelper.log("短期功率预测精度计算调度程序执行开始!........");

        try {


            // 输入数据
            double[] predictedPower = {};
            { /* 96个点的预测功率值 */ }
            ;
            double[] actualPower = {};
            { /* 96个点的实际功率值 */ }
            ;
            double installedCapacity = 0; /* 装机容量 */
            ;

            // 计算准确率
            double accuracy = shortTermPowerPredictionAccuracyCalculator.calculateAccuracy(predictedPower, actualPower, installedCapacity);

            // 输出结果
            System.out.println("超短期预测曲线准确率: " + accuracy + "%");

        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("短期功率预测精度计算调度程序处理完成!........");

    }


    /**
     * 功率预测错误计算
     * 每两秒执行一次
     */
    @XxlJob("powerpredictionerrorcalculator ")
    public void powerpredictionerrorcalculator() {

        XxlJobHelper.log("功率预测错误计算调度程序执行开始!........");

        try {

            // 输入数据
            double[] predictedPower = { /* 96个点的预测功率值 */};
            double[] actualPower = { /* 96个点的实际功率值 */};
            double installedCapacity = 0; /* 装机容量 */

            double maxErrorPercentage = PowerPredictionErrorCalculator.calculateMaxErrorPercentage(predictedPower, actualPower, installedCapacity);

            // 输出结果
            System.out.println("日预测曲线最大误差值: " + maxErrorPercentage + "%");

        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("功率预测错误计算调度程序处理完成!........");
    }


    /**
     * 可用功率精度计算
     * 每两秒执行一次
     */
    @XxlJob("availablepoweraccuracycalculator ")
    public void availablepoweraccuracycalculator() {

        XxlJobHelper.log("可用功率精度计算调度程序执行开始!........");

        try {

            // 输入数据
            double actualGeneration = 0; /* 当日新能源场站非限电时段实际发电量 */
            ;
            double availablePower = 0; /* 当日新能源场站非限电时段可用电量 */
            ;
            double installedCapacity = 0;/* 全场装机容量 */
            ;

            // 计算日准确率
            double accuracy = AvailablePowerAccuracyCalculator.calculateAccuracy(actualGeneration, availablePower);

            // 输出结果
            System.out.println("可用电量的日准确率: " + accuracy + "%");

            // 计算考核分数
            double score = AvailablePowerAccuracyCalculator.calculateAssessmentScore(accuracy, installedCapacity);

            // 输出考核分数
            System.out.println("考核分数: " + score + "分/万千瓦");


        } catch (Exception e) {
            e.printStackTrace();
        }
        XxlJobHelper.log("可用功率精度计算调度程序处理完成!........");
    }

    //    @XxlJob("PredictedPowerccuracy")
    //    public void Powerccuracy() {
    //
    //
    //        XxlJobHelper.log("预测功率准确率计算执行开始!........");
    //        try {
    //            powerService.predictedPower();
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("预测功率准确率计算执行开始!........");
    //    }
    //
    //
    //    @XxlJob("companysjs")
    //    public void companysjs() {
    //
    //
    //        XxlJobHelper.log("底码计算执行开始!........");
    //        try {
    //            analysisNewService.companys();
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("底码计算计算执行开始!........");
    //    }
    //
    //    @XxlJob("saveWindProjectjs")
    //    public void saveWindProjectjs() {
    //
    //
    //        XxlJobHelper.log("底码电量计算执行开始!........");
    //        try {
    //            analysisNewService.saveWindProject();
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("底码电量计算执行开始!........");
    //    }
    //
    //    @XxlJob("irradiationjs")
    //    public void irradiation() {
    //
    //
    //        XxlJobHelper.log("日照强度替换计算执行开始!........");
    //        try {
    //            irradiationinputService.getcockpit();
    //        } catch (Exception e) {
    //            e.printStackTrace();
    //        }
    //        XxlJobHelper.log("日照强度替换计算执行开始!........");
    //    }




    /**
     * 光伏数据写入
     */
    @XxlJob("ndgfzb")
    public void ndgfzb() throws Exception {

        Date date = new Date();
        windPowerInfo1Service.writeGf(date);
//        date.setTime(1743004500000L);
//        windPowerInfo1Service.writeGfHistory(date);


    }

    @XxlJob("report_ha_windturbine")
    public void reportHaWindturbine() throws Exception {

        Date date = new Date();
        windPowerInfo1Service.writeHaWindturbine(date);
//        date.setTime(1742486400000L);
//        windPowerInfo1Service.writeHaWindturbineHistory(date);

    }

    /**
     * 一/二期风机运行参数
     */
    @XxlJob("report_info1")
    public void reportInfo1() throws Exception {

        Date date = new Date();
        windPowerInfo1Service.writeReport1(date);
//        windPowerInfo1Service.writeReportHistory(date);

    }

    /**
     * 风电场设备运行参数
     */
    @XxlJob("report_info2")
    public void reportInfo2() throws Exception {

        Date date = new Date();
        windPowerInfo1Service.writeReport2(date);
//        windPowerInfo1Service.writeReportHistory2(date);

    }


    /**
     * 风电场设备运行参数
     */
    @XxlJob("report_info3")
    public void reportInfo3() throws Exception {

        Date date = new Date();
        windPowerInfo1Service.writeReport3(date);
//        windPowerInfo1Service.writeReportHistory3(date);
    }

}
