<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.hrm.User" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.systeminfo.SystemEnv" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%

    User user = HrmUserVarify.getUser(request, response);
    if(user==null) {
        response.sendRedirect("/login/Login.jsp");
        return;
    }
    Map<String,Object> map = new HashMap<String,Object>();
    if (!HrmUserVarify.checkUserRight("HrmKQGroup:Add", user)) {
        map.put("status", "-1");
        map.put("message", SystemEnv.getHtmlLabelName(2012, user.getLanguage()));
    }else{
        map.put("status", "1");
        map.put("message", "22222");
    }

    out.println("list:"+JSONObject.toJSONString(map));
%>


<%!

    /**
     *
     * @param requestid
     * @return
     */
    public static String getFormtableByRequestId(String requestid){
        String formtable = "" ;
        RecordSet rs = new RecordSet();
        BaseBean bb = new BaseBean();
        try{
            if(StringUtils.isNotBlank(requestid)){
                String sql =" select abs(formid) from workflow_base t \n" +
                        " inner join workflow_requestbase h on h.workflowid = t.id \n" +
                        " where requestid=  "+requestid ;
                bb.writeLog("sql2:"+sql);
                rs.executeQuery(sql);
                if(rs.next()){
                    String formid = Util.null2String(rs.getString("formid"));
                    if(StringUtils.isNotBlank(formid)){
                        formtable = "formtable_main_"+formid ;
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            bb.writeLog("getFormtableByRequestId:"+e);
        }

        return formtable;
    }

%>




