package workflow;

import com.engine.attendance.vacation.service.VocationService;
import com.engine.attendance.vacation.service.impl.VocationServiceImpl;
import com.engine.attendance.workflow.action.askforleave.AskForLeaveWorkFlowSubmitAction;
import com.engine.attendance.workflow.service.AskForLeaveService;
import com.engine.attendance.workflow.service.impl.AskForLeaveServiceImpl;
import com.engine.common.util.CommonUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.common.util.Utils;
import com.engine.cube.service.ModeImpExpService;
import com.engine.cube.service.impl.ModeImpExpServiceImpl;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import org.junit.Test;
import weaver.hrm.User;
import weaver.hrm.company.SubCompanyComInfo;
import weaver.soa.workflow.request.RequestInfo;

import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;

public class Test1 extends beforlog {
    private ModeImpExpService getService(User user) {
        return (ModeImpExpService) ServiceUtil.getService(ModeImpExpServiceImpl.class, user);
    }
    AskForLeaveService askForLeaveService = ServiceUtil.getService(AskForLeaveServiceImpl.class);
    @Test
    public  void test1() {
        Map<String,Object> param = Maps.newHashMap();
        param.put("itemId","139");
        param.put("userId","34");
        param.put("startDate","2024-05-01");
        param.put("endDate","2024-05-28");
        Map<String,Object> result = askForLeaveService.getRestDayInterval(param);
        System.out.println(result);
    }

    @Test
    public  void test2() {
        String str = "{cxqj='0', jqlx='134', cxjqj='3',  qjzz='1', kssj='09:00', jssj='18:00', szjg='1', qjry='31', sjqjlx='134', ksrq='2024-05-29', scdw='1', mtcfsdjq='1', jsrq='2024-06-06', id='42',  qjsc='7.00'}";
        String str2 = "[{cxqj='0', ksrq='2024-05-29', qtj='0',  btj='0', id='233', qjsc='1.00'}, {cxqj='0', ksrq='2024-05-30', qtj='0',  btj='0', id='233', qjsc='1.00'}, {cxqj='0', ksrq='2024-05-31', qtj='0',  btj='0', id='233', qjsc='1.00'}, {cxqj='0', ksrq='2024-06-01', qtj='0',  btj='0', id='233', qjsc='1.00'}, {cxqj='0', ksrq='2024-06-04', qtj='0',  btj='0', id='233', qjsc='1.00'}, {cxqj='0', ksrq='2024-06-05', qtj='0',  btj='0', id='233', qjsc='1.00'}, {cxqj='0', ksrq='2024-06-06', qtj='0',  btj='0', id='233', qjsc='1.00'}]";
        Gson gson = new Gson();
        Map<String,Object> param = gson.fromJson(str, (Type) Map.class);
        List<Map<String,Object>> param2 = gson.fromJson(str2, (Type) List.class);
//        System.out.println(param);
//        System.out.println(param2);
        AskForLeaveWorkFlowSubmitAction action = new AskForLeaveWorkFlowSubmitAction();
        action.execute(new RequestInfo());
    }



}
