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.powersaturation.PowerSaturationAmonutController;
import com.gyee.frame.controller.powersaturation.PowerSaturationController;
import com.gyee.frame.controller.powersaturation.PowerSaturationMonthController;
import com.gyee.frame.model.custom.DataVo;
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 PowerSaturationTest {

    @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";

        PowerSaturationController powerSaturationController= SpringUtils.getBean("powerSaturationController");
        PowerSaturationMonthController powerSaturationMonthController= SpringUtils.getBean("powerSaturationMonthController");
        PowerSaturationAmonutController powerSaturationAmonutController= SpringUtils.getBean("powerSaturationAmonutController");


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


//        AjaxResult ajaxResult = powerSaturationController.powersaturationlist(tablepar,"MG01_01","2021-05-01");
//
//        PageInfo<Windturbinecurvefitting> result1=(PageInfo<Windturbinecurvefitting>)ajaxResult.get("data");
//        List<Windturbinecurvefitting> test=result1.getList();
//        for(Windturbinecurvefitting wtd:test)
//        {
//            System.out.println(wtd.getActualpower()+"----------------"+wtd.getOptimalpower());
//        }
//        System.out.println("*****************************************************************");
//
//        AjaxResult ajaxResult2 = powerSaturationMonthController.powersaturationmonthlist(tablepar,"MG01_01","2021","5");
//
//        List<Windturbinecurvefittingmonth> test2=(List<Windturbinecurvefittingmonth>)ajaxResult2.get("data");
//        for(Windturbinecurvefittingmonth wtd:test2)
//        {
//            System.out.println(wtd.getActualpower()+"----------------"+wtd.getOptimalpower());
//        }
//
//        System.out.println("*****************************************************************");
//
//
//        System.out.println("*****************************************************************");

//        AjaxResult ajaxResult3 = powerSaturationAmonutController.powersaturationamonutlist(tablepar,"MG01_01");
//        PageInfo<Windturbinecurvefitting> result3=(PageInfo<Windturbinecurvefitting>)ajaxResult3.get("data");
//        List<Windturbinecurvefitting> test3=result3.getList();
//        for(Windturbinecurvefitting wtd:test3)
//        {
//            System.out.println(wtd.getActualpower()+"----------------"+wtd.getOptimalpower());
//        }


        AjaxResult ajaxResult4 = powerSaturationAmonutController.powersaturationamonutchart("MG01_01");
        List<DataVo> test4=(List<DataVo>)ajaxResult4.get("data");

        for(DataVo wtd:test4)
        {
            System.out.println(wtd.getValue1()+"----------------"+wtd.getValue2()+"----------------"+wtd.getValue3()+"----------------"+wtd.getValue4());
        }
    }




}
