资源简介

分层实现从前台点单模糊分页查询,加入购物车提交订单,到后端的菜品管理、菜系管理、新菜品的上传,退桌订桌状态的查看,是一套完整的餐馆服务项目。

资源截图

代码片段和文件信息

/**
 * 
 */
package com.hotel.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

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

import com.hotel.pojo.DinnerTable;
import com.hotel.service.DinnerTableServiceI;
import com.hotel.service.impl.DinnerTableServiceImpl;

/**
 *
 *title: DinnerTableServlet
 *Description:TODO
 *@author ghb
 *@date 2016-10-24下午7:12:14
 *
 */
public class DinnerTableServlet extends HttpServlet {
private  DinnerTableServiceI dinnerTableService= new DinnerTableServiceImpl();

public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {

doPost(requestresponse);
}


public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
String method= request.getParameter(“method“);
if(“getDinnerTableList“.equals(method)){
getDinnerTableList(requestresponse);
}else if(“del“.equals(method)){
del(requestresponse);
}else if(“search“.equals(method)){
search(requestresponse);
}else if(“add“.equals(method)){
add(requestresponse);
}else if (“update“.equals(method)){
update(requestresponse);
}
}
//更新
private void update(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
// TODO Auto-generated method stub
String id=request.getParameter(“id“);
dinnerTableService.updateDinnerTable(Integer.parseInt(id));
getDinnerTableList(requestresponse);
}


//添加
private void add(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
// TODO Auto-generated method stub
String tableName = request.getParameter(“tableName“);
System.out.println(tableName);
DinnerTable dinnerTable = new DinnerTable(0tableName0 new Timestamp(new Date().getTime()));
 dinnerTableService.addDinnerTable(dinnerTable);
 getDinnerTableList(requestresponse);
}


//搜索
private void search(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
// TODO Auto-generated method stub
String tableName=request.getParameter(“keyword“);
List dinnerTableList=dinnerTableService.SearchDinnerTable(tableName);
request.setAttribute(“dinnerTableList“ dinnerTableList);
request.getRequestDispatcher(“/sys/boardList.jsp“).forward(request response);

}


//删除
private void del(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
// TODO Auto-generated method stubre
String id=request.getParameter(“id“);
dinnerTableService.delDinnerTable(Integer.parseInt(id));
getDinnerTableList(requestresponse);
}


//餐桌列表
private void getDinnerTableList(HttpServletRequest reque

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-07-14 22:06  day1024hotel\
     文件        1730  2016-10-27 18:58  day1024hotel\.classpath
     目录           0  2016-10-24 17:33  day1024hotel\.myeclipse\
     文件         309  2016-11-05 08:54  day1024hotel\.mymetadata
     文件        1755  2016-10-24 17:56  day1024hotel\.project
     目录           0  2018-07-14 22:06  day1024hotel\.settings\
     文件         500  2016-10-24 17:33  day1024hotel\.settings\.jsdtscope
     文件         364  2016-10-24 17:33  day1024hotel\.settings\org.eclipse.jdt.core.prefs
     文件         474  2016-10-24 17:33  day1024hotel\.settings\org.eclipse.wst.common.component
     文件         252  2016-10-24 17:33  day1024hotel\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-10-24 17:33  day1024hotel\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-10-24 17:33  day1024hotel\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-07-14 22:06  day1024hotel\src\
     文件         529  2016-10-26 16:09  day1024hotel\src\c3p0-config.xml
     目录           0  2018-07-14 22:06  day1024hotel\src\com\
     目录           0  2018-07-14 22:06  day1024hotel\src\com\hotel\
     目录           0  2018-07-14 22:06  day1024hotel\src\com\hotel\controller\
     文件        3366  2016-10-25 19:44  day1024hotel\src\com\hotel\controller\DinnerTableServlet.java
     文件        7269  2016-10-29 16:08  day1024hotel\src\com\hotel\controller\FoodServlet.java
     文件        3713  2016-10-25 21:50  day1024hotel\src\com\hotel\controller\FoodTypeServlet.java
     文件        1653  2016-10-28 10:53  day1024hotel\src\com\hotel\controller\OrderDetailServlet.java
     文件        1419  2016-10-26 11:11  day1024hotel\src\com\hotel\controller\OrdersServlet.java
     文件        1468  2016-10-26 15:58  day1024hotel\src\com\hotel\controller\pDinnerTableServlet.java
     文件        4289  2016-10-28 19:31  day1024hotel\src\com\hotel\controller\pFoodServlet.java
     文件        3682  2016-10-28 19:36  day1024hotel\src\com\hotel\controller\pOrderDetailServlet.java
     文件        3839  2016-10-28 09:19  day1024hotel\src\com\hotel\controller\pOrderServlet.java
     目录           0  2018-07-14 22:06  day1024hotel\src\com\hotel\dao\
     文件         497  2016-10-24 21:07  day1024hotel\src\com\hotel\dao\DinnerTableDaoI.java
     文件         479  2016-10-28 14:57  day1024hotel\src\com\hotel\dao\FoodDaoI.java
     文件         561  2016-10-25 21:43  day1024hotel\src\com\hotel\dao\FoodTypeDaoI.java
     目录           0  2018-07-14 22:06  day1024hotel\src\com\hotel\dao\impl\
............此处省略285个文件信息

评论

共有 条评论