import com.engine.common.util.DateUtil;
import com.engine.common.util.Utils;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TestRemoveRestTime {
    public static void main(String[] args) {
        List<Map<String,Object>> schedulingList = Lists.newArrayList();
        schedulingList.add(new HashMap(){{
            put("edsc","8");
            put("bdlx","0");
            put("jsdk","0");
            put("tqdkfzs","60");
            put("sfkt","0");
            put("dtjssj","12:00");
            put("zddxfz","30");
            put("bcxx","25");
            put("dxhs","5");
            put("bcsdxx","09:00-12:00|13:00-18:00");
            put("sfdx","0");
            put("dtkssj","09:00");
            put("thdkfzs","");
            put("ksdk","1");
            put("rqlx","11");
        }});
        schedulingList.add(new HashMap(){{
            put("edsc","9.50");
            put("bdlx","8");
            put("jsdk","1");
            put("tqdkfzs","120");
            put("sfkt","0");
            put("dtjssj","18:00");
            put("zddxfz","30");
            put("bcxx","25");
            put("dxhs","5");
            put("bcsdxx","09:00-13:00|13:00-18:30");
            put("sfdx","0");
            put("dtkssj","11:00");
            put("thdkfzs","120");
            put("ksdk","0");
            put("rqlx","11");
        }});
        schedulingList.add(new HashMap(){{
            put("edsc","9.50");
            put("bdlx","1");
            put("jsdk","1");
            put("tqdkfzs","120");
            put("sfkt","0");
            put("dtjssj","13:00");
            put("zddxfz","30");
            put("bcxx","25");
            put("dxhs","5");
            put("bcsdxx","09:00-13:00|13:00-18:30");
            put("sfdx","0");
            put("dtkssj","12:00");
            put("thdkfzs","120");
            put("ksdk","0");
            put("rqlx","11");
        }});
        schedulingList.add(new HashMap(){{
            put("edsc","8");
            put("bdlx","0");
            put("jsdk","1");
            put("tqdkfzs","300");
            put("sfkt","1");
            put("dtjssj","18:00");
            put("zddxfz","30");
            put("bcxx","25");
            put("dxhs","5");
            put("bcsdxx","09:00-13:00|13:00-18:30");
            put("sfdx","0");
            put("dtkssj","13:00");
            put("thdkfzs","");
            put("ksdk","0");
            put("rqlx","11");
        }});

        int between = Utils.removeRestTime("2023-12-06 10:59:00","2023-12-06 18:00:00",schedulingList,"2023-12-06");

        int betweenTime = DateUtil.getBetWeenMinutes("2023-12-06 10:29:00","2023-12-06 18:00:00");

        Map<String,Object> leaveMap = Maps.newHashMap();
        leaveMap.put("kssj","2023-12-06 11:00");
        leaveMap.put("jssj","2023-12-06 18:00");
        int intersectionTime = Utils.getIntersectionTime("2023-12-06 10:59:00","2023-12-06 18:00:00",leaveMap,schedulingList,"2023-12-06");

        System.out.println(between);
        System.out.println(betweenTime);
        System.out.println(intersectionTime);
    }
}
