基于SSM的高校课程评价系统

news2025/7/19 15:42:31

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


目录

一、项目简介

二、系统功能

三、系统项目截图

3.1学生

3.2教师

3.3管理员

四、核心代码

4.1登录相关

4.2文件上传

4.3封装


一、项目简介

基于SSM的高校课程评价系统利用网络沟通、计算机信息存储管理,有着与传统的方式所无法替代的优点。比如计算检索速度特别快、可靠性特别高、存储容量特别大、保密性特别好、可保存时间特别长、成本特别低等。在工作效率上,能够得到极大地提高,延伸至服务水平也会有好的收获,有了网络,基于SSM的高校课程评价系统的各方面的管理更加科学和系统,更加规范和简便。


二、系统功能

基于SSM的高校课程评价系统主要包括三大功能模块,即管理员、教师和学生。

(1)管理员模块:管理员进入系统有指标信息管理、课程管理、院系管理、专业管理、班级管理、教师管理、专家管理、学生管理、课程信息管理等相关功能模块。         

(2)教师:教师登录到系统有首页、个人中心、指标信息管理、课程信息管理、教师自评管理这几个功能模块。

(3)学生:学生登录到系统有个人中心、课程信息管理、学生评价管理这几个功能模块。



三、系统项目截图

3.1学生

 管理员、教师和学生都可以在此页面登录到系统。

未有账号的学生可以进行注册并且登录。

 学生登录到系统有个人中心、课程信息管理、学生评价管理这几个功能模块。在个人信息中学生可以对自己的信息进行修改等操作。

3.2教师

 教师登录

教师登录到系统有首页、个人中心、指标信息管理、课程信息管理、教师自评管理这几个功能模块

在指标信息中可以查看指标信息等情况

在课程信息中教师可以查看到自己的课程信息。

 教师自评。

3.3管理员

管理员进入系统有指标信息管理、课程管理、院系管理、专业管理、班级管理、教师管理、专家管理、学生管理、课程信息管理等相关功能模块。         

 添加新的课程信息模块

 班级信息页面,可以添加新的班级,也可以删除旧的班级。

在教师管理中管理员可以查看教师的信息情况


四、核心代码

4.1登录相关


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{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private 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();
    }
}

4.2文件上传

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{
	@Autowired
    private 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);
	}
	
}

4.3封装

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.coloradmin.cn/o/38161.html

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

相关文章

一文带你深入理解【Java基础】· 注解

写在前面 Hello大家好&#xff0c; 我是【麟-小白】&#xff0c;一位软件工程专业的学生&#xff0c;喜好计算机知识。希望大家能够一起学习进步呀&#xff01;本人是一名在读大学生&#xff0c;专业水平有限&#xff0c;如发现错误或不足之处&#xff0c;请多多指正&#xff0…

多线程编程【条件变量】

条件变量&#x1f4d6;1. 为什么需要条件变量&#xff1f;&#x1f4d6;2. 条件变量概念&#x1f4d6;3. 发信号时总是持有锁&#x1f4d6;4. 生产者消费者问题&#x1f4d6;5. 基于阻塞队列的生产者消费者模型&#x1f4d6;1. 为什么需要条件变量&#xff1f; 在很多情况下&a…

Android开发音效增强中铃声播放Ringtone及声音池调度SoundPool的讲解及实战(超详细 附源码)

需要源码请点赞关注收藏后评论区留下QQ~~~ 一、铃声播放 虽然媒体播放器MediaPlayer既可用来播放视频&#xff0c;也可以用来播放音频&#xff0c;但是在具体的使用场合&#xff0c;MediaPlayer存在某些播音方面的不足之处 包括以下几点 1&#xff1a;初始化比较消耗资源 尤其…

软件开发工程师笔试记录--关键路径,浮点数计算,地址变换,中断向量,I/O接口,海明码

时间&#xff1a;2022年11月26日 10&#xff1a;00 -11&#xff1a;00 &#xff08;可提前登录15分钟&#xff09; 公司&#xff1a;XX&#xff08;rongyu&#xff09; 岗位&#xff1a;软件开发工程师&#xff08;我的简历语言是Java&#xff09; 题型&#xff1a;选择题&…

一次应用多次fgc原因的排查及解决

应用多次fgc性能排查&#xff08;一次抢购引起的性能问题&#xff09; 大家好我是魔性的茶叶&#xff0c;今天分享一个项目jvm多次fgc的整个排查流程 上班后不久运维突然通知我们组&#xff0c;有一个应用在短时间内多次fgc&#xff0c;即将处于挂掉的状态。 首先我登录skyw…

客户听不进去,很强势,太难沟通了,怎么办?

案例 最近接手一项目,项目范围蔓延,成本超支,进度延期,问项目经理怎么回事? 项目经理C无奈诉苦到:用户A大领导,是业主B的领导,咱们业主B不敢反驳他,让我直接与用户A对接,说A提的需求,默认答应,我有什么办法啊,只能接了。 分析 经过复盘,导致项目蔓延的主要原因…

【参赛经历总结】第五届“传智杯”全国大学生计算机大赛(初赛B组)

