酒店点菜系统的开发与实现说明书
实训说明书
实训名称: JavaEE 框架与应用开发实训 题目名称: 酒店外卖网上订餐系统 专
班 级:
小组成员
年 1 月
任务分工情况说明
2016
一. 功能需求分析
1. 概述
网上订餐系统的设计与实施迎合了二十一世纪经济高速发展、人们的生活节奏日益加快以及现代餐饮业越来越发达和便捷这一现状。网上订餐系统将极大地方便食客的就餐。同时也有利于管理和售后服务。同时,订餐系统还能帮助酒店扩大营业范围,增加知名度等。
2 需求分析 2.1软件需求
此系统整体可以分为两个子系统,其中一个为针对顾客开放的网上点菜系统.另一个为针对餐厅管理人员开放的菜单及订单管理系统。
顾客点菜主要流程如下:
1.顾客登录网上点菜系统进行菜单的浏览或者注册为会员。
2.会员可以对自己的个人信息进行更改,以会员形式登录的顾客享受优惠。 3.如果顾客觉得菜单应该有所改变则可对已选的菜单进行选择、更改、删除。 4.当顾客确定点菜完毕后,顾客可以将其提交至服务器并生成订单 管理员订单管理的业务流程如下:
1.管理员在本地登录后既可对服务器上的菜单进行添加、删除、修改。
2.当菜单管理工作结束之后,管理员可以对订单进行管理,进行确认和查看详细信息操作。
本系统解决传统的手工管理菜单、订单以及点菜信息效率低下等问题.酒店还可根据自己的特点添加特色模块,使酒店富于个性化.提高外卖业务的销售量。
3.3.1 客户端子系统功能分析
根据对顾客点菜系统业务流程的分析,可以看出顾客点菜主要涉及到一些数据库的逻辑和程序应用逻辑。具体的功能归纳如下:
(1)顾客通过房台号及随机密码登陆点菜系统进行菜单的浏览。
(2)顾客可以在客户端查询自己的开台信息,包括当前消费金额及所交押金数额等。 (3)顾客在点菜时,可以对已选的菜单进行更改数量或者取消选择。 (4)当顾客确定点菜完毕后,顾客将其提交至服务器并生成菜单。 (5)顾客可以查询已点菜单信息及已退菜单信息。 (6)顾客提交过点单后,还可根据需要添加菜单。 3.3.2 服务端系统功能分析
根据营业员及管理员的业务流程的分析,可以看出服务端系统要涉及到一些数据库的逻辑操作和程序应用逻辑。具体的功能归纳如下: (1)管理员在服务端登陆,可以创建新的管理员及营业员。
(2)管理员对服务器上的菜单可进行添加、删除和修改,比如更改菜单的名称、类别、价格等等,还可以添加新的菜品类别及退菜原因设置。 (3)管理员可以对一些打折的菜品进行折扣设置,设置折扣率。 (4)管理员还可以对房台信息进行管理,主要包括添加及删除房台。
(5)为保证数据的安全性,管理员可以对数据库进行定期的备份操作,以便系统出现故障导致数据丢失时可以恢复数据;管理员还可以随时清理一些没有使用价值的数据信息,如点单历史信息、结账历史信息,以减小数据库的负荷。 以下是管理员及营业员都可以使用的功能: (6)开台
顾客在前台登记交押金并开台,获取房台号及密码后方可进入点菜子系统。 (7)并台
顾客在就餐过程中,当遇到亲朋好友也在此就餐时,可以实现两房台合并至同一房台,并能保证数据的一致性。 (8)转台
顾客在就餐过程中,可能由于环境等各种原因需要换台,可以实现从一房台转
至另一房台,并能保转台的数据的一致性。 (9)退菜
顾客在就餐过程中,可以会遇到菜品质量有问题或者不需要未上过的菜品时,可以向前台申请退菜,系统自动删除不需要的菜单,并自动重新计算消费金额。 (10)结账
当顾客消费完后,需要到前台结账,可以实现自动结账功能,包括自动计算消费金额、打印顾客账单等。 (11)更改登陆
可以通过此功能在不同用户间进行切换登陆。 (12)更改密码
此功能可以更改当前系统用户的登陆密码,确保密码安全。 3.3.3 查询/统计
系统的查询主要包括顾客点单查询,可根据房台编号、顾客姓名、点单编号及顾客编号中的任一条件实现顾客的点单查询; 房台信息查询;菜谱信息查询;退菜信息查询等。
统计主要包括日营业统计及月营业统计。 3.3.4 数据报表
主要是为了实现对一些重要的信息进行打印,主要包括顾客的消费账单、日营业报表及月营业报表的打印等。
方便顾客及酒店管理者对相关数据的了解,使消费过程更加透明化,可视化,充分的体现了本系统的人性化设计。
3.4系统结构图
根据对系统的调研和系统功能分析,构绘出系统结构图,包括客户端和服务端。其中,客户端是顾客进行点菜、加菜等,该模块都是由顾客自主进行操作。而服务端是由管理员和营业员进行操作。 系统结构图(客户端)如图3-1所示。
图3-1 系统结构图(客户端)
系统结构图(服务端)如图3-2所示。
图3-2 系统结构图(服务端)
4 数据库设计
成功的数据库设计意味着数据库能够存储所有必需的数据,而且其存储方式保证能够快速的保存、提取、编辑、删除数据。许多因素影响数据库设计是否成功,而数据库是否规范化是一个关键的因素。一个规范化的数据库应满足第三范式的要求,即应该竭力避免部分依赖和传递依赖,因为它们的存在表示存在数据冗余。数据冗余将会造成由于数据异常而引起的错误和不希望出现的数据管理问题。本系统按照概念设计、逻辑设计、物理设计的流程完成数据库设计,力求满足该设计原则。该系统的数据库服务器采用比较适合中型数据量的SQL server2000。
4.1 数据库概要设计
通过调查研究和需求分析,本系统可以定义出八个实体。它们分别是:用户、菜谱、房台类型、菜品类别、房台信息、开台信息、点单、结账。各实体的属性及属性间的联系见下面的E-R 图。
4.2 系统E-R 图
根据以上系统分析,采用E-R 图方法表示概念设计如下: 系统E-R 图如图4-1所示。
用户实体E-R 图如图4-2所示。
图4-2 用户实体E-R 图
菜谱实体E-R 图如图4-3所示。
图4-3 菜谱实体E-R 图
菜品类型实体E-R 图如图4-4所示。房台类型实体E-R 图如图4-5所示。
图4-4 菜品类型实体E-R 图 图4-5 房台类型实体E-R 图
房台信息实体E-R 图如图4-6所示。
图4-6 房台信息实体E-R 图
开台信息实体E-R 图如图4-7所示。
图4-7 开台信息实体E-R 图
点单实体E-R 图如图4-8所示。
图4-8 点单实体E-R 图
结账实体E-R 图如图4-9所示。
图4-9 结账实体E-R 图
4.3 数据库表结构设计
用户表(tb_user)如表4-1所示。
表4-1 用户表(tb_user)
菜谱表(tb_menu)如表4-2所示。
菜品类别表(tb_kind)如表4-3所示。
房台类型表(tb_tablekind)如表4-4所示。
房台信息表(tb_table)如表4-5所示。
表4-5 房台信息表(tb_table)
5. 核心代码
package nuc.B03.property.action;
import java.util.ArrayList; import java.util.List;
import nuc.B03.property.dao.CustomerDAO; import nuc.B03.property.model.Customer; import nuc.B03.property.model.User;
import nuc.B03.property.service.BusinessServiceImpl; import com.opesymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven;
public class CustomerAction extends ActionSupport implements ModelDriven{ /** * */ private static final long serialVersionUID = 1L;
private Customer customer=new Customer();
private List customerList=new ArrayList(); public List getCustomerList() { return customerList; }
public void setCustomerList(List customerList) { this.customerList = customerList; }
private String password1; private int id; private int temp;
public int getTemp() { return temp; }
public void setTemp(int temp) { this.temp = temp; }
public int getId() { return id; }
public void setId(int id) { this.id = id; }
public String getPassword1() { return password1; }
public void setPassword1(String password1) { this.password1 = password1; }
public Customer getCustomer() { return customer; }
public void setCustomer(Customer customer) { this.customer = customer; }
@Override
public Customer getModel() { // TODO Auto-generated method stub return customer; }
public String registUser() throws Exception { // TODO Auto-generated method stub CustomerDAO dao=new CustomerDAO(); if(dao.doInsert(customer)) { ActionContext.getContext().getSession().put("customer", customer); return "registOK"; }else return INPUT; } }
package nuc.B03.property.model;
public class Food { private int userId; private String username; private String price; private String opinion; public String getOpinion() { return opinion; } public void setOpinion(String opinion) { this.opinion = opinion; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public String getUsername() { return username; } public void setUsername(String username) {
this.username = username; } }
package nuc.B03.property.action;
import java.util.ArrayList; import java.util.List;
import nuc.B03.property.dao.CustomerDAO; import nuc.B03.property.model.Customer; import nuc.B03.property.model.User;
import nuc.B03.property.service.BusinessServiceImpl; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven;
public class CustomerAction extends ActionSupport implements ModelDriven{ /** * */ private static final long serialVersionUID = 1L; private Customer customer=new Customer(); private List customerList=new ArrayList(); public List getCustomerList() { return customerList; } public void setCustomerList(List customerList) { this.customerList = customerList; } private String password1; private int id; private int temp; public int getTemp() { return temp; } public void setTemp(int temp) { this.temp = temp; } public int getId() { return id;
} public void setId(int id) { this.id = id; } public String getPassword1() { return password1; } public void setPassword1(String password1) { this.password1 = password1; } public Customer getCustomer() { return customer; } public void setCustomer(Customer customer) { this.customer = customer; } @Override public Customer getModel() { // TODO Auto-generated method stub return customer; } public String registUser() throws Exception { // TODO Auto-generated method stub CustomerDAO dao=new CustomerDAO(); if(dao.doInsert(customer)) { ActionContext.getContext().getSession().put("customer", customer); return "registOK"; }else return INPUT; } } package nuc.B03.property.action;
import java.util.ArrayList; import java.util.List;
import nuc.B03.property.dao.CustomerDAO; import nuc.B03.property.model.Customer; import nuc.B03.property.model.User;
import nuc.B03.property.service.BusinessServiceImpl;
import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven;
public class CustomerAction extends ActionSupport implements ModelDriven{ /** * */ private static final long serialVersionUID = 1L; private Customer customer=new Customer(); private List customerList=new ArrayList(); public List getCustomerList() { return customerList; } public void setCustomerList(List customerList) { this.customerList = customerList; } private String password1; private int id; private int temp; public int getTemp() { return temp; } public void setTemp(int temp) { this.temp = temp; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getPassword1() { return password1; } public void setPassword1(String password1) { this.password1 = password1; } public Customer getCustomer() { return customer;
}
public void setCustomer(Customer customer) { this.customer = customer; }
@Override
public Customer getModel() { // TODO Auto-generated method stub return customer; }
public String registUser() throws Exception { // TODO Auto-generated method stub CustomerDAO dao=new CustomerDAO(); if(dao.doInsert(customer)) { ActionContext.getContext().getSession().put("customer", customer); return "registOK"; }else return INPUT; }