package com.engine.htsc.zbclbx.web;

import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ServiceUtil;
import com.engine.htsc.zbclbx.service.lcIsGledService;
import com.engine.htsc.zbclbx.service.lcIsGledServiceImpl;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.HashMap;
import java.util.Map;

public class Zbclbxgllcpd {
    private lcIsGledService getService(){
        return ServiceUtil.getService(lcIsGledServiceImpl.class);
    }

    /**
     * 根据requestid判断流程是否被关联
     *
     * */
    @GET
    @Path("/isgled")
    @Produces({MediaType.APPLICATION_JSON})
    public String lcIsGled(@Context HttpServletRequest request, @Context HttpServletResponse response){
        BaseBean bb = new BaseBean();
        bb.writeLog("====================lcIsGled check in =======================");
        Map<String,Object> result = new HashMap<>();
        String treavelcode = Util.null2String(request.getParameter("treavelcode"));
        bb.writeLog("============获取的treavelcode参数为："+treavelcode);
        if("".equals(treavelcode)){
            result.put("code","500");
            result.put("message","treavelcode参数为空");
        }else {
            Map<String,Object> params = new HashMap<>();
            params.put("treavelcode",treavelcode);
            result = getService().getGldLcbh(params);
            result.put("code","200");
            result.put("message","success");
        }
        return JSONObject.toJSONString(result);
    }
}
