⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 displayorders.jsp

📁 运输模块代码
💻 JSP
字号:
<%@ page import="com.hexiesoft.utils.StringUtils"%>
<%--
  Created by IntelliJ IDEA.
  User: Ligang Wu
  Date: 2006-5-21
  Time: 11:56:56
  To change this template use File | Settings | File Templates.
--%>
<%@page contentType="text/html;charset=GBK"%>
<%@ include file="/IncludeBegin.jsp"%>
<%
    //所使用的全局变量
    String plantValue = "";
    String cAccountValue = "";
    String cSubacctValue = "";
    String cShname = "";
    String cWricust = "";

    String oWorksno = "";
    String oStatus = "";
    String oLbs = "";
    String oTemper = "";
    String oSalloy ="";
    String orderInfo = "";
    String custpo = "";
    String ordertype = "";
    String curpromdt = "";
    String shipdt = "";

    float internal = 0.0f;
    float oWidth = 0.0f;
    float gauge = 0.0f;
    float mt_gauge = 0.0f;
    float mt_width = 0.0f;
    float worksno = 0.0f;
    int isimperial = 0;
    float shipnet = 0.0f;
    float packnotetnet = 0.0f;
    float npackw = 0.0f;
    int npack = 0;

    //使用的临时变量
    String account = "";
    String subacct = "";
    String plant = "";
    String alloy = "";
    String metal = "";
    String crdflag = "";
%>
 <%
     //从语言包里获取数据
     String msgCritcal = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("MSG_CRITCAL");
     String msgWaring = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("MSG_WARNING");
     String msgNonMetal = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("MSG_NONMETAL");
     String openOrgerLabel = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("OPENORDERS");
     String worksLabel = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("WORKS");
     String lbsLabel = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("LBS");
     String productLabel = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("PRODUCT");
     String promiseLabel = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("PROMISE");
     String shipmentLabel = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("SHIPMENT");
     String fgLabel = (String) Configure.getConfigure(sIe_Language, "ShippingManager_Openorders").get("FG");

     String sql = "";
     //从开始页面获取值
     account = DataConvert.toRealString(iPostChange,(String)CurPage.getParameter("Account"));
     cAccountValue = account;
     subacct = DataConvert.toRealString(iPostChange,(String)CurPage.getParameter("Subacct"));
     plant =  DataConvert.toRealString(iPostChange,(String)CurPage.getParameter("Plant"));
     metal = DataConvert.toRealString(iPostChange,(String)CurPage.getParameter("Metal"));
     plantValue = plant;
