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

📄 exportitemsubmittempaction.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:   ExportItemSubmitTempAction.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.rule.ExportItemSearchRule;
import mediastore.web.form.GoodsExportGoodsInfo;
import mediastore.web.global.Globals;
import mediastore.web.page.ExportItemSearchConPage;
import mediastore.web.struts.*;
import org.apache.struts.action.ActionForward;

public class ExportItemSubmitTempAction extends AbstractAction
{

    public ExportItemSubmitTempAction()
    {
    }

    public ActionForward execute(ActionContext actionContext)
        throws Exception
    {
        System.out.println("---Start: ExportItemSubmitTempAction::execute(actionContext)---");
        String startRecNumStr = actionContext.getParameter("start_rec_num");
        int startRecNum = Integer.parseInt(startRecNumStr);
        int recNumOfPage = Globals.REC_NUM_OF_PAGE;
        String orderStr = actionContext.getParameter("orderstr");
        String billIdStr = actionContext.getParameter("billid");
        int billId = Integer.parseInt(billIdStr);
        String goodsId = actionContext.getParameter("goodsid");
        if(goodsId == null)
            goodsId = "";
        String goodsName = actionContext.getParameter("goodsname");
        if(goodsName == null)
            goodsName = "";
        String salesPerson = actionContext.getParameter("salesperson");
        if(salesPerson == null)
            salesPerson = "";
        String confirmFlage = actionContext.getParameter("confirmflage");
        if(confirmFlage == null)
            confirmFlage = "";
        String createTime1 = actionContext.getParameter("createtime1");
        if(createTime1 == null)
            createTime1 = "";
        String createTime2 = actionContext.getParameter("createtime2");
        if(createTime2 == null)
            createTime2 = "";
        ExportItemSearchRule eisr = new ExportItemSearchRule();
        eisr.setStartRecNum(startRecNum);
        eisr.setRecNumOfPage(recNumOfPage);
        eisr.setOrderStr(orderStr);
        eisr.setBillId(billId);
        eisr.setGoodsId(goodsId);
        eisr.setGoodsName(goodsName);
        eisr.setSalesPerson(salesPerson);
        eisr.setConfirmFlage(confirmFlage);
        eisr.setCreateTime1(createTime1);
        eisr.setCreateTime2(createTime2);
        GoodsExportGoods geg = new GoodsExportGoods();
        GoodsExportInfo gei = new GoodsExportInfo();
        GoodsInfo gi = new GoodsInfo();
        String submitBillIdStr = actionContext.getParameter("submitbillid");
        int submitBillId = Integer.parseInt(submitBillIdStr);
        int memberId = geg.getMemberId(submitBillId);
        SessionContext ctx = (SessionContext)actionContext.getSession().getAttribute(Globals.SESSION_CONTEXT);
        String salesPersons = ctx.getUserName();
        if(salesPersons == null)
            salesPersons = "";
        List salesPersonList = geg.getSalesPersonList(submitBillId);
        for(int i = 0; i < salesPersonList.size(); i++)
        {
            String curPerson = (String)salesPersonList.get(i);
            if(salesPersons.indexOf(curPerson) == -1)
                if(salesPersons.equals(""))
                    salesPersons = curPerson;
                else
                    salesPersons = salesPersons + "," + curPerson;
        }

        List goodsList = geg.getGoodsList(submitBillId);
        float totalPrice = 0.0F;
        for(int i = 0; i < goodsList.size(); i++)
        {
            GoodsExportGoodsInfo tmp_gegi = (GoodsExportGoodsInfo)goodsList.get(i);
            totalPrice += (float)tmp_gegi.getExportAmount() * tmp_gegi.getExportUnitPrice();
        }

        MemberInfoDAO mi = new MemberInfoDAO();
        float discount = mi.getDiscount(memberId);
        float totalDisPrice = totalPrice * discount;
        gei.insertNewBillRec(submitBillId, memberId, salesPersons, totalPrice, discount, totalDisPrice, "0");
        geg.updateConfirmFlageToOne(submitBillId);
        for(int i = 0; i < goodsList.size(); i++)
        {
            GoodsExportGoodsInfo tmp_gegi = (GoodsExportGoodsInfo)goodsList.get(i);
            String curGoodsId = tmp_gegi.getGoodsId();
            int curra = tmp_gegi.getCurRepertoryAmount();
            int curea = tmp_gegi.getExportAmount();
            if(curra >= curea)
                gi.updateRepertoryAmount(curGoodsId, curea, curra);
        }

        DynamicForm dynaForm = (DynamicForm)actionContext.getForm();
        dynaForm.put("exportItemSearchRule", eisr);
        System.out.println("---End: ExportItemSubmitTempAction::execute(actionContext)---");
        return ExportItemSearchConPage.show(actionContext);
    }
}

⌨️ 快捷键说明

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