package test;

import com.gyee.SpringbootStart;
import com.gyee.frame.common.domain.AjaxResult;
import com.gyee.frame.common.spring.SpringUtils;
import com.gyee.frame.controller.leaderboard.LeaderboardController;
import com.gyee.frame.model.auto.Curvefittingmonthmain;
import com.gyee.frame.model.custom.Tablepar;
import lombok.SneakyThrows;
import org.springframework.boot.SpringApplication;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class LeaderboardTest {

    @SneakyThrows
    public static void main(String[] args) {

        SpringApplication.run(SpringbootStart.class, args);


        Calendar c = Calendar.getInstance();

        c.set(Calendar.HOUR_OF_DAY, 0);
        c.set(Calendar.MINUTE, 0);
        c.set(Calendar.SECOND, 0);

        c.set(Calendar.DAY_OF_MONTH,2);
        c.set(Calendar.MONTH,0);
        c.set(Calendar.YEAR,2021);

        Date beginDate = c.getTime();
        c.add(Calendar.DAY_OF_MONTH,1);
        Date endDate = c.getTime();

        String wtid="MG01_01,MG01_02,MG01_03,MG01_04,MG01_05";
        String wpid="MHS_FDC";
        LeaderboardController leaderboardController= SpringUtils.getBean("leaderboardController");
//
//        AjaxResult ajaxResult = dayBenchmarkingController.gadaylist(wpid,"2021-01-01");
//
//        List<Windturbineinfodaytop3> test=(List<Windturbineinfodaytop3>)ajaxResult.get("data");

        Tablepar tablepar=new Tablepar();
        tablepar.setPageNum(1);
        tablepar.setPageSize(10);
        tablepar.setOrderByColumn(null);
        tablepar.setIsAsc(null);

//        AjaxResult ajaxResult =leaderboardController.fittingtoplist(tablepar,null,beginDate,endDate);
//
//        List<StatisticalAnalysisTopVo>   test=(List<StatisticalAnalysisTopVo>)ajaxResult.get("data");
//        for(StatisticalAnalysisTopVo wtd:test)
//        {
//            System.out.println(wtd.getFrequency()+"----------------"+wtd.getPower()+"----------------"+wtd.getSpeed());
//        }

//        AjaxResult ajaxResult =leaderboardController.loadfactortoplist(tablepar,"-1","MHS_FDC","2021-01-01","2021-01-03");
//        AjaxResult ajaxResult =leaderboardController.querywarningStatistical(tablepar,"1","2021-01-01","2021-01-03");
//
//        AjaxResult ajaxResult1 =leaderboardController.querywarningStatistical(tablepar,"2","2021-01-01","2021-01-03");
////        AjaxResult ajaxResult2 =leaderboardController.querywarningStatistical(tablepar,"3","2021-01-01","2021-01-03");
//
//        List<StatisticalAnalysisTopVo> test2=(List<StatisticalAnalysisTopVo>)ajaxResult1.get("data");
//        for(StatisticalAnalysisTopVo wtd:test2)
//        {
//            System.out.println(wtd.getWindfarm()+"----------------"+wtd.getPower()+"----------------"+wtd.getSpeed());
//        }

//        AjaxResult ajaxResult =leaderboardController.utilizationList(tablepar,null,"2021-01-01","2021-01-03","0");
//
//        List<Windturbineinfoday3> test2=(List<Windturbineinfoday3>)ajaxResult.get("data");
//        for(Windturbineinfoday3 wtd:test2)
//        {
//            System.out.println(wtd.getDaydl2()+"----------------"+wtd.getDaylldl()+"----------------"+wtd.getDayspeed());
//        }


//        AjaxResult ajaxResult =leaderboardController.querywarningStatistical(tablepar,"1",beginDate,endDate);
//
//        List<StatisticalAnalysisWarningTopVo> test=(List<StatisticalAnalysisWarningTopVo>)ajaxResult.get("data");
//        for(StatisticalAnalysisWarningTopVo wtd:test)
//        {
//            System.out.println(wtd.getFrequency()+"----------------"+wtd.getFrequencyday()+"----------------"+wtd.getTotalhours());
//        }
//
//
//         AjaxResult  ajaxResult2 =leaderboardController.querywarningStatisticalPie("1",beginDate,endDate);
//
//        List<StatisticalAnalysisWarningTopVo>   test2=(List<StatisticalAnalysisWarningTopVo>)ajaxResult2.get("data");
//        for(StatisticalAnalysisWarningTopVo wtd:test2)
//        {
//            System.out.println(wtd.getFrequency()+"----------------"+wtd.getFrequencyday()+"----------------"+wtd.getTotalhours());
//        }
//
//
//        AjaxResult ajaxResult =leaderboardController.curvefittingmainList(tablepar,wpid,"2021-01-01");
//
//        List<Curvefittingmain> test=(List<Curvefittingmain>)ajaxResult.get("data");
//        for(Curvefittingmain wtd:test)
//        {
//            System.out.println(wtd.getDeviationrate1()+"----------------"+wtd.getDeviationrate2()+"----------------"+wtd.getDeviationrate3());
//        }
//
//
//        AjaxResult  ajaxResult2 =leaderboardController.getCurvechatAjax("sjbz","MG01_01","2021-01-01");
//
//
//        Map<String, Object> map=(Map<String, Object>)ajaxResult2.get("data");
//        List<DataVo> datavos =(List<DataVo>)map.get("datas");
//        for(DataVo wtd:datavos)
//        {
//            System.out.println(wtd.getValue1()+"----------------"+wtd.getValue2()+"----------------"+wtd.getValue3());
//        }
//
//
//        AjaxResult ajaxResult3 =leaderboardController.curvefittingmonthmainList(tablepar,  "MHS_FDC",  "2021", "1");
//
//
//        List<Curvefittingmonthmain> list=(List<Curvefittingmonthmain>)ajaxResult3.get("data");
//
//        for(Curvefittingmonthmain wtd:list)
//        {
//            System.out.println(wtd.getDeviationrate1()+"----------------"+wtd.getDeviationrate2()+"----------------"+wtd.getDeviationrate3());
//        }

       AjaxResult ajaxResult4 =leaderboardController.curveMonthchatAjaxbg("bg",  "XG01_53",  "2021", "06");


        List<Curvefittingmonthmain> list2=(List<Curvefittingmonthmain>)ajaxResult4.get("data");

        for(Curvefittingmonthmain wtd:list2)
        {
            System.out.println(wtd.getDeviationrate1()+"----------------"+wtd.getDeviationrate2()+"----------------"+wtd.getDeviationrate3());
        }

    }




}
