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.71 | |
| java開發工具 | idea | |
| 框架 | mybatis/Struts2 | |
| 專案名稱 | 《學生教務系統》 | |
| 實作技術 | struts2+mybatis+mysql+Servlet+jquery+ajax+js+Maven等技術 |
2、《百知教務系統》的總體功能
| 序號 | 模塊名稱 | 主要功能 |
|---|---|---|
| 1 | 學生管理模塊 | 添加學生資訊,洗掉學生資訊,修改學生資訊,查詢學生資訊,下載學生新,分頁顯示學生資訊 |
| 2 | 小組管理模塊 | 添加小組資訊,洗掉小組資訊,展示小組具體資訊 |
| 3 | 班級管理模塊 | 添加班級資訊,洗掉班級資訊,展示班級資訊 |
| 4 | 標簽管理模塊 | 添加標簽,洗掉標簽,展示標簽 |
| 5 | 城市管理模塊 | 添加城市,洗掉城市 |
| 6 | 登錄注冊模塊 | 登陸與注冊(權限識別 ) |
(3)用戶角色描述
| 角色名稱 | 角色描述 | 使用頻率 |
|---|---|---|
| 用戶 | 主要為每班班長、班主任(只能查看學生,沒有其他功能操作權限) | 中 |
| 管理員 | 為系統管理員 | 高 |
四、具體需求
1、功能劃分
本系統總體功能上是B/S 結構的Windows應用程式!
2、專案整體功能框架

3、概念資料模型CMD
CMD是物體與物體之間關系的模型(使用PdShell 設計)

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)
| 欄位 | 型別 | 主鍵 | 約束 | 備注 |
|---|---|---|---|---|
| id | int | 是 | 自增 | ID |
| username | Varchar(40) | not null unique | 用戶名(唯一) 使用Ajax實作 | |
| password | Varchar(40) | not null | 密碼,使用Md5進行加密 | |
| role | int | not null | 角色: 0管理員1用戶 | |
| code | Varchar(100) | 激活碼 | ||
| Varchar(50) | not null | 郵箱,不可重復 | ||
| status | int | 激活狀態: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)登錄功能實作

1. 用戶登錄之前用戶名必須是在注冊時通過郵箱激活 后的,否則不能登錄, 回傳提示資訊:用戶名輸入錯誤~~
2. 如果用戶名輸入錯誤 回傳提示資訊:用戶名輸入錯誤~~
3. 如果驗證碼輸錯 回傳提示資訊: 驗證碼輸入錯誤~~~
4. 如果用戶名,驗證碼正確 回傳提示資訊: 密碼輸入錯誤~~
(3)注冊功能實作

1.由于原型模型,沒有設計“郵箱欄位”,特加到了用戶上面,具體開發中,郵箱放在用戶下
2. 注冊進行提交后,會跳轉到請去郵箱激活用戶頁面
3.激活成功后會跳轉到登錄
注意:輸入用戶的時候會通過Ajax實作用戶是否存在驗證,
如果用戶名存在,會提醒你:"用戶已經存在,請重新輸入"
(4)用戶板塊功能流程圖

1. 注冊頁面進行注冊
2. 跳轉到請求激活頁面
3. 郵箱頁面請求激活
4. 激活后跳轉到已經激活頁面
5. 激活后跳轉到登錄頁面
2、城市管理板塊
(1)城市管理資料庫(t_city)
| 欄位 | 型別 | 主鍵 | 約束 | 備注 |
|---|---|---|---|---|
| c_id | int | 是 | 自增 | 編號 |
| c_name | varchar(20) | not null unique | 名稱 |
注意:其中Studnet表中有t_city,所以我們建表時最好把城市表放在第一個建的表
create table t_city(
id int primary key auto_increment ,
name varchar(20) not null unique
)
(2)城市功能示意圖

(3)城市功能詳情
1. 添加城市:只需要添加城市名稱,使用Ajax確定城市唯一
2. 洗掉城市: 洗掉"城市"欄位之前我們一定得把選中當前城市就業的學生洗掉,
或者讓該學生修改修改就業城市(使用Ajax判斷是否洗掉)
3、標簽管理板塊
(1)標簽管理資料庫設計(t_mark)
| 欄位 | 型別 | 主鍵 | 約束 | 序號 |
|---|---|---|---|---|
| m_id | int | 是 | 自增 | 編號 |
| m_name | Varchar(20) | 非空 | 名稱 | |
| m_time | date | 非空 | 創建時間 | |
| m_type | Varchar(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)標簽功能示意圖

