——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明







基于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等等;
——————————CodeStart——————————
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;
@RequestMapping("/back/course/list") public String toCourseList(Model model) { List<Course> courses = courseDao.queryAllCourse(); model.addAttribute("courses", courses);
return "back/course/list"; }
@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;
@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
| }
@PostMapping("/back/notice/info") public String updateNotice(Notice notice) { noticeDao.updateNotice(notice); return "redirect:/back/notice"; }
@RequestMapping("/back/help/course") public String toHelpCourse() { return "back/help/course"; }
@RequestMapping("/back/help/student") public String toHelpStudent() { return "back/help/student"; }
@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
| }
@PostMapping("/front/student/info") public String updateInfo(Student student) { studentDao.updateStudentInfo(student); return "redirect:/front/student/info"; }
@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"; }
@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"; }
@GetMapping("/back/teacher/delete/{teacherId}") public String deleteStudent(@PathVariable("teacherId") String teacherId) { teacherDao.deleteTeachCourseByID(teacherId); teacherDao.deleteTeacher(teacherId); return "redirect:/back/teacher/list"; }
@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"; }
@PostMapping("/back/teacher/info") public String updateStudent(Teacher teacher, @Param("teachcourseId") String teachcourseId) { teacherDao.updateTeacherInfo(teacher); teacherDao.updateTeacherTeachCourse(teacher.getTeacherId(), teachcourseId);
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=231422282105200cw
https://javayms.pages.dev?id=231422282105200cw