package com.engine.htsc.TrealReimTools;

import weaver.general.Util;
import weaver.interfaces.htsc.GlobatTools.JAVATools;
import weaver.interfaces.htsc.GlobatTools.trealReimTools;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

public class TrealReimToolsWeb {

    @POST
    @Path("/getregionStringtoId")
    @Produces({MediaType.TEXT_PLAIN})
    public String getregionStringtoId(@Context HttpServletRequest request, @Context HttpServletResponse response) {
        String value= Util.null2String(request.getParameter("value"));
        String returnvalue="";
        if("".equals(value)){
            return JAVATools.Apiretrun("400","数据为空");
        }

        returnvalue=  trealReimTools.getregionStringtoId(value);
        return JAVATools.Apiretrun("200",returnvalue);
    }

    @POST
    @Path("/gethrmtodeptid")
    @Produces({MediaType.TEXT_PLAIN})
    public String gethrmtodeptid(@Context HttpServletRequest request, @Context HttpServletResponse response) {
        String value= Util.null2String(request.getParameter("userids"));
        String returnvalue="";
        if("".equals(value)){
            return JAVATools.Apiretrun("400","数据为空");
        }


        return JAVATools.Apiretrun("200",trealReimTools.Gethrmdeptid(value));
    }

    @POST
    @Path("/gethrmsupdepid")
    @Produces({MediaType.TEXT_PLAIN})
    public String gethrmsupdepid(@Context HttpServletRequest request, @Context HttpServletResponse response) {
        String value= Util.null2String(request.getParameter("userids"));
        String returnvalue="";
        if("".equals(value)){
            return JAVATools.Apiretrun("400","数据为空");
        }


        return JAVATools.Apiretrun("200",trealReimTools.Gethrmsupdepid(value));
    }

}
