144 lines
3.7 KiB
Plaintext
144 lines
3.7 KiB
Plaintext
|
|
<?xml version="1.0" encoding="gb2312"?>
|
|||
|
|
<%@ page contentType="text/xml; charset=GBK" %>
|
|||
|
|
<%@ page import="java.util.*"%>
|
|||
|
|
<%@ page import="com.zcsoft.dbvisit.DB"%>
|
|||
|
|
<%@ page import="com.wxzd.wms.util.ServerUtil"%>
|
|||
|
|
<%@ page import="com.zcsoft.purview.data.Purview"%>
|
|||
|
|
<%@ page import="com.wxzd.wms.sys.data.ModuleConstant"%>
|
|||
|
|
<%@ page import="com.usun.web.http.ParameterConvertor"%>
|
|||
|
|
<jsp:useBean id="db1" scope="application" class="com.zcsoft.dbvisit.DB" />
|
|||
|
|
<jsp:useBean id="userInfo" scope="session" class="com.zcsoft.purview.data.UserInfoData" />
|
|||
|
|
<%
|
|||
|
|
String errorInfo = null, code = null, ckbh = null, field = null;
|
|||
|
|
if (userInfo.getYhm() == null)
|
|||
|
|
{
|
|||
|
|
out.write("<redirect href=\"sm.jsp\"/>");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
code = DB.regulateInput(request.getParameter("input"));
|
|||
|
|
ckbh = DB.regulateInput(request.getParameter("ckbh"));
|
|||
|
|
field = request.getParameter("field");
|
|||
|
|
List data = null;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//<2F>ٴμ<D9B4><CEBC><EFBFBD>Ȩ<EFBFBD><C8A8>
|
|||
|
|
String module = ModuleConstant.<2E><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>;
|
|||
|
|
Purview p = userInfo.getUserPurview(module);
|
|||
|
|
if (p == null || (p.getQx() & 16) == 0)
|
|||
|
|
{
|
|||
|
|
throw new IllegalArgumentException("<22><>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯȨ<D1AF><C8A8>");
|
|||
|
|
}
|
|||
|
|
if (field != null
|
|||
|
|
&& field.matches("[a-zA-Z_][a-zA-Z_0-9]*")
|
|||
|
|
&& !ServerUtil.isNull(code))
|
|||
|
|
{
|
|||
|
|
StringBuffer sql = new StringBuffer("SELECT ISNULL(a.sl,b.zsl) sl");
|
|||
|
|
sql.append(",CAST(a.sl/a.jzl AS INT)js,a.zlzt,a.lpxx");
|
|||
|
|
sql.append(",ISNULL(a.cpmc,CASE WHEN b.zsl>0 THEN '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' ELSE '<27>տ<EFBFBD>λ' END) cpmc");
|
|||
|
|
sql.append(",a.cpgg1,b.kwbh,b.tpbh");
|
|||
|
|
sql.append("\nFROM cpkcxx a RIGHT JOIN kwjbxx b ON a.ckmc=b.ckmc AND a.kwbh=b.kwbh");
|
|||
|
|
sql.append("\nWHERE ");
|
|||
|
|
if ("tpbh".equals(field))
|
|||
|
|
{
|
|||
|
|
char c = code.charAt(0);
|
|||
|
|
if (c !='T' && c != 't')
|
|||
|
|
{
|
|||
|
|
code = "T" + code;
|
|||
|
|
}
|
|||
|
|
sql.append("b.").append(field);
|
|||
|
|
}
|
|||
|
|
else if ("kwbh".equals(field))
|
|||
|
|
{
|
|||
|
|
sql.append("b.").append(field);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sql.append("a.").append(field);
|
|||
|
|
code = ParameterConvertor.convertString(request, code, response);
|
|||
|
|
}
|
|||
|
|
sql.append(" LIKE '").append(code).append('%').append('\'');
|
|||
|
|
if (!ServerUtil.isNull(ckbh))
|
|||
|
|
{
|
|||
|
|
sql.append(" AND a.ckmc='").append(ckbh).append('\'');
|
|||
|
|
}
|
|||
|
|
//System.out.println(sql);
|
|||
|
|
sql.append("\nORDER BY a.cpbh,a.lpxx,a.kwbh");
|
|||
|
|
data = db1.getVDataWithException(sql.toString());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
errorInfo = "<22><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//ex.printStackTrace();
|
|||
|
|
errorInfo = ex.getMessage();
|
|||
|
|
if (errorInfo == null) errorInfo = ex.toString();
|
|||
|
|
}
|
|||
|
|
//<2F><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>
|
|||
|
|
//System.err.println("errorInfo = " + errorInfo);
|
|||
|
|
out.write("<result status=\"");
|
|||
|
|
if (errorInfo != null)
|
|||
|
|
{
|
|||
|
|
out.write("false\" exception=\"");
|
|||
|
|
out.write(errorInfo);
|
|||
|
|
out.write("\">");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
out.write("true\">");
|
|||
|
|
out.print("<table border=\"1\" class=\"data\">");
|
|||
|
|
out.print("<tr><th colspan=\"2\"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></th>");
|
|||
|
|
out.print("<th rowspan=\"2\"><3E><><EFBFBD><EFBFBD></th><th rowspan=\"2\">Ʒ<><C6B7></th><th rowspan=\"2\"><3E><><EFBFBD><EFBFBD></th><th rowspan=\"2\"><3E><>λ</th><th rowspan=\"2\"><3E><><EFBFBD><EFBFBD></th></tr>");
|
|||
|
|
out.print("<tr>");
|
|||
|
|
for (int i = 1; i < 2; i++)
|
|||
|
|
{
|
|||
|
|
out.print("<th><3E><><EFBFBD><EFBFBD></th><th><3E><><EFBFBD><EFBFBD></th>");
|
|||
|
|
}
|
|||
|
|
out.print("</tr>");
|
|||
|
|
for (int i = 0, n = data.size(), m = -1; i < n; i++)
|
|||
|
|
{
|
|||
|
|
out.print("<tr class=\"row");
|
|||
|
|
out.print(i%4);
|
|||
|
|
out.print("\"");
|
|||
|
|
out.print('>');
|
|||
|
|
|
|||
|
|
List rowData = (List)data.get(i);
|
|||
|
|
if (m == -1) m = rowData.size();
|
|||
|
|
String cssClass = "";
|
|||
|
|
for (int j = 0; j < m; j++)
|
|||
|
|
{
|
|||
|
|
String content = (String)rowData.get(j);
|
|||
|
|
if (j < 2)
|
|||
|
|
{
|
|||
|
|
cssClass = "numeric";
|
|||
|
|
}
|
|||
|
|
else if (j == 2)
|
|||
|
|
{
|
|||
|
|
cssClass = "zlzt" + content;
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
out.print("<td");
|
|||
|
|
|
|||
|
|
if (j <= 3)
|
|||
|
|
{
|
|||
|
|
out.print(" class=\"");
|
|||
|
|
out.print(cssClass);
|
|||
|
|
out.print('\"');
|
|||
|
|
}
|
|||
|
|
out.print('>');
|
|||
|
|
|
|||
|
|
out.print(content);
|
|||
|
|
|
|||
|
|
out.print("</td>");
|
|||
|
|
}
|
|||
|
|
out.print("</tr>");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
out.print("</table>");
|
|||
|
|
}
|
|||
|
|
%>
|
|||
|
|
</result>
|
|||
|
|
|