package com.engine.htsc.cgscjsfk.web;

import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ServiceUtil;
import com.engine.htsc.cgscjsfk.service.getDt10Service;
import com.engine.htsc.cgscjsfk.service.impl.getDt10ServiceImpl;

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

public class JsfkAction {

    private getDt10Service getService() {
        return ServiceUtil.getService(getDt10ServiceImpl.class);
    }


    /*
    * 获取明细表10数据
    * 入参:String-deptCode;String-type;String-requestid
    * 出参:List<Map<String,Object>>-needshow
    * */
    @GET
    @Path("/getdttendata")
    @Produces({MediaType.APPLICATION_JSON})
    public String getDt10Data(@Context HttpServletRequest request){
        List<Map<String,Object>> needshow;
        Map<String,Object> paramsMap = new HashMap<>();
        paramsMap.put("deptCode",request.getParameter("deptCode"));
        paramsMap.put("type",request.getParameter("type"));
        paramsMap.put("requestid", request.getParameter("requestid"));
        needshow = getService().getDt10Data(paramsMap);
        return JSONObject.toJSONString(needshow);
    }
}
