资源描述
超市物流管理系统项目
数据库实验报告
学 院 信息与电子工程学院
专 业 班 级 计算机科学与技术071
组 员 虞赵俊 107021022
欧东旭 107021021
沈新杰 107021016
张国晓 107021004
俞芳青 107021010
组 长 虞赵俊
联 系 电 话 15858173643
指 导 教 师 俞 坚
目录
第1章 系统需求分析 2
1.1 需求概述 2
1.2 需求描述 3
1.2.1数据流图: 3
1.2.2数据字典 9
第2章 系统初步设计 18
2.1 基于PowerDesigner的数据库设计 18
2.1.1 概念数据模型 18
2.1.2物理数据模型 22
2.1.3 创建表的脚本文件 23
2.2 数据库不规范化设计举例 23
2.2.1 不满足第二范式举例 45
2.2.2 不满足第三范式举例 46
2.3 基于MyEclipse的系统功能界面设计 48
2.3.1 系统功能图 48
2.3.2 系统功能描述 48
第3章 系统详细设计与实现 51
3.1系统功能界面 51
3.1.1 登录界面 51
3.1.2 主界面 51
3.1.3 采购单入库界面 52
参考文献 54
第1章 系统需求分析
1.1 需求概述
当今时代,在社会日趋激烈的竞争中,在商品营销业也出现了各种形式,超市经营便是其中一种。超市可能拥有更多的途径销售产品,但是超市作为一个大型销售集体,其供货较难得到保证,销售人员则抱怨说采购员没有及时供应他们所需要的商品;实际上,采购员的效率过高,仓库里囤积的某些商品要很久才能卖完,商品会过期,仓库库位饱和,资金周转很慢,仓库管理员要定期进行商品进出货统计也比较困难,订货单和采购单上的日期和缺料清单上的日期都不相同,长此以往,造成超市经营的管理混乱,这些情况正是大多数超市目前所面临的一个严峻的问题。
目前大多数超市已经开始应用了计算机技术,销售、采购管理过程已经实现半自动化,但虽然如此,但仍还有很多是依靠手工和经验来完成的,且主要集中在业务管理层次上。
为了适应日益激烈的市场竞争要求,提高业务管理的工作效率,要建立一种新的超市物流管理模式。
超市物流管理系统应具有如下功能:
(1) 对流动数据作及时的记录:
在采购、销售管理中,借助计算机,对每一笔进货和出货进行记录,包括商品各项信息及日期,方便管理员对数据信息进行查找和修改,使整个管理具有高度的灵活性和可靠性。
(2) 对流动数据进行详细审核:
在进行商品存库之前,对商品信息进行审核确认,提高信息的可靠性,减少数据的错误率;在提取商品时,也要对提货单进行比对审核。
(3) 对库存商品进行统一管理:
库存商品按编号统一管理,详细记录库存商品各项信息以及存库日期,利于仓库管理员进行商品入库、出库的调配。
1.2 需求描述
1.2.1数据流图:
超市物流管理系统数据流图(第0层)
超市物流管理系统数据流图(第一层)
库存管理系统数据流图(第二层)
POS收银系统数据流图(第二层)
采购管理系统数据流图(第二层)
销售管理系统数据流图(第二层)
POS收银系统应收款数据流图(第三层)
POS收银系统收银找零数据流图(第三层)
1.2.2数据字典
1.2.2.1 数据结构
销售单
编号
数据项
数据项别名
数据类型
数据项含义
1
销售单编号
sbno
char(10)
唯一标识
2
日期
sbdate
date
3
员工编号
sno
char(10)
外码
员工信息
编号
数据项
数据项别名
数据类型
数据项含义
1
员工编号
sno
char(10)
唯一标识
2
员工姓名
sname
char(20)
3
性别
ssex
char(5)
4
联系方式
stel
char(20)
5
所在部门
sdepart
char(20)
6
密码
spw
char(20)
7
工资
smoney
money
8
家庭住址
saddress
char(20)
收款单
编号
数据项
数据项别名
数据类型
数据项含义
1
收款单编号
pbno
char(10)
唯一标识
2
日期
pbdate
date
3
员工编号
sno
char(10)
外码
收款记录
编号
数据项
数据项别名
数据类型
数据项含义
1
收款单编号
pbno
char(10)
唯一标识,外码
2
商品编号
wgno
char(10)
唯一标识,外码
3
销售量
prnum
int
4
销售单价
prprice
money
发票
编号
数据项
数据项别名
数据类型
数据项含义
1
发票编号
reno
char(10)
唯一标识
2
员工编号
sno
char(10)
外码
3
实收金额
rerprice
money
4
找零金额
refprice
money
5
日期
redate
date
发票记录
编号
数据项
数据项别名
数据类型
数据项含义
1
发票编号
reno
char(10)
唯一标识,外码
2
商品编号
wgno
char(10)
唯一标识,外码
3
卖出量
rrnum
int
4
卖出单价
rrprice
money
采购计划
编号
数据项
数据项别名
数据类型
数据项含义
1
计划单编号
bpno
char(10)
唯一标识
2
计划日期
bpdate
date
3
员工编号
sno
char(10)
外码
采购单
编号
数据项
数据项别名
数据类型
数据项含义
1
采购单编号
bbno
char(10)
唯一标识
2
进货日期
bbdate
date
3
员工编号
sno
char(10)
外码
库存商品信息
编号
数据项
数据项字段名
数据类型
数据项含义
1
商品编号
wgno
char(10)
唯一标识
2
商品名称
wgname
char(20)
3
商品规格
wgnorms
char(10)
4
商品类型
wgtype
char(10)
5
供应商
wgmanu
char(20)
6
库存量
wgamount
int
销售记录
编号
数据项
数据项别名
数据类型
数据项含义
1
商品编号
wgno
char(10)
唯一标识,外码
2
员工编号
sno
char(10)
唯一标识,外码
3
销售单编号
sbno
char(10)
唯一标识,外码
4
销售量
prnum
5
销售单价
prprice
money
采购记录
编号
数据项
数据项别名
数据类型
数据项含义
1
采购单编号
bbno
char(10)
唯一标识,外码
2
商品编号
wgno
char(10)
唯一标识,外码
3
采购量
bnum
int
4
采购单价
bprice
money
缺货记录
编号
数据项
数据项别名
数据类型
数据项含义
1
计划单编号
bpno
char(10)
唯一标识,外码
2
商品编号
wgno
char(10)
唯一标识,外码
3
预计采购量
planbnum
int
1.2.2.2 数据处理
1.与销售单有关的数据处理
①.处理过程“销售单审核”可描述如下:
·处理过程:销售信息核实
·输 入:未审核销售单
·输 出:已审核销售单
·说 明:核实销售信息,包括销售单编号、日期、员工编号等信息,建立新的销售单。
②.处理过程“提交销售单”可描述如下:
·处理过程:销售信息送入
·输 入:已审核销售单
·输 出:无
·说 明:外部实体输入销售信息,包括销售单编号、商品编号、商品名称、销售数量、销售金额、收银员编号等信息,建立销售信息表。
③.处理过程“历史销售记录查询”可描述如下:
·处理过程:历史销售记录查询
·输 入:查询条件
·输 出:销售记录
·说 明:查询条件可为商品编号或员工编号,反馈内容为员工编号、销售数量、销售金额、销售单编号、商品编号等信息。
2.与采购单有关的数据处理
①.处理过程“制定订单过程”可描述如下:
·处理过程:制定订单
·输 入:库存商品信息
·输 出:采购信息单
·说 明:根据现有商品的库存量,包括商品编号、商品名称、商品存量(主要)、商品售价等信息,制定建立采购信息表。
②.处理过程“库存商品的增加”可描述如下:
·处理过程:库存商品增加
·输 入:核实后的采购单信息
·输 出:现有的商品库存量
·说 明:核实采购单信息之后,包括商品编号、商品名称、采购数量等信息,建立新的商品库存信息表。
③.处理过程“采购记录利用”可描述如下:
(1)·处理过程:采购记录查看
·输 入:采购信息
·输 出:满足条件的采购记录单
·说 明:根据输入的采购信息输出采购信息记录单,包括采购时间、采购商品编号、采购商品数量、采购商品价格等信息。
(2)·处理过程:采购记录增加
·输 入:核实并执行的采购单
·输 出:采购记录单
·说 明:根据核实并执行的采购单信息记录采购时间、采购商品编号、采购商品数量、采购商品价格等信息。
第2章 系统初步设计
2.1 基于PowerDesigner的数据库设计
2.1.1 概念数据模型
(1) 由子系统设计E-R图
POS收银子系统
图2-11 POS收银子系统E-R图
销售管理子系统
图2-12 销售管理子系统E-R图
采购管理子系统
图2-13 采购管理子系统E-R图
仓库商品管理子系统
图2-14 库存管理子系统E-R图
(1) 设计总E-R图
超市物流管理系统E-R图
2.1.2物理数据模型
超市物流管理系统物理图
2.1.3 创建表的脚本文件
if exists (select 1
from sysindexes
where id = object_id('buy_bill')
and name = '制定2_FK'
and indid > 0
and indid < 255)
drop index buy_bill.制定2_FK
go
if exists (select 1
from sysobjects
where id = object_id('buy_bill')
and type = 'U')
drop table buy_bill
go
if exists (select 1
from sysindexes
where id = object_id('buy_plan')
and name = '制定1_FK'
and indid > 0
and indid < 255)
drop index buy_plan.制定1_FK
go
if exists (select 1
from sysobjects
where id = object_id('buy_plan')
and type = 'U')
drop table buy_plan
go
if exists (select 1
from sysindexes
where id = object_id('out_rec')
and name = 'out_rec2_FK'
and indid > 0
and indid < 255)
drop index out_rec.out_rec2_FK
go
if exists (select 1
from sysindexes
where id = object_id('out_rec')
and name = 'out_rec_FK'
and indid > 0
and indid < 255)
drop index out_rec.out_rec_FK
go
if exists (select 1
from sysobjects
where id = object_id('out_rec')
and type = 'U')
drop table out_rec
go
if exists (select 1
from sysindexes
where id = object_id('pay_bill')
and name = '出示2_FK'
and indid > 0
and indid < 255)
drop index pay_bill.出示2_FK
go
if exists (select 1
from sysobjects
where id = object_id('pay_bill')
and type = 'U')
drop table pay_bill
go
if exists (select 1
from sysindexes
where id = object_id('payl_record')
and name = 'payl_record2_FK'
and indid > 0
and indid < 255)
drop index payl_record.payl_record2_FK
go
if exists (select 1
from sysindexes
where id = object_id('payl_record')
and name = 'payl_record_FK'
and indid > 0
and indid < 255)
drop index payl_record.payl_record_FK
go
if exists (select 1
from sysobjects
where id = object_id('payl_record')
and type = 'U')
drop table payl_record
go
if exists (select 1
from sysindexes
where id = object_id('receipt')
and name = '开具_FK'
and indid > 0
and indid < 255)
drop index receipt.开具_FK
go
if exists (select 1
from sysobjects
where id = object_id('receipt')
and type = 'U')
drop table receipt
go
if exists (select 1
from sysindexes
where id = object_id('receipt_re')
and name = 'receipt_re2_FK'
and indid > 0
and indid < 255)
drop index receipt_re.receipt_re2_FK
go
if exists (select 1
from sysindexes
where id = object_id('receipt_re')
and name = 'receipt_re_FK'
and indid > 0
and indid < 255)
drop index receipt_re.receipt_re_FK
go
if exists (select 1
from sysobjects
where id = object_id('receipt_re')
and type = 'U')
drop table receipt_re
go
if exists (select 1
from sysindexes
where id = object_id('sell_bill')
and name = '出示1_FK'
and indid > 0
and indid < 255)
drop index sell_bill.出示1_FK
go
if exists (select 1
from sysobjects
where id = object_id('sell_bill')
and type = 'U')
drop table sell_bill
go
if exists (select 1
from sysindexes
where id = object_id('sell_record')
and name = 'sell_record3_FK'
and indid > 0
and indid < 255)
drop index sell_record.sell_record3_FK
go
if exists (select 1
from sysindexes
where id = object_id('sell_record')
and name = 'sell_record2_FK'
and indid > 0
and indid < 255)
drop index sell_record.sell_record2_FK
go
if exists (select 1
from sysindexes
where id = object_id('sell_record')
and name = 'sell_record_FK'
and indid > 0
and indid < 255)
drop index sell_record.sell_record_FK
go
if exists (select 1
from sysobjects
where id = object_id('sell_record')
and type = 'U')
drop table sell_record
go
if exists (select 1
from sysobjects
where id = object_id('staff')
and type = 'U')
drop table staff
go
if exists (select 1
from sysobjects
where id = object_id('warehouse_goods')
and type = 'U')
drop table warehouse_goods
go
if exists (select 1
from sysindexes
where id = object_id('采购记录')
and name = '采购记录2_FK'
and indid > 0
and indid < 255)
drop index 采购记录.采购记录2_FK
go
if exists (select 1
from sysindexes
where id = object_id('采购记录')
and name = '采购记录_FK'
and indid > 0
and indid < 255)
drop index 采购记录.采购记录_FK
go
if exists (select 1
from sysobjects
where id = object_id('采购记录')
and type = 'U')
drop table 采购记录
go
/*==============================================================*/
/* Table: buy_bill */
/*==============================================================*/
create table buy_bill (
bbno char(10) not null,
sno char(10) null,
bbdate datetime null,
constraint PK_BUY_BILL primary key nonclustered (bbno)
)
go
/*==============================================================*/
/* Index: 制定2_FK */
/*==============================================================*/
create index 制定2_FK on buy_bill (
sno ASC
)
go
/*==============================================================*/
/* Table: buy_plan */
/*==============================================================*/
create table buy_plan (
bpno char(10) not null,
sno char(10) null,
bpdate datetime null,
constraint PK_BUY_PLAN primary key nonclustered (bpno)
)
go
/*==============================================================*/
/* Index: 制定1_FK */
/*==============================================================*/
create index 制定1_FK on buy_plan (
sno ASC
)
go
/*==============================================================*/
/* Table: out_rec */
/*==============================================================*/
create table out_rec (
bpno char(10) not null,
wgno char(10) not null,
planbnum int null,
constraint PK_OUT_REC primary key (bpno, wgno)
)
go
/*==============================================================*/
/* Index: out_rec_FK */
/*==============================================================*/
create index out_rec_FK on out_rec (
bpno ASC
)
go
/*==============================================================*/
/* Index: out_rec2_FK */
/*==============================================================*/
create index out_rec2_FK on out_rec (
wgno ASC
)
go
/*==============================================================*/
/* Table: pay_bill */
/*==============================================================*/
create table pay_bill (
pbno char(10) not null,
sno char(10) null,
pbdate datetime null,
constraint PK_PAY_BILL primary key nonclustered (pbno)
)
go
/*==============================================================*/
/* Index: 出示2_FK */
/*==============================================================*/
create index 出示2_FK on pay_bill (
sno ASC
)
go
/*==============================================================*/
/* Table: payl_record */
/*==============================================================*/
create table payl_record (
pbno char(10) not null,
wgno char(10) not null,
prnum int null,
prprice money null,
constraint PK_PAYL_RECORD primary key (pbno, wgno)
)
go
/*==============================================================*/
/* Index: payl_record_FK */
/*==============================================================*/
create index payl_record_FK on payl_record (
pbno ASC
)
go
/*==============================================================*/
/* Index: payl_record2_FK */
/*==============================================================*/
create index payl_record2_FK on payl_record (
wgno ASC
)
go
/*==============================================================*/
/* Table: receipt */
/*=====================
展开阅读全文