ordermanageaction.java

来自「一个完整的网络订餐系统」· Java 代码 · 共 61 行

JAVA
61
字号
package com.order.web.action;

import com.common.*;
import com.common.struts.*;
import com.order.rule.OrderRule;
import org.apache.struts.action.ActionForward;
import com.order.web.page.OrderManagePage;
import java.util.Date;
import java.text.SimpleDateFormat;

public class OrderManageAction  extends AbstractAction {

  public OrderManageAction() {
  }

  public ActionForward execute(ActionContext actionContext) throws java.lang.Exception {

    SessionContext ctx = (SessionContext) actionContext.getSession().getAttribute(Globals.SESSION_CONTEXT);
    String storeID = ctx.getStoreID();

    String startRecNumStr = actionContext.getParameter("start_rec_num");
    if (startRecNumStr == null || "".equals(startRecNumStr))
      startRecNumStr = "1";
    int startRecNum = Integer.parseInt(startRecNumStr);
    int recNumOfPage = Globals.REC_NUM_OF_PAGE;
    String orderStr = actionContext.getParameter("orderstr");

    String status = actionContext.getParameter("status");
    String memberID =  actionContext.getParameter("memberID");

    String sendDate1 = actionContext.getParameter("sendDate1");
    String sendDate2 = actionContext.getParameter("sendDate2");

    SimpleDateFormat curDate = new SimpleDateFormat("yyyy-MM-dd");

    if(("").equals(sendDate1)||null==sendDate1)
      sendDate1 = curDate.format(new Date());
    if(("").equals(sendDate2)||null==sendDate2)
      sendDate2 = curDate.format(new Date());

    OrderRule rule = new OrderRule();

    rule.setStartRecNum(startRecNum);
    rule.setRecNumOfPage(recNumOfPage);
    rule.setOrderStr(orderStr);

    rule.setStatus(status);
    rule.setMemberID(memberID);
    rule.setSendDate1(sendDate1);
    rule.setSendDate2(sendDate2);

    rule.setStoreID(storeID);

    DynamicForm dynaForm = (DynamicForm)actionContext.getForm();

    dynaForm.put("orderSearchRule", rule);

    return OrderManagePage.show(actionContext);
  }
}

⌨️ 快捷键说明

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