|
|
|
@ -14,22 +14,31 @@ import com.cn.service.impl.PrepServiceImpl;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @ClassName: GetAllPrepServlet
|
|
|
|
|
* @Description: 管理员 订单中心
|
|
|
|
|
* @ClassName: GetAllPrepServlet
|
|
|
|
|
* @Description: 管理员订单中心,用于获取所有订单信息
|
|
|
|
|
* @author: ljy
|
|
|
|
|
* @date: 2019年11月16日 下午7:44:25
|
|
|
|
|
*/
|
|
|
|
|
public class GetAllPrepServlet extends HttpServlet {
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
|
|
|
PrepService prepService = new PrepServiceImpl();
|
|
|
|
|
List<Prep> prepList = prepService.getAll();
|
|
|
|
|
request.setAttribute("prepList", prepList);
|
|
|
|
|
request.getRequestDispatcher("pages/admin/right/prepCenter.jsp").forward(request, response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 处理GET请求的方法。
|
|
|
|
|
* 当客户端发送GET请求时,这个方法会被调用。
|
|
|
|
|
* @param request HttpServletRequest对象,包含客户端请求信息。
|
|
|
|
|
* @param response HttpServletResponse对象,用于发送响应到客户端。
|
|
|
|
|
* @throws ServletException 可能抛出的Servlet异常。
|
|
|
|
|
* @throws IOException 可能抛出的IO异常。
|
|
|
|
|
*/
|
|
|
|
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
|
|
|
// 创建PrepService的实现类对象,用于访问订单相关的业务逻辑
|
|
|
|
|
PrepService prepService = new PrepServiceImpl();
|
|
|
|
|
// 调用prepService的getAll方法获取所有订单的列表
|
|
|
|
|
List<Prep> prepList = prepService.getAll();
|
|
|
|
|
// 将订单列表设置为request的属性,以便在JSP页面中可以访问
|
|
|
|
|
request.setAttribute("prepList", prepList);
|
|
|
|
|
// 使用RequestDispatcher将请求转发到指定的JSP页面
|
|
|
|
|
// "pages/admin/right/prepCenter.jsp"是JSP文件的路径,用于展示所有订单信息
|
|
|
|
|
request.getRequestDispatcher("pages/admin/right/prepCenter.jsp").forward(request, response);
|
|
|
|
|
}
|
|
|
|
|
}
|