首页
项目列表
订单查询
历史案例
项目定制
部署教程
联系我们
登录
源码客栈
基于SSM的教务管理系统
简介 & 技术栈
展示效果:
PC网页
源码类型:
学生/校园/宿舍
后端框架:
SSM
前端框架:
Layui
视图技术:
JSP,HTML
其他技术:
Ajax
开发工具:
IDEA,Eclipse
图片预览
默认图片
部署安装
部署文档
传统SSM项目部署文档-前后端不分离
软件下载(点击下方软件名称即可下载)
idea2021
jdk1.8
tomcat8.5
Navicat Premium 12
文档介绍
分享
收藏
源码
获取
项目完整源码
项目完整源码+远程部署调试
总价
30 / 元
项目推荐
基于SSM的教务管理系统
azhou
部署文档
2,584
2022-06-05
基于SpringBoot+Html的前后端分离的学习平台
azhou
部署文档
1,881
2022-05-17
基于SpringBoot+Vue前后端分离的学校心理健康测试系统
azhou
部署文档
1,736
2023-09-10
基于Springboot+vue的物流管理项目
azhou
部署文档
1,637
2022-07-12
基于SpringBoot的前后端分离的汽车维修系统
azhou
部署文档
1,322
2022-05-17
基于SSM的教务管理系统
azhou
部署文档
1,059
2022-06-29
如有问题需要咨询,请留下您的微信号
客服会添加您,为您服务!
提交
# ssm-教务系统 #### 介绍 采用了spring mvc,spring,mybatis框架,前端用到js,html,主要功能包括:课程管理,学生管理,教师管理,账号密码重置等功能 #### 安装教程 1. 把项目放到idea 2. 注意把连接的数据库信息修改成自己的 3. 配置tomcat 4. 导入依赖,如果有的爆红导不进去可以选择换个maven版本试试 ```java 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; @Controller @RequestMapping("/admin") public class AdminController { @Resource private StudentService studentService; @Resource private TeacherService teacherService; @Resource private CourseService courseService; @Resource private CollegeService collegeService; @Resource private UserloginService userloginService; /*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<学生操作>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ // 学生信息显示 @RequestMapping("/showStudent") public String showStudent(Model model, Integer page) throws Exception { List
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
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
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
list = studentService.findByName(findByName); model.addAttribute("studentList", list); return "admin/showStudent"; } /*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<教师操作>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ // 教师页面显示 @RequestMapping("/showTeacher") public String showTeacher(Model model, Integer page) throws Exception { List
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
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
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
list = teacherService.findByName(findByName); model.addAttribute("teacherList", list); return "admin/showTeacher"; } /*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<课程操作>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ // 课程信息显示 @RequestMapping("/showCourse") public String showCourse(Model model, Integer page) throws Exception { List
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
list = teacherService.findAll(); List
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
list = teacherService.findAll(); List
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
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"; } } ```