package test;

import com.gyee.SpringbootStart;
import com.gyee.frame.common.spring.SpringUtils;
import com.gyee.frame.controller.goodness.WindturbineDetailLineChartController;
import com.gyee.frame.model.custom.Tablepar;
import lombok.SneakyThrows;
import org.springframework.boot.SpringApplication;

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

public class GoodnessTest {

    @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 date = c.getTime();

        String wpid = "MHS_FDC";
        String wtid = "MG01_02";

//        WindturbinegoodnessController windturbinegoodnessController= SpringUtils.getBean("windturbinegoodnessController");
        WindturbineDetailLineChartController windturbineDetailLineChartController = SpringUtils.getBean("windturbineDetailLineChartController");

////
//
//        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);

//        AjaxResult ajaxResult =windturbinegoodnessController.windturbinegoodness(tablepar,wtid,"2021-01-02");
//
//        PageInfo<Windturbinegoodness> test=(PageInfo<Windturbinegoodness>)ajaxResult.get("data");
//
//        for(Windturbinegoodness wtd:test.getList())
//        {
//            System.out.println(wtd.getDaytop()+"----------------"+wtd.getDaygoodness()+"----------------"+wtd.getDayspeed());
//        }

//        AjaxResult ajaxResult =windturbineGoodnessDetailController.wadAjax(wtid,"2021-01-02");
//
//        Windturbineanalysisday wtd=(Windturbineanalysisday)ajaxResult.get("data");
//
//        System.out.println(wtd.getWindturbineid()+"----------------"+wtd.getC1()+"----------------"+wtd.getC2());
//
//        AjaxResult ajaxResult =windturbineGoodnessDetailController.bjphlist(tablepar,wtid,"2021-01-01","2021-01-04");
//
//        List<StatisticalAnalysisWarningTopVo> test=( List<StatisticalAnalysisWarningTopVo> )ajaxResult.get("data");
//
//        for(StatisticalAnalysisWarningTopVo wtd:test)
//        {
//            System.out.println(wtd.getFrequency()+"----------------"+wtd.getName()+"----------------"+wtd.getName());
//        }
//
//
//
//        WindturbineDetailLineChartController windturbineDetailLineChartController= SpringUtils.getBean("windturbineDetailLineChartController");
//
//        AjaxResult ajaxResult1 =windturbineDetailLineChartController.bjjllist(tablepar,wtid,"2021-01-01","2021-01-04");
//
//        PageInfo<WarningRecords> test1=(PageInfo<WarningRecords>)ajaxResult1.get("data");
//
//        for(WarningRecords wtd:test1.getList())
//        {
//            System.out.println(wtd.getWarningtime()+"----------------"+wtd.getWindturbineid()+"----------------"+wtd.getWarnDesc());
//        }
//
//        AjaxResult ajaxResult2 =windturbineDetailLineChartController.gzjllist(tablepar,wtid,"2021-01-01","2021-01-04");
//
//        PageInfo<ShutdowneventVo> test2=(PageInfo<ShutdowneventVo>)ajaxResult2.get("data");
//
//        for(ShutdowneventVo wtd:test2.getList())
//        {
//            System.out.println(wtd.getWarnDesc()+"----------------"+wtd.getStartTime()+"----------------"+wtd.getStopTime());
//        }
//
//        AjaxResult ajaxResult3 =windturbineDetailLineChartController.xdjllist(tablepar,wtid,"2021-01-01","2021-01-04");
//
//        PageInfo<Brownoutsevent2> test3=(PageInfo<Brownoutsevent2>)ajaxResult3.get("data");
//
//        for(Brownoutsevent2 wtd:test3.getList())
//        {
//            System.out.println(wtd.getLimitload()+"----------------"+wtd.getStoptime()+"----------------"+wtd.getLosspower());
//        }
//
//
//
//        AjaxResult ajaxResult4 =windturbineGoodnessDetailController.glchat(wtid,"2021-01-01");
//
//        List<DataVo> test4=(List<DataVo> )ajaxResult4.get("data");
//
//        for(DataVo wtd:test4)
//        {
//            System.out.println(wtd.getValue1()+"----------------"+wtd.getName()+"----------------"+wtd.getName());
//        }
//
//        AjaxResult ajaxResult5 =windturbineGoodnessDetailController.fjfzy(wtid,"2021-01-01");
//
//        Map<String, Object> test5=(Map<String, Object>)ajaxResult5.get("data");
//
//        for(ValueVo wtd:(List<ValueVo>)test5.get("data"))
//        {
//            System.out.println(wtd.getValue()+"----------------"+wtd.getName()+"----------------"+wtd.getData1());
//        }


//        ajaxResult =compareController.fzyDay(wtid,date);
//
//        Map<String, Object> test2=(Map<String, Object>)ajaxResult.get("data");
//        System.out.println(String.valueOf(test2.get("jfpl")));
//        List<ValueVo> vos =(List<ValueVo>)test2.get("data");
//
//        for(ValueVo wtd:vos)
//        {
//            System.out.println(wtd.getName()+"----------------"+wtd.getValue()+"----------------"+wtd.getData1());
//        }
//        System.out.println("***************************************************************************************");
//
//        AjaxResult ajaxResult =compareController.compareDayChat(wtid,date);
//
//        List<DataVo> test3=(List<DataVo>)ajaxResult.get("data");
//
//        for(DataVo wtd:test3)
//        {
//            System.out.println(wtd.getValue1()+"----------------"+wtd.getSpeed());
//        }
//        System.out.println("***************************************************************************************");
//


//        WindturbineDetailPieChartAController windturbineDetailPieChartAController= SpringUtils.getBean("windturbineDetailPieChartAController");
//
//        AjaxResult ajaxResult =windturbineDetailPieChartAController.pieChart(wtid,"2021-01-02","1");
//
//        List<DataVo> test3=(List<DataVo>)ajaxResult.get("data");
//
//        for(DataVo wtd:test3)
//        {
//            System.out.println(wtd.getValue1()+"----------------"+wtd.getSpeed());
//        }
//        System.out.println("***************************************************************************************");
//
//
//        WindturbineDetailLineChartController windturbineDetailLineChartController= SpringUtils.getBean("windturbineDetailLineChartController");
//
//        AjaxResult ajaxResult = windturbineDetailLineChartController.getplotBands(wtid, "2021-01-02");
//
//        List<List<EchartDataVo>> test3 = (List<List<EchartDataVo>>) ajaxResult.get("data");
//
//        for (List<EchartDataVo> ls : test3) {
//            for (EchartDataVo wtd : ls) {
//                System.out.println(wtd.getName() + "----------------" + wtd.getxAxis());
//            }
//
//        }
//        System.out.println("***************************************************************************************");
//
//        AjaxResult ajaxResult2 =windturbineDetailLineChartController.plotBandAjax(wtid,"2021-01-02 00:01" ,"2021-01-02 03:22");
//
//        Map<String, Double> test2=(Map<String, Double>)ajaxResult2.get("data");
//
//
//                System.out.println(test2.get("fdl")+"----------------"+test2.get("llfdl")+"----------------"+test2.get("fjzt")+"----------------"
//                        +test2.get("fs")+"----------------"+test2.get("gl")+"----------------"+test2.get("sc"));


//       AjaxResult ajaxResult4 =windturbineDetailLineChartController.findWtRealPowerChar(wtid,"2021-01-01");
//
//        List<DataVo> test4=(List<DataVo> )ajaxResult4.get("data");
//
//        for(DataVo wtd:test4)
//        {
//            System.out.println(wtd.getValue1()+"----------------"+wtd.getValue2()+"----------------"+wtd.getValue3());
//        }
//        System.out.println("***************************************************************************************");
//    }


    }
}
