1. Database design
1. Overview of database model design
2. Database table design
①depository
Description: This table stores warehouse information, such as warehouse name, warehouse address and warehouse introduction.
Table Structure:
serial number |
Field name |
type of data |
primary key |
non empty |
default value |
describe |
1 |
id |
INT(10) |
yes |
yes |
||
2 |
dname |
VARCHAR(255) |
no |
yes |
warehouse name |
|
3 |
address |
VARCHAR(255) |
no |
yes |
Warehouse Address |
|
4 |
introduce |
VARCHAR(255) |
no |
yes |
Warehouse introduction |
②Warehouse scheduling record (depository_record)
Description: This table records warehouse scheduling records. At the same time, this table is also data and can be viewed as pieces of application information.
Table Structure:
serial number |
Field name |
type of data |
primary key |
non empty |
default value |
describe |
1 |
id |
INT(10) |
yes |
yes |
record id |
|
2 |
application_id |
INT(10) |
no |
no |
Application number (temporarily unused) |
|
3 |
happy |
VARCHAR(255) |
no |
yes |
product name |
|
4 |
depository_id |
INT(10) |
no |
yes |
Scheduled warehouse id |
|
5 |
type |
INT(10) |
no |
yes |
0 |
Scheduling record type (0 outbound, 1 inbound) |
6 |
quantity |
DOUBLE(22) |
no |
no |
quantity |
|
7 |
price |
DOUBLE(22) |
no |
no |
price |
|
8 |
state |
VARCHAR(255) |
no |
no |
Status (to be reviewed/failed to pass the review, not put into the warehouse/out of the warehouse/failed to pass the inspection, to be accepted/into the warehouse/out of the warehouse) |
|
9 |
applicant_id |
INT(10) |
no |
no |
Applicant ID |
|
10 |
apply_remark |
VARCHAR(255) |
no |
no |
Application notes |
|
11 |
apply_time |
DATETIME |
no |
no |
application time |
|
12 |
reviewer_id |
INT(10) |
no |
no |
Reviewer ID |
|
13 |
review_remark |
VARCHAR(255) |
no |
no |
Comments on review results |
|
14 |
review_time |
DATETIME |
no |
no |
review time |
|
15 |
review_pass |
INT(10) |
no |
no |
Whether the review passed, 0 means failed, 1 means passed |
|
16 |
checker_id |
INT(10) |
no |
no |
Inspector ID |
|
17 |
check_remark |
VARCHAR(255) |
no |
no |
Acceptance remarks |
|
18 |
check_time |
DATETIME |
no |
no |
Warehousing time (inspection time) |
|
19 |
check_pass |
INT(10) |
no |
no |
Whether the acceptance is passed |
3. Product information record (inventory) (material)
Description: Product information record (inventory information)
Table Structure:
serial number |
Field name |
type of data |
primary key |
non empty |
default value |
describe |
1 |
id |
INT(10) |
yes |
yes |
store id |
|
2 |
depository_id |
INT(10) |
no |
no |
warehouse name |
|
3 |
happy |
VARCHAR(255) |
no |
no |
Material name |
|
4 |
quantity |
DOUBLE(22) |
no |
no |
quantity |
|
5 |
price |
DOUBLE(22) |
no |
no |
lump sum |
|
6 |
type_id |
INT(10) |
no |
no |
Material type id |
4、material_type
Description: Material types. I have classified the materials so that statistics are much more convenient. Another table is created to prevent possible additions to the material types in the future and to save storage space.
Table Structure:
serial number |
Field name |
type of data |
primary key |
non empty |
default value |
describe |
1 |
id |
INT(10) |
yes |
yes |
typeid |
|
2 |
tname |
VARCHAR(255) |
否 |
是 |
类型名称 |
|
3 |
introduce |
VARCHAR(255) |
否 |
否 |
类型介绍 |
5、notice
描述: 公告表,用于存储公告信息
表结构
序号 |
字段名 |
数据类型 |
主键 |
非空 |
默认值 |
描述 |
1 |
id |
INT(10) |
是 |
是 |
公告主键 |
|
2 |
title |
VARCHAR(255) |
否 |
是 |
公告标题 |
|
3 |
content |
VARCHAR(255) |
否 |
否 |
公告内容 |
|
4 |
time |
DATETIME |
否 |
是 |
发布时间 |
6、standing_book
描述: 台账表。
表结构:
序号 |
字段名 |
数据类型 |
主键 |
非空 |
默认值 |
描述 |
1 |
id |
INT(10) |
是 |
是 |
台账记录id |
|
2 |
type |
INT(10) |
否 |
是 |
0表示调入,1表示调出(外部);2表示调入(退料),3表示调出(领料)(内部调用) |
|
3 |
quantity |
INT(10) |
否 |
是 |
0 |
数量 |
4 |
price |
INT(10) |
否 |
是 |
0 |
总价 |
5 |
material_name |
VARCHAR(255) |
否 |
是 |
材料名称 |
7、transfer_record
描述: 转移表,这个是用来关联转移操作的。
表结构:
序号 |
字段名 |
数据类型 |
主键 |
非空 |
默认值 |
描述 |
1 |
id |
INT(10) |
是 |
是 |
转移记录id |
|
2 |
from_id |
INT(10) |
否 |
是 |
转出仓库id |
|
3 |
to_id |
INT(10) |
否 |
是 |
转入仓库id |
8、 user
描述: 用户表,这里的密码是经过加密存储的。
表结构:
序号 |
字段名 |
数据类型 |
主键 |
非空 |
默认值 |
描述 |
1 |
id |
INT(10) |
是 |
是 |
用户id |
|
2 |
uname |
VARCHAR(255) |
否 |
是 |
用户名称 |
|
3 |
authority |
VARCHAR(255) |
否 |
否 |
表示权限等级(游客/员工/审核员/仓管员/系统管理员) |
|
4 |
pwd |
VARCHAR(255) |
否 |
否 |
用户登录密码(数据库存储的是加密后的) |
|
5 |
sex |
VARCHAR(255) |
否 |
是 |
性别 |
|
6 |
depository_id |
INT(10) |
否 |
否 |
负责仓库,序号表示仓库id,0表示全部仓库 |
|
7 |
entry_date |
DATE |
否 |
是 |
入职日期 |
|
8 |
|
VARCHAR(255) |
否 |
否 |
邮箱 |
|
9 |
phone |
VARCHAR(255) |
否 |
否 |
手机号 |