作者主页:夜未央5788

简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

SSM项目-学生学籍管理系统。该项目分管理员、老师、学生三种用户角色。每种角色分别对应不同的菜单;

以下分别介绍各个角色对应的功能模块:

管理员角色:

- 用户登录和退出
- 权限控制
- 系统管理
- 专业管理
- 班级管理
- 学生管理
- 老师管理
- 课程管理
- 开课管理
- 用户管理

老师角色:

- 老师管理
- 成绩管理
- 学生查询

学生角色:

- 学生管理
- 选课管理

- 成绩查询

技术路线

- 开发工具:IDEA 2020.1

- 技术框架:Spring、SpringMVC、MyBatis
- Web容器:Tomcat 8.5.7
- 数据库:MySQL 5.7
- 前端UI框架:LayUI

- 项目管理:Maven 3.6.3

使用说明

1. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

若为maven项目,导入成功后请执行maven clean;maven install命令,下载所需jar包;

2. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置
4. 配置tomcat,然后运行项目,输入localhost:8080 登录

运行截图

相关代码

CourseController

package com.yanzhen.controller;import com.yanzhen.entity.Course;
import com.yanzhen.service.CourseService;
import com.yanzhen.utils.MapControl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;import java.util.List;
import java.util.Map;@Controller
@RequestMapping("/course")
public class CourseController {private static final String LIST = "course/list";private static final String ADD = "course/add";private static final String UPDATE = "course/update";@Autowiredprivate CourseService courseService;//跳转添加页面@GetMapping("/add")public String create() {return ADD;}//添加操作@PostMapping("/create")@ResponseBodypublic Map<String, Object> create(@RequestBody Course course) {int result = courseService.create(course);if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//根据id删除@PostMapping("/delete/{id}")@ResponseBodypublic Map<String, Object> delete(@PathVariable("id") Integer id) {int result = courseService.delete(id);if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//批量删除@PostMapping("/delete")@ResponseBodypublic Map<String, Object> delete(String ids) {int result = courseService.delete(ids);if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//修改操作@PostMapping("/update")@ResponseBodypublic Map<String, Object> update(@RequestBody Course course) {int result = courseService.update(course);if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//根据id删除,跳转修改页面@GetMapping("/detail/{id}")public String detail(@PathVariable("id") Integer id, ModelMap modelMap) {//查询出要修改的课程信息,存储到request域Course course = courseService.detail(id);modelMap.addAttribute("course", course);return UPDATE;}//查询所有@PostMapping("/query")@ResponseBodypublic Map<String, Object> query(@RequestBody Course course) {List<Course> list = courseService.query(course);//查询总记录条数Integer count = courseService.count(course);return MapControl.getInstance().success().page(list, count).getMap();}//跳转列表页面@GetMapping("/list")public String list() {return LIST;}}

IndexController

package com.yanzhen.controller;import com.yanzhen.entity.*;
import com.yanzhen.service.*;
import com.yanzhen.utils.MD5Utils;
import com.yanzhen.utils.MapControl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;@Controller
public class IndexController {@AutowiredUserService userService;@AutowiredTeacherService teacherService;@AutowiredStudentService studentService;@AutowiredClazzService clazzService;@AutowiredSubjectService subjectService;@AutowiredCourseService courseService;@AutowiredSectionService sectionService;@AutowiredScoreService scoreService;//跳转系统主页@GetMapping("/index")public String login() {return "index";}//跳转用户基本信息页面@GetMapping("/info")public String info() {return "info";}//跳转修改密码页面@GetMapping("/pwd")public String pwd() {return "pwd";}//修改密码 根据旧密码来修改密码@PostMapping("/pwd")@ResponseBodypublic Map<String,Object> pwd(String sourcePwd,String newPwd,String type,Integer id) {//先判断类型if("1".equals(type)) {User user = userService.detail(id);//比较原密码是否相同 注意:原密码也要加密后再进行比较,因为数据库中存储的是加密后的密码if(user.getUserPwd().equals(MD5Utils.getMD5(sourcePwd))) {User entity = new User();entity.setId(id);entity.setUserPwd(MD5Utils.getMD5(newPwd)); //主要要加密int result = userService.update(entity);if(result <= 0) {return MapControl.getInstance().error().getMap();} else {return MapControl.getInstance().success().getMap();}} else {return MapControl.getInstance().error("原密码错误").getMap();}}if("2".equals(type)) {Teacher teacher = teacherService.detail(id);//比较原密码if(teacher.getTeacherPwd().equals(MD5Utils.getMD5(sourcePwd))) {Teacher entity = new Teacher();entity.setId(id);entity.setTeacherPwd(MD5Utils.getMD5(newPwd));int result = teacherService.update(entity);if(result <= 0) {return MapControl.getInstance().error().getMap();} else {return MapControl.getInstance().success().getMap();}} else {return MapControl.getInstance().error("原密码错误").getMap();}}if("3".equals(type)) {Student student = studentService.detail(id);//比较原密码if(student.getStuPwd().equals(MD5Utils.getMD5(sourcePwd))) {Student entity = new Student();entity.setId(id);entity.setStuPwd(MD5Utils.getMD5(newPwd));int result = studentService.update(entity);if(result <= 0) {return MapControl.getInstance().error().getMap();} else {return MapControl.getInstance().success().getMap();}} else {return MapControl.getInstance().error("原密码错误").getMap();}}return MapControl.getInstance().error().getMap();}//跳转系统主页(数据概览)@GetMapping("/main")public String main(ModelMap modelMap) {//1.系统数据概览List<Clazz> clazzes = clazzService.query(null);List<Subject> subjects = subjectService.query(null);List<Teacher> teachers = teacherService.query(null);List<Course> courses = courseService.query(null);List<Section> sections = sectionService.query(null);List<Student> students = studentService.query(null);modelMap.addAttribute("clazzCnt",clazzes.size());modelMap.addAttribute("subjectCnt",subjects.size());modelMap.addAttribute("teacherCnt",teachers.size());modelMap.addAttribute("courseCnt",courses.size());modelMap.addAttribute("studentCnt",students.size());modelMap.addAttribute("sectionCnt",sections.size());//2.班级学生数量List<Map<String,Object>> mapList = new ArrayList<>();for(Clazz clazz : clazzes) {Map<String,Object> map = new HashMap<>();map.put("name",clazz.getClazzName()); //设置班级名称int cnt = 0;//统计学生数量for(Student student : students) {if(student.getClazzId() == clazz.getId()) {cnt++;}}map.put("cnt",cnt); //设置学生数量mapList.add(map);}modelMap.addAttribute("mapList",mapList);//3.查询各科平均成绩(根据专业查询各科平均成绩)List<HashMap> mapList2 = scoreService.queryAvgScoreBySection();modelMap.addAttribute("mapList2",mapList2);return "main";}}

ScoreController

package com.yanzhen.controller;import com.yanzhen.entity.Course;
import com.yanzhen.entity.Score;
import com.yanzhen.entity.Section;
import com.yanzhen.entity.Student;
import com.yanzhen.service.CourseService;
import com.yanzhen.service.ScoreService;
import com.yanzhen.service.SectionService;
import com.yanzhen.utils.MapControl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;@Controller
@RequestMapping("/score")
public class ScoreController {@Autowiredprivate ScoreService scoreService;@Autowiredprivate CourseService courseService;@Autowiredprivate SectionService sectionService;//添加操作@PostMapping("/create")@ResponseBodypublic Map<String, Object> create(String sectionIds, String courseIds, HttpSession session) {Student student = (Student) session.getAttribute("user");int result = scoreService.create(sectionIds, courseIds, student.getId());if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//修改操作@PostMapping("/update")@ResponseBodypublic Map<String, Object> update(Score score) {int result = scoreService.update(score);if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//根据id查询@PostMapping("/detail/{id}")@ResponseBodypublic Map<String, Object> detail(@PathVariable("id") Integer id) {Score score = scoreService.detail(id);if (score == null) {return MapControl.getInstance().nodata().getMap();}return MapControl.getInstance().success().put("data", score).getMap();}//查询所有@PostMapping("/query")@ResponseBodypublic Map<String, Object> query(Score score) {List<Score> list = scoreService.query(score);return MapControl.getInstance().success().put("data", list).getMap();}//跳转查询成绩页面@GetMapping("/student_score")public String student_score() {return "score/student_score";}//查询学生成绩@PostMapping("/query_student_score")@ResponseBodypublic Map<String, Object> query_student_score(HttpSession session) {//从session中获取Student student = (Student) session.getAttribute("user");Score score = new Score();score.setStuId(student.getId());//查询成绩List<Score> scores = scoreService.query(score);//查询课程信息List<Course> courses = courseService.query(null);//查询开课信息List<Section> sections = sectionService.query(null);scores.forEach(entity -> {courses.forEach(course -> {//判断该成绩表中的courseId与课程表的id是否一致if (entity.getCourseId() == course.getId()) {entity.setCourse(course);}});sections.forEach(section -> {//判断该成绩的开课id是否与开课的id一致if (entity.getSectionId() == section.getId()) {entity.setSection(section);}});entity.setStudent(student);});return MapControl.getInstance().success().put("data", scores).getMap();}
}

StudentController

package com.yanzhen.controller;import com.yanzhen.entity.Clazz;
import com.yanzhen.entity.Student;
import com.yanzhen.entity.Subject;
import com.yanzhen.entity.Teacher;
import com.yanzhen.service.ClazzService;
import com.yanzhen.service.StudentService;
import com.yanzhen.service.SubjectService;
import com.yanzhen.utils.MapControl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;@Controller
@RequestMapping("/student")
public class StudentController {private static final String LIST = "student/list";private static final String ADD = "student/add";private static final String UPDATE = "student/update";@Autowiredprivate StudentService studentService;@Autowiredprivate SubjectService subjectService;@Autowiredprivate ClazzService clazzService;//跳转添加页面@GetMapping("/add")public String create(ModelMap modelMap) {//查询所有的专业,存储到request域List<Subject> subjects = subjectService.query(null);modelMap.addAttribute("subjects", subjects);return ADD;}//添加操作@PostMapping("/create")@ResponseBodypublic Map<String, Object> create(@RequestBody Student student) {//设置学生的状态student.setStatus(Student.StatusType.type_1);int result = studentService.create(student);if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//根据id查询@PostMapping("/delete/{id}")@ResponseBodypublic Map<String, Object> delete(@PathVariable("id") Integer id) {int result = studentService.delete(id);if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//删除操作@PostMapping("/delete")@ResponseBodypublic Map<String, Object> delete(String ids) {int result = studentService.delete(ids);if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//修改操作@PostMapping("/update")@ResponseBodypublic Map<String, Object> update(@RequestBody Student student) {int result = studentService.update(student);if (result <= 0) {return MapControl.getInstance().error().getMap();}return MapControl.getInstance().success().getMap();}//根据id查询,跳转修改页面@GetMapping("/detail/{id}")public String detail(@PathVariable("id") Integer id, ModelMap modelMap) {//查询出要修改的学生的信息Student student = studentService.detail(id);//查询所有的专业List<Subject> subjects = subjectService.query(null);//将查询出来的数据存储到request域,实现表单回显modelMap.addAttribute("student", student);modelMap.addAttribute("subjects", subjects);return UPDATE;}//查询所有@PostMapping("/query")@ResponseBodypublic Map<String, Object> query(@RequestBody Student student) {//查询所有的学生信息List<Student> list = studentService.query(student);//查询所有的专业List<Subject> subjects = subjectService.query(null);//查询所有的班级List<Clazz> clazzes = clazzService.query(null);//设置关联list.forEach(entity -> {subjects.forEach(subject -> {//判断学生表中的subjectId和专业表的id是否一致if (subject.getId() == entity.getSubjectId()) {entity.setSubject(subject);}});clazzes.forEach(clazz -> {//判断学生表中的clazzId和班级表的id是否一致if (clazz.getId() == entity.getClazzId()) {entity.setClazz(clazz);}});});//查询总记录条数Integer count = studentService.count(student);return MapControl.getInstance().success().page(list, count).getMap();}//跳转列表页面@GetMapping("/list")public String list() {return LIST;}//跳转查询学生页面@GetMapping("/teacher_student")public String teacher_student(ModelMap modelMap, HttpSession session) {//查询所有的专业List<Subject> subjects = subjectService.query(null);//查询所有的班级List<Clazz> clazzes = clazzService.query(null);Teacher teacher = (Teacher) session.getAttribute("user");modelMap.addAttribute("subjects", subjects);modelMap.addAttribute("clazzes", clazzes);modelMap.addAttribute("teacher", teacher);return "student/teacher_student";}//老师查询学生@PostMapping("/teacher_student")@ResponseBodypublic Map<String, Object> teacher_student(Integer clazzId, Integer subjectId, ModelMap modelMap, HttpSession session) {Teacher teacher = (Teacher) session.getAttribute("user");List<Student> students = studentService.queryStudentByTeacher(teacher.getId(), clazzId, subjectId);List<Subject> subjects = subjectService.query(null);List<Clazz> clazzes = clazzService.query(null);//设置关联students.forEach(entity -> {subjects.forEach(subject -> {//判断学生表的subjectId和专业表的id是否一致if (subject.getId() == entity.getSubjectId()) {entity.setSubject(subject);}});clazzes.forEach(clazz -> {//判断学生表的clazzId和班级表的id是否一致if (clazz.getId() == entity.getClazzId()) {entity.setClazz(clazz);}});});return MapControl.getInstance().success().add("data", students).getMap();}
}

如果也想学习本系统,下面领取。关注并回复:014ssm

Java项目:ssm学生学籍管理系统相关推荐