(3)標簽功能詳情
1. 添加標簽: 添加標簽注意添加標簽名稱,標簽型別(標簽型別包含:學生/班級兩種型別 )
2. 洗掉標簽: 洗掉標簽名字欄位之前之前,我們得把對應的學生表,班級表中選中相關標簽的班級和班級資訊進行修改或者洗掉
(使用Ajax判斷是否洗掉)
4、班級管理板塊
(1)班級資料庫表(t_clazz)
| 欄位 | 型別 | 主鍵 | 約束 | 序號 |
|---|---|---|---|---|
| c_id | int | 是 | 自增 | 班級ID |
| c_name | Varchar(20) | 班級名 | ||
| c_logoPath | Varchar(300) | 班級LOGO | ||
| c_mark_id | Varchar(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)班級頁面圖

(3)班級功能詳情
1. 添加班級:班級的id,班級的標簽(依賴于標簽表),班級名,班級Logo(其中班級的Logo 通過存盤路徑的形式進行存盤 )
2. 洗掉班級: 洗掉標簽時,需要先洗掉,學生,和小組里面包含的該班級資訊
(使用Ajax判斷是否洗掉)
5、小組管理模塊
(1)小組資料庫設計(t_group)
| 欄位 | 型別 | 主鍵 | 約束 | 序號 |
|---|---|---|---|---|
| g_id | int | 是 | 自增 | 小組編號 |
| g_name | Varchar(20) | 非空 | 小組名 | |
| g_createdate | date | 小組的創建時間 | ||
| g_clazz_id | int | 班級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)小組功能示意圖

(3)小組功能詳情
1. 添加小組功能:會添加組名稱,然后選擇班級(小組是班級的外鍵,需要先建班級表才能創建小組表 )
(其中包含student外鍵:添加組名稱時:本組學生的標簽會自動增加到小組標簽上,并且統計本組學生人數 )
2. 洗掉小組功能: 洗掉小組之前需要將本小組的studnet洗掉或者修改帶其他組,否則無法洗掉
(使用Ajax判斷是否洗掉)
3.頁面展示功能中的學生標簽和學生人數,將從外鍵Student中獲取,班級名稱名班級表中獲取
6、學生管理板塊
(1)學生表資料庫設計(t_student)
| 欄位 | 型別 | 主鍵 | 約束 | 備注 |
|---|---|---|---|---|
| s_id | int | 是 | 自增 | 學號 |
| s_name | Varchar(20) | 非空 | 姓名 | |
| s_phone | Varchar(20) | 非空 | 電話 | |
| s_qq | Varchar(20) | 非空 | ||
| s_age | int | 非空 | 年齡 | |
| s_birthday | date | 非空 | 生日 | |
| s_starts | Varchar(20) | 星座,可以為空,如果不填,默認為空 | ||
| s_attr | Varchar(20) | 生肖,可以為空,如果不填,默認為空 | ||
| s_clazz_id | int | 非空,外鍵 | 班級id(外鍵),關聯班級表 | |
| s_group_id | int | 非空,外鍵 | 小組id(外鍵),關聯小組表 | |
| s_city_id | int | 非空,外鍵 | 就業城市id(外鍵),關聯城市表 |
注意:學生表一定要 最后建 ,學生表依賴于 城市表,班級表,標簽表,小組表 ,并且需要這四個表有資料之后,我們才能添加資料
- 學生標簽關系表 t_sm_relation( 因為學生和標簽為多對多關系,產生中間表 )
| 欄位 | 型別 | 主鍵 | 約束 | 備注 |
|---|---|---|---|---|
| r_id | int | 是 | 自增 | 關系id |
| s_id | int | 外鍵,非空 | 學生id | |
| mark_id | int | 外鍵,非空 | 標簽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)學生管理操作圖

(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

(2)創建資料庫表
-
展示資料庫中目前擁有的資料庫表:
show databases; -
創建資料庫表:
create database status_sys

(3)先退出資料庫:exit,

(4)匯入“status_sys”檔案:
先將“status_sys”檔案放入E盤下,方便匯入:
命令:mysql -uroot -proot status_sys<e:\status_sys.sql

(5)效果展示圖

📌 作者:王恒杰
📃 更新: 2021.11.3
? 勘誤: 無
📜 宣告: 由于作者水平有限,本文有錯誤和不準確之處在所難免,本人也很想知道這些錯誤,懇望讀者批評指正!
🍅 歡迎點贊 👍 收藏 ?留言 📝
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/347109.html
標籤:java
