酒店管理系统数据库课程设计_第1页
酒店管理系统数据库课程设计_第2页
酒店管理系统数据库课程设计_第3页
免费预览已结束,剩余19页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、课程设计报告课程名称:数据库原理应用设计题目:酒店客房管理专业:信息与计算科学班级:姓名:学号:指导教师:河北建筑工程学院数理系2014年1月课程设计题目(问题)描述随着我国改革开放的不断推进,人民生活水平日益提高,旅游经济蓬勃发展, 这一切都带动了酒店行业的发展。再加上入境旅游的人越来越多,入境从事商务活 动的外宾也越来越多。传统的手工已不适应现代化酒店管理的需要。及时、准确、 全方位的网络化信息管理成为必需。酒店是一个服务至上的行业,从客人的预定开始,到入住登记直至最后退房结 账,每一步骤都要保持一致性的服务水准,错失一步,会令其辛苦经营的形象功亏一篑。面对酒店业内激烈的竞争形势,各酒店均

2、在努力拓展其服务领域的广度和 深度。虽然计算机并不是酒店走向成功的关键元素,但它可以帮助那些真正影响成 败的要素发挥更大的效用。因此,采用全新的计算机网络和管理,将成为提高酒店 的管理效率,改善服务水准的重要手段之一。通过此设计可解决一些前台操作问题,预定管理问题以及一些信息查询问题,大大减轻服务人员的工作力度,使酒店宾馆服务更加完善,方便快捷。本组成员情况姓名学号承担的任务成绩数据库的查询、设计、执行、修改以及编写设计报告数据库的查询、设计、执行、修改以及编写设计报告教师评语签名:注:本设计报告中各个部分如果页数不够,请大家自行扩页,原则是一定要把报告写详细,能 说明本组设计的成果和特色,能

3、够反应小组中每个人的工作。报告中应该叙述设计中的每个模块。 设计报告将是评定每个人成绩的一个重要组成部分。一、本组设计的功能描述(含所有实现的模块的功能)一、前台操作开房登记:(1)输入房号查询房状态 (2)输入房状态查询房号 (3)输入房号 把房间状态改成入住 (4)输入顾客信息 (5)输入订单信息(6)输入开房信息退房结账:(1 )输入房号把房间状态改成空闲(2)退房结账时输入订单号,输出应结账金额并自动把订单中的“结账离开日期”改为当前日期房状态查看:输入房号查询房信息二、预订管理预订房间:(1)输入房号查询房状态(2)输入房号把房间状态改成预订(3)输入顾客信息输入订单信息(4)输入订

4、房信息预订入住:(1)输入订单编号,查询此订单的信息(2)输入房号把房间状态改成入住(3)输入订单信息解除预订:(1)删除订房信息(2)输入订单编号,删除客人信息、订单对应的房号、订单信息并把对应的房间状态改成空闲三、信息查询在住客人列表查询预订客人列表查询历史客人列表查询四、报表统计开房记录统计退房结账统计预订房间统计二、本组设计的主要特色在设计过程中,经过充分的考虑,我们设计了前台操作、预订管理、信息 查询、报表统计功能,他们使得开放服务更加完善方便。(1)在前台操作中通过简单的输入就可以查询房信息和客人信息。(2)在预订管理中可以方便的处理房间预订方面的服务,使房间预订更加方 便,不至于

5、产生预订冲突。(3)在信息查询方面,可以方便的查询客人的各种信息,服务全面。(4) 在报表统计方面,把各种记录统计起来,使酒店的管理更加完善,有利 于档案储存管理。总之,该设计大大的节约了人力物力,提高了酒店服务效率,不仅有利 于增强整体收入,还可以给顾客以愉悦感,为酒店打出良好的名声。三、系统分析与设计根据问题描述和要求,完成:系统总体设计-确定程序功能模块;系统详细设计-在总体设计基础上设计系统总体框架、数据结构(类)、关键算法的流程;最后编制源程序。1. 系统功能模块划分及说明2. 总体框架,数据文件等3. 系统关键算法流程图4. 源程序关键性代码、程序功能模块二、系统详细设计2.1系统

6、总体框架(1) 需求分析1、系统主要业务分析1.1前台操作:<1>开房登记:客人把自身信息和要入住的房号告诉酒店操作员,酒店操作员可以帮用户登记入住信息;<2>退房登记:客人要是想查询房间的状态一一是否已入住、是否已预订、是否是空闲一一时,由酒店操作员帮忙查询;<3>房状态查看:客人要退房的时候付清住宿费,酒店操作员便帮客人把在住记录改成历史记录。1.2预定管理:<1>预定房间:客人把自身信息和想预订的房间号给酒店操作员,酒店操作员便帮客人预订这间房间,之后其他人在此房间被取消预定前无法入住或预定;<2>预定入住:客人把自身信息和预定

