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.health.PartBjController;
import com.gyee.frame.model.custom.PartbjcountVo;
import com.gyee.frame.model.custom.Tablepar;
import com.gyee.frame.model.custom.WindturbinebjCountVo;
import lombok.SneakyThrows;
import org.springframework.boot.SpringApplication;

import java.util.List;

public class PartBjTest {

    @SneakyThrows
    public static void main(String[] args) {

        SpringApplication.run(SpringbootStart.class, args);



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

        PartBjController partBjController= SpringUtils.getBean("partBjController");

        Tablepar tablepar=new Tablepar();
        tablepar.setPageNum(1);
        tablepar.setPageSize(10);
        tablepar.setOrderByColumn("deviationrate2");
        tablepar.setIsAsc("asc");



//        AjaxResult ar = lossPowerRateHealthController.losspowerrateList(wtId,"2021-01-01","2021-01-03");
//
//        List<LossPowerRate> vos=(List<LossPowerRate>)ar.get("data");
//
//
//        for(LossPowerRate wtd:vos)
//        {
//            System.out.println(wtd.getLosspower()+"----------------"+wtd.getRate()
//                    +"----------------"+wtd.getRealpower()+"----------------"+wtd.getWtid());
//        }


        AjaxResult ar = partBjController.partbjList("2021-01-02");

        List<PartbjcountVo> vos=(List<PartbjcountVo>)ar.get("data");


        for(PartbjcountVo wtd:vos)
        {
            System.out.println(wtd.getLnid()+"----------------"+wtd.getPartname()
                   +"----------------"+wtd.getDate()+"----------------"+wtd.getPart());
        }



         ar = partBjController.partbjsubList("SBQ06_XL",null,"2021-01-02");

        List<WindturbinebjCountVo> vos2=(List<WindturbinebjCountVo>)ar.get("data");


        for(WindturbinebjCountVo wtd:vos2)
        {
            System.out.println(wtd.getLnid()+"----------------"+wtd.getAlertrulename()
                    +"----------------"+wtd.getCount()+"----------------"+wtd.getPart());
        }


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