成绩 比赛链接 比赛过程 被虐4h 比赛体验不是很好我开始五分后才在qq上看到题第一题签到题第二题调了1h吧&#xff0c;算法题做的不多&#xff0c;题目没读全&#xff0c;wa了几发&#xff0c;有几发是网络问题&#xff0c;交了显示失败&#xff0c;但还是判wa了第三题知道…

mulesoft What‘s the typeOf(payload) of Database Select

Whats the typeOf payload of Database SelectQuestionOptionExplanationMule ApplicationDebugQuestion Refer to the exhibit. The Database Select operation returns five rows from a database. What is logged by the Logger component? Option A “Array” B “Objec…

第五届传智杯-初赛【B组-题解】

A题 题目背景 在宇宙射线的轰击下&#xff0c;莲子电脑里的一些她自己预定义的函数被损坏了。 对于一名理科生来说&#xff0c;各种软件在学习和研究中是非常重要的。为了尽快恢复她电脑上的软件的正常使用&#xff0c;她需要尽快地重新编写这么一些函数。 你只需输出fun(a,…

数据库错误知识集3(摘)

&#xff08;摘&#xff09; 逻辑独立性是外模式不变&#xff0c;模式改变时&#xff0c;如增加新的关系&#xff0c;新的属性&#xff0c;改变属性的数据类型&#xff0c;由数据库管理员对各个外模式/模式的映像做相应改变&#xff0c;可以使得外模式不变&#xff0c;因为应用…

sdfsdfasfsdfdsfasfdfasfasadsfasdfasf

白包api 图片编辑功能&#xff1a; 1、你变体下 SnapEditMenuManager 的 这个方法 public void initEditMainMenu(final EditUITabMenu editUITabMenu) 换成你需要的配置&#xff0c;需要哪个功能 就拿哪一坨&#xff0c;别拿多了 //相框 MenuBean menuBean new MenuBean…

线程的学习

v# 1. 线程基本概念 1.1进程 进程是指运行中的程序&#xff0c;比如启动了QQ&#xff0c;就相当于启动了一个进程&#xff0c;操作系统会为该进程分配空间&#xff1b;当我们使用迅雷&#xff0c;就相当于又启动了一个进程&#xff0c;操作系统将为迅雷分配新的内存空间&…

坦克大战①

1. java绘图技术 JFrame&#xff1a;画板 Jpanel&#xff1a;画板 Graphics&#xff1a;画笔 初始化画板&#xff0c;定义画框的大小&#xff0c;设置可视化&#xff1b; 1.1 画坦克 初始化我方坦克、敌方坦克 绘图&#xff1a;(1)更改背景颜色&#xff1b;(2)绘制敌方坦克…

【Docker】常用命令

背景 当下&#xff0c;docker技术已成为开发者常用的技术栈。不管是开发过程中需要应对的各种复杂多变的开发环境的搭建&#xff0c;还是生产部署环节需要的自动化运维&#xff0c;都离不开docker&#xff0c;本文简单介绍相关命令的含义&#xff0c;用作平时查询使用。 1. doc…

【计算机毕业设计】38.网上轰趴预订系统

一、系统截图&#xff08;需要演示视频可以私聊&#xff09; 摘要 在网上轰趴发展的整个过程中&#xff0c;网上轰趴预定担负着最重要的角色。为满足如今日益复杂的管理需求&#xff0c;各类网上轰趴程序也在不断改进。本课题所设计的网上轰趴预定系统&#xff0c;使用SSM框架…

一文看懂Transformer(详解)

文章目录Transformer前言网络结构图&#xff1a;EncoderInput EmbeddingPositional Encoderself-attentionPadding maskAdd & NormFeed ForwardDecoderinputmasked Multi-Head Attentiontest时的Decoder预测Transformer 前言 Transformer最初是用于nlp领域的翻译任务。 …

大屏图表,ECharts 从“熟练”到入门

&#x1f4d6;阅读本文&#xff0c;你将 了解 配置驱动 的思想理解 Echarts 基本概念了解 graphic 和 动画基本玩法。了解 Echarts 基底组件的封装的思路 一、不是标题党&#xff01;Echarts&#xff0c;简历上人均 “熟练”&#xff1f; 公司最近在招外包&#xff0c;而因为…

基于ASP学生资助管理系统的设计与实现

项目描述 临近学期结束&#xff0c;还是毕业设计&#xff0c;你还在做ASP程序网络编程&#xff0c;期末作业&#xff0c;老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等。这里根据疫情当下&#xff0c;你想解决的问题…

用Python蹭别人家图片接口,做一个【免费图床】吧

打开本文&#xff0c;相信你确实需要一个免费且稳定的图床&#xff0c;这篇博客就让你实现。 文章目录⛳️ 谁家的图床⛳️ 实战编码⛳️ 第一轮编码⛳️ 第二轮编码⛳️ 第三轮编码⛳️ 第四轮编码⛳️ 谁家的图床 这次咱们用新浪微博来实现【免费图床应用】&#xff0c;通过…

栈浅谈(上)

目录 栈的定义 栈的实现 初始化 判断栈是否为空 入栈操作 获取栈顶元素 出栈操作 遍历栈 销毁栈 完整代码演示 栈—STL 基本操作 例题 参考代码 栈的定义 说到栈&#xff0c;一些不会计算机语言的“小白”&#xff08;我就是&#xff09;就会想到栈道之类的词语…