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.recommen.RecommenController;
import com.gyee.frame.model.custom.Tablepar;
import com.gyee.frame.model.custom.WoBugVo;
import lombok.SneakyThrows;
import org.springframework.boot.SpringApplication;

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

public class RecommenTest {

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

        RecommenController recommenController = SpringUtils.getBean("recommenController");


//        AjaxResult ajaxResult = recommenController.getRecommenmainDay1();
//
//        List<Recommenmain> test=(List<Recommenmain>)ajaxResult.get("data");
//        for(Recommenmain wtd:test)
//        {
//            System.out.println(wtd.getRecodedate()+"----------------"+wtd.getReason()+"----------------"+wtd.getReason());
//        }
//        System.out.println("**********************************************************************************");
//
//        AjaxResult ajaxResult2 = recommenController.getRecommenmainDay3();
//
//        List<Recommenmain> test2=(List<Recommenmain>)ajaxResult2.get("data");
//        for(Recommenmain wtd:test2)
//        {
//            System.out.println(wtd.getRecodedate()+"----------------"+wtd.getReason()+"----------------"+wtd.getReason());
//        }
//        System.out.println("**********************************************************************************");
//
//        AjaxResult ajaxResult3 = recommenController.getRecommenmainDay7();
//
//        List<Recommenmain> test3=(List<Recommenmain>)ajaxResult3.get("data");
//        for(Recommenmain wtd:test3)
//        {
//            System.out.println(wtd.getRecodedate()+"----------------"+wtd.getReason()+"----------------"+wtd.getReason());
//        }
//        System.out.println("**********************************************************************************");

//        AjaxResult ajaxResult = recommenController.getRecommenmainDay1();
//
//        List<Recommenmain> test=(List<Recommenmain>)ajaxResult.get("data");
//        for(Recommenmain wtd:test)
//        {
//            System.out.println(wtd.getRecodedate()+"----------------"+wtd.getReason()+"----------------"+wtd.getReason());
//        }
//        System.out.println("**********************************************************************************");
//
//        recommenController.confirpush("0869af9c7f17468faecbeb3b96f21c87");
//
//        System.out.println("**********************************************************************************");
//        recommenController.ignorepush("4749ad4f83114475a14fe43bdd293888");
//
//        System.out.println("**********************************************************************************");
//        AjaxResult ajaxResult = recommenController.recommenConfirmedList();
//
//        List<Recommenmain> test=(List<Recommenmain>)ajaxResult.get("data");
//        for(Recommenmain wtd:test)
//        {
//            System.out.println(wtd.getRecodedate()+"----------------"+wtd.getReason()+"----------------"+wtd.getReason());
//        }
//        System.out.println("**********************************************************************************");
//
//
//        System.out.println("**********************************************************************************");
//        AjaxResult ajaxResult1 = recommenController.findAllChartjz("MHS_FDC","2");
//        AjaxResult ajaxResult2 = recommenController.findAllChartjz("MHS01_GC","2");
//        AjaxResult ajaxResult3 = recommenController.findAllChartjz("MHS01_XL","2");
//        AjaxResult ajaxResult4 = recommenController.findAllChartjz("MG01_01","2");
//
//
//        System.out.println("**********************************************************************************");
//
//       map.put("yslchart", yslchart);
//        map.put("lslchart", lslchart);
//        map.put("cslchart", cslchart);
//        map.put("lvchart", lvchart);
//        map.put("datechart", datechart);
//        Map<String, Object[]> test=(Map<String, Object[]>)ajaxResult.get("data");
//        Double[] yslchart=(Double[])test.get("yslchart");
//        String[] datechart=(String[])test.get("datechart");
//        for(Double wtd:yslchart)
//        {
//            System.out.println(wtd);
//        }
//
//        for(String wtd:datechart)
//        {
//            System.out.println(wtd);
//        }
//        System.out.println("**********************************************************************************");
//
//
//        AjaxResult ajax=recommenController.findMainTrack("0869af9c7f17468faecbeb3b96f21c87");
//        MainTrackVo test4=(MainTrackVo)ajax.get("data");
//        System.out.println(test4.getDdxcpjsc()+"***************"+test4.getBugnum());
//        System.out.println("**********************************************************************************");
//
//
//       AjaxResult ajaxResult = recommenController.findShbraceletList("王义波","2020-08-22 17:55:00","2020-08-22 18:51:00");
//
//        Map<String, Map<String,Object>> test=( Map<String,Map<String,Object>>)ajaxResult.get("data");
//        Map<String,Object> map1=(Map<String,Object>)test.get("ss");
//        Map<String,Object> map2=(Map<String,Object>)test.get("ls");
//        Set<Map.Entry<String, Object>> set1 = map1.entrySet();
//        for (Iterator<Map.Entry<String, Object>> it = set1.iterator(); it.hasNext();) {
//            Map.Entry<String, Object> entry = (Map.Entry<String, Object>) it.next();
//            System.out.println(entry.getKey() + "--->" + String.valueOf(entry.getValue()));
//        }
//        System.out.println("**********************************************************************************");
//
//        Set<Map.Entry<String, Object>> set2 = map2.entrySet();
//        for (Iterator<Map.Entry<String, Object>> it = set2.iterator(); it.hasNext();) {
//            Map.Entry<String, Object> entry = (Map.Entry<String, Object>) it.next();
//            System.out.println(entry.getKey() + "--->" + entry.getValue());
//            List<PointData> ls =(List<PointData>)entry.getValue();
//            for(PointData po:ls)
//            {
//                System.out.println(po.getPointTime()+"*********************"+po.getPointValueInDouble());
//            }
//        }
//        System.out.println("**********************************************************************************");
//
//        AjaxResult ajaxResult = recommenController.findLocationTreeByWtId("MG01_01");
//
//        String test = (String) ajaxResult.get("data");
//
//        System.out.println(test);
//
//        System.out.println("**********************************************************************************");
        Tablepar tablepar = new Tablepar();
        tablepar.setPageNum(1);
        tablepar.setPageSize(10);
       AjaxResult ajaxResult2 = recommenController.findWobugeqByLocation(tablepar,"02055002");

        List<WoBugVo> test2=(List<WoBugVo>)ajaxResult2.get("data");

        for(WoBugVo wtd:test2)
        {
            System.out.println(wtd.getStatus()+"----------------"+wtd.getXqms()+"----------------"+wtd.getXqry());
        }
//        System.out.println("**********************************************************************************");
//
//        AjaxResult ajaxResult2 = recommenController.unfinishedList(null,null,"2016-08-22","2020-08-22");
//
//        PageInfo<WoBugEqVo> value=(PageInfo<WoBugEqVo>)ajaxResult2.get("data");
//        List<WoBugEqVo> test2=value.getList();
//        for(WoBugEqVo wtd:test2)
//        {
//            System.out.println(wtd.getOperationdate()+"----------------"+wtd.getRepairedcomment()+"----------------"+wtd.getWfname());
//        }
//        System.out.println("**********************************************************************************");
//    }

    }


}
