Java经典基础项目《学生教务系统》立项需求说明书
🍅 Java学习路线:搬砖工的Java学习路线 🍅 作者:程序员小王 🍅 程序员小王的博客:https://www.wolai.com/wnaghengjie/ahNwvAUPG2Hb1Sy7Z8waaF 🍅 扫描主页左侧二维码,加我微信 一起学习、一起进步 🍅 欢迎点赞 👍 收藏 ⭐留言 📝 🍅 如有编辑错误联系作者,如果有比较好的文章欢迎分享给我,我会取其精华去其糟粕
一、需求背景
《学生教务系统》 系统设计以方便快捷和安全为出发点,放弃传统的人工记录对学生信息管理的缺陷和不足, 采用全新的方式使学校对学生信息进行存储和维护,增加管理效率。
本系统大体为教务学生管理系统 、并且赋予了管理员很多功能来操作这个系统,包括:学生管理,小组管理,班级管理等功能;通过这些功能模块的设计,满足了老师对学生的信息进行管控所需的功能。
系统采用 b/s(浏览器/服务器) 三层结构 ,对动态页面的制作采用了 JSP+Ajax 技术,为了实现管理系统的安全可靠以及对有些代码可以进行重复使用考虑, 对程序的重要代码进行封装时采用 Java Bean。本系统贯彻以人为本的思想,实用性高。
二、产品目标
学生信息的管理工作变得越来越庞大和繁冗,效率也低。为了充分利用互联网带给人们的便利,更好地提高教学管理管理工作的效率,使学生和教职员工能更方便地进行信息查询活动,特开发此教学管理系统。本软件通过权限识别登录到该系统,权限不同享有的功能就又说差异,来实现日常的学生信息的管理。
三、《学生教务系统》项目介绍:
1、开发环境
分类名称语种操作系统windows10简体中文数据库平台MySQL Server 8.0+应用服务器apache-tomcat-8.5.71java开发工具idea框架mybatis/Struts2项目名称《学生教务系统》实现技术struts2+mybatis+mysql+Servlet+jquery+ajax+js+Maven等技术
2、《百知教务系统》的总体功能
序号模块名称主要功能1学生管理模块添加学生信息,删除学生信息,修改学生信息,查询学生信息,下载学生新,分页显示学生信息2小组管理模块添加小组信息,删除小组信息,展示小组具体信息3班级管理模块添加班级信息,删除班级信息,展示班级信息4标签管理模块添加标签,删除标签,展示标签5城市管理模块添加城市,删除城市6登录注册模块登陆与注册(权限识别 )
(3)用户角色描述
角色名称角色描述使用频率用户主要为每班班长、班主任(只能查看学生,没有其他功能操作权限)中管理员为系统管理员高
四、具体需求
1、功能划分
本系统总体功能上是B/S 结构的Windows应用程序!
2、项目整体功能框架
![](https://img-blog.csdnimg.cn/img_convert/ab20c97614471959e60bc1311a63e421.png)
3、概念数据模型CMD
CMD是实体与实体之间关系的模型(使用PdShell 设计)
![](https://img-blog.csdnimg.cn/img_convert/02a86e2e93966a11ece8742706963513.png)
1. 表的数量 和模块有关 6表
2. 确认字段
用户表:id 用户名 密码 角色
城市表:id 地址名
标签表: id 标签名,标签创建时间,标签类型
班级表: id 班级名称,班级Logo(图片路径)
小组表: id 小组名称,创建时间
学生表: id 名字,生日,QQ,电话,星座,生肖
3. 确认关系
关系:
学生-班级: 多对一 外键列加在学生表 clazz_id
学生-小组: 多对一 外键列加在学生表 gropu_id
学生-就业城市: 多对一 外键列加在学生表 city_id
学生-标签: 多对多 中间表(关系表)
班级-标签: 多对一 外键列加在班级表 clazz_id
班级-小组: 一对多 外键列加在小组表 group_id
五、功能需求
1、用户登录/注册板块
(1)用户/管理员表设计(t_user)
字段类型主键约束备注idint是自增IDusernameVarchar(40)not null unique用户名(唯一) 使用Ajax实现passwordVarchar(40)not null密码,使用Md5进行加密roleintnot null角色: 0管理员1用户codeVarchar(100)激活码emailVarchar(50)not null邮箱,不可重复statusint激活状态:0 未激活,1激活,2无效
注意:邮箱用户注册后向注册用户发送邮箱,激活后可以使用该账户进行登录,否则注册失效
--用户表
create table t_user(
id int primary key auto_increment,
-- 其中用户名通过Ajax注册查询用户名是否重复进行判断
username varchar(40) not null unique,
password varchar(40) not null,
--'用户 0 管理员 1',
role int not null,
--用户的邮箱!用于激活使用!
email varchar(50) not null,
--'邮件激活码',
code Varchar(100),
-- '用户的激活状态 0 未激活 1 激活',
status int
)
(2)登录功能实现
![](https://img-blog.csdnimg.cn/img_convert/0116fec8874fa2113fd95130cde10c67.png)
1. 用户登录之前用户名必须是在注册时通过邮箱激活 后的,否则不能登录, 返回提示信息:用户名输入错误~~
2. 如果用户名输入错误 返回提示信息:用户名输入错误~~
3. 如果验证码输错 返回提示信息: 验证码输入错误~~~
4. 如果用户名,验证码正确 返回提示信息: 密码输入错误~~
(3)注册功能实现
![](https://img-blog.csdnimg.cn/img_convert/f4fb822fb9a67ec02af9896ca968a5c0.png)
1.由于原型模型,没有设计“邮箱字段”,特加到了用户上面,具体开发中,邮箱放在用户下
2. 注册进行提交后,会跳转到请去邮箱激活用户页面
3.激活成功后会跳转到登录
注意:输入用户的时候会通过Ajax实现用户是否存在验证,
如果用户名存在,会提醒你:"用户已经存在,请重新输入"
(4)用户板块功能流程图
![](https://img-blog.csdnimg.cn/img_convert/3f7103383fb357c11f54064a73602c06.png)
1. 注册页面进行注册
2. 跳转到请求激活页面
3. 邮箱页面请求激活
4. 激活后跳转到已经激活页面
5. 激活后跳转到登录页面
2、城市管理板块
(1)城市管理数据库(t_city)
字段类型主键约束备注c_idint是自增编号c_namevarchar(20)not null unique名称
注意:其中Studnet表中有t_city,所以我们建表时最好把城市表放在第一个建的表
create table t_city(
id int primary key auto_increment ,
name varchar(20) not null unique
)
(2)城市功能示意图
![](https://img-blog.csdnimg.cn/img_convert/2a45d3970fa33c880b9907b3009e4716.png)
(3)城市功能详情
1. 添加城市:只需要添加城市名称,使用Ajax确定城市唯一
2. 删除城市: 删除"城市"字段之前我们一定得把选中当前城市就业的学生删除,
或者让该学生修改修改就业城市(使用Ajax判断是否删除)
3、标签管理板块
(1)标签管理数据库设计(t_mark)
字段类型主键约束序号m_idint是自增编号m_nameVarchar(20)非空名称m_timedate非空创建时间m_typeVarchar(20)非空标签类型
注:其中学生表,班级表里面均有标签,我们建表之前最好在学生表,班级表之前建学生表
--标签表
create table t_mark(
m_id int primary key auto_increment,
m_name varchar(20) not null,
m_time date,
m_type varchar(20)
)
(2)标签功能示意图
![](https://img-blog.csdnimg.cn/img_convert/8f7c2111682a1a68941817e613c63531.png)
(3)标签功能详情
1. 添加标签: 添加标签注意添加标签名称,标签类型(标签类型包含:学生/班级两种类型 )
2. 删除标签: 删除标签名字字段之前之前,我们得把对应的学生表,班级表中选中相关标签的班级和班级信息进行修改或者删除
(使用Ajax判断是否删除)
4、班级管理板块
(1)班级数据库表(t_clazz)
字段类型主键约束序号c_idint是自增班级IDc_nameVarchar(20)班级名c_logoPathVarchar(300)班级LOGOc_mark_idVarchar(20)外键标签序号
注:其中班级标签id是标签表的外键,建表后添加数据时, 一定要保证标签中有数据
--班级表
create table t_clazz(
c_id int primary key auto_increment,
c_name varchar(20) not null,
c_logoPath varchar(50),
c_mark_id int
)
(2)班级页面图
![](https://img-blog.csdnimg.cn/img_convert/3a2aeb7d3668de6d60e8f22c0f580d1a.png)
(3)班级功能详情
1. 添加班级:班级的id,班级的标签(依赖于标签表),班级名,班级Logo(其中班级的Logo 通过存储路径的形式进行存储 )
2. 删除班级: 删除标签时,需要先删除,学生,和小组里面包含的该班级信息
(使用Ajax判断是否删除)
5、小组管理模块
(1)小组数据库设计(t_group)
字段类型主键约束序号g_idint是自增小组编号g_nameVarchar(20)非空小组名g_createdatedate小组的创建时间g_clazz_idint班级id
注意:其中班级id依赖于班级表,添加小组数据之前我们需要先添加班级的数据
--小组表
create table t_group(
g_id int primary key auto_increment,
g_name varchar(20) not null,
g_createdate date,
g_clazz_id int
)
(2)小组功能示意图
![](https://img-blog.csdnimg.cn/img_convert/b920b72ed33949aa909fbaac9bb2511c.png)
(3)小组功能详情
1. 添加小组功能:会添加组名称,然后选择班级(小组是班级的外键,需要先建班级表才能创建小组表 )
(其中包含student外键:添加组名称时:本组学生的标签会自动增加到小组标签上,并且统计本组学生人数 )
2. 删除小组功能: 删除小组之前需要将本小组的studnet删除或者修改带其他组,否则无法删除
(使用Ajax判断是否删除)
3.页面展示功能中的学生标签和学生人数,将从外键Student中获取,班级名称名班级表中获取
6、学生管理板块
(1)学生表数据库设计(t_student)
字段类型主键约束备注s_idint是自增学号s_nameVarchar(20)非空姓名s_phoneVarchar(20)非空电话s_qqVarchar(20)非空QQs_ageint非空年龄s_birthdaydate非空生日s_startsVarchar(20)星座,可以为空,如果不填,默认为空s_attrVarchar(20)生肖,可以为空,如果不填,默认为空s_clazz_idint非空,外键班级id(外键),关联班级表s_group_idint非空,外键小组id(外键),关联小组表s_city_idint非空,外键就业城市id(外键),关联城市表
注意:学生表一定要 最后建 ,学生表依赖于 城市表,班级表,标签表,小组表 ,并且需要这四个表有数据之后,我们才能添加数据
学生标签关系表 t_sm_relation( 因为学生和标签为多对多关系,产生中间表 )
字段类型主键约束备注r_idint是自增关系ids_idint外键,非空学生idmark_idint外键,非空标签id
t_studnet学生表
-- 学生表
create table t_student(
-- 学生 id 主键 自增
id int primary key auto_increment,
-- 学生姓名
name varchar(20) not null,
--电话
phone varchar(20),
--QQ
qq varchar(20),
--年龄
age int,
-- 生日
s_birthday date,
--星座
s_starts varchar(20),
--生肖
s_attr varchar(20),
--班级id
s_clazz_id int,
--小组id
s_group_id int,
--城市id
s_city_id int,
--学生标签关系表id
r_id int
)
--t_sm_relation 学生标签关系表
create table t_sm_relation(
r_id int primary key auto_increment,
m_id int not null,
s_id int not null
)
(2)学生管理操作图
![](https://img-blog.csdnimg.cn/img_convert/0a9fcef2dd37f9e14d3b9561258e09a1.png)
(3)学生信息功能详情
1. 添加学生信息(**城市表,班级表,标签表,小组表有数据之后才能添加** )
2. 功能是修改学生,删除学生
3. 展示内容(分页实现)
4. 以Json形式下载信息
5. 以QQ或者姓名或者手机号查询学生信息
六、数据库表
1、教务管理系统数据库表
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2021/10/31 11:47:31 */
/*==============================================================*/
drop table if exists m_s_fk;
drop table if exists t_city;
drop table if exists t_group;
drop table if exists t_mark;
drop table if exists t_studnet;
drop table if exists user;
/*==============================================================*/
/* Table: m_s_fk */
/*==============================================================*/
create table m_s_fk
(
m_id int not null auto_increment,
s_id int not null,
primary key (m_id, s_id)
);
alter table m_s_fk comment '一个标签可以被多个学生选择,一个学生可以选择多个标签';
/*==============================================================*/
/* Table: t_city */
/*==============================================================*/
create table t_city
(
c_id int not null auto_increment,
c_name varchar(20) not null,
primary key (c_id)
);
alter table t_city comment '用于存储城市信息的实体';
/*==============================================================*/
/* Table: t_group */
/*==============================================================*/
create table t_group
(
g_id int not null auto_increment,
clazz_id int,
g_name varchar(20) not null,
g_createdate date not null,
primary key (g_id)
);
alter table t_group comment '用于存储小组信息的实体';
/*==============================================================*/
/* Table: t_mark */
/*==============================================================*/
create table t_mark
(
m_id int not null auto_increment,
m_name varchar(20) not null,
m_time date not null,
m_type varchar(20) not null,
primary key (m_id)
);
alter table t_mark comment '用于存储标签的实体';
/*==============================================================*/
/* Table: t_clazz */
/*==============================================================*/
create table t_clazz
(
clazz_id int not null auto_increment,
m_id int not null,
c_name varchar(20) not null,
c_logo_path varchar(300) not null,
primary key (clazz_id)
);
alter table t_clazz comment '用于存储班级信息的实体';
/*==============================================================*/
/* Table: t_studnet */
/*==============================================================*/
create table t_studnet
(
s_id int not null auto_increment,
clazz_id int ,
g_id int ,
c_id int ,
s_phone varchar(20) not null,
s_name varchar(20) not null,
s_qq varchar(20) not null,
s_age varchar(20) not null,
s_birthday date not null,
s_starts varchar(20) not null,
s_attr varchar(20) not null,
primary key (s_id)
);
alter table t_studnet comment '用于存储学生信息的实体';
/*==============================================================*/
/* Table: user */
/*==============================================================*/
create table user
(
id int not null auto_increment,
username varchar(20) not null,
password varchar(20) not null,
role int,
code varchar(100),
email varchar(50) not null,
status int,
primary key (id)
);
alter table user comment '用于用户登录注册';
alter table m_s_fk add constraint FK_m_s_fk foreign key (m_id)
references t_mark (m_id) on delete restrict on update restrict;
alter table m_s_fk add constraint FK_m_s_fk2 foreign key (s_id)
references t_studnet (s_id) on delete restrict on update restrict;
alter table t_group add constraint FK_g_c_fk foreign key (clazz_id)
references t_clazz (clazz_id) on delete restrict on update restrict;
alter table t_clazz add constraint FK_m_c_fk foreign key (m_id)
references t_mark(m_id) on delete restrict on update restrict;
alter table t_studnet add constraint FK_c_s_fk foreign key (c_id)
references t_city (c_id) on delete restrict on update restrict;
alter table t_studnet add constraint FK_s_c_fk foreign key (clazz_id)
references t_clazz (clazz_id) on delete restrict on update restrict;
alter table t_studnet add constraint FK_s_m_fk foreign key (g_id)
references t_group (g_id) on delete restrict on update restrict;
2、导入数据库表的步骤:
(1)打开命令窗口输入: mysql -uroot -proot
![](https://img-blog.csdnimg.cn/img_convert/534a1d5b228fa098c9207100a4e97f08.png)
(2)创建数据库表
展示数据库中目前拥有的数据库表:show databases; 创建数据库表:create database status_sys
![](https://img-blog.csdnimg.cn/img_convert/0fd84a54cfe3dc5b1392f67a6dfc6d7b.png)
(3)先退出数据库:exit,
![](https://img-blog.csdnimg.cn/img_convert/7dea7ccd207e1a8f04155eee8a6655b1.png)
(4)导入“status_sys”文件:
先将“status_sys”文件放入E盘下,方便导入:
命令:mysql -uroot -proot status_sys |