景点门票销售管理系统数据库设计Word格式文档下载.docx

上传人:b****5 文档编号:21406859 上传时间:2023-01-30 格式:DOCX 页数:14 大小:88.83KB
下载 相关 举报
景点门票销售管理系统数据库设计Word格式文档下载.docx_第1页
第1页 / 共14页
景点门票销售管理系统数据库设计Word格式文档下载.docx_第2页
第2页 / 共14页
景点门票销售管理系统数据库设计Word格式文档下载.docx_第3页
第3页 / 共14页
景点门票销售管理系统数据库设计Word格式文档下载.docx_第4页
第4页 / 共14页
景点门票销售管理系统数据库设计Word格式文档下载.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

景点门票销售管理系统数据库设计Word格式文档下载.docx

《景点门票销售管理系统数据库设计Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《景点门票销售管理系统数据库设计Word格式文档下载.docx(14页珍藏版)》请在冰豆网上搜索。

景点门票销售管理系统数据库设计Word格式文档下载.docx

景点门票销售部

1.3参考资料

[1]王珊,萨师煊.数据库系统概论[M].高等教育出版社,2006年5月第4版

[2]郑人杰,马素霞,殷人昆.软件工程概率[M].机械工业出版社,2009年11月

[3]马晓梅.SQLServer实验指导[M].清华大学出版社,2009年9月第3版

2需求分析

2.1目标

这个门票管理系统主要是处理旅客买票,订票,退票,以及各类查询结算。

该系统针对的用户是门票销售部门,由于门票销售,查询以及计算各天或者不同时间段的收入比较繁琐,此系统方便简单的实现了这些功能,使得管理员与职工方便很多,让这个门票销售都变得条条有理。

2.2运算坏境

(1)软件资源

服务器端软件选择的具体说明:

操作系统:

Windows2007Server或WindowsXP。

数据库管理系统:

SQLServer。

开发工具:

visualstudio2008.

软件平台:

windows+iis+mssql。

客户端软件选择的具体说明:

web浏览器。

2.3需求概述

本系统的开发是为了提高门票销售以及管理的效率,尽可能杜绝各个销售环节中可能出现的资金流失不明现象,满足系统化的门票管理域收入需求。

系统功能主要包括:

登陆管理(包括管理员登陆以及职工登陆,职工注册情况),系统管理(系统启用,及其系统截止),直接销售(个人购买与团购),订票管理(订票与查看订票状态),退票管理(处理当天所要退的票),查询管理(按时间查询,按职工号查询,游客种类查询,按时间票号查询,按时间,职工号查询,按时间,游客种类查询,以及当天销售查询),结算管理(具体时间查询以及时间段查询),最后是系统简介。

3结构设计

3.1逻辑结构设计

3.1.1局部E-R图

图4.营业员E-R图

图5.游客E-R图

图6.门票E-R图

图7.门票类型E-R图

3.1.2全局E-R图

图8总体E-R图

3.1.3关系模式

Admin_T(Sell_operator,User_name,password,Sex,Realname,Cardnumber,Age,Phone,User_type)

该表为管理表,表项包括销售营业员,用户姓名,密码,性别,真实姓名,卡号,年龄,电话号码,用户类型的信息。

主键为销售营业员。

Dd_T(Order_ID,Custom_ID,Ticker_ID,Ticker_type,Ticker_Price,Sell_operator,Sell_date,Sell_month)

该表为订单表,表项有订单号,游客号,门票号,门票类型,门票价格,销售营业员,销售日期和销售月份。

该表的主键为订单号,外键有游客号,门票号,门票类型,门票价格和销售营业员。

Custom_T(Custom_ID,Custom_name,Sex,Age,Cardnumber,Custom_type,Custom_phone)

该表为游客信息表,表项有游客号,游客姓名,身份证号,游客类型,游客电话。

该表主键为游客号,无外键。

Ticket_summary(Sell_ID,Ticket_type,Sell_amount,Sell_money,Sell_month)

该表为门票信息统计表,表项有出售号码,门票类型,出售时间,出售月份,出售价格。

该表主键为出售号,外键为门票类型。

