package test;

import com.gyee.SpringbootStart;
import com.gyee.frame.common.spring.SpringUtils;
import com.gyee.frame.model.custom.YawValuesVo;
import com.gyee.frame.service.yaw.YawService;
import org.springframework.boot.SpringApplication;

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

public class YawServiceTest {


    public static void main(String[] args) throws Exception {

        SpringApplication.run(SpringbootStart.class, args);

          String QS = "0";
          String FD = "-1";
          String GF = "-2";

        String wtId="MG01_03";
        String wpId="MHS_FDC";
        String year="2021";
        String month="1";



        YawService yawService= SpringUtils.getBean("yawService");
//        Map<String, Object> map =genreSetPushController.findBasicDataInfo("0");
//        Map<String, Object> map =genreSetPushController.findDayInfo("0","rfdl");

//        Map<String, Object> map2 =genreSetPushController.findBasicDataInfo("MHS_FDC");
//        Map<String, Object> map = new HashMap<>();
//
//
//        map.put(QS, genreSetPushService.findBasicDataInfo(QS));
//        map.put(FD, genreSetPushService.findBasicDataInfo(FD));
//        map.put(GF, genreSetPushService.findBasicDataInfo(GF));


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


        Date beginDate = c.getTime();

        c.add(Calendar.MONTH,1);

        Date endDate = c.getTime();
        List<YawValuesVo> vos1 = yawService.getYawValuesPowerTotalAll("XG01_03",beginDate,endDate);

//        List<YawValuesVo> vos2 = yawService.getYawValuesPowerTotal("MG01_01",beginDate,endDate,4);
//
//        List<YawVo> vos3 = yawService.getYawSpeedTotal("MG01_01",beginDate,endDate);
//
//        List<YawValuesVo> vos4 = yawService.getYawValuesSpeedTotal("MG01_01",beginDate,endDate,4);

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



//        AjaxResult ar = singleAnalysisController.singleanalysisSub(wtId,year,month);
//
//        Map<String,Object> map=( Map<String,Object>)ar.get("data");
//        for(SingleAnalysisVo wtd:vos)
//        {
//            System.out.println(wtd.getXfqr()+"----------------"+wtd.getXfqrhgl());
//        }
//
//        AjaxResult ar = singleAnalysisController.singleanalysisChart(wtId,year,month);
//
//        Map<String, List<SingleAnalysisVo>> map=( Map<String,List<SingleAnalysisVo>>)ar.get("data");
//        List<SingleAnalysisVo> vos=map.get("ff");
//        for(SingleAnalysisVo wtd:vos)
//        {
//            System.out.println(wtd.getFdl()+"----------------"+wtd.getFs());
//        }
//
//        System.out.println("---------------------------------------------------------------------------------");
//        vos=map.get("ws");
//        for(SingleAnalysisVo wtd:vos)
//        {
//            System.out.println(wtd.getGzss()+"----------------"+wtd.getJxss()+"----------------"+wtd.getXdss()
//                    +"----------------"+wtd.getXnss()+"----------------"+wtd.getSlss());
//        }
//        System.out.println("---------------------------------------------------------------------------------");
//        vos=map.get("jd");
//        for(SingleAnalysisVo wtd:vos)
//        {
//            System.out.println(wtd.getJfpl()+"----------------"+wtd.getTjxs());
//        }
//
//
//
    }
}
