基于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框架的介绍;系统分析部分涵盖可行性分析、性能分析和功能需求分析;最后详细描述了系统各功能模块的具体实现,如登录、管理员功能(美食分类管理、用户管理等)和前台首页功能。通过此系统,管理员可以高效管理美食信息,用户也能方便地获取和分享美食资讯,从而提升校园美食交流的管理水平和用户体验。
|
4天前
|
安全 Java 关系型数据库
ssm019社区文化宣传网站(文档+源码)_kaic
社区文化宣传网站采用JSP技术和Mysql数据库开发,旨在通过现代化技术手段提升社区文化的宣传效果。系统开发过程中,首先进行需求分析,明确主要功能,随后进行总体设计与详细设计,涵盖系统结构、数据结构、功能和安全设计等方面。系统详细设计包括前台首页、管理员及用户功能模块,确保操作简便、页面简洁,具备良好的可读性、实用性和扩展性。整个开发过程注重系统的稳定性和安全性,最终通过功能测试优化系统性能,为后续维护和类似系统开发提供参考。关键词:社区文化宣传网站、JSP技术、Mysql数据库。
|
3天前
|
Java 关系型数据库 MySQL
ssm027学校运动会信息管理系统(文档+源码)_kaic
本文介绍了基于B/S结构的学校运动会信息管理系统开发过程。该系统采用JSP技术和MySQL数据库,确保了系统的安全性和稳定性。系统界面友好、操作简便,涵盖系统概述、分析、设计、数据库设计和测试等环节,实现了学校运动会信息管理的重要功能。经过测试,系统运行稳定,操作便捷,具备全面的功能、良好的可扩展性和维护性,有效提升了运动会信息管理的效率和准确性。关键词:学校运动会信息管理;B/S结构;JSP技术;MYSQL数据库。
|
4天前
|
Java 关系型数据库 MySQL
ssm020基于ssm的人才招聘网站(文档+源码)_kaic
网络和科技的进步以及人们生活条件的提高都让计算机技术越来越平民化,深入日常生活中。网络更是成为生活的必备条件,大到国家单位、科研项目,小到大街小巷都充斥着网络的身影。在日常办公中,计算机起到了文字编辑、打印、信息检索、统计等的作用。使用计算机可以使日常繁杂的信息进行科学的加工,使信息变得更加的有序、可利用。计算机技术已成为热门。 正是因为网络、科技、计算机技术使现代人的生活和工作变得便利、轻松,给实体行业带来了巨大的冲击。人才招聘的日常工作也遇到了前所未有的挑战。现如今,对于招聘的管理有很多的局限性,究其原因是因为招聘管理的根本是信息的运动。在新时代的环境下,传统的管理方式不再满足用户的需求,
|
6月前
|
Java 数据库连接 Maven
手把手教你如何搭建SSM框架、图书商城系统案例
这篇文章是关于如何搭建SSM框架以及实现一个图书商城系统的详细教程,包括了项目的配置文件整合、依赖管理、项目结构和运行效果展示,并提供了GitHub源码链接。
手把手教你如何搭建SSM框架、图书商城系统案例
|
3月前
|
前端开发
基于CSS3+Bootstrap实现的侧边栏后台菜单源码
CSS3+Bootstrap实现的侧边栏后台菜单特效源码是一段基于Bootstrap和图标库制作的侧边栏菜单后台管理页面效果代码,简洁大方、易于管理,是一段非常不错的后台菜单栏效果,欢迎对此段代码感兴趣的朋友前来下载。
121 54
|
6月前
|
机器学习/深度学习 数据采集 数据可视化
基于爬虫和机器学习的招聘数据分析与可视化系统,python django框架,前端bootstrap,机器学习有八种带有可视化大屏和后台
本文介绍了一个基于Python Django框架和Bootstrap前端技术,集成了机器学习算法和数据可视化的招聘数据分析与可视化系统,该系统通过爬虫技术获取职位信息,并使用多种机器学习模型进行薪资预测、职位匹配和趋势分析,提供了一个直观的可视化大屏和后台管理系统,以优化招聘策略并提升决策质量。
306 4
|
5月前
|
设计模式 Java 关系型数据库
【Java笔记+踩坑汇总】Java基础+JavaWeb+SSM+SpringBoot+SpringCloud+瑞吉外卖/谷粒商城/学成在线+设计模式+面试题汇总+性能调优/架构设计+源码解析
本文是“Java学习路线”专栏的导航文章,目标是为Java初学者和初中高级工程师提供一套完整的Java学习路线。
531 37
|
5月前
|
Java 应用服务中间件 数据库连接
ssm项目整合,简单的用户管理系统
文章介绍了一个使用SSM框架(Spring、SpringMVC、MyBatis)构建的简单用户管理系统的整合过程,包括项目搭建、数据库配置、各层代码实现以及视图展示。
ssm项目整合,简单的用户管理系统
|
5月前
|
XML Java 数据库连接
如何搭建SSM框架、图书商城系统
这是一份详尽的《Spring + SpringMVC + Mybatis 整合指南》,作者耗时良久整理出约五万字的内容,现已经全部笔记公开。此文档详细地介绍了如何搭建与整合SSM框架,具体步骤包括创建Maven项目、添加web骨架、配置pom文件以及整合Spring、SpringMVC和Mybatis等。无论是对初学者还是有一定基础的开发者来说,都是很好的学习资源。此外,作者还提供了项目源码的GitHub链接,方便读者实践。虽然当前主流推荐学习SpringBoot,但了解SSM框架仍然是不可或缺的基础。
87 0