📄 displayresult.jsp
字号:
<%--
Created by IntelliJ IDEA.
User: Ligang Wu
Date: 2006-5-20
Time: 18:42:33
To change this template use File | Settings | File Templates.
--%>
<%@page contentType="text/html;charset=GBK"%>
<%@ include file="/IncludeBegin.jsp"%>
<%
//所使用的全局变量
String plantValue = "";
String pAccountValue = "";
String pSubacctValue = "";
String cShnameValue = "";
String cShcityValue = "";
String cShcountryValue = "";
String pWorksno = "";
String pPnno = "";
String pDesc = "";
String pFsw = "";
float netkgs = 0.0f;
float netlbs = 0.0f;
float totnetb = 0.0f;
float totnetbk = 0.0f;
//使用的临时变量
String account = "";
String subacct = "";
float totnetc = 0.0f;
float totnet = 0.0f;
float totrec = 0.0f;
float totnetck = 0.0f;
float totnetk = 0.0f;
float net = 0.0f;
%>
<%
String sql = "";
//从开始页面获取值
account = DataConvert.toRealString(iPostChange,(String)CurPage.getParameter("Account"));
subacct = DataConvert.toRealString(iPostChange,(String)CurPage.getParameter("Subacct"));
plantValue = "HILL";
%>
<body class="pagebackground" >
<%
pAccountValue = account;
pAccountValue = subacct;
//存储检索customer表的结果
ASResultSet customerRs;
//存储检索packnote表的结果
ASResultSet packnoteRs;
//存储检索promise表的结果
ASResultSet promiseRs;
sql = " select * from customer where account='"+account+"' and subacct='"+subacct+"'";
try
{
//根据主帐号、次帐号 、plant 到 packnote查询记录
String sqlStr = " select * from packnote where account='"+account+"' and subacct='"+subacct+"' and plant='"+plantValue+"' and blno is null";
System.out.println("packnoteSql:"+sqlStr);
packnoteRs = Sqlca.getASResultSet(sqlStr);
if(packnoteRs.getRowCount() > 0){
%>
<table width="703" >
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left">Customer Account: <%=account%></td>
<td align="center">STOCK ON HAND <%=plantValue%></td>
</tr>
</table>
</td>
</tr>
<tr>
<td >
<table width="603" border="0" cellpadding="0" cellspacing="0">
<%
System.out.println("customerSql:"+sql);
customerRs = Sqlca.getASResultSet(sql);
while(customerRs.next())
{
cShnameValue = customerRs.getString("shname");
System.out.println("cShnameValue:"+cShnameValue);
cShcityValue = customerRs.getString("shcity");
System.out.println("cShcityValue"+cShcityValue);
cShcountryValue = customerRs.getString("shcountry");
System.out.println("cShcountryValue"+cShcountryValue);
%>
<tr>
<td width="61"><%=pAccountValue%></td>
<td width="58"><%=pSubacctValue%></td>
<td width="242"><%=cShnameValue%></td>
<td width="99"><%=cShcityValue%></td>
<td width="100"><%=cShcountryValue%></td>
</tr>
<%
}//while(customerRs.next())
%>
</table>
</td>
</tr>
<tr>
<td>
<table width="603" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>Work</td>
<td>LOT</td>
<td>DESCRIPTION</td>
<td>FSW</td>
<td>LBS</td>
<td>KGS</td>
</tr>
<%
//循环取记录
while(packnoteRs.next()){
float worksno = packnoteRs.getFloat("worksno");
System.out.println("worksno"+worksno);
pWorksno = String.valueOf(worksno);
pPnno = packnoteRs.getString("pnno");
pDesc = packnoteRs.getString("desc");
net = packnoteRs.getFloat("net");
int islbs = packnoteRs.getInt("islbs");
System.out.println("islbs:"+islbs);
//根据工作号到promise查询fsw记录
sql = "select * from promise where worksno="+worksno;
System.out.println("promiseSql:"+ sql);
promiseRs = Sqlca.getASResultSet(sql);
if(promiseRs.next()){
pFsw = promiseRs.getString("fsw");
}
if(islbs == 1){
netlbs = net;
netkgs = 0.0f;
}//if
else{
netkgs = net;
netlbs = net * 2.2046f;
}//else
%>
<tr>
<td><%=pWorksno%></td>
<td><%=pPnno%></td>
<td><%=pDesc%></td>
<td><%=pFsw%></td>
<td><%=netlbs%></td>
<%
totnetb = totnetb + netlbs;
totnetbk = totnetbk + netkgs;
totrec = totrec + 1;
}//while(packnoteRs.next())
%>
<td><%=netkgs%></td>
</tr>
</table>
</td>
</tr>
<tr><td height="40"></td></tr>
<tr><td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td width="95%" align="right">TOTAL</td></tr>
<tr>
<td align="right"><%=totnetb%></td>
<td width="5%" align="right">lbs</td>
</tr>
<%
if(totnetbk > 0){
%>
<tr>
<td align="right"><%=totnetbk%></td>
<td width="5%" align="right">kgs</td>
</tr>
<%
}//if
%>
</table>
</td></tr>
</table>
<%
}//if
else if(packnoteRs == null || packnoteRs.getRowCount() == 0){
%>
<script type="text/javascript">
alert("No inventory found!");
</script>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td width="95%" align="center">No inventory found!</td></tr>
</table>
<%
}
}//try
catch (Exception e) {
e.printStackTrace();
}
%>
</body>
<%@ include file="/IncludeEnd.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -