SSM+MySQL+JSP教务管理系统设计与实现(附源码下载地址) |
您所在的位置:网站首页 › 教务管理系统架构设计图 › SSM+MySQL+JSP教务管理系统设计与实现(附源码下载地址) |
文章目录01 项目背景02 使用技术03 运行环境04 功能分析05 数据库设计06 项目工程结构07 部分功能展示及源码7.1 登录页7.2 管理员端--首页7.3 管理员端--课程管理7.4 管理员端--学生管理7.5 教师端--首页7.6 教师端--个人信息7.7 学生端--已修课程7.8 学生端--公告管理08 运行教程01 项目背景 教务管理是大学的主要日常管理工作之一,涉及到校、系、师、生的诸多方面,随着教学体制的不断改革,尤其是学分制、选课制的展开和深入,教务日常管理工作日趋复杂繁重。如何把教务工作信息化,模块化,便捷化是现代高校发展的重点,因此研制开发一种综合教务管理软件,建成一个完整统一、技术先进、高效稳定、安全可靠的教务管理系统变得尤为重要。 本系统基于B/S结构,运用MVC(Model-View-Controller)模式,采用先进的Spring、SpringMVC、MyBatis等技术框架 ,实现了课程管理、教师管理、学生管理、院系管理、公告管理、个人信息管理等功能模块,为高校数字化校园建设提供先进实用、安全可靠、便于操作、易干扩展的应用解决方案。 02 使用技术数据表现层:Jsp+JavaScript+CSS+Bootstrap+JQuery业务逻辑层:Java+Spring+SpringMVC数据持久层:MySQL+MyBatis开发工具:IDEA / Eclipse安全框架:Shiro日志:log4j03 运行环境代码语言:javascript复制JDK1.8 + Maven3.6.3 + MySQL5.7 + Tomcat9.004 功能分析管理员: ![]() 教师: ![]() 学生: ![]() 数据库详细设计见 “教务管理系统设计与实现(SSM+MySQL+JSP)”源码包中 educational_manage.sql 文件。 源码包通过第09章节下载 06 项目工程结构下载本项目源码并导入到开发工具后(下图为导入到Eclipse中的目录结构),项目的目录结构如下图所示: ![]() ![]() 部分代码: 代码语言:javascript复制package com.cya.controller; 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; import com.cya.entity.Userlogin; /** * @author 【IT学长】 * @version */ @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/index"; } else if (subject.hasRole("teacher")) { return "redirect:/teacher/index"; } else if (subject.hasRole("student")) { return "redirect:/student/index"; } return "/login"; } }7.2 管理员端–首页![]() 课程列表: ![]() 课程添加: ![]() 部分代码: 代码语言:javascript复制package com.cya.service.impl; import com.cya.entity.*; import com.cya.mapper.CollegeMapper; import com.cya.mapper.CourseMapper; import com.cya.mapper.CourseMapperCustom; import com.cya.mapper.SelectedcourseMapper; import com.cya.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.HashMap; import java.util.List; import java.util.Map; /** * @author 【IT学长】 * @version 2022-10-6 */ @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 Map removeById(Integer id) throws Exception { Map resMap = new HashMap(); // 自定义查询条件 SelectedcourseExample example = new SelectedcourseExample(); SelectedcourseExample.Criteria criteria = example.createCriteria(); criteria.andCourseidEqualTo(id); criteria.andMarkIsNull(); List list = selectedcourseMapper.selectByExample(example); if (list.size() == 0) { courseMapper.deleteByPrimaryKey(id); resMap.put("status", true); resMap.put("message", "删除成功"); } else { List tempList = new ArrayList(); for (Selectedcourse selectedcourse : list) { tempList.add(selectedcourse.getStudentid().toString()); } // 根据课程号查授课教师 Course course = courseMapper.selectByPrimaryKey(id); resMap.put("status", false); resMap.put("message", tempList); if (course != null) { resMap.put("teacherID", course.getTeacherid()); } } return resMap; } public List findByPaging(Integer toPageNo) throws Exception { PagingVO pagingVO = new PagingVO(); pagingVO.setToPageNo(toPageNo); List 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 findByName(String name, Integer teacherId) throws Exception { CourseExample courseExample = new CourseExample(); // 自定义查询条件 CourseExample.Criteria criteria = courseExample.createCriteria(); criteria.andCoursenameLike("%" + name + "%"); if (teacherId != null) { criteria.andTeacheridEqualTo(teacherId); } List list = courseMapper.selectByExample(courseExample); List courseCustomList = null; if (list != null) { courseCustomList = new ArrayList(); 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 findByTeacherID(Integer id) throws Exception { CourseExample courseExample = new CourseExample(); // 自定义查询条件 CourseExample.Criteria criteria = courseExample.createCriteria(); // 根据教师id查课程 criteria.andTeacheridEqualTo(id); List list = courseMapper.selectByExample(courseExample); List courseCustomList = null; if (list.size() > 0) { courseCustomList = new ArrayList(); 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; } }7.4 管理员端–学生管理学生列表: ![]() 学生修改: ![]() ![]() ![]() 部分源码: 代码语言:javascript复制 //查询个人信息 @RequestMapping(value = "/teacherInfo") public String teacherInfo(Model model) throws Exception { Subject subject = SecurityUtils.getSubject(); String username = (String) subject.getPrincipal(); TeacherCustom teacherCustom = teacherService.findById(Integer.parseInt(username)); if (teacherCustom == null) { throw new CustomException("未找到此教师信息") ; } model.addAttribute("teacher", teacherCustom); return "teacher/teacherInfo"; }7.7 学生端–已修课程![]() 公告列表: ![]() 公告详情: ![]() 部分源码: 代码语言:javascript复制 and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{listItem} id, title, date, content, type select distinct from notice order by ${orderByClause} select from notice where id = #{id,jdbcType=INTEGER} delete from notice where id = #{id,jdbcType=INTEGER} insert into notice (id, title, date, content, type) values ( #{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{date,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR}, #{type,jdbcType=VARCHAR} ) insert into notice id, title, date, content, type, #{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{date,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR}, #{type,jdbcType=VARCHAR}, select count(*) from notice update notice title = #{title,jdbcType=VARCHAR}, date = #{date,jdbcType=TIMESTAMP}, content = #{content,jdbcType=LONGVARCHAR}, type = #{type,jdbcType=VARCHAR}, where id = #{id,jdbcType=INTEGER} update notice set title = #{title,jdbcType=VARCHAR}, date = #{date,jdbcType=TIMESTAMP}, content = #{content,jdbcType=LONGVARCHAR}, type = #{type,jdbcType=VARCHAR} where id = #{id,jdbcType=INTEGER} 08 运行教程详细运行步骤及常见问题解答请看“教务管理系统设计与实现(SSM+MySQL+JSP)”源码包中 README.md 文件。 通过第09章节下载源码包并解压后如下图所示: ![]() |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |