基于SSM+Bootstrap【爱校教务系统管理系统】附源码

简介: 基于SSM+Bootstrap【爱校教务系统管理系统】附源码

前言介绍:

现如今学校招生越来越多,必然就会有大量的学生信息需要处理。如果只靠人力来完成,这将会变成一项非常繁琐、复杂的工作,而且还会出现很多意想不到的错误,给管理这些数据带来了很大的不便,也越来越不适合学校发展的需要.教务管理系统是一个庞大而复杂的系统,它包括对院系资料的管理,对课程资料的管理,对学生资料的管理和对学生成绩的管理等等主要的功能。教务管理系统是每个学校的一项必不可少的内容,它的好坏直接影响到学校里的主要工作,一旦此系统瘫疾,学校将会受到非常严重的损失,也会影响到每一个学生.


Nowadays, with more and more school enrollment, it is inevitable that there will be a lot of student information to deal with. If only rely on manpower to complete, this will become a very tedious, complex work, and there will be a lot of unexpected mistakes, to manage these data brought great inconvenience, but also more and more not suitable for the needs of school development. Educational administration management system is a huge and complex system, it includes the management of department information, the management of course information, the management of student information and the management of student achievement and so on. Educational administration management system is an essential content of each school, its quality directly affects the main work in the school, once this system paralysis disease, the school will be very serious loss, will also affect every student.

image.png

一、行业发展缓慢的原因分析


所以现如今设计一个功能完整、操作简单以及界面友好的教务管理系统变得非常重要。


为了提高教务管理工作的效率,减少错误的出现,节约大量的人力资源,现在的学校的教务管理也逐步从手工转到计算机自动化信息处理阶段。


通过这个系统,用户可以方便的对院系资料、课程资料、学生资料和学生成绩资料进行添加、修改和删除操作,还可以对学生资料和成绩进行查询操作.除此之外,对用户的添加和删除操作也很方便


系统设计:

系统设计:

该项目是基于SSM+Bootstrap【爱校教务系统管理系统】,下面做了功能和相关技术的描述,适合出入职场和即将进入职场的各位,如有问题欢迎留言。

系统总共分为几个大的模块。


管理员可对 教师信息、学生信息、课程信息 进行 增删改查 操作,管理员账户,可以重置非管理员账户的密码


课程管理:当课程已经有学生选课成功时,将不能删除

学生管理:添加学生信息时,其信息也会添加到登录表中

教师管理:同上

账户密码重置:

修改密码:

教师登陆后,可以获取其,教授的课程列表,并可以给已经选择该课程的同学打分,无法对已经给完分的同学进行二次操作


我的课程

修改密码

学生登录后,根据学生信息,获取其已经选择的课程,和已经修完的课程


所有课程: 在这里选修课程,选好后,将会自动跳转到已选课程选项


已选课程: 这里显示的是,还没修完的课程,也就是老师还没给成绩,由于还没有给成绩,所以这里可以进行退课操作


已修课程: 显示已经修完,老师已经给成绩的课程


修改密码:

运行环境

JDK8、Tomcat8、MySQL5.7、IntelliJ IDEA、Maven

  • IOC容器:Spring Web框架:SpringMVC
  • ORM框架:Mybatis
  • 数据源:C3P0
  • 日志:log4j
  • 前端框架:Bootstrap

账号:

![Alt text]

管理员页:管理员账户:admin+123

![Alt text]

学生页:学生登录: 10001+123

![Alt text]

老师页:教师登录:1001+123

功能截图:

代码实现:



import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@WebServlet("/MyServlet")
public class MyServlet extends HttpServlet {
  private static final long serialVersionUID = 1L;
       
    public MyServlet() {
        super();
    }

    @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    System.out.println("doget MyServlet");
  }
    @Override
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      System.out.println("dopost MyServlet");
      super.doPost(request, response);
  }
    @Override
    public void init(ServletConfig servletConfig){
      System.out.println("MyServlet");
    }

}


