如何使用SSM+JSP实现一个教务管理系统

简介: 如何使用SSM+JSP实现一个教务管理系统

最近为客户开发了一套学校用教务管理系统,主要实现学生、课程、老师、选课等相关的信息化管理功能,今天拿出来给大家介绍一下:


系统编号:BS-GX-020


后台技术:Spring+Springmvvc+mybatis+shiro


前端技术:Bootstrap+jquery+ajax


页面开发:JSP


开发工具:IDEA  或  Eclipse


数据库:mysql5


应用服务器:tomcat8


JAVA版本:jdk1.8


说明:本系统基于SSM框架开发而成,系统功能完整,界面简洁大方,运行无误,适合做毕业设计使用。


系统分三个角色:


1,管理员角色:可以管理课程,管理教师,管理学生,个人信息管理等


2,教师角色:可以管理选课成绩,对选修本人的课程进行打分,个人信息管理等


3,学生角色:可以进行选课,退课,查看选课信息,选课成绩,个人信息管理等


系统功能演示如下:

管理员登陆:


image.png

课程管理:

image.png

添加课程:分配老师

image.png

学生管理:

image.png

老师管理:

image.png

重置其它账户密码:

image.png

密码修改:

image.png

教师登陆:


image.png

为选课的学生打分

image.png

学生登陆:


image.png

己选课程:显示己选未结课(未打分)

image.png

己修课程:显示己选并结课(己打分)

image.png

以上是基于SSM教务管理系统的部分功能展示,本项目比较适合JAVA语言方面 的毕业设计系统使用。

部分项目实现代码:

package com.system.service.impl;
import com.system.mapper.CollegeMapper;
import com.system.po.College;
import com.system.po.CollegeExample;
import com.system.service.CollegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * 院系管理
 */
@Service
public class CollegeServiceImpl implements CollegeService {
    @Autowired
    private CollegeMapper collegeMapper;
    //查询所有院系
    public List<College> finAll() throws Exception {
        CollegeExample collegeExample = new CollegeExample();
        CollegeExample.Criteria criteria = collegeExample.createCriteria();
        criteria.andCollegeidIsNotNull();
        return collegeMapper.selectByExample(collegeExample);
    }
    //添加院系
    public void addCollege(College college) {
        collegeMapper.insert(college);
    }
    //查询单个院系
    public College findCollegeById(Integer id){
        return collegeMapper.selectByPrimaryKey(id);
    }
    //更新院系
    public void updateCollege(College college) {
        collegeMapper.updateByPrimaryKey(college);
    }
}
package com.system.service.impl;
import com.system.mapper.CollegeMapper;
import com.system.mapper.CourseMapper;
import com.system.mapper.CourseMapperCustom;
import com.system.mapper.SelectedcourseMapper;
import com.system.po.*;
import com.system.service.CourseService;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
  课程管理业务实现