  1. java学籍管理系统 课程设计,Java课程设计---学生学籍管理系统

    Java课程设计---学生学籍管理系统 设计报告设计报告 课题名称学生学籍管理系统 学院 专业班级计算机应用技术 091 学号 学生 指导教师 2011 年 7 月 7 日 1 学生 指导教师 课题名 ...

  2. 计算机java毕业设计 ssm学生周报管理系统(源码+论文)

    文章目录 前言 一.使用技术 二.实现功能 展示 前言 这边文章介绍一下就Java web系统, 基于java ssm框架的学生周报管理系统. 学长这里依然不是很建议大家用web系统作为毕设, 技术含 ...

  3. Java项目ssm企业工资管理系统源码

    Java版ssm企业工资管理系统,源码免费分享,需要可私信. 项目技术:jsp+mysql+Spring+mybatis 运行环境:最好是java jdk 1.8,我们在这个平台上运行的.其他版本理论 ...

  4. 基于java swing的学生学籍管理系统

    原作githubGitHub - xuexuehan/scmis: Java Swing学籍管理系统Java Swing学籍管理系统. Contribute to xuexuehan/scmis de ...

  5. Java项目:教务处学生成绩管理系统(java+JSP+bootstrap+servlet+Mysql)

    源码获取:俺的博客首页 "资源" 里下载! 项目介绍 本项目包含管理员.教师.学生三种角色: 用户角色包含以下功能: 修改密码,查看自己的信息,查看自己的成绩,登录界面等功能. 管 ...