Ticket_T(Ticket_type,Ticket_type_name,Ticket_price,Ticket_Count,Ticket_comment,Date)

该表为门票信息表,表项有门票类型,类型名,门票价格,门票数量,日期。

主键为门票类型,无外键。

Ticket_List(Ticket_ID,Ticket_type,Sell_flag)

该表为门票属性信息表,表项为门票号,门票类型,和是否出售标记。

主键为门票号,外键为门票类型。

3.1.1关系图

3.2物理结构设计

表1Admin_T表

列名

数据类型

允许空

Sell_operator

nvarchar(10)

NONULL

User_name

varchar(20)

Password

Sex

char(5)

NULL

Realname

cardnumber

char(18)

Age

int

Phone

char(11)

User_type

char(10)

表2Custom_T表

Custom_ID

Custom_name

Cardnumber

Custom_type

Custom_phone

表3dd_T表

Order_ID

Ticket_ID

char(17)

Ticket_type

char(3)

Ticket_Price

decimal(5,2)

Sell_date

datetime

Sell_month

表4Ticket_List表

Sell_flag

表5Ticket_summary表

Sell_ID

char(20)

Sell_amount

Sell_money

表6Ticket_T表

Ticket_type_name

char(50)

Ticket_price

Ticket_Count

Ticket_comment

char(200)

Date

4.存储过程

4.1统计指定日期的门票销售情况

createProcedurePro_QTicsinf

@starttimedatetime,@endtimedatetime,@sSell_amount_outintoutput,

@sSell_money_outdecimal(5,2)output

ASselect@sSell_amount_out=count(Ticket_ID),

@sSell_money_out=sum(dd_T.Ticket_Price)

fromdd_T,Ticket_T

whereTicket_T.Ticket_type=dd_T.Ticket_typeandSell_datebetween@starttimeand@endtime

declare@starttimedatetime,@endtimedatetime,@sSell_amount_outint,

@sSell_money_outdecimal(5,2)

select@starttime='

2013/1/1300:

00:

00'

select@endtime='

2013/1/1319:

40:

execPro_QTicsinf@starttime,@endtime,@sSell_amount_outoutput,@sSell_money_outoutput

select@sSell_amount_outas门票数量,@sSell_money_outas金额

4.2统计指定月份的门票销售情况

createProcedurePro_QTicsminf

@sSell_monthnvarchar(10),@sSell_amount_outintoutput,@sSell_money_outdecimal(5,2)output

whereTicket_T.Ticket_type=dd_T.Ticket_typeandSell_month=@sSell_month

declare@sSell_monthnvarchar(10),@sSell_amount_outint,

select@sSell_month='

2013/1'

execPro_QTicsminf@sSell_month,@sSell_amount_outoutput,@sSell_money_outoutput

4.3统计指定日期各种价格的门票销售情况

createProcedurePro_QTicsPinf

@starttimedatetime,@endtimedatetime,@sTicket_typechar(3),

@sTicket_Price_outdecimal(5,2)output,@sSell_amount_outintoutput,

ASselect

@sTicket_Price_out=Ticket_Price,

@sSell_amount_out=count(Ticket_ID),

@sSell_money_out=sum(dd_T.Ticket_Price)

fromdd_T

where@sTicket_type=dd_T.Ticket_typeandSell_datebetween@starttimeand@endtime

groupbyTicket_Price

declare@starttimedatetime,@endtimedatetime,@sTicket_typechar(3),

@sTicket_Price_outdecimal(5,2),

@sSell_amount_outint,@sSell_money_outdecimal(5,2)

00'

select@sTicket_type='

T01'

execPro_QTicsPinf@starttime,@endtime,@sTicket_type,@sTicket_Price_outoutput,@sSell_amount_outoutput,@sSell_money_outoutput

select@sTicket_Price_outas门票价格,@sSell_amount_outas门票数量,@sSell_money_outas门票金额

T02'

T03'

4.3统计指定营业员指定日期的收费情况

createProcedurePro_QTicsCinf

@starttimedatetime,@endtimedatetime,@sSell_operatornvarchar(10),