package com.system.controller;

import com.system.exception.CustomException;
import com.system.po.*;
import com.system.service.*;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Jacey on 2017/6/30.
 */
@Controller
@RequestMapping("/admin")
public class AdminController {

  @Resource(name = "studentServiceImpl")
  private StudentService studentService;

  @Resource(name = "teacherServiceImpl")
  private TeacherService teacherService;

  @Resource(name = "courseServiceImpl")
  private CourseService courseService;

  @Resource(name = "collegeServiceImpl")
  private CollegeService collegeService;

  @Resource(name = "userloginServiceImpl")
  private UserloginService userloginService;

  /*
   * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<学生操作>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   * >>>>>
   */

  // 学生信息显示
  @RequestMapping("/showStudent")
  public String showStudent(Model model, Integer page) throws Exception {

    List<StudentCustom> list = null;
    // 页码对象
    PagingVO pagingVO = new PagingVO();
    // 设置总页数
    pagingVO.setTotalCount(studentService.getCountStudent());
    if (page == null || page == 0) {
      pagingVO.setToPageNo(1);
      list = studentService.findByPaging(1);
    } else {
      pagingVO.setToPageNo(page);
      list = studentService.findByPaging(page);
    }

    model.addAttribute("studentList", list);
    model.addAttribute("pagingVO", pagingVO);

    return "admin/showStudent";

  }

  // 添加学生信息页面显示
  @RequestMapping(value = "/addStudent", method = { RequestMethod.GET })
  public String addStudentUI(Model model) throws Exception {

    List<College> list = collegeService.finAll();

    model.addAttribute("collegeList", list);

    return "admin/addStudent";
  }

  // 添加学生信息操作
  @RequestMapping(value = "/addStudent", method = { RequestMethod.POST })
  public String addStudent(StudentCustom studentCustom, Model model)
      throws Exception {

    Boolean result = studentService.save(studentCustom);

    if (!result) {
      model.addAttribute("message", "学号重复");
      return "error";
    }
    // 添加成功后,也添加到登录表
    Userlogin userlogin = new Userlogin();
    userlogin.setUsername(studentCustom.getUserid().toString());
    userlogin.setPassword("123");
    userlogin.setRole(2);
    userloginService.save(userlogin);

    // 重定向
    return "redirect:/admin/showStudent";
  }

  // 修改学生信息页面显示
  @RequestMapping(value = "/editStudent", method = { RequestMethod.GET })
  public String editStudentUI(Integer id, Model model) throws Exception {
    if (id == null) {
      // 加入没有带学生id就进来的话就返回学生显示页面
      return "redirect:/admin/showStudent";
    }
    StudentCustom studentCustom = studentService.findById(id);
    if (studentCustom == null) {
      throw new CustomException("未找到该名学生");
    }
    List<College> list = collegeService.finAll();

    model.addAttribute("collegeList", list);
    model.addAttribute("student", studentCustom);

    return "admin/editStudent";
  }

  // 修改学生信息处理
  @RequestMapping(value = "/editStudent", method = { RequestMethod.POST })
  public String editStudent(StudentCustom studentCustom) throws Exception {

    studentService.updataById(studentCustom.getUserid(), studentCustom);

    // 重定向
    return "redirect:/admin/showStudent";
  }

  // 删除学生
  @RequestMapping(value = "/removeStudent", method = { RequestMethod.GET })
  private String removeStudent(Integer id) throws Exception {
    if (id == null) {
      // 加入没有带学生id就进来的话就返回学生显示页面
      return "admin/showStudent";
    }
    studentService.removeById(id);
    userloginService.removeByName(id.toString());

    return "redirect:/admin/showStudent";
  }

  // 搜索学生
  @RequestMapping(value = "selectStudent", method = { RequestMethod.POST })
  private String selectStudent(String findByName, Model model)
      throws Exception {

    List<StudentCustom> list = studentService.findByName(findByName);

    model.addAttribute("studentList", list);
    return "admin/showStudent";
  }