  6. 基于java的学生学籍管理系统(含源文件)

    欢迎添加微信互相交流学习哦! 项目源码:https://gitee.com/oklongmm/biye 目录 内容摘要    - 2 - 引言    - 4 - 学生学籍管理系统开发的意义和目的   ...

  7. Java SpringMVC毕业项目实战-学生信息管理系统

    目录 摘要设计: 系统功能概述: B站视频演示:java毕业设计-SSM学生信息管理系统.mp4 主要功能截图: 主要数据库设计: 论文结构目录设计 : 获取完整源码: 摘要设计:文末获取源码联系 本 ...

  8. 学生学籍管理系统~~登录界面(Java、SQL)

    有些同学跟我要代码但是因为我没及时看到所以没能及时回复,很抱歉!于是把代码放到github里了.https://github.com/DKAngel/DatabaseExperiment 这次所要介绍 ...

  9. mysql学籍管理系统的开发背景,学生学籍管理系统的设计与实现(JSP,MySQL)

    学生学籍管理系统的设计与实现(JSP,MySQL)(任务书,开题报告,中期检查表,文献综述,外文翻译,毕业论文22000字,程序代码,MySQL数据库) 本课题根据学生学籍管理系统的流程及所需要的相关 ...

  10. 学生学籍管理系统 jsp mysql_学生学籍管理系统的设计与实现(JSP,MySQL)