7、的房间号告诉酒店操作员,酒店操作员调出预定记录核对后在客户出示身份证件后便允许他登记入住此房间;<3>解除预定:客人把自身信息和预定了的房号告诉酒店操作员,酒店操作员便帮客户取消预订。1.3信息查询:<1>在住客人列表查询:显示现在在住的客人信息<2>预订客人列表查询:显示预定了房间的客人信息<3>历史客人列表查询:显示所有曾经在该酒店定房或入住的顾客信息1.4报表统计:<1>开房记录统计:显示现在有多少已经开房入住的客人<2>退房结账统计:显示现在有多少客人已经退房结账<3>预订房间统计:显示现在有多少客人预

8、定了房间2、系统功能需求分析图1图2数据流图-前台操作数据流图-预定管理 数据流图一信息查询 数据流图-报表统计(2)数据库概念结构设计由客人信息的数据项可以得到其相应的实体属性图证件类型的数据项有:证件类型号、证件类型名。由证件类型的数据项可以得到其 相应的实体属性图房间信息的数据项有:房号、房类型号、价格、押金、房状态。由房间信息的数据项可以得到其相应的实体属性图房类型的数据项有:房类型号、房类型名、房间平米。由房类型的数据项可以得到其相应的实体属性图由订(3)数据库逻辑结构设计数据库的关系模型根据数据模型来确定,即将关系模型转化为SQL-Server数据库系统所支持的实际数据模型,得到数