  /*
   * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<教师操作>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   * >>>>>>>>
   */

  // 教师页面显示
  @RequestMapping("/showTeacher")
  public String showTeacher(Model model, Integer page) throws Exception {

    List<TeacherCustom> list = null;
    // 页码对象
    PagingVO pagingVO = new PagingVO();
    // 设置总页数
    pagingVO.setTotalCount(teacherService.getCountTeacher());
    if (page == null || page == 0) {
      pagingVO.setToPageNo(1);
      list = teacherService.findByPaging(1);
    } else {
      pagingVO.setToPageNo(page);
      list = teacherService.findByPaging(page);
    }

    model.addAttribute("teacherList", list);
    model.addAttribute("pagingVO", pagingVO);

    return "admin/showTeacher";

  }

  // 添加教师信息
  @RequestMapping(value = "/addTeacher", method = { RequestMethod.GET })
  public String addTeacherUI(Model model) throws Exception {

    List<College> list = collegeService.finAll();

    model.addAttribute("collegeList", list);

    return "admin/addTeacher";
  }

  // 添加教师信息处理
  @RequestMapping(value = "/addTeacher", method = { RequestMethod.POST })
  public String addTeacher(TeacherCustom teacherCustom, Model model)
      throws Exception {

    Boolean result = teacherService.save(teacherCustom);

    if (!result) {
      model.addAttribute("message", "工号重复");
      return "error";
    }
    // 添加成功后,也添加到登录表
    Userlogin userlogin = new Userlogin();
    userlogin.setUsername(teacherCustom.getUserid().toString());
    userlogin.setPassword("123");
    userlogin.setRole(1);
    userloginService.save(userlogin);

    // 重定向
    return "redirect:/admin/showTeacher";
  }

  // 修改教师信息页面显示
  @RequestMapping(value = "/editTeacher", method = { RequestMethod.GET })
  public String editTeacherUI(Integer id, Model model) throws Exception {
    if (id == null) {
      return "redirect:/admin/showTeacher";
    }
    TeacherCustom teacherCustom = teacherService.findById(id);
    if (teacherCustom == null) {
      throw new CustomException("未找到该名学生");
    }
    List<College> list = collegeService.finAll();

    model.addAttribute("collegeList", list);
    model.addAttribute("teacher", teacherCustom);

    return "admin/editTeacher";
  }

  // 修改教师信息页面处理
  @RequestMapping(value = "/editTeacher", method = { RequestMethod.POST })
  public String editTeacher(TeacherCustom teacherCustom) throws Exception {

    teacherService.updateById(teacherCustom.getUserid(), teacherCustom);

    // 重定向
    return "redirect:/admin/showTeacher";
  }

  // 删除教师
  @RequestMapping("/removeTeacher")
  public String removeTeacher(Integer id) throws Exception {
    if (id == null) {
      // 加入没有带教师id就进来的话就返回教师显示页面
      return "admin/showTeacher";
    }
    teacherService.removeById(id);
    userloginService.removeByName(id.toString());

    return "redirect:/admin/showTeacher";
  }

  // 搜索教师
  @RequestMapping(value = "selectTeacher", method = { RequestMethod.POST })
  private String selectTeacher(String findByName, Model model)
      throws Exception {

    List<TeacherCustom> list = teacherService.findByName(findByName);

    model.addAttribute("teacherList", list);
    return "admin/showTeacher";
  }

  /*
   * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<课程操作>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   * >>>>>>>>
   */

  // 课程信息显示
  @RequestMapping("/showCourse")
  public String showCourse(Model model, Integer page) throws Exception {

    List<CourseCustom> list = null;
    // 页码对象
    PagingVO pagingVO = new PagingVO();
    // 设置总页数
    pagingVO.setTotalCount(courseService.getCountCouse());
    if (page == null || page == 0) {
      pagingVO.setToPageNo(1);
      list = courseService.findByPaging(1);
    } else {
      pagingVO.setToPageNo(page);
      list = courseService.findByPaging(page);
    }

    model.addAttribute("courseList", list);
    model.addAttribute("pagingVO", pagingVO);

    return "/admin/showCourse";

  }