    学生学籍管理系统的设计与实现(,MySQL)(任务书,开题报告,中期检查表,文献综述,外文翻译,毕业论文22000字,程序代码,MySQL数据库) 本课题根据学生学籍管理系统的流程及所需要的相关操作, ...

最新文章

  1. node.js邮箱注册,激活,登陆相关案例
  2. 【转】visual studio 2012进行C语言开发[图文]
  3. 内存位置访问无效 midas.dll_内存虚拟化介绍
  4. P3899-[湖南集训]谈笑风生【主席树】
  5. Oreo易支付程序开源源码分享发行版V1.3
  6. python房子代码_基于python的链家小区房价爬取——仅需60行代码!
  7. 函数的梯度方向和切线方向_梯度是函数变化最快的方向
  8. 力扣-876 链表的中间结点
  9. MultiRow发现之旅(五)- MultiRow版俄罗斯方块(exe + 源码)
  10. King Arthur's Birthday Celebration
  11. 6-14漏洞利用-rpcbind漏洞利用
  12. 2022年必备的加密行业术语大全,你了解有多少?
  13. 阿拉伯数字翻译成中文的大写数字
  14. Rerun the EDA Netlist Writer
  15. 情人节数码好物推荐,值得入手的四款数码好物分享
  16. 汇编语言入门--调试工具debug的使用(史上最全,11种常见命令)
  17. iOS地图定位导航与大头针的简单使用
  18. 什么是CSS(层叠样式表)
  19. DeepChem教程4:分子指纹
  20. 医保结算那些事,医保基金结算的具体违规项目,医保结算审核哪些东西(一)

热门文章

  1. 一文理清Apache Spark内存管理脉络
  2. html日程管理,日程管理.html
  3. 【学英语~磨耳朵】2013年以来看过的所有美剧电影纪录片等等
  4. SiT9386:AEC-Q100认证汽车级差分振荡器1-220MHz任意频率
  5. 更改Ansys Workbench的语言的方法
  6. Burp suite的扫描模块
  7. 征集国内操作系统项目列表
  8. git生成sshkey 并添加SSH key
  9. 怎么查看正在连接的无线网密码
  10. 苏宁易购为京东量身打造北京攻略