*/
@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseMapper courseMapper;
    @Autowired
    private CourseMapperCustom courseMapperCustom;
    @Autowired
    private CollegeMapper collegeMapper;
    @Autowired
    private SelectedcourseMapper selectedcourseMapper;
    public void upadteById(Integer id, CourseCustom courseCustom) throws Exception {
        courseMapper.updateByPrimaryKey(courseCustom);
    }
    public Boolean removeById(Integer id) throws Exception {
        //自定义查询条件
        SelectedcourseExample example = new SelectedcourseExample();
        SelectedcourseExample.Criteria criteria = example.createCriteria();
        criteria.andCourseidEqualTo(id);
        List<Selectedcourse> list = selectedcourseMapper.selectByExample(example);
        if (list.size() == 0) {
            courseMapper.deleteByPrimaryKey(id);
            return true;
        }
        return false;
    }
    public List<CourseCustom> findByPaging(Integer toPageNo) throws Exception {
        PagingVO pagingVO = new PagingVO();
        pagingVO.setToPageNo(toPageNo);
        List<CourseCustom> list = courseMapperCustom.findByPaging(pagingVO);
        return list;
    }
    public Boolean save(CourseCustom couseCustom) throws Exception {
        Course course = courseMapper.selectByPrimaryKey(couseCustom.getCourseid());
        if (course == null) {
            courseMapper.insert(couseCustom);
            return true;
        }
        return false;
    }
    public int getCountCouse() throws Exception {
        //自定义查询对象
        CourseExample courseExample = new CourseExample();
        //通过criteria构造查询条件
        CourseExample.Criteria criteria = courseExample.createCriteria();
        criteria.andCoursenameIsNotNull();
        return courseMapper.countByExample(courseExample);
    }
    public CourseCustom findById(Integer id) throws Exception {
        Course course = courseMapper.selectByPrimaryKey(id);
        CourseCustom courseCustom = null;
        if (course != null) {
            courseCustom = new CourseCustom();
            BeanUtils.copyProperties(courseCustom, course);
        }
        return courseCustom;
    }
    public List<CourseCustom> findByName(String name) throws Exception {
        CourseExample courseExample = new CourseExample();
        //自定义查询条件
        CourseExample.Criteria criteria = courseExample.createCriteria();
        criteria.andCoursenameLike("%" + name + "%");
        List<Course> list = courseMapper.selectByExample(courseExample);
        List<CourseCustom> courseCustomList = null;
        if (list != null) {
            courseCustomList = new ArrayList<CourseCustom>();
            for (Course c : list) {
                CourseCustom courseCustom = new CourseCustom();
                //类拷贝
                org.springframework.beans.BeanUtils.copyProperties(c, courseCustom);
                //获取课程名
                College college = collegeMapper.selectByPrimaryKey(c.getCollegeid());
                courseCustom.setcollegeName(college.getCollegename());
                courseCustomList.add(courseCustom);
            }
        }
        return courseCustomList;
    }
    public List<CourseCustom> findByTeacherID(Integer id) throws Exception {
        CourseExample courseExample = new CourseExample();
        //自定义查询条件
        CourseExample.Criteria criteria = courseExample.createCriteria();
        //根据教师id查课程
        criteria.andTeacheridEqualTo(id);
        List<Course> list = courseMapper.selectByExample(courseExample);
        List<CourseCustom> courseCustomList = null;
        if (list.size() > 0) {
            courseCustomList = new ArrayList<CourseCustom>();
            for (Course c : list) {
                CourseCustom courseCustom = new CourseCustom();
                //类拷贝
                BeanUtils.copyProperties(courseCustom, c);
                //获取课程名
                College college = collegeMapper.selectByPrimaryKey(c.getCollegeid());
                courseCustom.setcollegeName(college.getCollegename());
                courseCustomList.add(courseCustom);
            }
        }
        return courseCustomList;
    }
}
package com.system.service.impl;
import com.system.mapper.CollegeMapper;
import com.system.mapper.StudentMapper;
import com.system.mapper.StudentMapperCustom;
import com.system.po.*;
import com.system.service.StudentService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
  学生管理业务实现
*/
@Service
public class StudentServiceImpl implements StudentService {
    //使用spring 自动注入
    @Autowired
    private StudentMapperCustom studentMapperCustom;
    @Autowired
    private StudentMapper studentMapper;
    @Autowired
    private CollegeMapper collegeMapper;
    public void updataById(Integer id, StudentCustom studentCustom) throws Exception {
        studentMapper.updateByPrimaryKey(studentCustom);
    }
    public void removeById(Integer id) throws Exception {
        studentMapper.deleteByPrimaryKey(id);
    }
    public List<StudentCustom> findByPaging(Integer toPageNo) throws Exception {
        PagingVO pagingVO = new PagingVO();
        pagingVO.setToPageNo(toPageNo);
        List<StudentCustom> list = studentMapperCustom.findByPaging(pagingVO);
        return list;
    }
    public Boolean save(StudentCustom studentCustoms) throws Exception {
        Student stu = studentMapper.selectByPrimaryKey(studentCustoms.getUserid());
        if (stu == null) {
            studentMapper.insert(studentCustoms);
            return true;
        }
        return false;
    }
    //返回学生总数
    public int getCountStudent() throws Exception {
        //自定义查询对象
        StudentExample studentExample = new StudentExample();
        //通过criteria构造查询条件
        StudentExample.Criteria criteria = studentExample.createCriteria();
        criteria.andUseridIsNotNull();
        return studentMapper.countByExample(studentExample);
    }
    public StudentCustom findById(Integer id) throws Exception {
        Student student  = studentMapper.selectByPrimaryKey(id);
        StudentCustom studentCustom = null;
        if (student != null) {
            studentCustom = new StudentCustom();
            //类拷贝
            BeanUtils.copyProperties(student, studentCustom);
        }
        return studentCustom;
    }
    //模糊查询
    public List<StudentCustom> findByName(String name) throws Exception {
        StudentExample studentExample = new StudentExample();
        //自定义查询条件
        StudentExample.Criteria criteria = studentExample.createCriteria();
        criteria.andUsernameLike("%" + name + "%");
        List<Student> list = studentMapper.selectByExample(studentExample);
        List<StudentCustom> studentCustomList = null;
        if (list != null) {
            studentCustomList = new ArrayList<StudentCustom>();
            for (Student s : list) {
                StudentCustom studentCustom = new StudentCustom();
                //类拷贝
                BeanUtils.copyProperties(s, studentCustom);
                //获取课程名
                College college = collegeMapper.selectByPrimaryKey(s.getCollegeid());
                studentCustom.setcollegeName(college.getCollegename());
                studentCustomList.add(studentCustom);
            }
        }
        return studentCustomList;
    }
    public StudentCustom findStudentAndSelectCourseListByName(String name) throws Exception {
        StudentCustom studentCustom = studentMapperCustom.findStudentAndSelectCourseListById(Integer.parseInt(name));
        List<SelectedCourseCustom> list = studentCustom.getSelectedCourseList();
        // 判断该课程是否修完
        for (SelectedCourseCustom s : list) {
            if (s.getMark() != null) {
                s.setOver(true);
            }
        }
        return studentCustom;
    }
}
package com.system.service.impl;
import com.system.exception.CustomException;
import com.system.mapper.CollegeMapper;
import com.system.mapper.CourseMapper;
import com.system.mapper.TeacherMapper;
import com.system.mapper.TeacherMapperCustom;
import com.system.po.*;
import com.system.service.TeacherService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
   教师管理业务实现