  // 添加课程
  @RequestMapping(value = "/addCourse", method = { RequestMethod.GET })
  public String addCourseUI(Model model) throws Exception {

    List<TeacherCustom> list = teacherService.findAll();
    List<College> collegeList = collegeService.finAll();

    model.addAttribute("collegeList", collegeList);
    model.addAttribute("teacherList", list);

    return "admin/addCourse";
  }

  // 添加课程信息处理
  @RequestMapping(value = "/addCourse", method = { RequestMethod.POST })
  public String addCourse(CourseCustom courseCustom, Model model)
      throws Exception {

    Boolean result = courseService.save(courseCustom);

    if (!result) {
      model.addAttribute("message", "课程号重复");
      return "error";
    }

    // 重定向
    return "redirect:/admin/showCourse";
  }

  // 修改教师信息页面显示
  @RequestMapping(value = "/editCourse", method = { RequestMethod.GET })
  public String editCourseUI(Integer id, Model model) throws Exception {
    if (id == null) {
      return "redirect:/admin/showCourse";
    }
    CourseCustom courseCustom = courseService.findById(id);
    if (courseCustom == null) {
      throw new CustomException("未找到该课程");
    }
    List<TeacherCustom> list = teacherService.findAll();
    List<College> collegeList = collegeService.finAll();

    model.addAttribute("teacherList", list);
    model.addAttribute("collegeList", collegeList);
    model.addAttribute("course", courseCustom);

    return "admin/editCourse";
  }

  // 修改教师信息页面处理
  @RequestMapping(value = "/editCourse", method = { RequestMethod.POST })
  public String editCourse(CourseCustom courseCustom) throws Exception {

    courseService.upadteById(courseCustom.getCourseid(), courseCustom);

    // 重定向
    return "redirect:/admin/showCourse";
  }

  // 删除课程信息
  @RequestMapping("/removeCourse")
  public String removeCourse(Integer id) throws Exception {
    if (id == null) {
      // 加入没有带教师id就进来的话就返回教师显示页面
      return "admin/showCourse";
    }
    courseService.removeById(id);

    return "redirect:/admin/showCourse";
  }

  // 搜索课程
  @RequestMapping(value = "selectCourse", method = { RequestMethod.POST })
  private String selectCourse(String findByName, Model model)
      throws Exception {

    List<CourseCustom> list = courseService.findByName(findByName);

    model.addAttribute("courseList", list);
    return "admin/showCourse";
  }

  /*
   * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<其他操作>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   * >>>>>>>>
   */

  // 普通用户账号密码重置
  @RequestMapping("/userPasswordRest")
  public String userPasswordRestUI() throws Exception {
    return "admin/userPasswordRest";
  }

  // 普通用户账号密码重置处理
  @RequestMapping(value = "/userPasswordRest", method = { RequestMethod.POST })
  public String userPasswordRest(Userlogin userlogin) throws Exception {

    Userlogin u = userloginService.findByName(userlogin.getUsername());

    if (u != null) {
      if (u.getRole() == 0) {
        throw new CustomException("该账户为管理员账户,没法修改");
      }
      u.setPassword(userlogin.getPassword());
      userloginService.updateByName(userlogin.getUsername(), u);
    } else {
      throw new CustomException("没找到该用户");
    }

    return "admin/userPasswordRest";
  }

  // 本账户密码重置
  @RequestMapping("/passwordRest")
  public String passwordRestUI() throws Exception {
    return "admin/passwordRest";
  }

}

package com.system.controller;

import com.system.po.Userlogin;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by Jacey on 2017/6/30.
 */
@Controller
public class LoginController {

    //登录跳转
    @RequestMapping(value = "/login", method = {RequestMethod.GET})
    public String loginUI() throws Exception {
        return "../../login";
    }

