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

📄 exportgoodsbillgoodssubmitaction.java

📁 用jsp,java写的在线购物系统
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   ExportGoodsBillGoodsSubmitAction.java

package mediastore.web.action;

import java.io.PrintStream;
import java.util.List;
import javax.servlet.http.HttpSession;
import mediastore.common.SessionContext;
import mediastore.dao.*;
import mediastore.web.form.GoodsExportGoodsInfo;
import mediastore.web.global.Globals;
import mediastore.web.page.ExportGoodsBillShowPage;
import mediastore.web.struts.*;
import org.apache.struts.action.ActionForward;

public class ExportGoodsBillGoodsSubmitAction extends AbstractAction
{

    public ExportGoodsBillGoodsSubmitAction()
    {
    }

    public ActionForward execute(ActionContext actionContext)
        throws Exception
    {
        System.out.println("---Start: ExportGoodsBillGoodsSubmitAction::execute(actionContext)---");
        GoodsExportGoods geg = new GoodsExportGoods();
        GoodsExportInfo gei = new GoodsExportInfo();
        String curBillIdStr = actionContext.getParameter("curBillId");
        int curBillId = Integer.parseInt(curBillIdStr);
        System.out.println("curBillIdStr:" + curBillIdStr);
        String memberIdStr = actionContext.getParameter("memberid");
        if(memberIdStr == null)
            memberIdStr = "0";
        int memberId = Integer.parseInt(memberIdStr);
        System.out.println("memberIdStr:" + memberIdStr);
        SessionContext ctx = (SessionContext)actionContext.getSession().getAttribute(Globals.SESSION_CONTEXT);
        String salesPersons = ctx.getUserName();
        if(salesPersons == null)
            salesPersons = "";
        String createPersons[] = actionContext.getParameterValues("salesperson");
        int strBufLen = 0;
        if(createPersons == null)
            strBufLen = 0;
        else
            strBufLen = createPersons.length;
        for(int i = 0; i < strBufLen; i++)
        {
            String curCreatePerson = createPersons[i];
            if(salesPersons.indexOf(curCreatePerson) == -1)
                if(salesPersons.equals(""))
                    salesPersons = curCreatePerson;
                else
                    salesPersons = salesPersons + "," + curCreatePerson;
        }

        System.out.println("salesPersons:" + salesPersons);
        String totalPriceStr = actionContext.getParameter("totalprice_value");
        System.out.println("totalPriceStr:" + totalPriceStr);
        float totalPrice = Float.parseFloat(totalPriceStr);
        String discountStr = actionContext.getParameter("discount_value");
        float discount = Float.parseFloat(discountStr);
        String totalDisPriceStr = actionContext.getParameter("totaldisprice_value");
        float totalDisPrice = Float.parseFloat(totalDisPriceStr);
        String payOrNot = actionContext.getParameter("payornot");
        List goodsList = geg.getGoodsList(curBillId);
        int tmpflage = 1;
        for(int i = 0; i < goodsList.size(); i++)
        {
            GoodsExportGoodsInfo gegi = (GoodsExportGoodsInfo)goodsList.get(i);
            int curra = gegi.getCurRepertoryAmount();
            int curea = gegi.getExportAmount();
            if(curra < curea)
                tmpflage = 0;
        }

        System.out.println("tmpflage:" + tmpflage);
        if(tmpflage == 1)
        {
            gei.insertNewBillRec(curBillId, memberId, salesPersons, totalPrice, discount, totalDisPrice, payOrNot);
            geg.updateConfirmFlageToOne(curBillId);
            GoodsInfo gi = new GoodsInfo();
            for(int i = 0; i < goodsList.size(); i++)
            {
                GoodsExportGoodsInfo gegi = (GoodsExportGoodsInfo)goodsList.get(i);
                String curGoodsId = gegi.getGoodsId();
                int curra = gegi.getCurRepertoryAmount();
                int curea = gegi.getExportAmount();
                System.out.println("curGoodsId:" + curGoodsId + " RepertoryAmount:" + curra + " ExportAmount:" + curea);
                if(curra >= curea)
                    gi.updateRepertoryAmount(curGoodsId, curea, curra);
            }

        }
        int nextBillId = gei.getMaxBillIDNum();
        nextBillId++;
        DynamicForm dynaForm = (DynamicForm)actionContext.getForm();
        dynaForm.put("maxBillId", (new StringBuffer(String.valueOf(nextBillId))).toString());
        System.out.println("---End: ExportGoodsBillGoodsSubmitAction::execute(actionContext)---");
        return ExportGoodsBillShowPage.show(actionContext);
    }
}

⌨️ 快捷键说明

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