*/
@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherMapper teacherMapper;
    @Autowired
    private TeacherMapperCustom teacherMapperCustom;
    @Autowired
    private CollegeMapper collegeMapper;
    @Autowired
    private CourseMapper courseMapper;
    public void updateById(Integer id, TeacherCustom teacherCustom) throws Exception {
        teacherMapper.updateByPrimaryKey(teacherCustom);
    }
    public void removeById(Integer id) throws Exception {
        CourseExample courseExample = new CourseExample();
        CourseExample.Criteria criteria = courseExample.createCriteria();
        criteria.andTeacheridEqualTo(id);
        List<Course> list = courseMapper.selectByExample(courseExample);
        if (list.size() != 0) {
            throw new CustomException("请先删除该名老师所教授的课程");
        }
        teacherMapper.deleteByPrimaryKey(id);
    }
    public List<TeacherCustom> findByPaging(Integer toPageNo) throws Exception {
        PagingVO pagingVO = new PagingVO();
        pagingVO.setToPageNo(toPageNo);
        List<TeacherCustom> list = teacherMapperCustom.findByPaging(pagingVO);
        return list;
    }
    public Boolean save(TeacherCustom teacherCustom) throws Exception {
        Teacher tea = teacherMapper.selectByPrimaryKey(teacherCustom.getUserid());
        if (tea == null) {
            teacherMapper.insert(teacherCustom);
            return true;
        }
        return false;
    }
    public int getCountTeacher() throws Exception {
        //自定义查询对象
        TeacherExample teacherExample = new TeacherExample();
        //通过criteria构造查询条件
        TeacherExample.Criteria criteria = teacherExample.createCriteria();
        criteria.andUseridIsNotNull();
        return teacherMapper.countByExample(teacherExample);
    }
    public TeacherCustom findById(Integer id) throws Exception {
        Teacher teacher = teacherMapper.selectByPrimaryKey(id);
        TeacherCustom teacherCustom = null;
        if (teacher != null) {
            teacherCustom = new TeacherCustom();
            BeanUtils.copyProperties(teacher, teacherCustom);
        }
        return teacherCustom;
    }
    public List<TeacherCustom> findByName(String name) throws Exception {
        TeacherExample teacherExample = new TeacherExample();
        //自定义查询条件
        TeacherExample.Criteria criteria = teacherExample.createCriteria();
        criteria.andUsernameLike("%" + name + "%");
        List<Teacher> list = teacherMapper.selectByExample(teacherExample);
        List<TeacherCustom> teacherCustomList = null;
        if (list != null) {
            teacherCustomList = new ArrayList<TeacherCustom>();
            for (Teacher t : list) {
                TeacherCustom teacherCustom = new TeacherCustom();
                //类拷贝
                BeanUtils.copyProperties(t, teacherCustom);
                //获取课程名
                College college = collegeMapper.selectByPrimaryKey(t.getCollegeid());
                teacherCustom.setcollegeName(college.getCollegename());
                teacherCustomList.add(teacherCustom);
            }
        }
        return teacherCustomList;
    }
    public List<TeacherCustom> findAll() throws Exception {
        TeacherExample teacherExample = new TeacherExample();
        TeacherExample.Criteria criteria = teacherExample.createCriteria();
        criteria.andUsernameIsNotNull();
        List<Teacher> list = teacherMapper.selectByExample(teacherExample);
        List<TeacherCustom> teacherCustomsList = null;
        if (list != null) {
            teacherCustomsList = new ArrayList<TeacherCustom>();
            for (Teacher t: list) {
                TeacherCustom teacherCustom = new TeacherCustom();
                BeanUtils.copyProperties(t, teacherCustom);
                teacherCustomsList.add(teacherCustom);
            }
        }
        return teacherCustomsList;
    }
}
相关文章
|
11天前
|
Java 关系型数据库 MySQL
毕设项目&课程设计&毕设项目:springboot+jsp实现的房屋租租赁系统(含教程&源码&数据库数据)
本文介绍了一款基于Spring Boot和JSP技术的房屋租赁系统,旨在通过自动化和信息化手段提升房屋管理效率,优化租户体验。系统采用JDK 1.8、Maven 3.6、MySQL 8.0、JSP、Layui和Spring Boot 2.0等技术栈,实现了高效的房源管理和便捷的租户服务。通过该系统,房东可以轻松管理房源,租户可以快速找到合适的住所,双方都能享受数字化带来的便利。未来,系统将持续优化升级,提供更多完善的服务。
毕设项目&课程设计&毕设项目:springboot+jsp实现的房屋租租赁系统(含教程&源码&数据库数据)
|
2月前
|
安全 Java 关系型数据库
毕设项目&课程设计&毕设项目:基于springboot+jsp实现的健身房管理系统(含教程&源码&数据库数据)
本文介绍了一款基于Spring Boot和JSP技术实现的健身房管理系统。随着健康生活观念的普及,健身房成为日常锻炼的重要场所,高效管理会员信息、课程安排等变得尤为重要。该系统旨在通过简洁的操作界面帮助管理者轻松处理日常运营挑战。技术栈包括:JDK 1.8、Maven 3.6、MySQL 8.0、JSP、Shiro、Spring Boot 2.0等。系统功能覆盖登录、会员管理(如会员列表、充值管理)、教练管理、课程管理、器材管理、物品遗失管理、商品管理及信息统计等多方面。
|
2月前
|
供应链 前端开发 Java
JSP+servlet+mybatis+layui服装库存管理系统(大三上学期课程设计)
这篇文章通过一个服装库存管理系统的实例,展示了在Spring Boot项目中使用Ajax、JSON、layui、MVC架构和iframe等技术,涵盖了注册登录、权限管理、用户管理、库存管理等功能,并提供了系统运行环境和技术要求的详细说明。
JSP+servlet+mybatis+layui服装库存管理系统(大三上学期课程设计)
|
3月前
|
存储 关系型数据库 测试技术
基于ssm+vue的校园驿站管理系统+(源码+部署说明+演示视频+源码介绍)(2)
基于ssm+vue的校园驿站管理系统+(源码+部署说明+演示视频+源码介绍)
40 1
|
3月前
|
Java 关系型数据库 测试技术
基于ssm+vue的校园驿站管理系统+(源码+部署说明+演示视频+源码介绍)(1)
基于ssm+vue的校园驿站管理系统+(源码+部署说明+演示视频+源码介绍)
44 0
|
4月前
|
前端开发 JavaScript Java
杨校老师项目之基于SSM大学生创新创业项目管理系统
杨校老师项目之基于SSM大学生创新创业项目管理系统
69 0
|
4月前
|
前端开发 Java 关系型数据库
杨校老师项目之基于SSM企业物流快递配送管理系统
杨校老师项目之基于SSM企业物流快递配送管理系统
44 0
|
4月前
|
Java 关系型数据库 MySQL
基于JSP的高校毕业生就业满意度调查统计系统
基于JSP的高校毕业生就业满意度调查统计系统
|
4月前
|
搜索推荐 Java 关系型数据库
基于JSP的房屋租赁系统
基于JSP的房屋租赁系统
|
4月前
|
安全 Java 关系型数据库
基于JSP技术的个人网站系统
基于JSP技术的个人网站系统