<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="weaver.general.Util" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%

    String billid = request.getParameter("billid");
    RecordSet rs = new RecordSet();
    String bmzzsqs = "";
    if(StringUtils.isNotBlank(billid)){

        String zlcid = "";
        String sql =" select zlcid from formtable_main_236 where id = "+billid ;
        rs.executeQuery(sql);
        if (rs.next()){
            zlcid = rs.getString("zlcid");
        }

        if(StringUtils.isNotBlank(zlcid)){
            String mainTable = "";
            sql = " select abs(k.formid) as formid from workflow_requestbase t inner join workflow_base k on k.id = t.workflowid " +
                    " where t.requestid = "+zlcid;
            rs.executeQuery(sql);
            if(rs.next()){
                mainTable = "formtable_main_"+ Util.null2String(rs.getString("formid"));
            }

            if (StringUtils.isNotBlank(mainTable)) {
                sql = "select bmzzsqs from "+mainTable+" where requestid = "+zlcid;
                rs.executeQuery(sql);
                if(rs.next()){
                    bmzzsqs = Util.null2String(rs.getString("bmzzsqs"));
                }
            }
        }
    }

    JSONObject dataJson = new JSONObject();
    dataJson.put("bmzzsqs",bmzzsqs);

%>

<%=dataJson.toJSONString() %>


