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

📄 importgoodsbillgoodssubmitaction.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:   ImportGoodsBillGoodsSubmitAction.java

package mediastore.web.action;

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

public class ImportGoodsBillGoodsSubmitAction extends AbstractAction
{

    public ImportGoodsBillGoodsSubmitAction()
    {
    }

    public ActionForward execute(ActionContext actionContext)
        throws Exception
    {
        System.out.println("---Start: ImportGoodsBillGoodsSubmitAction::execute(actionContext)---");
        String curBillIdStr = actionContext.getParameter("curBillId");
        int curBillId = Integer.parseInt(curBillIdStr);
        String sendPersons = actionContext.getParameter("sendpersons");
        if(sendPersons == null)
            sendPersons = "";
        SessionContext ctx = (SessionContext)actionContext.getSession().getAttribute(Globals.SESSION_CONTEXT);
        String inceptPersons = ctx.getUserName();
        if(inceptPersons == null)
            inceptPersons = "";
        String createPersons[] = actionContext.getParameterValues("createperson");
        int strBufLen = 0;
        if(createPersons == null)
            strBufLen = 0;
        else
            strBufLen = createPersons.length;
        for(int i = 0; i < strBufLen; i++)
        {
            String curCreatePerson = createPersons[i];
            if(inceptPersons.indexOf(curCreatePerson) == -1)
                if(inceptPersons.equals(""))
                    inceptPersons = curCreatePerson;
                else
                    inceptPersons = inceptPersons + "," + curCreatePerson;
        }

        String importAmounts[] = actionContext.getParameterValues("importamount");
        String importUnitPrices[] = actionContext.getParameterValues("importunitprice");
        float totalPrice = 0.0F;
        if(importAmounts == null)
            strBufLen = 0;
        else
            strBufLen = importAmounts.length;
        for(int i = 0; i < strBufLen; i++)
            totalPrice += (float)Integer.parseInt(importAmounts[i]) * Float.parseFloat(importUnitPrices[i]);

        String payOrNot = actionContext.getParameter("payornot");
        GoodsImportInfo gii = new GoodsImportInfo();
        gii.insertNewBillRec(curBillId, sendPersons, inceptPersons, totalPrice, payOrNot);
        GoodsImportGoods gig = new GoodsImportGoods();
        gig.updateConfirmFlageToOne(curBillId);
        GoodsInfo gi = new GoodsInfo();
        String goodsIds[] = actionContext.getParameterValues("goodsid");
        if(goodsIds == null)
            strBufLen = 0;
        else
            strBufLen = goodsIds.length;
        for(int i = 0; i < strBufLen; i++)
            gi.importAdjustAandU(goodsIds[i], Integer.parseInt(importAmounts[i]), Float.parseFloat(importUnitPrices[i]), ctx.getUserName());

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

⌨️ 快捷键说明

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