package com.engine.htsc.ReimbursementFlow.web;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ServiceUtil;
import com.engine.htsc.ReimbursementFlow.Dao.TravelreimDaoImpl;
import com.engine.htsc.ReimbursementFlow.Service.Impl.TravelreimServiceImpl;
import com.engine.htsc.ReimbursementFlow.Service.TravelUserdepthService;
import com.engine.htsc.ReimbursementFlow.Service.TravelreimService;
import weaver.general.Util;
import weaver.interfaces.htsc.GlobatTools.JAVATools;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Travelreim {

    TravelreimService getService() {
        return ServiceUtil.getService(TravelreimServiceImpl.class);
    }

    @POST
    @Path("/GetTypeToId")
    @Produces({MediaType.TEXT_PLAIN})
    public String GetTypeToId(@Context HttpServletRequest request,
                               @Context HttpServletResponse response){
        //  String requestid= request.getParameter("body");

        String value= Util.null2String(request.getParameter("value"));
        String fileid = Util.null2String(request.getParameter("fileid"));
        if("".equals(value)||"".equals(fileid)){
            return JAVATools.Apiretrun("400","参数不允许为空");
        }
        TravelreimService travelreimService=getService();
        String retvalue= travelreimService.GetTypeToId(fileid,value);

       // JSONObject jsonObject= travelUserdepthService.getUserdistdepth(detaillist);
        return  JAVATools.Apiretrun("200",retvalue);
    }


}
