基于javaweb的SpringBoot学生信息管理系统(java+springboot+html+thymeleaf+js+bootstrap+maven+mybatis+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

200023022402

210023022402

230023022402

240023022402

250023022402

260023022402

432024073108

基于javaweb的SpringBoot学生信息管理系统(java+springboot+html+thymeleaf+js+bootstrap+maven+mybatis+mysql)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
admin   123456

教师(teacher表):
20240001 123456
20240002 123456

学生(student表):
202400001 123456
202400002 123456


管理员、教师、学生分别有如下功能:

管理员:
公告管理
课程管理
课程选报查看
学生管理
学生选课查看
教师管理(含设置所授课程)
班级管理

教师:
查看公告
查看自己教授的课程
查看选了自己教授课程的学生
成绩录入
个人信息管理

学生:
查看公告
查看课程
选课
查看成绩
个人信息管理

环境配置:

Jdk1.8 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)

项目技术:

SpringBoot +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

/**
*/

@Controller
public class CourseController {
@Autowired
CourseDao courseDao;
@Autowired
ClassDao classDao;
@Autowired
StudentDao studentDao;

/*
* @Param: [model]
* @Return: java.lang.String
* @Description: 查询所有课程并请求转发到课程列表页面
*/
@RequestMapping("/back/course/list")
public String toCourseList(Model model) {
List<Course> courses = courseDao.queryAllCourse();
model.addAttribute("courses", courses);

return "back/course/list";
}

/*
* @Param: [course]
* @Return: java.lang.String
* @Description: 课程添加,后重定向到课程列表
*/
@PostMapping("/back/course/add")
public String addCourse(Course course) {
courseDao.addCourse(course);
if (course.getCourseType().equals("7")) {
List<Student> students = studentDao.queryAllStudent();
for (Student student : students) {
studentDao.setSelectCourse(student.getStudentId(), course.getCourseId());
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


/**
*/

@Controller
public class TeacherController {
@Autowired
TeacherDao teacherDao;
@Autowired
CourseDao courseDao;

/*
* @Param: [model]
* @Return: java.lang.String
* @Description: 转发到教师列表页面
*/
@RequestMapping("/back/teacher/list")
public String toStudentList(Model model) {
List<Teacher> teachers = teacherDao.queryAllTeacher();
model.addAttribute("teachers", teachers);
List<Course> teachcourses = new ArrayList<>();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
    }

/*
* @Param: [notice]
* @Return: java.lang.String
* @Description: 修改公告内容
*/
@PostMapping("/back/notice/info")
public String updateNotice(Notice notice) {
noticeDao.updateNotice(notice);
return "redirect:/back/notice";
}

/*
* @Param: []
* @Return: java.lang.String
* @Description: 转发到帮助导入课程页面
*/
@RequestMapping("/back/help/course")
public String toHelpCourse() {
return "back/help/course";
}

/*
* @Param: []
* @Return: java.lang.String
* @Description: 转发到帮助导入学生页面
*/
@RequestMapping("/back/help/student")
public String toHelpStudent() {
return "back/help/student";
}

/*
* @Param: []
* @Return: java.lang.String
* @Description: 转发到帮助导入教师页面
*/
@RequestMapping("/back/help/teacher")
public String toHelpTeacher() {
return "back/help/teacher";
}
}
package com.zby.demo.filter;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
    }

/*
* @Param: [student]
* @Return: java.lang.String
* @Description: 修改学生信息
*/
@PostMapping("/front/student/info")
public String updateInfo(Student student) {
studentDao.updateStudentInfo(student);
return "redirect:/front/student/info";
}

/*
* @Param: [studentId, password]
* @Return: java.lang.String
* @Description: 修改密码
*/
@PostMapping("/front/student/info/{studentId}")
public String updatePassword(@PathVariable("studentId") String studentId, @Param("password") String password) {
studentDao.updateStudentPassword(studentId, password);
return "redirect:/logout";
}
}
package com.zby.demo.controller.front;


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
     * @Description: 修改课程信息,后重定向到课程列表
*/
@PostMapping("/back/course/info")
public String updateCourse(Course course) {
courseDao.updateCourse(course);
return "redirect:/back/course/list";
}

/*
* @Param: [model]
* @Return: java.lang.String
* @Description: 查询课程选报情况,并请求转发到课程选报详情页面
*/
@GetMapping("/back/course/selectcourse")
public String toCourseSelectCourse(Model model) {
List<SelectCourseStudents> selectCourseStudents = newList(courseDao.selectCourseStudents());
model.addAttribute("selectCourseStudents", selectCourseStudents);
List<Class> classes = classDao.queryAllClass();
model.addAttribute("classes", classes);
return "back/course/selectcourse";
}

//更新课程状态
List<SelectCourseStudents> newList(List<SelectCourseStudents> selectCourseStudents) {
List<SelectCourseStudents> list = new ArrayList<>();
long time = new Date().getTime();
for (SelectCourseStudents scs : selectCourseStudents) {
Course course = scs.getCourse();
if (time - course.getBeginDate().getTime() >= 0) {
if (course.getEndDate().getTime() + 1000 * 60 * 60 * 24 > time) {
course.setStatus("进行中");
list.add(0, scs);
} else {
course.setStatus("已结束");
list.add(scs);
}
} else {
course.setStatus("未开始");
list.add(scs);
}
}
return list;
}
}
package com.zby.demo.controller.front;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
    return "redirect:/back/teacher/list";
}

/*
* @Param: [teacherId]
* @Return: java.lang.String
* @Description: 删除指定教师。注意点:需要先删除对应的授课表的内容
*/
@GetMapping("/back/teacher/delete/{teacherId}")
public String deleteStudent(@PathVariable("teacherId") String teacherId) {
teacherDao.deleteTeachCourseByID(teacherId);
teacherDao.deleteTeacher(teacherId);
return "redirect:/back/teacher/list";
}

/*
* @Param: [deleteall]
* @Return: java.lang.String
* @Description: 批量删除教师。注意点同上
*/
@PostMapping("/back/teacher/delete")
public String deleteTeachers(@Param("deleteall") String deleteall) {
String[] deleteTeacherIds = deleteall.split(",");
for (String teacherId : deleteTeacherIds) {
teacherDao.deleteTeachCourseByID(teacherId);
teacherDao.deleteTeacher(teacherId);
}
return "redirect:/back/teacher/list";
}

/*
* @Param: [teacher, teachcourseId]
* @Return: java.lang.String
* @Description: 修改教师信息
*/
@PostMapping("/back/teacher/info")
public String updateStudent(Teacher teacher, @Param("teachcourseId") String teachcourseId) {
teacherDao.updateTeacherInfo(teacher);
teacherDao.updateTeacherTeachCourse(teacher.getTeacherId(), teachcourseId);


项目链接:
https://javayms.github.io?id=231422282105200cw
https://javayms.pages.dev?id=231422282105200cw