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

📄 saleaction.java

📁 java开发购物车+网上书城
💻 JAVA
字号:
package com.xaccp.aj3q8073.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xaccp.aj3q8073.controller.Action;
import com.xaccp.aj3q8073.controller.ActionForward;
import com.xaccp.aj3q8073.dao.SaleDao;

public class SaleAction implements Action {

	SaleDao dao=new SaleDao();
	
	/**
	 * 查询待发货的订单
	 */
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		List list= dao.findWaitOkOrder();
		request.setAttribute("order_list", list);
		return new ActionForward("/background/OrderFormList.jsp");
	}
	/**
	 * 查询待付款的订单
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward findWaitPayOrder(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		List list= dao.findWaitPayOrder();
		request.setAttribute("order_list", list);
		return new ActionForward("/background/OrderFormList.jsp");
	}
	
	/**
	 * 查询已取消的订单
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward findCancleOrder(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		List list= dao.findCancleOrder();
		request.setAttribute("order_list", list);
		return new ActionForward("/background/OrderFormList.jsp");
	}
	/**
	 * 查询已成功的订单
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward findHistoryOrder(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		List list= dao.findHistoryOrder();
		request.setAttribute("order_list", list);
		return new ActionForward("/background/OrderFormList.jsp");
	}
	
	/**
	 * 查找订单详情
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward findOrderDetail(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String id= request.getParameter("id");
		List list= dao.findOrderDetail(id);//查找订单详情
		request.setAttribute("order_da", list);
		Object obj= dao.findOrderUser(id);
		request.setAttribute("order_user", obj);//查找订单用户信息
		return new ActionForward("/background/orderFormInformationBrow.jsp");
	}
	
	/**
	 * 根据输入信息查询订单信息
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward findOrderByInfo(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String condition=request.getParameter("condition");
		
//		condition=java.net.URLDecoder.decode(condition,"UTF-8");
//		condition=new String(condition.getBytes("iso-8859-1"),"UTF-8");
		
		System.out.println(condition);
		List list= dao.findOrderByInfo(condition);
		request.setAttribute("order_list", list);
		return new ActionForward("/background/OrderFormList.jsp");
	}
	
	/**
	 * 更新为发货
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward sendGoods(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String id=request.getParameter("id");
		dao.sendGoods(id);
		return new ActionForward("/sale.do");
	}
	
	/**
	 * 更新为取消
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward cancleGoods(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String id=request.getParameter("id");
		dao.cancleGoods(id);
		return new ActionForward("/sale.do");
	}
	
	/**
	 * 更新为等待发货
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward renew(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String id=request.getParameter("id");
		dao.renew(id);
		return new ActionForward("/cancle.do");
	}
	
	/**
	 * 更新为历史订单
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward succeed(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String id=request.getParameter("id");
		dao.succeed(id);
		return new ActionForward("/pay.do");
	}
}

⌨️ 快捷键说明

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