基于SSM的培训学校教学管理平台的设计与实现

末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SSM
前端:Vue
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是


目录

一、项目简介

二、系统功能

三、系统项目截图

登录模块的实现

注册模块的实现

生管理模块的实现

教师管理模块的实现

机构信息管理模块的实现

课程信息管理模块的实现

选课信息管理模块的实现

四、核心代码

登录相关

文件上传

封装


一、项目简介

社会的进步,教育行业发展迅速,人们对教育越来越重视,在当今网络普及的情况下,教学管理模式也开始逐渐网络化,学校开始网络教学管理模式。

本文研究的培训学校教学管理平台基于SSM框架,采用Java技术和MYSQL数据库设计开发。在系统的整个开发过程中,首先对系统进行了需求分析,设计出系统的主要功能模块,包括学生功能模块、教师功能模块以及管理员功能模块三大部分,其次对网站进行总体规划和详细设计,最后对培训学校教学管理平台进行了系统测试,包括测试概述,测试内容等,并对测试结果进行了分析和总结,进而得出系统的不足及需要改进的地方,为以后的系统维护和扩展提供了方便。

本系统布局合理、色彩搭配和谐、框架结构设计清晰,具有操作简单,界面清晰,管理方便,功能完善等优势,有很高的使用价值。


二、系统功能

系统架构的整体设计是一个将一个庞大的任务细分为多个小的任务的过程,这些小的任务分段完成后,组合在一起形成一个完整的任务。本培训学校教学管理平台的设计与实现主要包括学生功能模块、教师功能模块和管理员功能模块三大部分。



三、系统项目截图

登录模块的实现

用户要想进入本系统必须进行登录操作

注册模块的实现

没有账号的学生和教师均可进行注册操作

 

生管理模块的实现

管理员可查看、修改和删除学生信息

教师管理模块的实现

管理员可查看、修改和删除教师信息

 

机构信息管理模块的实现

管理员可增删改查机构信息,教师可查看机构信息,并可选择进行加盟操作

 

课程信息管理模块的实现

教师可增删改查课程信息,学生可查看课程信息,并可选择进行选课

 

选课信息管理模块的实现

教师可查看学生选课信息,并可对其进行审核操作

 


四、核心代码

登录相关


package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

文件上传

package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上传文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上传文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上传文件不能为空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}/*** 下载文件*/@IgnoreAuth@RequestMapping("/download")public ResponseEntity<byte[]> download(@RequestParam String fileName) {try {File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}File file = new File(upload.getAbsolutePath()+"/"+fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    headers.setContentDispositionFormData("attachment", fileName);    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);}}

封装

package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回数据*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知异常,请联系管理员");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/112490.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

CentOS 7 安装 MySQL 8

一、卸载MariaDB MariaDB是MySQL 的一个分支&#xff0c;完全兼容MySQL&#xff0c;包括API和命令行&#xff0c;使之能轻松成为MySQL的代替品。 1、查看版本&#xff08;如果有就卸载&#xff09; rpm -qa|grep mariadbrpm -e --nodeps 文件名 二、下载mysql 1、进入 /usr/…

多年没有遇到如此流畅的面试了

美东一公司的面试&#xff0c;有多年没有遇到如此流畅的面试了。 本来说的面试时间是 30 分钟&#xff0c;这个还是第一轮处于电话面试那种&#xff0c;但是不知道为什么最后面试整个时间都延长到了快一个小时&#xff0c;貌似双方都还继续沟通下&#xff0c;有点意犹未尽的感觉…

什么是AJAX

AJAX&#xff08;Asynchronous JavaScript and XML&#xff09;是一种用于创建交互式、动态网页应用程序的Web开发技术。它允许网页在不刷新整个页面的情况下&#xff0c;与服务器进行异步通信&#xff0c;以获取或发送数据。以下是对AJAX的主要组成部分和概念的概述&#xff1…

Leetcode 第 361 场周赛题解

Leetcode 第 361 场周赛题解 Leetcode 第 361 场周赛题解题目1&#xff1a;2843. 统计对称整数的数目思路代码复杂度分析 题目2&#xff1a;生成特殊数字的最少操作思路代码复杂度分析 题目3&#xff1a;统计趣味子数组的数目思路代码复杂度分析 题目4&#xff1a;边权重均等查…

华为OD 数组去重和排序(100分)【java】A卷+B卷

华为OD统一考试A卷B卷 新题库说明 你收到的链接上面会标注A卷还是B卷。目前大部分收到的都是B卷。 B卷对应20022部分考题以及新出的题目&#xff0c;A卷对应的是新出的题目。 我将持续更新最新题目 获取更多免费题目可前往夸克网盘下载&#xff0c;请点击以下链接进入&#xff…

华为云HECS云服务器docker环境下安装nacos

华为云HECS云服务器&#xff0c;安装docker环境&#xff0c;查看如下文章。 华为云HECS安装docker-CSDN博客 一、拉取镜像 docker pull nacos/nacos-server二、宿主机创建挂载目录 执行如下命令&#xff1a; mkdir -p /usr/local/nacos/logs mkdir -p /usr/local/nacos/con…

Coreldraw2020最新64位电脑完整版本下载教程

安装之前所有的杀毒软件都要退出。无论是360&#xff0c;腾讯管家&#xff0c;或者电脑自带的安全中心&#xff0c;要不然会阻止安装。 CorelDRAW2020版win下载如下:https://wm.makeding.com/iclk/?zoneid55678 CorelDRAW2020版mac下载如下:https://wm.makeding.com/iclk/?…

