package test;

import com.gyee.SpringbootStart;
import com.gyee.frame.common.spring.SpringUtils;
import com.gyee.frame.controller.report.WtHealthReportController;
import com.gyee.frame.service.report.WtHealthReport3Service;
import com.gyee.frame.util.DateUtils;
import lombok.SneakyThrows;
import org.springframework.boot.SpringApplication;

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

public class WtHealthReportTest {

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

        Date date = c.getTime();

        String wtid="MG01_01";

        WtHealthReportController wtHealthReportController= SpringUtils.getBean("wtHealthReportController");

        WtHealthReport3Service wtHealthReport3Service= SpringUtils.getBean("wtHealthReport3Service");
//        AjaxResult ajaxResult =wtHealthReportController.healthReport(wtid,"2021-03-24");
//
//        Map<String,Object> test=(Map<String,Object>)ajaxResult.get("data");
//
//        WtReportMain wtrm=(WtReportMain)test.get("main");
//        System.out.println(wtrm.getRecodedate()+"----------------"+wtrm.getGztop3name()+"----------------"+wtrm.getTop1type());
//        List<WtReportSub> wtrsls=(List<WtReportSub>)test.get("sub");
//        for(WtReportSub wtd:wtrsls)
//        {
//            System.out.println(wtd.getRecodedate()+"----------------"+wtd.getFdl()+"----------------"+wtd.getGzss());
//        }
//        System.out.println("***************************************************************************************");

//        AjaxResult ajaxResult =wtHealthReportController.healthReportChart(wtid,"fdj","2021-03-24");
//
//        List<WtTragetReportChart> test2=(List<WtTragetReportChart>)ajaxResult.get("data");
//
//
//        for(WtTragetReportChart wtd:test2)
//        {
//            System.out.println(wtd.getRecorddate()+"----------------"+wtd.getValue()+"----------------"+wtd.getWtname());
//        }


        Map<String, Object> map =wtHealthReport3Service.healthReport(wtid, DateUtils.parseStrtoDate("2021-06-19"));

        System.out.println(map.size());

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

    }




}
