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.compare.CompareController;
import com.gyee.frame.model.custom.Tablepar;
import com.gyee.frame.model.custom.ValueVo;
import lombok.SneakyThrows;
import org.springframework.boot.SpringApplication;

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

public class CompareTest {

    @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 wtid="MG01_01,MG01_02,MG01_03";

        CompareController compareController= SpringUtils.getBean("compareController");
//
//        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 =compareController.compareDayList(wtid,"2021-01-02");
//
//        List<GoodCompareVo> test=(List<GoodCompareVo>)ajaxResult.get("data");
//        for(GoodCompareVo wtd:test)
//        {
//            System.out.println(wtd.getName()+"----------------"+wtd.getValue1()+"----------------"+wtd.getValue2());
//        }

        AjaxResult ajaxResult =compareController.fzyDay(wtid,"2021-01-02");

        Map<String, Object> test2=(Map<String, Object>)ajaxResult.get("data");
        System.out.println(String.valueOf(test2.get("jfpl0")));
        List<ValueVo> vos =(List<ValueVo>)test2.get("data0");

        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("***************************************************************************************");
//

    }




}