@sSell_amount_outintoutput,@sSell_money_outdecimal(5,2)output

where@sSell_operator=dd_T.Sell_operatorandSell_datebetween@starttimeand@endtime

groupbySell_operator

declare@starttimedatetime,@endtimedatetime,@sSell_operatornvarchar(10),

2013/1/1323:

select@sSell_operator='

001'

execPro_QTicsCinf@starttime,@endtime,@sSell_operator,@sSell_amount_outoutput,@sSell_money_outoutput

select@sSell_operatoras营业员,@sSell_amount_outas销售门票数量,@sSell_money_outas收费总金额

002'

5触发器

a.有人买票时,自动更改门票标志位

createtriggerTRIGGER_BUY_TIC

ondd_Tforinsert

as

begin

Declare@Ticket_ID_INchar(17)

Select@Ticket_ID_IN=Ticket_IDfrominserted

updateTicket_ListsetSell_flag=1

whereTicket_ID=@Ticket_ID_IN

end

insertintodd_Tvalues('

O006'

'

1005'

S0006'

40,'

2013/2/1319:

50:

2013/2'

b.若有人退票,对各表所有有关该人的信息进行级联删除

createtriggerTRiGGER_EXIT_TIC

ondd_Tfordelete

as

Declare@Order_ID_DELchar(10),@Custom_ID_DELchar(10),@Ticket_ID_ALTchar(17)

Select@Order_ID_DEL=Order_ID,@Custom_ID_DEL=Custom_ID,@Ticket_ID_ALT=Ticket_IDfromdeleted

updateTicket_ListsetSell_flag=0

whereTicket_ID=@Ticket_ID_ALT

deletefromCustom_T

whereCustom_ID=@Custom_ID_DEL

go

DELETEfromdd_TwhereOrder_ID='

c.当门票销售时自动减少该该类型门票的总量

createtriggertri_Tic_Sell

onTicket_summaryforinsert

asdeclare@oldcountint,@newcountint,@sTicket_typechar(3)

select@sTicket_type=Ticket_type,@newcount=Sell_amountfrominserted

select@oldcount=Ticket_CountfromTicket_TwhereTicket_type=@sTicket_type

if@newcount>

0and@oldcount>

updateTicket_TsetTicket_Count=@oldcount-@newcountwhereTicket_type=@sTicket_type

return

rollbacktransaction

insertintoTicket_summaryvalues('

C0004'

2013-01-1718:

47'

'

2,40,'

2013-01'

d.当门票修改类型时自动修改门票各类型的数量

createtriggertri_Ticxg

onTicket_Listforupdate

asdeclare@sTic_IDchar(17),@sTicket_typechar(3),@saTicket_typechar(3),@scountint,@sacountint

select@sTicket_type=Ticket_type,@sTic_ID=Ticket_IDfrominserted

select@saTicket_type=Ticket_typefromTicket_ListwhereTicket_ID=@sTic_ID

select@scount=Ticket_CountfromTicket_TwhereTicket_type=@sTicket_type

select@sacount=Ticket_CountfromTicket_TwhereTicket_type=@saTicket_type

updateTicket_TsetTicket_Count=@scount+1whereTicket_type=@sTicket_type

updateTicket_TsetTicket_COunt=@sacount-1whereTicket_type=@saTicket_type

updateTicket_ListsetTicket_type='

whereTicket_ID='

S0001'

6完整性约束

USEAttraction_Manage

go

altertableAdmin_Twithcheck

addconstraintCHECK_SEXcheck(Sex='

男'

orSex='

女'

),

constraintCHECK_AGEcheck(Age>

=0)

altertableCustom_Twithcheck

addconstraintCHECK1_SEXcheck(Sex='

constraintCHECK1_AGEcheck(Age>

altertableAdmin_

altertableTicket_summarywithcheck

addconstraintCHECK_Sell_amountcheck(Sell_amount>

=0),

constraintCHECK_Sell_moneycheck(Sell_money>

=0.00)

7.数据库备份

7.1完整数据库备份

useAttraction_Manage

backupdatabaseAttraction_Manage

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1