package com.engine.htsc.htjjh.web;

import com.alibaba.fastjson.JSONObject;
import com.api.doc.detail.util.DocDownloadCheckUtil;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.htsc.hthy.service.HtscMettingService;
import com.engine.htsc.hthy.service.impl.HhtscMeetingServiceImpl;
import com.engine.htsc.htjjh.service.HtscFoundationExpService;
import com.engine.htsc.htjjh.service.impl.HtscFoundationExpServiceImpl;
import weaver.conn.RecordSet;
import weaver.docs.qc969424.util.QC969424RequestBaseUtil;
import weaver.docs.qc969424.util.QC969424SyncauthRequestUtil;
import weaver.docs.qc969424.util.QC969424Util;
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 javax.ws.rs.core.Response;
import java.io.*;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipInputStream;

public class HtscFoundationExpAction {

    public HtscFoundationExpService getService(HttpServletRequest request, HttpServletResponse response){
        User user = HrmUserVarify.getUser( request, response );
        return  (HtscFoundationExpService) ServiceUtil.getService(HtscFoundationExpServiceImpl.class,user);
    }


    @GET
    @Path("/gethalldata")
    @Produces({MediaType.TEXT_PLAIN})
    public String getHymbData(@Context HttpServletRequest request, @Context HttpServletResponse response){
        Map<String,Object> apidatas = new HashMap<String,Object>();
        try {
            User user = HrmUserVarify.getUser( request, response );
            Map<String,Object> param = ParamUtil.request2Map(request);
            apidatas.putAll(this.getService(request,response).gethalldata(param,user));;
            apidatas.put("api_status", true);
        } catch (Exception e) {
            e.printStackTrace();
            apidatas.put("api_status", false);
            apidatas.put("api_errormsg", "catch exception : " + e.getMessage());
        }
        return JSONObject.toJSONString(apidatas);
    }
}
