第一次提交
This commit is contained in:
159
tomcat/webapps/sm/qtp.jsp
Normal file
159
tomcat/webapps/sm/qtp.jsp
Normal file
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="gb2312"?>
|
||||
<%@ page contentType="text/xml; charset=GBK" %>
|
||||
<%@ page import="java.util.*"%>
|
||||
<%@ page import="com.wxzd.wms.util.ServerUtil"%>
|
||||
<%@ page import="com.zcsoft.stock.StockCell"%>
|
||||
<%@ page import="com.zcsoft.stock.Instruction"%>
|
||||
<%@ page import="com.zcsoft.purview.data.UserInfoData"%>
|
||||
<%@ page import="com.zcsoft.dbvisit.DB"%>
|
||||
<%@ page import="com.zcsoft.client.*"%>
|
||||
<%@ page import="com.usun.web.http.ParameterConvertor"%>
|
||||
<jsp:useBean id="db1" scope="application" class="com.zcsoft.dbvisit.DB" />
|
||||
<%
|
||||
String errorInfo = null, ckkw = null, tpbh = null, zlbh = null, remark = null
|
||||
, table = null, field = null, pzbh = null;
|
||||
session = request.getSession(false);
|
||||
if (session != null && session.getAttribute("userInfo") != null)
|
||||
{
|
||||
ckkw = request.getParameter("ckkw");
|
||||
if (ckkw != null && ckkw.length() == 6)
|
||||
{
|
||||
try
|
||||
{
|
||||
tpbh = request.getParameter("tpbh");
|
||||
zlbh = request.getParameter("zlbh");
|
||||
table = request.getParameter("table");
|
||||
field = request.getParameter("field");
|
||||
Map kwxx = db1.getSingleRow("SELECT xnkw,zsl,sfwzzl FROM kwjbxx WHERE kwbh=?", ckkw);
|
||||
if (kwxx == null)
|
||||
{
|
||||
throw new IllegalStateException("<22><><EFBFBD><EFBFBD><EFBFBD>ڵĿ<DAB5>λ " + ckkw);
|
||||
}
|
||||
if ("1".equals(kwxx.get("xnkw")))
|
||||
{
|
||||
throw new IllegalStateException("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>");
|
||||
}
|
||||
String zsl = (String)kwxx.get("zsl");
|
||||
if ("0".equals(zsl))
|
||||
{
|
||||
throw new IllegalStateException("Ŀ<><C4BF><EFBFBD><EFBFBD>λ<EFBFBD>ǿտ<C7BF>λ");
|
||||
}
|
||||
if ("T".equals(kwxx.get("sfwzzl")))
|
||||
{
|
||||
//<2F><>Ҫ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɿ<EFBFBD><C9BF><EFBFBD><EFBFBD>̳<EFBFBD><CCB3><EFBFBD>ָ<EFBFBD><D6B8>
|
||||
UserInfoData uid = (UserInfoData)session.getAttribute("userInfo");
|
||||
String czr = uid.getYhm();
|
||||
if (zlbh == null || zlbh.length() == 0 || "0".equals(zlbh))
|
||||
{
|
||||
zlbh = ServerUtil.nextInstNo(db1, 1).toString();
|
||||
}
|
||||
table = "qtzl";
|
||||
field = "zt";
|
||||
|
||||
String insertStmt = DB.prepareInsertStmt(table
|
||||
, new String[]{"zlbh", "lx", "ckdm", "kwbh", "tpbh", "sl", "ykcs", "czr"});
|
||||
Object[] fieldsValue = new Object[]{zlbh, "0", "LTCK", ckkw, tpbh, zsl, zsl, czr};
|
||||
|
||||
db1.preparedUpdate(insertStmt, fieldsValue, false);
|
||||
}
|
||||
remark = request.getParameter("remark");
|
||||
remark = ParameterConvertor.convertString(request, remark, response);
|
||||
pzbh = request.getParameter("pzbh");
|
||||
pzbh = ParameterConvertor.convertString(request, pzbh, response);
|
||||
String entrance = request.getParameter("ckk");
|
||||
entrance = ParameterConvertor.convertString(request, entrance, response);
|
||||
//ֱ<><D6B1><EFBFBD>·<EFBFBD><C2B7><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳִ<CDB3><D6B4>
|
||||
Instruction inst = new Instruction();
|
||||
if (zlbh != null) inst.setNo(ServerUtil.getInt(zlbh));
|
||||
if ("T".equals(kwxx.get("sfwzzl")))
|
||||
{
|
||||
inst.setType(Instruction.OUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
inst.setType(Instruction.PICK_OUT);
|
||||
}
|
||||
inst.setFrom(new StockCell(ckkw));
|
||||
inst.setCarrier(tpbh);
|
||||
inst.setRemark(remark);
|
||||
|
||||
if (table != null && field != null)
|
||||
{
|
||||
inst.setFootprint(new Object[]{table, field,pzbh});
|
||||
}
|
||||
if (entrance != null && entrance.length() > 0)
|
||||
{
|
||||
inst.setProducer(entrance);
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5>ύִ<E1BDBB><D6B4>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (RemoteAccesser.countServletURLs() == 0)
|
||||
{
|
||||
RemoteAccesser.setUser("");
|
||||
String wmcsServer = (String)db1.getSingleField("SELECT dqz FROM sys_config WHERE ID_pzx=?", "wmcs-server");
|
||||
if (wmcsServer == null || wmcsServer.length() == 0)
|
||||
{
|
||||
wmcsServer = "localhost";
|
||||
}
|
||||
String port = (String)db1.getSingleField("SELECT dqz FROM sys_config WHERE ID_pzx=?", "wmcs-server-port");
|
||||
if (port == null || port.length() == 0)
|
||||
{
|
||||
port = "8080";
|
||||
}
|
||||
RemoteAccesser.setRootServlet("http://" + wmcsServer + ":" + port + "/wmcs/servlet/wmcs");
|
||||
}
|
||||
ObjectFromServlet ofs = RemoteAccesser.commitRequest(99
|
||||
, 5
|
||||
, inst);
|
||||
if (!ofs.isSuccess())
|
||||
{
|
||||
errorInfo = ((String)ofs.getReturnedValue());
|
||||
//System.out.println(errorInfo);
|
||||
}
|
||||
else if (table != null && field != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
db1.preparedUpdate(DB.prepareUpdateStmt(table, field, "zlbh"),
|
||||
new Object[]{Instruction.BUSY, zlbh},
|
||||
true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.err.println(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorInfo = ex.getMessage();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfo = "<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfo = "δ<><CEB4>¼";
|
||||
}
|
||||
%>
|
||||
<%
|
||||
out.write("<result status=\"");
|
||||
if (errorInfo != null)
|
||||
{
|
||||
out.write("false\" exception=\"");
|
||||
out.write(errorInfo.replace("\"", """));
|
||||
}
|
||||
else
|
||||
{
|
||||
out.write("true");
|
||||
if (field != null)
|
||||
{
|
||||
out.write("\" field=\"");
|
||||
out.write(field);
|
||||
}
|
||||
}
|
||||
out.write("\"></result>");
|
||||
%>
|
||||
|
||||
Reference in New Issue
Block a user