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

📄 existwhatistoship.jsp

📁 运输模块代码
💻 JSP
字号:
<%--
  Created by IntelliJ IDEA.
  User: lijun
  Date: 2006-5-17
  edit: RuiLei  2006-6-4
 --%>
<%@ page contentType="text/html;charset=GBK" %>
<%@ include file="/IncludeBegin.jsp" %>
<%@ page import="com.hexiesoft.utils.*" %>
<%
    //String PG_TITLE = "ExistWhatistoship";

    String sCode = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("Code"));
    String sDesc = "";
    String saccount = "";
    String ssubacct = "";
    String sshname = "";
    String scustprod = "";
    String sordertype = "";
    String sadd1 = "";
    String sadd2 = "";
    String scustpo = "";
    String sovership = "";
    String soverprod = "";
    String sstatus = "";
    String splant = "";
    String sshipweight = "";
    String sordweight = "";
    String sGross = "";
    String sNet = "";
    String sWeight = "";
    String sName = "";
    String sGross1 = "";
    String sNet1 = "";
    String sWeight1 = "";
    String sMessage = ""; //储存弹出窗口内容;
    //通过worksno,internal在表ord_item ord_hdr 中查询定位
    String selectsql = "select a.alloy,a.temper,a.[WIDTH],a.[gauge],a.internal,a.account,a.subacct,a.Islbs,a.lbs,a.kgs,a.status,a.servstatus,a.lstatus,a.plant,a.custprod,a.overprod,a.overship,b.custpo,b.ordertype from ord_item a left outer join ord_hdr b on a.internal=b.internal where worksno='" + sCode + "'";
    ASResultSet rs1 = Sqlca.getASResultSet(selectsql);
    System.out.println("flkdjsflkjdsklfjkdlsjfkdsjk");
    if (rs1.next()) {
        sDesc = rs1.getString("alloy") + " " + rs1.getString("temper") + " " + rs1.getString("WIDTH") + " " + rs1.getString("gauge");
        System.out.println("flkdjsflkjdsklfjkdlsjfkdsjk");
        saccount = rs1.getString("account");
        System.out.println("flkdjsflkjdsklfjkdlsjfkdsjk");
        ssubacct = rs1.getString("subacct");
        scustprod = StringUtils.nullToEmpty(rs1.getString("custprod"));
        scustpo = StringUtils.nullToEmpty(rs1.getString("custpo"));
        sordertype = rs1.getString("ordertype");
        sstatus = rs1.getString("status");
        splant = rs1.getString("plant");
        soverprod = rs1.getString("overprod");
        sovership = rs1.getString("overship");
        //sName = rs1.getString("Name")+" "+rs1.getString("add2");
        if (rs1.getString("Islbs").equals("1")) {
            sordweight = rs1.getString("lbs");
            sWeight = (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("lbs");//"lbs";
        } else {
            sordweight = rs1.getString("kgs");
            sWeight = (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("kgs");//"kgs";
        }
    }
    if (sordertype.equals("REG")) {
        //通过account、subacct在表customer中进行查询定位
        selectsql = "select shname,shadd1,shadd2,shcity,shprovst,shcountry,crdflag from customer where account='" + saccount + "'and subacct='" + ssubacct + "'";
        System.out.println("flkdjsflkjdsklfjkdlsjfkdsjk11111111111111111111111");
        rs1 = Sqlca.getASResultSet(selectsql);
        if (rs1.next()) {
            sshname = rs1.getString("shname");
            System.out.println(rs1.getString("crdflag") + "  " + soverprod + "  " + sovership);

            sadd1 = StringUtils.nullToEmpty(rs1.getString("shadd1")) + ", " + StringUtils.nullToEmpty(rs1.getString("shadd1"));
            sadd2 = StringUtils.nullToEmpty(rs1.getString("shcity")) + ", " + StringUtils.nullToEmpty(rs1.getString("shprovst")) + "," + StringUtils.nullToEmpty(rs1.getString("shcountry"));
            //通过对字段值判断,给出相应提示信息
            if (rs1.getString("crdflag") != null) {
                if (rs1.getString("crdflag").equals("LC") && ((soverprod == null) || sovership == null)) {
                    sMessage += (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("msg5");
                } else
                if (rs1.getString("crdflag").equals("CH") && (soverprod==null || sovership==null)) {
                    sMessage += (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("msg4");
                } else if (rs1.getString("crdflag").equals("NC") && (soverprod==null || sovership==null)) {
                    sMessage += (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("msg6");
                } else if (rs1.getString("crdflag").equals("CA") && (sovership==null)) {
                    sMessage += (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("msg7");
                } else if (rs1.getString("crdflag").equals("PD") && (sovership==null)) {
                    sMessage += (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("msg8");
                } else if (rs1.getString("crdflag").equals("CD") && (sovership==null)) {
                    sMessage += (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("msg9");
                } else if (rs1.getString("crdflag").equals("NO") && (soverprod.equals("") || sovership.equals(""))) {
                    sMessage += (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("msg3");
                }
            }
        }
    } else {
        //通过ordertype在表whouse中查询定位
        selectsql = "select wname ,shadd1,shadd2,shcity,shprovst,shcountry from whouse  where Shpcode='" + sordertype + "'";
        rs1 = Sqlca.getASResultSet(selectsql);
        if (rs1.next()) {
            sshname = rs1.getString("wname");
            sadd1 = rs1.getString("shadd1") + ", " + rs1.getString("shadd1");
            sadd2 = rs1.getString("shcity") + ", " + rs1.getString("shprovst") + "," + rs1.getString("shcountry");
        }
    }
    //计算shipment的合计值
    rs1 = Sqlca.getASResultSet("select sum([net]) as sum_net from shipment where (shiptype is null or shiptype='') and worksno='" + sCode + "'");
    if (rs1.next()) {
        sshipweight = rs1.getString("sum_net");
    }

    //是否为磅
    boolean islbs = false;
    rs1 = Sqlca.getASResultSet("select islbs from packnote where (blno is null or blno='') and worksno='" + sCode + "'");
    if (rs1.next()) {
        islbs = rs1.getString("islbs").equals("1");
    }
    //计算packnote的合计值
    rs1 = Sqlca.getASResultSet("select sum([gross])as sum_gross,sum([net]) as sum_net from packnote where (blno is null or blno='') and worksno='" + sCode + "'");
    if (rs1.next()) {
        sGross = rs1.getString("sum_gross");
        sNet = rs1.getString("sum_net");
        if (islbs) {//是磅则单位换算再取整;

            sWeight1 = (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("lbs");
        } else {
            Double d = new Double(Math.round(rs1.getDouble("sum_gross") * 2.20460));
            sGross1 = d.toString();
            d = new Double(Math.round(rs1.getDouble("sum_net") * 2.20460));
            sNet1 = d.toString();
            sWeight1 = (String) Configure.getConfigure(sIe_Language, "Whatistoship").get("lbs");
        }
    }
%>
<script type="text/javascript">
    function poperror(msg) {
        if (msg.length > 0) {
            alert(msg);
        }
    }

</script>

<body onLoad="javascript:poperror('<%=sMessage%>')" bgcolor="#DCDCDC">
<p align="center"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("title")%>
</p>

<table width=100% align="center">
    <tr>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("WorksNo")%>
        </td>
        <td align="right"><%=sCode%>
        </td>
        <td colspan="2" align="right"><%=sDesc%>
        </td>
    </tr>
    <tr>
        <td align="right">&nbsp; <%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("Customer")%>
        </td>
        <td align="right">&nbsp;<%=saccount + "-" + ssubacct%>
        </td>
        <td colspan="2" align="right">&nbsp;<%=sshname%>
        </td>
    </tr>
    <tr>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("CustPart")%>
        </td>
        <td align="right"><%=StringUtils.nullToEmpty(scustprod)%>
        </td>
        <td colspan="2" align="right"><%=sadd1%>
        </td>
    </tr>
    <tr>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("CusPO")%>
        </td>
        <td align="right"><%=StringUtils.nullToEmpty(scustpo)%>
        </td>
        <td colspan="2" align="right"><%=StringUtils.nullToEmpty(sadd2)%>
        </td>
    </tr>
    <tr>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("Order")%>
        </td>
        <td align="right"><%=StringUtils.nullToEmpty(sordweight)%>
        </td>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("Status")%><%=StringUtils.nullToEmpty(sstatus)%>
        </td>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("Plant")%><%=StringUtils.nullToEmpty(splant)%>
        </td>
    </tr>
    <tr>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("Shipments")%>
        </td>
        <td align="right"><%=StringUtils.nullToEmpty(sshipweight)%>
        </td>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("Gross")%><%=StringUtils.nullToEmpty(sGross)%>
        </td>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("NET")%><%=StringUtils.nullToEmpty(sNet)%>
            &nbsp;<%=StringUtils.nullToEmpty(sWeight)%>
        </td>
    </tr>
</table>
<p>&nbsp;</p>
<table width=100% align="center">
    <tr>
        <td align="right" colspan="5"><%=sName%>
        </td>
    </tr>
    <tr>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("LOT")%>
        </td>
        <td></td>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("NET")%>
        </td>
        <td></td>
        <td align="right">&nbsp;</td>
    </tr>
    <%
        ASResultSet rs_packnote = Sqlca.getASResultSet("select pnno,[gross],[net] from packnote where (blno is null or blno='') and worksno ='" + sCode + "' order by pnno");
        while (rs_packnote.next()) {
    %>
    <tr>
        <td align="right"><%=rs_packnote.getString("pnno")%>
        </td>
        <td></td>
        <td align="right"><%=rs_packnote.getString("net")%>
        </td>
        <td></td>
        <td align="right">&nbsp;</td>
    </tr>
    <%}%>
    <tr>
        <td align="right">&nbsp; <%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("Gross")%>
        </td>
        <td align="right">&nbsp;<%=StringUtils.nullToEmpty(sGross1) + "  " + StringUtils.nullToEmpty(sWeight1)%>
        </td>
        <td align="right"><%=(String) Configure.getConfigure(sIe_Language, "Whatistoship").get("NET")%>
        </td>
        <td align="right">&nbsp;<%=StringUtils.nullToEmpty(sNet1)%>
        </td>
        <td align="right">&nbsp;<%=StringUtils.nullToEmpty(sWeight1)%>
        </td>
    </tr>
</table>
<p>&nbsp;</p>
</body>

<%@ include file="/IncludeEnd.jsp" %>
</html>

⌨️ 快捷键说明

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