一、源码路径
https://github.com/weiganyi/ibooking
二、界面
通过浏览器访问web网站,可以看到界面如下:
三、背景
这两年来O2O的概念越来越火热,O2O因为能够把线下的资源通过线上的信息沟通渠道进行连接,影响着很多实体行业未来的发展。
这个项目就是为餐饮店提供线上外卖订餐服务的web网站,具有O2O网站的特点。网站有顾客和管理员两类角色,分别对于与餐饮店的顾客和餐饮店自身。用户在网站上注册后会留下用户的地址和联系电话,这些信息会作为送外卖时的用户信息,然后用户能够在网站上看到餐饮店的所有菜品图片,选中后到购物车下单,就会生成一个订单,餐饮店后台可以看到这些订单,然后完成后续的餐品制作和送达服务。
系统后台采用的是成熟的SSH框架来搭建服务,前端仍然是用jsp来拼接页面,所以页面还是在后台生成的。由于本人是后台开发,所以为了美化界面采用bootstrap的css框架,在js框架方面只是使用了jquery,并没有使用其他js框架。数据库方面使用的mysql,对于用户访问量大的几个表采用了redis做为缓存,提高响应速度。
四、功能实现
1、用户功能
1)菜品预定:菜品展示(主页)、购物车、订单列表、订单详情
2)注册登录:注册、登录、用户信息
2、管理员功能
1)用户管理
2)订单管理
3)图片管理
4)菜品管理
5)菜品类型管理
6)配置管理
五、总体设计思路
1、数据库设计
1)其中ib_menu_type表存储菜品类型信息,ib_menu表存储菜品信息,ib_option表存储配置信息,ib_user表存储用户信息,ib_shopping表存储用户购物车信息,ib_order表存储订单信息,ib_order_detail表存储订单详情信息,这7个表为关系型表,使用mysql数据库存储。它们的具体字段如下:
create table ib_menu_type(
menu_type_id int(4) not null primary key auto_increment,
menu_type_name char(255) not null);
create table ib_menu(
menu_id int(4) not null primary key auto_increment,
menu_name char(255) not null,
menu_price int(16) not null,
menu_pic_addr char(255) not null,
menu_type_id int(4) not null);
create table ib_option(
option_id int(4) not null primary key auto_increment,
option_name char(255) not null,
option_value char(255) not null);
create table ib_user(
user_id int(16) not null primary key auto_increment,
user_name char(255) not null,
user_passwd char(255) not null,
user_auth enum('admin', 'customer') not null,
user_tel char(255) not null,
user_addr char(255) not null);
create table ib_shopping(
shopping_id int(16) not null primary key auto_increment,
shopping_user_name char(255) not null,
shopping_menu_name char(255) not null,
shopping_menu_price int(16) not null,
shopping_amount int(16) not null,
sho