    //登录表单处理
    @RequestMapping(value = "/login", method = {RequestMethod.POST})
    public String login(Userlogin userlogin) throws Exception {

        //Shiro实现登录
        UsernamePasswordToken token = new UsernamePasswordToken(userlogin.getUsername(),
                userlogin.getPassword());
        Subject subject = SecurityUtils.getSubject();

        //如果获取不到用户名就是登录失败,但登录失败的话,会直接抛出异常
        subject.login(token);

        if (subject.hasRole("admin")) {
            return "redirect:/admin/showStudent";
        } else if (subject.hasRole("teacher")) {
            return "redirect:/teacher/showCourse";
        } else if (subject.hasRole("student")) {
            return "redirect:/student/showCourse";
        }

        return "/login";
    }

}

package com.system.controller;

import com.system.exception.CustomException;
import com.system.po.Userlogin;
import com.system.service.UserloginService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * Created by Jacey on 2017/7/6.
 */
@Controller
public class RestPasswordController {

    @Resource(name = "userloginServiceImpl")
    private UserloginService userloginService;

    // 本账户密码重置
    @RequestMapping(value = "/passwordRest", method = {RequestMethod.POST})
    public String passwordRest(String oldPassword, String password1) throws Exception {
        Subject subject = SecurityUtils.getSubject();
        String username = (String) subject.getPrincipal();

        Userlogin userlogin = userloginService.findByName(username);

        if (!oldPassword.equals(userlogin.getPassword())) {
            throw new CustomException("旧密码不正确");
        } else {
            userlogin.setPassword(password1);
            userloginService.updateByName(username, userlogin);
        }

        return "redirect:/logout";
    }

}

论文参考:

