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

📄 docancel.jsp

📁 运输模块代码
💻 JSP
字号:
<%@ page contentType="text/html;charset=GBK" %>
<%@ include file="/IncludeBegin.jsp" %>
<%@ page import="com.hexiesoft.utils.*" %>
<%
    String sCode = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("Code"));

    ASResultSet invoiceRs;
    ASResultSet packnoteRs;
    ASResultSet shipmentRs;
    ASResultSet standsRs;

%>
<%
    boolean flag = false;
    String sql = "";

    boolean plantIsHill = false;
    String islbs = "";
    float ship_weight = 0.0f;
    float net = 0.0f;
    String alloy = "";
    String shipdt = "";
    try {
        //Sqlca.conn.setAutoCommit(false);
        //更新ord_item表
        sql = "select * from packnote where blno='" + sCode + "'";
        packnoteRs = Sqlca.getASResultSet(sql);
        float sWorksno = 0.0f;
        while (packnoteRs.next()) {
            sWorksno = packnoteRs.getFloat("worksno");
            sql = "update ord_item set  STATUS='IP'  where worksno='" + sWorksno+"'";
            Sqlca.executeSQL(sql);
        }

        //更新表packnote的ordertype,custpo,blno
        sql = "update packnote set ordertype='',custpo='',blno='' where blno='" + sCode + "'";
        Sqlca.executeSQL(sql);

        sql = "select * from shipment where blno='" + sCode + "'";
        shipmentRs = Sqlca.getASResultSet(sql);
        while (shipmentRs.next()) {
            islbs = shipmentRs.getString("islbs");
            net = shipmentRs.getFloat("net");
            alloy = shipmentRs.getString("alloy");
            shipdt = shipmentRs.getString("shipdt");
            if (islbs.equals("1")) {
                ship_weight = net;
            } else {
                ship_weight = net * 2.2046f;
            }//end if(islbs=1)-else

            //if (plant=hill)
            if (shipmentRs.getString("plant").equals("HILL")) {
                plantIsHill = true;
                //更新表schedule
                if (alloy.equals("12200") || alloy.equals("14300")) {
                    sql = "update schedule set c300ship=c300ship-" + ship_weight + " where week_date='" + shipdt + "'";
                    Sqlca.executeSQL(sql);
                } else if (alloy.equals("11000") || alloy.equals("C1100")) {
                    sql = "update schedule set etpship=etpship-" + ship_weight + " where week_date='" + shipdt + "'";
                    Sqlca.executeSQL(sql);
                } else if (alloy.equals("14200")) {
                    sql = "update schedule set c420ship=c420ship-" + ship_weight + " where week_date='" + shipdt + "'";
                    Sqlca.executeSQL(sql);
                } else if (shipmentRs.getString("account").equals("FEDCO")) {
                    sql = "update schedule set corship=corship-" + ship_weight + " where week_date='" + shipdt + "'";
                    Sqlca.executeSQL(sql);
                } else if (alloy.equals("2600W") || alloy.equals("INHBW")) {
                    sql = "update schedule set wtbship=wtbship-" + ship_weight + " where week_date='" + shipdt + "'";
                    Sqlca.executeSQL(sql);
                } else {
                    sql = "update schedule set regship=regship-" + ship_weight + " where week_date='" + shipdt + "'";
                    Sqlca.executeSQL(sql);
                }

            }
            sql = "delete from shipment where blno='" + sCode + "'";
            Sqlca.executeSQL(sql);
        }//end while

        if (plantIsHill) {
            //更新数据表stands
            sql = "update stands set blno='',shipdt=null where blno='" + sCode + "'";
            Sqlca.executeSQL(sql);

        }
        //Sqlca.conn.commit();
          String success_operation = (String) Configure.getConfigure(sIe_Language, "Common").get("SUCCESS_OPERATION_COM");
        %>
        
   <script language="javascript">
    alert('<%= success_operation %>');
     OpenComp("CancelShippingListOK", "/Blank.jsp",
             "rand=" + randomNumber(), "right", "");
</script> 
        
        <%
    } catch (Exception e) {
        //Sqlca.conn.rollback();
       e.printStackTrace();
    } finally {
       // Sqlca.conn.setAutoCommit(true);
    }


%>

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

⌨️ 快捷键说明

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