大河弯弯:CSS 文档流与三大元素显示模式

文章目录 参考环境文档流概念三大显示模式 内联元素概念常见的内联元素宽高由内容决定 块级元素概念常见的块级元素宽度受容器影响&#xff0c;高度受内容影响 内联块级元素概念常见的内联块级元素折中方案 设置元素的显示模式display 属性内联元素与块级元素的切换为什么要通过…

使用Matplotlib画多y轴图

使用Matplotlib画多y轴图 代码成品图 代码 import matplotlib.pyplot as plt import mpl_toolkits.axisartist as AA from mpl_toolkits.axes_grid1 import host_subplot%matplotlib inline config {"font.family": "serif","font.size": 14,&…

保序回归与金融时序数据

保序回归在回归问题中的作用是通过拟合一个单调递增或递减的函数&#xff0c;来保持数据点的相对顺序特性。 一、保序回归的作用 主要用于以下情况&#xff1a; 1. 有序数据&#xff1a;当输入数据具有特定的顺序关系时&#xff0c;保序回归可以帮助保持这种顺序关系。例如&…

计算机加减乘除的本质

只应用位运算实现加减乘除是程序员的基本修养&#xff0c;这里应用通俗易懂的python实现加减乘除&#xff0c;其他语言同理。 应对python无限制扩展位数的方法 # 限制变量为32位 def int32(value):return -(value & 0x80000000) | (value & 0x7FFFFFFF)加法,本位进位…

机器学习 | 基于随机森林的可解释性机器学习

可解释性机器学习在当今数据驱动的决策系统中扮演着重要的角色。随着人工智能技术的快速发展,越来越多的应用场景需要了解和解释模型的决策过程,以提高透明度、可信度和可接受性。乳腺癌作为一种常见的恶性肿瘤,早期诊断对于治疗和预后具有重要意义。 然而,乳腺癌早期诊断…

认识系统服务

daemon与service 达成某个服务&#xff08;service&#xff09;需要一个守护进程&#xff08;daemon&#xff09;在后台运行。 实现 ssh 服务&#xff0c;需要 sshd 这个守护进程实现 mysql 服务&#xff0c;需要 mysqld 这个守护进程实现 cron 服务&#xff0c;需要 crond 这…

HttpServlet源码分析及HttpServletRequest接口

2023.10.20 HttpServlet HttpServlet类是专门为HTTP协议准备的。比GenericServlet更加适合HTTP协议下的开发。 http包下都有哪些类和接口呢&#xff1f;&#xff08;jakarta.servlet.http.*&#xff09; jakarta.servlet.http.HttpServlet &#xff08;HTTP协议专用的Servlet…

电源模块测试用例科普:如何调整电压调整率?ATECLOUD-POWER测试系统能否测试?

电压调整率可以控制电压水平&#xff0c;确保设备正常工作&#xff0c;并且可以减少电能浪费&#xff0c;是开关电源测试的其中一个测试项目。那么要如何测试电压调整率呢?测试条件是什么呢? 什么是电压调整率? 电压调整率是指变压器某个绕组的空载电压和指定负载和功率因数…

【SA8295P 源码分析 (四)】35 - QNX侧 Marvell 88Q5152 Phy_Switch 导通实录(硬核)

【SA8295P 源码分析】35 - QNX侧 Marvell 88Q5152 Phy_Switch 导通实录(硬核) 一、硬件原理分析二、88Q5152 芯片读写时序分析2.1 Clause 22 读、写寄存器配置(配置 Port 5 采用C22条款)2.1.1 88Q5152 P5 端口配置2.2 Clause 45 读寄存器时序(配置 Port 1、Port 2 采用C45…

软考系列(系统架构师)- 2019年系统架构师软考案例分析考点

试题一 软件架构&#xff08;架构风格、质量属性&#xff09; 【问题1】&#xff08;13分&#xff09; 针对用户级别与折扣规则管理功能的架构设计问题&#xff0c;李工建议采用面向对象的架构风格&#xff0c;而王工则建议采用基于规则的架构风格。请指出该系统更适合采用哪种…

三网话费余额查询的API系统 基于thinkphp6.0框架

本套系统是用thinkphp6.0框架开发的&#xff0c;PHP需大于8.2&#xff0c;系统支持用户中心在线查询和通过API接口对接发起查询&#xff0c;用户余额充值是对接usdt接口&#xff0c;源码全开源&#xff0c;支持懂技术的人二次开发~搭建教程1、源码上传后&#xff0c;吧运行目录…

字符串Hash学习笔记

哈希算法 哈希算法是通过一个哈希函数 H H H&#xff0c;将一种数据&#xff08;包括字符串、较大的数等&#xff09;转化为能够用变量表示或是直接就可作为数组下标的数。 哈希值 通过哈希函数转化的得到的数值。可以通过哈希值实现快速查找和匹配。 简介 寻找长度为 n n…

【TES600】青翼科技基于XC7K325T与TMS320C6678的通用信号处理平台

板卡概述 TES600是一款基于FPGA&#xff0b;DSP协同处理架构的通用高性能实时信号处理平台&#xff0c;该平台采用1片TI的KeyStone系列多核浮点/定点DSP TMS320C6678作为主处理单元&#xff0c;采用1片Xilinx的Kintex-7系列FPGA XC7K325T作为协处理单元&#xff0c;具有1个FMC…