目录
相关文章
|
3月前
|
存储 Java 关系型数据库
ssm026校园美食交流系统(文档+源码)_kaic
本文介绍了基于Java语言和MySQL数据库的校园美食交流系统的设计与实现。该系统采用B/S架构和SSM框架,旨在提高校园美食信息管理的效率与便捷性。主要内容包括:系统的开发背景、目的及内容;对Java技术、MySQL数据库、B/S结构和SSM框架的介绍;系统分析部分涵盖可行性分析、性能分析和功能需求分析;最后详细描述了系统各功能模块的具体实现,如登录、管理员功能(美食分类管理、用户管理等)和前台首页功能。通过此系统,管理员可以高效管理美食信息,用户也能方便地获取和分享美食资讯,从而提升校园美食交流的管理水平和用户体验。
|
2月前
|
Java 关系型数据库 MySQL
weixin050高校体育场管理系统+ssm(文档+源码)_kaic
本文针对高校体育场管理系统的开发与实现进行详细介绍。随着经济快速发展,人们对手机软件需求增加,高校体育场管理系统应运而生。系统采用JAVA技术、Mysql数据库和SSM框架等成熟技术,通过分析功能需求、可行性及性能,设计出包含管理员、用户和学生角色的功能模块。系统实现用户注册登录、信息管理等功能,简化传统手工统计模式,提高管理效率,满足用户对信息获取的及时性与准确性需求。
weixin050高校体育场管理系统+ssm(文档+源码)_kaic
|
2月前
|
前端开发 Java 关系型数据库
基于ssm的社区物业管理系统,附源码+数据库+论文+任务书
社区物业管理系统采用B/S架构,基于Java语言开发,使用MySQL数据库。系统涵盖个人中心、用户管理、楼盘管理、收费管理、停车登记、报修与投诉管理等功能模块,方便管理员及用户操作。前端采用Vue、HTML、JavaScript等技术,后端使用SSM框架。系统支持远程安装调试,确保顺利运行。提供演示视频和详细文档截图,帮助用户快速上手。
103 17
|
2月前
|
前端开发 Java 关系型数据库
基于ssm的超市会员(积分)管理系统,附源码+数据库+论文,包安装调试
本项目为简单内容浏览和信息处理系统,具备管理员和员工权限。管理员可管理会员、员工、商品及积分记录,员工则负责积分、商品信息和兑换管理。技术框架采用Java编程语言,B/S架构,前端使用Vue+JSP+JavaScript+Css+LayUI,后端为SSM框架,数据库为MySQL。运行环境为Windows,JDK8+Tomcat8.5,非前后端分离的Maven项目。提供演示视频和详细文档,购买后支持免费远程安装调试。
105 19
|
2月前
|
前端开发 JavaScript Java
[Java计算机毕设]基于ssm的OA办公管理系统的设计与实现,附源码+数据库+论文+开题,包安装调试
OA办公管理系统是一款基于Java和SSM框架开发的B/S架构应用,适用于Windows系统。项目包含管理员、项目管理人员和普通用户三种角色,分别负责系统管理、请假审批、图书借阅等日常办公事务。系统使用Vue、HTML、JavaScript、CSS和LayUI构建前端,后端采用SSM框架,数据库为MySQL,共24张表。提供完整演示视频和详细文档截图,支持远程安装调试,确保顺利运行。
127 17
|
2月前
|
前端开发 Java 关系型数据库
基于ssm的网络直播带货管理系统,附源码+数据库+论文
该项目为网络直播带货网站,包含管理员和用户两个角色。管理员可进行主页、个人中心、用户管理、商品分类与信息管理、系统及订单管理;用户可浏览主页、管理个人中心、收藏和订单。系统基于Java开发,采用B/S架构,前端使用Vue、JSP等技术,后端为SSM框架,数据库为MySQL。项目运行环境为Windows,支持JDK8、Tomcat8.5。提供演示视频和详细文档截图。
81 10
|
2月前
|
前端开发 Java 关系型数据库
基于ssm的台球厅管理系统,附源码+数据库+论文
本项目为新锐台球厅管理系统,支持管理员和会员两种角色。管理员可进行会员管理、台球桌管理、订单管理等;会员可查看台球桌、预约、购买商品等。技术框架基于Java,采用B/S架构,前端使用Vue+HTML+JavaScript+CSS+LayUI,后端使用SSM框架,数据库为MySQL。运行环境为Windows,JDK8+MySQL5.7+Tomcat8.5。提供演示视频及详细文档截图。
|
9月前
|
Java 数据库连接 Maven
手把手教你如何搭建SSM框架、图书商城系统案例
这篇文章是关于如何搭建SSM框架以及实现一个图书商城系统的详细教程,包括了项目的配置文件整合、依赖管理、项目结构和运行效果展示,并提供了GitHub源码链接。
手把手教你如何搭建SSM框架、图书商城系统案例
|
3月前
|
存储 Java 关系型数据库
ssm064农产品仓库管理系统系统(文档+源码)_kaic
农产品仓库管理系统基于现代经济快速发展和信息化技术的升级,采用SSM框架、Java语言及Mysql数据库开发。系统旨在帮助管理者高效处理大量数据信息,提升事务处理效率,实现数据管理的科学化与规范化。该系统涵盖物资基础数据管理、出入库订单管理等功能,界面简洁美观,符合用户操作习惯,并提供数据安全解决方案,确保信息的安全性和可靠性。通过自动化和集中处理,系统显著提高了仓库管理的效率和准确性。
|
9月前
|
机器学习/深度学习 数据采集 数据可视化
基于爬虫和机器学习的招聘数据分析与可视化系统,python django框架,前端bootstrap,机器学习有八种带有可视化大屏和后台
本文介绍了一个基于Python Django框架和Bootstrap前端技术,集成了机器学习算法和数据可视化的招聘数据分析与可视化系统,该系统通过爬虫技术获取职位信息,并使用多种机器学习模型进行薪资预测、职位匹配和趋势分析,提供了一个直观的可视化大屏和后台管理系统,以优化招聘策略并提升决策质量。
495 4