餐馆点餐系统分析与设计
PRIMARY KEY (`id`),
KEY `FK_Merchant_Cuisine` (`cuisine`), KEY `FK_Merchant_Region` (`region`),
CONSTRAINT `FK_Merchant_Cuisine` FOREIGN KEY (`cuisine`) REFERENCES `catery_cuisine` (`id`),
CONSTRAINT
`FK_Merchant_Region`
FOREIGN
KEY
(`region`)
REFERENCES `catery_region` (`id`)
)
管理员数据表的创建脚本代码如下。 CREATE TABLE `catery_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT, `login_name` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `password` varchar(20) DEFAULT NULL, `register_date` datetime DEFAULT NULL, `roles` varchar(255) DEFAULT NULL, `salt` varchar(255) DEFAULT NULL, `status` varchar(255) DEFAULT NULL, `avatar` int(11) DEFAULT NULL, PRIMARY KEY (`id`) )
菜品数据表的创建脚本代码如下。 CREATE TABLE `catery_dish` (
`id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `price` float DEFAULT NULL, `cuisine_id` int(11) DEFAULT NULL, `technology_id` int(11) DEFAULT NULL, `unit` varchar(255) DEFAULT NULL, `photo_id` int(11) DEFAULT NULL,
53
石西南油大学本科毕业设计(论文)
`rank` int(11) NOT NULL, `status` int(11) NOT NULL,
`material` varchar(255) DEFAULT NULL, `description` varchar(255) DEFAULT NULL, `merchant_id` int(11) DEFAULT NULL, `category_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`),
KEY `FK_Dish_Technology` (`technology_id`), KEY `FK_Dish_Cuisine` (`cuisine_id`), KEY `FK_Dish_Merchant` (`merchant_id`), KEY `FK_Dish_Category` (`category_id`), CONSTRAINT
`FK_Dish_Category`
FOREIGN
KEY
(`category_id`)
REFERENCES `catery_category` (`id`),
CONSTRAINT `FK_Dish_Cuisine` FOREIGN KEY (`cuisine_id`) REFERENCES `catery_cuisine` (`id`), CONSTRAINT
`FK_Dish_Merchant`
FOREIGN
KEY
(`merchant_id`)
REFERENCES `catery_merchant` (`id`),
CONSTRAINT `FK_Dish_Technology` FOREIGN KEY (`technology_id`) REFERENCES `catery_technology` (`id`) )
菜品分类表的创建脚本代码如下。 CREATE TABLE `catery_category` (
`id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `rank` int(11) NOT NULL, `merchant_id` int(11) NOT NULL, PRIMARY KEY (`id`),
KEY `FK_Category_Merchant` (`merchant_id`),
CONSTRAINT `FK_Category_Merchant` FOREIGN KEY (`merchant_id`) REFERENCES `catery_merchant` (`id`) )
54
餐馆点餐系统分析与设计
订单项数据表的创建脚本代码如下。 CREATE TABLE `catery_order` (
`id` int(11) NOT NULL AUTO_INCREMENT, `order_code` varchar(255) DEFAULT NULL, `merchant_id` int(11) NOT NULL, `user_id` int(11) NOT NULL,
`created_date` datetime DEFAULT NULL, `note` varchar(255) DEFAULT NULL, `status` int(11) NOT NULL, PRIMARY KEY (`id`),
KEY `FK_Order_Mechant` (`merchant_id`), KEY `FK_Order_User` (`user_id`), CONSTRAINT
`FK_Order_Mechant`
FOREIGN
KEY
(`merchant_id`)
REFERENCES `catery_merchant` (`id`),
CONSTRAINT `FK_Order_User` FOREIGN KEY (`user_id`) REFERENCES `catery_customer` (`id`) )
订单数据表的创建脚本代码如下。 CREATE TABLE `catery_order_item` (
`id` int(11) NOT NULL AUTO_INCREMENT, `num` int(11) NOT NULL, `price` float NOT NULL, `dish_id` int(11) NOT NULL, `order_id` int(11) NOT NULL, PRIMARY KEY (`id`),
KEY `FK_OrderItem_Dish` (`dish_id`), KEY `FK_OrderItem_Order` (`order_id`),
CONSTRAINT `FK_OrderItem_Dish` FOREIGN KEY (`dish_id`) REFERENCES `catery_dish` (`id`), CONSTRAINT
`FK_OrderItem_Order`
FOREIGN
KEY
(`order_id`)
REFERENCES `catery_order` (`id`))
55
石西南油大学本科毕业设计(论文)
用户上传文件表的创建脚本代码如下。 CREATE TABLE `catery_attachment` (
`id` int(11) NOT NULL AUTO_INCREMENT, `content_type` varchar(255) DEFAULT NULL, `created_date` datetime DEFAULT NULL, `enabled` bit(1) DEFAULT NULL, `existed` bit(1) DEFAULT NULL,
`file_name` varchar(255) DEFAULT NULL, `file_size` int(11) DEFAULT NULL, `file_url` varchar(255) DEFAULT NULL, `own_id` int(11) DEFAULT NULL, `own_type` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) )
5.3 输入输出设计
本系统为在线点餐系统,根据系统分析可知从顾客点餐到餐馆接收到订单在到付款都是在在完成的,所以设计输入输出的环节较少,但是有些也是有必要的。系统中需要输入的有:登录、菜品编辑;需要输出的有:点餐凭据。
5.3.1 输入设计
登录需要输入正确的账号和密码,应该有表示“提交”的按钮和表示“取消”的按钮,如图5.8所示。
登录系统账号:输入账号密码:输入密码登录取消 图 5.8 登录输入
菜品编辑输入的内容要包含菜品的所必须到基本信息,如名称、价格、单位等,还应有上传图片的功能,如图5.9所示。
56
相关推荐: