package com.gyee.generation;

import com.gyee.generation.service.InitialRedisService;
import com.gyee.generation.service.InputOrOutPutService;
import com.gyee.generation.service.WindPowerInfo5UpdateService;
import com.gyee.generation.util.SpringUtils;
import org.springframework.boot.SpringApplication;

import java.util.Calendar;

public class HealthTest {


    public static void main(String[] args) throws Exception {
        SpringApplication.run(GenerationMain.class, args);
        InputOrOutPutService inputOrOutPutService = SpringUtils.getBean("inputOrOutPutService");
        InitialRedisService initialRedisService = SpringUtils.getBean("initialRedisService");

        WindPowerInfo5UpdateService windPowerInfo5UpdateService = SpringUtils.getBean("windPowerInfo5UpdateService");


        Calendar c = Calendar.getInstance();
        c.set(Calendar.DAY_OF_MONTH, 24);
        c.set(Calendar.MONTH, 0);

        ////        windPowerInfo5UpdateService.calLineInfoDay(c.getTime());
        //        windPowerInfo5UpdateService.calProjectInfoDay(c.getTime());
        //        windPowerInfo5UpdateService.calWindpowerInfoDay(c.getTime());
        //
        //        windPowerInfo5UpdateService.calWindpowerInfoDayCurry();
        //        windPowerInfo5UpdateService.calProjectInfoDayCurry();
        //        inputOrOutPutService.initialInputOrOutputSpeed();
        //        Calendar c = Calendar.getInstance();
        //        Date begin=null;
        //        Date end=null;
        //        CacheService cacheService= SpringUtils.getBean("cacheService");
        //        cacheService.initRedisCache();
        //
        System.out.println("完成!。。。。。。");
        //
        //
        //
        //        //
        //        System.out.println("故障转换率记录调度程序执行开始!。。。。。。");
        //        TimelinessRateService timelinessRateService = SpringUtils.getBean("timelinessRateService");
        //        timelinessRateService.failRate(c.getTime());
        //        System.out.println("故障转换率记录调度程序执行结束!。。。。。。");
        //
        //        begin=new Date();
        //        System.out.println("切15分钟数据统计记录调度程序执行开始!。。。。。。");
        //        EquipmentInfo15minuteService equipmentInfo15minuteService = SpringUtils.getBean("equipmentInfo15minuteService");
        //        equipmentInfo15minuteService.calEquipmentInfo15minute(c.getTime());
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("切15分钟数据统计记录记录调度程序执行结束!。。。。。。");
        //
        //


        //        List<ProBasicEquipment> wtls= CacheContext.wpwtmap.get("SXJ_KGDL_GJY_FDC_STA");
        //        List<ProBasicEquipment> wtls= new ArrayList<>();
        //        for(ProBasicPowerstation wp: CacheContext.wpls)
        //        {
        //            if(wp.getId().contains("FDC"))
        //            {
        //                wtls.addAll(CacheContext.wpwtmap.get(wp.getId()));
        //            }
        //        }

        //        List<ProBasicEquipment> wtls= CacheContext.wpwtmap.get("SXJ_KGDL_GJY_FDC_STA");
        //
        //        while (true)
        //        {
        //            begin=new Date();
        //            System.out.println("切入切出状态切换记录调度程序执行开始!。。。。。。");
        //            inputOrOutPutService.inputOrOutputSpeed(c.getTime());
        //            end=new Date();
        //            System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //            System.out.println("切入切出状态切换记录调度程序执行结束!。。。。。。");
        //        }
        //
        //
        //        begin=new Date();
        //        System.out.println("初始化散点图调度程序执行开始!。。。。。。");
        //
        //
        //        initialRedisService.intialWtScatter();
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("初始化散点图度程序执行结束!。。。。。。");
        //
        //
        //        begin=new Date();
        //        System.out.println("切入切出统计调度程序执行开始!。。。。。。");
        //
        //
        //        inputOrOutPutService.inputOrOutput(c.getTime());
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("切入切出统计调度程序执行结束!。。。。。。");
        //
        //
        //
        //        begin=new Date();
        //        System.out.println("停机记录调度程序执行开始!。。。。。。");
        //        ShutdownnewService shutdownnewService= SpringUtils.getBean("shutdownnewService");
        //
        //        shutdownnewService.execShutdown(c.getTime());
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("停机记录调度程序执行结束!。。。。。。");
        //
        //
        //        begin=new Date();
        //        System.out.println("限电停机记录调度程序执行开始!。。。。。。");
        //        LimitEventnewService limitEventnewService= SpringUtils.getBean("limitEventnewService");
        ////
        //
        //       List<ProBasicPowerstation> wpls=new ArrayList<>();
        //
        ////        ProBasicPowerstation wp=  CacheContext.wpmap.get("SXJ_KGDL_GJY_FDC_STA");
        ////       wpls.add(wp);
        ////        List<ProBasicEquipment> wtls=CacheContext.wpwtmap.get("SXJ_KGDL_GJY_FDC_STA");
        //        limitEventnewService.execBrownouts(c.getTime());
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("限电停机记录调度程序执行结束!。。。。。。");
        //
        //
        //        begin=new Date();
        //        System.out.println("曲线拟合调度程序执行开始!。。。。。。");
        //        PowerCurveFittingByTimeService powerCurveFittingByTimeService= SpringUtils.getBean("powerCurveFittingByTimeService");
        ////
        ////        XxlJobHelper.log("日序执行开始!........");
        ////        powerCurveFittingByTimeService.cureFittingDay(c.getTime(),"SXJ_KGDL_XWT_FDC_STA");
        ////        XxlJobHelper.log("日处理完成!........");
        //
        ////
        //        XxlJobHelper.log("月序执行开始!........");
        //        powerCurveFittingByTimeService.cureFittingMonth(c.getTime(), "0", "SXJ_KGDL_XWT_FDC_STA");
        //        XxlJobHelper.log("月处理完成!........");
        ////
        ////        XxlJobHelper.log("年序执行开始!........");
        ////        powerCurveFittingByTimeService.cureFittingYear(c.getTime());
        ////        XxlJobHelper.log("年处理完成!........");
        ////
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("曲线拟合调度程序执行结束!。。。。。。");
        //
        //
        //        c.set(Calendar.DAY_OF_MONTH,1);
        //        begin=new Date();
        //        System.out.println("场站指标记录调度程序执行开始!。。。。。。");
        //        WindPowerInfo1Service windPowerInfo1Service= SpringUtils.getBean("windPowerInfo1Service");
        //        WindPowerInfo2Service windPowerInfo2Service= SpringUtils.getBean("windPowerInfo2Service");
        //        WindPowerInfo3Service windPowerInfo3Service= SpringUtils.getBean("windPowerInfo3Service");
        //        WindPowerInfo4Service windPowerInfo4Service= SpringUtils.getBean("windPowerInfo4Service");
        //        WindPowerInfo5Service windPowerInfo5Service= SpringUtils.getBean("windPowerInfo5Service");
        //        WindPowerInfo6Service windPowerInfo6Service= SpringUtils.getBean("windPowerInfo6Service");
        //        for(int i=0;i<20;i++)
        //        {
        //        windPowerInfo1Service.calLineInfoDay(c.getTime());
        //        windPowerInfo1Service.calProjectInfoDay(c.getTime());
        //        windPowerInfo1Service.calWindpowerInfoDay(c.getTime());
        //        windPowerInfo1Service.calCompanyInfoDay(c.getTime());
        //        windPowerInfo1Service.calRegionInfoDay(c.getTime());
        //
        //        windPowerInfo2Service.calLineInfoDay(c.getTime());
        //        windPowerInfo2Service.calProjectInfoDay(c.getTime());
        //        windPowerInfo2Service.calWindpowerInfoDay(c.getTime());
        //        windPowerInfo2Service.calCompanyInfoDay(c.getTime());
        //        windPowerInfo2Service.calRegionInfoDay(c.getTime());
        //
        //        windPowerInfo3Service.calLineInfoDay(c.getTime());
        //        windPowerInfo3Service.calProjectInfoDay(c.getTime());
        //        windPowerInfo3Service.calWindpowerInfoDay(c.getTime());
        //        windPowerInfo3Service.calCompanyInfoDay(c.getTime());
        //        windPowerInfo3Service.calRegionInfoDay(c.getTime());
        //
        //        windPowerInfo4Service.calLineInfoDay(c.getTime());
        //        windPowerInfo4Service.calProjectInfoDay(c.getTime());
        //        windPowerInfo4Service.calWindpowerInfoDay(c.getTime());
        //        windPowerInfo4Service.calCompanyInfoDay(c.getTime());
        //        windPowerInfo4Service.calRegionInfoDay(c.getTime());
        //
        //        windPowerInfo5Service.calLineInfoDay(c.getTime());
        //        windPowerInfo5Service.calProjectInfoDay(c.getTime());
        //        windPowerInfo5Service.calWindpowerInfoDay(c.getTime());
        //        windPowerInfo5Service.calCompanyInfoDay(c.getTime());
        //        windPowerInfo5Service.calRegionInfoDay(c.getTime());
        //
        //        windPowerInfo6Service.calLineInfoDay(c.getTime());
        //        windPowerInfo6Service.calProjectInfoDay(c.getTime());
        //        windPowerInfo6Service.calWindpowerInfoDay(c.getTime());
        //        windPowerInfo6Service.calCompanyInfoDay(c.getTime());
        //        windPowerInfo6Service.calRegionInfoDay(c.getTime());
        //           c.add(Calendar.DAY_OF_MONTH,1);
        //
        //            System.out.println("完成一次!。。。。。。");
        //        }
        ////
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("场站指标记录调度程序执行结束!。。。。。。");
        //
        //
        //
        //
        //        c.set(Calendar.DAY_OF_MONTH,23);
        //
        //        c.setTime(DateUtils.truncate(c.getTime()));
        //        EquipmentInfo2Service equipmentInfo2Service= SpringUtils.getBean("equipmentInfo2Service");
        //        EquipmentInfo3Service equipmentInfo3Service= SpringUtils.getBean("equipmentInfo3Service");
        //        EquipmentInfo4Service equipmentInfo4Service= SpringUtils.getBean("equipmentInfo4Service");
        //        begin=new Date();
        //        System.out.println("设备指标记录调度程序执行开始!。。。。。。");
        //        for(int i=0;i<1;i++)
        //        {

        //            equipmentInfo1Service.calEquipmentInfoDay(c.getTime());
        //            equipmentInfo2Service.calEquipmentInfoDay(c.getTime());
        //
        //            equipmentInfo3Service.calEquipmentInfoDay(c.getTime());
        //            equipmentInfo4Service.calEquipmentInfoDay(c.getTime());
        //
        //
        //
        //            equipmentInfo5Service.calEquipmentInfoDay(c.getTime());
        //
        //            equipmentInfo4Service.calEquipmentInfoDay(c.getTime());
        //
        //            equipmentInfoDayTopService.calEquipmentInfoDayTop(c.getTime());
        //            equipmentInfoDayTopService.calEquipmentInfoMonthTop(c.getTime());
        //            equipmentInfoDayTopService.calEquipmentInfoYearTop(c.getTime());
        //
        //            wtAlysisDayService.calEquipmentInfoDay(c.getTime());
        //
        //            c.add(Calendar.DAY_OF_MONTH,1);
        //
        //            System.out.println("完成一次!。。。。。。");
        //        }
        //
        //
        //
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("设备指标记录调度程序执行结束!。。。。。。");
        //
        //
        //
        //
        //       c.set(Calendar.DAY_OF_MONTH,19);
        //
        //        c.setTime(DateUtils.truncate(c.getTime()));
        //
        //        begin=new Date();
        //        System.out.println("功率一致性系数和拟合优度调度程序执行开始!。。。。。。");
        ////        for(int i=0;i<3;i++)
        ////        {
        //
        //
        //
        //            System.out.println(DateUtils.format(c.getTime(),"yyyy-MM-dd HH:mm:ss").toString());
        //            WindturbineGoodnessService windturbineGoodnessService= SpringUtils.getBean("windturbineGoodnessService");
        //
        //            windturbineGoodnessService.calWindturbineGoodness(c.getTime());
        //
        //
        //            c.add(Calendar.DAY_OF_MONTH,1);
        //
        //           System.out.println("完成一次!。。。 。。。");
        ////        }
        //
        //
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("功率一致性系数和拟合优度调度程序执行结束!。。。。。。");
        //
        //        begin=new Date();
        //        System.out.println("功率一致性系数和拟合优度调度程序执行开始!。。。。。。");
        //        WindturbineGoodnessService windturbineGoodnessService= SpringUtils.getBean("windturbineGoodnessService");
        //
        //        windturbineGoodnessService.calWindturbineGoodness(c.getTime());
        //        end=new Date();
        //        System.out.println("执行用时"+ com.gyee.generation.util.DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("功率一致性系数和拟合优度调度程序执行结束!。。。。。。");
        //
        //        c.add(Calendar.DAY_OF_MONTH,-1);
        //        begin=new Date();
        //        System.out.println("设备数据和场站数据风资源调度程序执行开始!。。。。。。");
        //        WpwindDayInfoService wpwindDayInfoService= SpringUtils.getBean("wpwindDayInfoService");
        //        //WtwindDayInfoService wtwindDayInfoService= SpringUtils.getBean("wtwindDayInfoService");
        //        wpwindDayInfoService.calWpwindDayInfo(c.getTime());
        //       // wtwindDayInfoService.calWtwindDayInfo(c.getTime());
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("设备数据和场站数据风资源调度程序执行结束!。。。。。。");
        //
        //
        //
        //        PowerCurveFittingModelService powerCurveFittingModelService= SpringUtils.getBean("powerCurveFittingModelService");
        //
        //        begin=new Date();
        //        System.out.println("保证功率拟合程序执行开始!。。。。。。");
        //
        //        List<String> keyls=new ArrayList<>();
        //
        //        keyls.add("AE-500-50-PV-X-HV");
        //        keyls.add("EA500KM-M");
        //        keyls.add("PVS-800-57-100KW-A");
        //        keyls.add("SG1250UD");
        //        keyls.add("SG136TX");
        //        keyls.add("SG500KTL");
        //        keyls.add("SG500MX");
        //        keyls.add("SG50KTL");
        //        keyls.add("SG50KTL-M");
        //        keyls.add("SG60KTL-M");
        //        keyls.add("SG630KTL");
        //        keyls.add("SG630MX");
        //        keyls.add("SG630-MX");
        //        keyls.add("SGI-500KTL");
        //        keyls.add("SSL500");
        //        keyls.add("SUN2000-125KTL-MO");
        //        keyls.add("SUN2000-28KTL");
        //        keyls.add("Sunny Central 500HE");
        //        keyls.add("TS80KTL-PLUS");
        //
        //
        //        powerCurveFittingModelService.cureFittingModel(keyls);
        //        end=new Date();
        //        System.out.println("执行用时"+ DateUtils.secondsDiff(begin,end) +"秒");
        //        System.out.println("保证功率拟合程序执行结束!。。。。。。");
    }

}