%>
<body class="pagebackground" ">
    <%
         //存储检索customer表的结果
         ASResultSet customerRs;
         //存储检索ord_item表的结果
         ASResultSet orditemRs;
         //存储检索ord_hdr表的结果
         ASResultSet ordhdrRs;
         //存储检索promise表的结果
         ASResultSet promiseRs;
         //存储检索shipment表的结果
         ASResultSet shipmentRs;
         //存储检索packnote表的结果
         ASResultSet packnotetRs;

         try
         {
              sql = " select * from customer where account='"+account+"' and subacct='"+subacct+"'";
              customerRs = Sqlca.getASResultSet(sql);
              if(customerRs.next())
              {
                  crdflag = customerRs.getString("crdflag");
                  if(crdflag.equals("NO")){
     %>
     <script type="text/javascript">
            alert('<%=msgCritcal%>');
        </script>
     <%
                 }
                 if(crdflag.equals("NO")){
     %>
     <script type="text/javascript">
            alert('<%=msgWaring%>');
        </script>
     <%
                 }//if

    %>
    <table width="730" >
	     <tr>
		 <td >
		        <table width="660" border="0" cellpadding="0" cellspacing="0">
                 <%
                        cSubacctValue = customerRs.getString("subacct");
                        cShname = customerRs.getString("shname");
                        cWricust = customerRs.getString("wricust");
                        isimperial = customerRs.getInt("isimperial");
                    %>
                      <tr>
					  <td width="61"><%=cAccountValue%></td>
					  <td width="58">-<%=cSubacctValue%></td>
					  <td width="40"><%=cWricust%></td>
					  <td width="200" align="center"><%=cShname%></td>
					  <td width="100"><%=openOrgerLabel%> <%=plantValue%></td>
					  </tr>
                   <%
                          }//if(customerRs.next())
                   %>
                </table>
		 </td>
		 </tr>
		 <tr>
			 <td>
					<table width="680" border="0" cellpadding="0" cellspacing="0">
						 <tr>
							  <td><%=worksLabel%></td>
							  <td><%=lbsLabel%></td>
							  <td><%=productLabel%></td>
							  <td><%=promiseLabel%></td>
							  <td><%=shipmentLabel%></td>
						 </tr>
    <%
           //根据主帐号、次帐号 、plant、status、temper 到 ord_item查询记录
            sql = "select * from ord_item where account='"+account+"' and subacct='"+subacct+"' and plant='"+plant+"' and temper != 'VAR' and status != 'CM'";
            System.out.println("sql:"+sql);
            orditemRs = Sqlca.getASResultSet(sql);
            while(orditemRs.next()){
                alloy = orditemRs.getString("alloy");
                internal = orditemRs.getFloat("internal");
               //判断alloy的范围
                boolean flag = false;
                System.out.println("flag1:"+flag);
                System.out.println("metal:"+metal);
                if(metal.equals("C"))
                {
                    //14420 14300 14415 12200 11400 11000 C1100 14530
                   flag = StringUtils.copper(alloy);
                }
                else if(metal.equals("B"))
                {
                    //21000 22010 22030 26010 26020 26030 26100 26800 27200 27400 27000 26000 26120
                   // 26130 27010 27020 27130 24000 23000 22000
                   flag = StringUtils.brass(alloy);
                }
                else if(metal.equals("N"))
                {
                    //71310 73110 73120 73500 74030 74210 75220 74500 7521
                   flag = StringUtils.nickel(alloy);
                }
                else if(metal.equals("P"))
                {
                    //50100 50110 50500 51000 51110 51900 52110 52410
                   flag = StringUtils.phos(alloy);
                }
                System.out.println("flag2:"+flag);
                if(!flag)
                {
    %>
     <script type="text/javascript">
            alert('<%=msgNonMetal%>');
            OpenComp("InputCustomerInfo","/ShippingManager/openorders/InputCustomerInfo.jsp","rand="+randomNumber(),"right","");
        </script>
      <%
                      }
                    //循环取记录
                    worksno = orditemRs.getFloat("worksno");
                    oWorksno = String.valueOf(worksno);
                    oStatus = orditemRs.getString("status");
                    oLbs = orditemRs.getString("lbs");
                    oTemper = orditemRs.getString("temper");
                    oSalloy = orditemRs.getString("alloy");
                    oWidth = orditemRs.getFloat("width");
                    gauge = orditemRs.getFloat("gauge");
                    mt_width = orditemRs.getFloat("mt_width");
                    mt_gauge = orditemRs.getFloat("mt_gauge");
                    orderInfo = String.valueOf(oWidth)+" "+String.valueOf(gauge) + " " + oTemper + " " + oSalloy;
                    sql = "select * from ord_hdr where internal="+internal;
                    ordhdrRs = Sqlca.getASResultSet(sql);
      %>
                         <tr>
							 <td><%=oWorksno%></td>
							 <td><%=oStatus%></td>
							 <td><%=oLbs%></td>
							 <td width="150"><%=orderInfo%></td>
                        <%
                            if(ordhdrRs.next()) {
                                 ordertype = ordhdrRs.getString("ordertype");
                                 custpo = ordhdrRs.getString("custpo");
                                 System.out.println("custpo:"+custpo);
                            }//if(ordhdrRs.next())
                             System.out.println("isimperial:"+isimperial);
                            if(isimperial != 1)
                            {
                                String sMtwidth = String.valueOf(mt_width).substring(0,1);
                                String sMtgauge = String .valueOf(mt_gauge).substring(0,1);
                        %>
                             <td><%=sMtwidth%>mm</td>
                             <td><%=sMtgauge%>mm</td>
                        <%
                             }//if(isimperial == 1)
                             //选择promise表
                             sql = "select * from promise where worksno="+worksno;
                             promiseRs = Sqlca.getASResultSet(sql);
                             if(promiseRs.next())
                             {
                                 curpromdt = promiseRs.getString("curpromdt");
                        %>
                             <td><%=curpromdt%></td>
                             <td width="30"><%=ordertype%></td>
                        <%
                              }
                              // 选择shipment表
                              sql = "select * from shipment where worksno="+worksno;
                              shipmentRs = Sqlca.getASResultSet(sql);
                              if(shipmentRs.next())
                              {
                                  System.out.println("shipmentSql:"+sql);
                                  String shiptype = "";
                                  shiptype = shipmentRs.getString("shiptype");
                                  shipdt = shipmentRs.getString("shipdt");
                                  shipnet = shipmentRs.getFloat("net");
                                  int islbs = shipmentRs.getInt("islbs");
                                  System.out.println("shiptype:"+shiptype);
                                  System.out.println("islbs:"+islbs);
                                  if(shiptype == null || shiptype.length() == 0)
                                  {
                                      if(islbs == 1)
                                      {
                                        shipnet = shipnet * 1;
                                      }
                                      else
                                      {
                                         shipnet = shipnet * 2.2046f;
                                      }//else
                       %>

                             <td><%=shipdt%></td>
                             <td><%=shipnet%></td>
                       <%
                                   }//if(shiptype.length() == 0)
                                 }//if(shipmentRs.next())
                                 sql = " select * from packnote where worksno=" + worksno + " and blno is null";
                                 System.out.println("packnoteSql11:"+sql);
                                 packnotetRs = Sqlca.getASResultSet(sql);
                                 while(packnotetRs.next())
                                 {
                                     System.out.println("packnoteSql:"+sql);
                                     packnotetnet = packnotetRs.getFloat("net");
                                     int islbs = packnotetRs.getInt("islbs");
                                      if(islbs == 1)
                                      {
                                         npackw = npackw + packnotetnet * 1;
                                      }//if
                                      else
                                      {
                                          npackw = npackw + packnotetnet * 2.2046f;
                                      }//else
                                      npack = npack + 1;
                                 }//while(packnotetRs.next())
                    %>
                         </tr>
                         <tr><td>
                         <%
                              if(custpo != null && custpo.length() > 0)
                              {
                         %>
                             <td><%=custpo%></td>
                         <%
                              }//if(custpo != null && custpo.length() > 0)
                          %>
                         </td>
                       </tr>
                    <%
                         }//while(orditemRs.getRowCount() > 0)
                    %>
                    </table>
			 </td>
		 </tr>
         <%

    %>
    <tr><td height="20"></td></tr>
		 <tr><td>
		       <table cellpadding="0" cellspacing="0" border="0" width="100%">
			         <tr>
                         <td width="85%"align="right"><%=fgLabel%></td>
                         <td width="30"align="right"><%=npack%></td>
                         <td width="30"align="right"><%=npackw%></td>
                     </tr>
               </table>
		 </td></tr>
    </table>
     <%
          if(orditemRs == null || orditemRs.getRowCount() == 0){
      %>
        <script type="text/javascript">
            alert('<%=msgNonMetal%>');
        </script>
      <%
         }//if
       }//try
       catch (Exception e) {
           e.printStackTrace();
         }
     %>
</body>
<%@ include file="/IncludeEnd.jsp" %>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -