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.powercompare.PowerCompareController;
import com.gyee.frame.model.custom.StopTypeTreeVo;
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 PowercompareTest {

    @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,1);
        c.set(Calendar.MONTH,0);
        c.set(Calendar.YEAR,2021);

        Date beginDate = c.getTime();

        String wpid="MHS_FDC";

        PowerCompareController powerCompareController= SpringUtils.getBean("powerCompareController");


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


//        AjaxResult ajaxResult = powerCompareController.powerAjaxAll("MHS_FDC","2021-01-01","2021-01-03","xl",null,null);
//
//        List<Windpowerinfoday3> test=(List<Windpowerinfoday3>)ajaxResult.get("data");
//        for(Windpowerinfoday3 wtd:test)
//        {
//            System.out.println(wtd.getLineid()+"----------------"+wtd.getLocation());
//        }
//        System.out.println(test);
//
//        AjaxResult ajaxResult3 = powerCompareController.windfarmAjax();
//
//        List<StopTypeTreeVo> test3=(List<StopTypeTreeVo>)ajaxResult3.get("data");
//        for(StopTypeTreeVo wtd:test3)
//        {
//            System.out.println(wtd.getId()+"----------------"+wtd.getName());
//        }
//
//
//        AjaxResult ajaxResult = powerCompareController.projectAjax("MHS_FDC");
//
//        List<StopTypeTreeVo> test=(List<StopTypeTreeVo>)ajaxResult.get("data");
//        for(StopTypeTreeVo wtd:test)
//        {
//            System.out.println(wtd.getId()+"----------------"+wtd.getName());
//        }
//
//        AjaxResult ajaxResult2 = powerCompareController.lineAjax("MHS01_GC");
//        List<StopTypeTreeVo> test2=(List<StopTypeTreeVo>)ajaxResult2.get("data");
//        for(StopTypeTreeVo wtd:test2)
//        {
//            System.out.println(wtd.getId()+"----------------"+wtd.getName());
//        }

        AjaxResult ajaxResult = powerCompareController.windfarmAllAjax();
        List<StopTypeTreeVo> test=(List<StopTypeTreeVo>)ajaxResult.get("data");
        for(StopTypeTreeVo wtd:test)
        {
            System.out.println(wtd.getId()+"----------------"+wtd.getName());
        }
        AjaxResult ajaxResult1 = powerCompareController.projectAllAjax();
        List<StopTypeTreeVo> test1=(List<StopTypeTreeVo>)ajaxResult1.get("data");
        for(StopTypeTreeVo wtd:test1)
        {
            System.out.println(wtd.getId()+"----------------"+wtd.getName());
        }

        AjaxResult ajaxResult2 = powerCompareController.lineAllAjax();
        List<StopTypeTreeVo> test2=(List<StopTypeTreeVo>)ajaxResult2.get("data");
        for(StopTypeTreeVo wtd:test2)
        {
            System.out.println(wtd.getId()+"----------------"+wtd.getName());
        }
        AjaxResult ajaxResult3 = powerCompareController.windturbineAllAjax();
        List<StopTypeTreeVo> test3=(List<StopTypeTreeVo>)ajaxResult3.get("data");
        for(StopTypeTreeVo wtd:test3)
        {
            System.out.println(wtd.getId()+"----------------"+wtd.getName());
        }

    }




}