9、据库的逻辑结构。在数据库的关系模型及系统处理 过程中的数据的结构的基础上,获得系统数据库表以及表之间的关系。在本系统中,以 下是系统中几个主要的数据依赖和数据库表结构。关系名主要函数依赖客人信息证件号码一-> (姓名,性别,证件类型号,联系电话BCNF证件类型证件类型号一-(证件类型名)BCNF房间信息房号一-> (房类型号,价格,押金,房状态)BCNF房类型房类型号一->(房类型名,房间平米)BCNF订单(客人证件号,预计入住日期,预计离开日期,入住日期,订单编号 fBCNF结账离开日期,应付金额)开房(订单编号,房号)f()BCNF订单表编号字段名字段类型备注说明字段约束

10、1order_idchar(10)订单编号主键2cust_idchar(20)客人证件号外键3pla n_en ter_datedatetime预计入住日期4pla n_leave_datedatetime预计离开日期5en ter_datedatetime入住日期6leave_datedatetime结账离开日期7order_ moneyint应付金额客人信息表编号字段名字段类型备注说明字段约束1cust_idchar(20)证件号码主键2ptype_idchar(10)证件类型号外键3cust_ namechar(10)姓名4sexchar(1)性别5pho nechar(10)联系电话房

11、间信息表编号字段名字段类型备注说明字段约束1roomdchar(10)用 i=r. 房号主键2rtype idchar(10)房类型号外键3rpriceint价格4rdepositint押金5rstatechar(10)房状态证件信息表编号字段名字段类型备注说明字段约束1ptype idchar(10)证件类型号主键2ptype_ namechar(10)证件类型名房间信息表编号字段名字段类型备注说明字段约束1rtype_idchar(10)房类型号主键2rtype_ namechar(10)房类型名3rareanu meric(5,2)房间平米开房表编号字段名字段类型备注说明字段约束1ord

12、er_idchar(10)订单编号主键2roomdchar(10)用 1=4. 房号三、编制源程序3.1在数据库中创建表的语句创建房类型表:create table room_type( rtype_id char(10) primary key, rtype_ name char(10), rarea nu meric(5,2);创建房间信息表:create table room(roomd char(10) primary key,rtype_id char(10),rprice int, rdeposit int, rstate char(10), foreig n key(rtype_

13、id)refere nces room_type(rtype_id) );创建证件类型表:create table paper_type( ptype_id char(10) primary key, ptype_ name char(10) );创建客人信息表:create table customer( cust_id char(20) primary key, ptype_id char(10), cust name char(10),sex char(1),phone char(10),foreig n key(ptype_id)refere nces paper_type(ptype

14、_id);创建订单表:create table order_log(order_id char(10) primary key,cust_id char(20),pla n_en ter_date datetime,pla n_leave_date datetime, en ter_date datetime, leave_date datetime, order_m oney int, foreig n key(cust_id) references customer(cust_id);创建订房表:create table book_room(order_id char(10),room_i

15、d char(10),foreig n key(order_id) references order_log(order_id),foreig n key(room_id) referen ces room(room_id);3.2酒店客房管理系统功能设计(存储过程与触发器)3.2.1前台操作功能设计(1)开房登记操作-输入房号查询房状态create procedure pro_rstate room_id char(10) as select roomd 房号,rstate 房状态 from room where room_id=roo md-运行exec pro_rstate 101-输入

16、房状态查询房号create procedure pro_rstate1 rstate char(10) asselect room_id 房号,rtype_name 房类型名,rarea 房间平米,rprice 价格,rdeposit 押金 from room,room_typewhere room.rtype_id=room_type.rtype_id and rstate=rstate;-运行exec pro_rstate1 空闲-输入房号把房间状态改成入住create procedure pro_cha nge_rstate_ in to_live room_id char(10) as

17、 update roomset rstate='入住'where room_id=roo mdselect roomd 房号,rstate 房状态 from room where roomd=roomd-运行exec pro_cha nge_rstate_ in to_live 101-输入顾客信息(证件号码,证件类型号,姓名,性别,联系电话)create procedure pro_in sert_cust cust_id char(20),ptype_id char(1O),cust_ name char(10),sex char(1),pho ne char(10) as

18、insert into customer values(cust_id,ptype_id,cust_ name,sex,ph on e);select cust_id证件号码,ptype_id证件号类型,cust_name姓名,sex性别,phone联系电话from customer-运行exec pro_ins1',李昂','1-输入订单信息(订单编号,客人证件号,入住日期,预计离开日期)create procedure pro_in sert_order order_id char(10),cust_id char(20),e nter_date datetime,

19、 pla n_leave_date datetime asin sert into order_log(order_id,cust_id,e nter_date,pla n_leave_date)values(order_id,cust_id,e nter_date,pla neave_date);select order_id订单编号,cust_id客人证件号,plan_enter_date预计入住日期,enter_date入住日期, planeave_date预计离开日期,leave_date结账离开日期,order_money 应付金额 from order_log -运行exec pr

20、o_i nsert_order '032013-7-1','2013-7-10'-输入开房信息(订单号,房号)create procedure pro_in sert_book_room order_id char(10),room_id char(10) asinsert into book_room values(order_id,room_id);select order_id 订单编号,roomd 房号 from book_roomwhere order_id=order_id-运行exec pro_i nsert_book_room '03&#

21、39;,'101'(2)退房结账-输入房号把房间状态改成空闲create procedure pro_cha nge_rstate_ in to_free room_id char(10) asupdate roomset rstate='空闲'where room_id=room_id;select roomd 房号,rstate 房状态 from room where roomd=roomd-运行exec pro_cha nge_rstate_ in to_free '101'-退房结账时输入订单号,输出应结账金额并自动把订单中的“结账离开日

22、期”改为当前日期create procedure pro_quit_getm oney order_id char(10) asbegindeclare en ter_date datetime,order_m oney in t,sum intdeclare getCur cursor forselect en ter_date,order_ moneyfrom order_logwhere order_id=order_id;ope n getCurfetch getCur into en ter_date,order_ moneybeginupdate order_logset leav

23、e_date=getdate()where order_id=order_id;select sum=(day(getdate()-day(e nter_date)*order_ mon ey;endclose getCurdeallocate getCurend-运行exec pro_quit_getm oney '01'(3)房状态查看-输入房号查询房信息create procedure pro_ro om_info room_id char(10) asselect room_id 房号,rtype_id 房类型号,rprice 价格,rdeposit 押金,rstate

24、 房状态 from roomwhere room_id=roo md-运行exec pro_ro om_info '101'3.2.2预订管理功能设计(1 )预定房间-输入房号查询房状态create procedure pro_rstate 12room_id char(10) asselect roomd 房号,rstate 房状态 from roomwhere room_id=roo md-运行exec pro_rstate '101'-输入房号把房间状态改成预订create procedure pro_cha nge_rstate_ in to_subsc

25、ribe room_id char(10) as update roomset rstate='预订'where room_id=room_id;select roomd 房号,rstate 房状态 from roomwhere room_id=roo md-运行exec pro_cha nge_rstate_ in to_subscribe 101-输入顾客信息(证件号码,证件类型号,姓名,性别,联系电话)create procedure pro_in sert_cust12 cust_id char(20),ptype_id char(10),cust_ name char

26、(10),sex char(1),pho ne char(10) asinsert into customer values(cust_id,ptype_id,cust_ name,sex,ph on e);select cust_id证件号码,ptype_id证件号类型,cust_name姓名,sex性别,phone联系电话from customer-运行王小','1-输入订单信息(订单编号,客人证件号,预计入住日期)进行预订create procedure pro_subscribe order_id char(10),cust_id char(20),pla n_en t

27、er_date datetime asin sert into order_log(order_id,cust_id,pla n_en ter_date)values(order_id,cust_id,pla n_en ter_date);select order_id订单编号,cust_id客人证件号,plan_enter_date预计入住日期,enter_date入住日期,planeave_date预计离开日期,leave_date结账离开日期,order_money应付金额from order_logwhere order_id=order_id;-运行exec pro_subscrib

28、e '2013-6-29'-输入订房信息(订单号,房号)create procedure pro_in sert_book_room1 order_id char(10),room_id char(10) asinsert into book_room values(order_id,room_id);select order_id 订单编号,roomd 房号 from book_roomwhere order_id=order_id-运行exec pro_i nsert_book_room '02','102'(2)预定入住-输入订单编号,查询

29、此订单的信息(看是否为已预订)create procedure pro_subscribe_to_e nter order_id char(10) asif exists(select* from order_log where order_id=order_id)print'已预订'elseprint'未预定'-运行exec pro_subscribe_to_e nter 101-输入房号把房间状态改成入住create procedure pro_cha nge_rstate_ in to_live1 room_id char(10) asupdate roo

30、mset rstate='入住'where room_id=roo mdselect roomd 房号,rstate 房状态 from room where roomd=roomd-运行exec pro_cha nge_rstate_ in to_live 101-输入订单信息(订单编号,预计离开日期,入住日期,应付金额)create procedure pro_subscribe_to_live order_id char(10),plan_leave_date datetime,enter_datedatetime,setorder_ money int asupdateo

31、rder_logpla n_leave_date=pla neave_date,e nter_date=e nter_date,order_m on ey=order_m oney where order_id=order_idselect order_id订单编号,cust_id客人证件号,plan_enter_date预计入住日期,enter_date入住日期, planeave_date预计离开日期,leave_date结账离开日期,order_money 应付金额 from order_log where order_id=order_id-运行 exec pro_subscribe_

32、toive '02','2013-7-12','2013-7-1',3003 )解除预订-删除订房信息(订单号,房号)【触发器实现】 create trigger trig_dele_book_room on order_log for delete as delete book_room from book_room,deletedwhere book_room.order_id=deleted.order_id-输入订单编号,删除客人信息、订单对应的房号、订单信息并把对应的房间状态改成空闲(取消预 订)create procedure pro

33、_ca ncel_subscribe order_id char(10) as declare cust_id char(20) declare getCur cursor for select cust_id from order_log where order_id=order_id ope n getCurfetch getCur into cust_idupdate room set rstate='空闲' where roomd in (select roomd from book room where order_id=order_id) delete from o

34、rder_log where order_id=order_id delete from book room where order_id=order_id delete from customer close getCur deallocate getCur-运行exec pro_ca ncel_subscribe '02'3.2.3信息查询功能设计(1)查询在住客人列表create procedure pro_select_cust asdeclare cust_id char(20)declare getCur cursor forselect cust_id from

35、order_logwhere en ter_date is not n ull and leave_date is n ullope n getCurfetch getCur into cust_idselect cust_id证件号码,ptype_id证件号类型,cust_name姓名,sex性别,phone联系电话 from customerwhere cust_id=cust_idclose getCurdeallocate getCur-运行exec pro_select_cust(2)查询预订客人信息create procedure pro_select_subscribe asde

36、clare cust_id char(20)declare getCur cursor forselect cust_id from order_logwhere pla n_en ter_date is not n ull and en ter_date is n ullope n getCurfetch getCur into cust_idselect cust_id证件号码,ptype_id证件号类型,cust_name姓名,sex性别,phone联系电话 from customerwhere cust_id=cust_idclose getCurdeallocate getCur-运

37、行exec pro_select_subscribe-查询历史客人信息create procedure pro_select_past1 asdeclare cust_id char(20)declare getCur cursor forselect cust_id from order_logwhere leave_date is not n ullope n getCurfetch getCur into cust_idselect cust_id证件号码,ptype_id证件号类型,cust_name姓名,sex性别,phone联系电话 from customerclose getCu

38、rdeallocate getCur-运行exec pro_select_past1324报表统计功能设计(1) 开房记录统计create procedure pro_sum_live asdeclare co unt intselect coun t=COUNT(*) from order_log where en ter_date is not n ull and leave_date is n ull print'开房记录共'+convert(char(10),count)+'条' -运行exec pro_sum_live(2) 退房结账记录统计creat

39、e procedure pro_sum_leave asdeclare co unt intselect coun t=COUNT(*) from order_log where leave_date is not n ull print'退房结账记录共'+convert(char(10),count)+'条 -运行exec pro_sum_leave(3) 预订房间记录统计create procedure pro_sum_subscribe as declare co unt intselect coun t=COUNT(*) from order_logwhere pla n_en ter_date is not n ull and en ter_date is

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论