Java+SpringBoot+JSP实现在线心理评测与咨询系统

ops/2024/10/10 17:55:03/
前言介绍 

随着互联网技术的高速发展,人们生活的各方面都受到互联网技术的影响。现在人们可以通过互联网技术就能实现不出家门就可以通过网络进行系统管理,交易等,而且过程简单、快捷。同样的,在人们的工作生活中,也就需要互联网技术来方便人们的日常工作生活,实现工作办公的自动化处理,实现信息化,无纸化办公。

本课题在充分研究了在ssm框架基础上,采用B/S模式,以Java为开发语言,MyEclipse为开发工具,MySQL为数据管理平台,实现的内容主要包括个人中心,学生管理,心理辅导员管理,心理测评管理,心理测试管理,在线咨询,试题管理,在线探讨,系统管理,考试管理等功能。

功能需求分析

根据一般在线心理评测与咨询管理系统的功能需求分析,本系统的功能模块如下:

(1)在个人中心,管理员可以修改自己的用户名和登录密码。

(2)在系统前台可以查看首页,心理测评,在线探讨,心理测试,在线咨询,个人中心等功能。

(3)在心理辅导员管理模块中,可以对个人中心,心理测评管理,试题管理,在线探讨,我的收藏管理,心理测试管理,考试管理等功能进行详细操作。

(3)在管理员模块中,管理员可以对个人中心,学生管理,心理辅导员管理,心理测评管理,心理测试管理,在线咨询,试题管理,在线探讨,系统管理,考试管理等功能进行查看,修改和删除等操作。

系统总体设计图

数据库设计 

数据可设计要遵循职责分离原则,即在设计时应该要考虑系统独立性,即每个系统之间互不干预不能混乱数据表和系统关系。

数据库命名也要遵循一定规范,否则容易混淆,数据库字段名要尽量做到与表名类似,多使用小写英文字母和下划线来命名并尽量使用简单单词。

概念模型是对现实中的问题出现的事物的进行描述,ER图是由实体及其关系构成的图,通过E-R图可以清楚地描述系统涉及到的实体之间的相互关系。

学生注册实体图如图

心理辅导员管理实体图如图 

在线咨询管理实体图如图

系统功能模块

在线心理评测与咨询系统,在系统首页可以查看首页,心理测评,在线探讨,心理测试,在线咨询,个人中心等内容,并进行详细操作;如图 

学生注册

在学生注册页面通过填写学生账号,学生姓名,密码,确认密码,联系方式等信息进行注册操作,如图 

心理测评

在心理测评页面可以查看标题,发布时间等内容,并进行收藏和评论操作,如图 

心理测试 

个人中心

在个人中心页面通过填写学生账号,学生姓名,密码,性别,联系方式等内容进行更新信息操作,并根据需要对我的发布,我的收藏,考试记录,错题本进行详细操作;如图 

管理员功能

管理员进入系统前在登录页面根据要求填写用户名,密码等信息,点击登录进行登录操作,如图

管理员登录进入在线心理评测与咨询系统可以对查看个人中心,学生管理,心理辅导员管理,心理测评管理,心理测试管理,在线咨询,试题管理,在线探讨,系统管理,考试管理等功能,还能对每个功能逐一进行相应操作,如图 

心理辅导员管理

在心理辅导员管理页面可以对辅导账号,辅导姓名,性别,联系方式,头像等内容进行查看,修改和删除操作,如图 

心理测评管理

在心理测评管理页面可以对标题,封面,发布时间等内容进行查看,修改,查看评论和删除等操作,如图 

在线咨询管理

在在线咨询管理页面可以对用户名,留言内容,留言图片,回复内容,回复图片等内容进行查看,修改,回复和删除等操作,如图 

试题管理

在试题管理页面可以对心理测评,试题,类型,答案,分数等内容进行修改和删除等操作,如图 

在线探讨管理

在在线探讨管理页面可以对贴子标题,用户名,状态等内容进行查看,修改和删除等操作,如图

系统管理

在轮播图管理页面可以对名称,值等内容进行查看和修改等操作,如图 

心理辅导员功能模块

心理辅导员登录进入在线心理评测与咨询系统可以对个人中心,心理测评管理,试题管理,在线探讨,我的收藏管理,心理测试管理,考试管理等功能进行相应操作,如图 

心理测试管理

在心理测试管理页面可以对心理测试名称,考试时长(分钟),心理测试状态等内容进行查看,修改和删除等操作,如图 

部分核心代码

上传文件映射表

/*** 上传文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上传文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file, String type,HttpServletRequest request) throws Exception {if (file.isEmpty()) {throw new EIException("上传文件不能为空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);String fileName = new Date().getTime()+"."+fileExt;File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);file.transferTo(dest);/*** 如果使用idea或者eclipse重启项目,发现之前上传的图片或者文件丢失,将下面一行代码注释打开* 请将以下的"D:\\ssmpiv99\\src\\main\\webapp\\upload"替换成你本地项目的upload路径,* 并且项目路径不能存在中文、空格等特殊字符*///FileUtils.copyFile(dest, new File("D:\\ssmpiv99\\src\\main\\webapp\\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 void download(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {try {File file = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);if (file.exists()) {response.reset();response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName+"\"");response.setHeader("Cache-Control", "no-cache");response.setHeader("Access-Control-Allow-Credentials", "true");response.setContentType("application/octet-stream; charset=UTF-8");IOUtils.write(FileUtils.readFileToByteArray(file), response.getOutputStream());}} catch (IOException e) {e.printStackTrace();}}}

/*** 心理测评* 后端接口* @author * @email * @date 2022-04-16 11:47:06*/
@RestController
@RequestMapping("/xinliceping")
public class XinlicepingController {@Autowiredprivate XinlicepingService xinlicepingService;@Autowiredprivate StoreupService storeupService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,XinlicepingEntity xinliceping, HttpServletRequest request){EntityWrapper<XinlicepingEntity> ew = new EntityWrapper<XinlicepingEntity>();PageUtils page = xinlicepingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xinliceping), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,XinlicepingEntity xinliceping, HttpServletRequest request){EntityWrapper<XinlicepingEntity> ew = new EntityWrapper<XinlicepingEntity>();PageUtils page = xinlicepingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xinliceping), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( XinlicepingEntity xinliceping){EntityWrapper<XinlicepingEntity> ew = new EntityWrapper<XinlicepingEntity>();ew.allEq(MPUtil.allEQMapPre( xinliceping, "xinliceping")); return R.ok().put("data", xinlicepingService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(XinlicepingEntity xinliceping){EntityWrapper< XinlicepingEntity> ew = new EntityWrapper< XinlicepingEntity>();ew.allEq(MPUtil.allEQMapPre( xinliceping, "xinliceping")); XinlicepingView xinlicepingView =  xinlicepingService.selectView(ew);return R.ok("查询心理测评成功").put("data", xinlicepingView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){XinlicepingEntity xinliceping = xinlicepingService.selectById(id);xinliceping.setClicktime(new Date());xinlicepingService.updateById(xinliceping);return R.ok().put("data", xinliceping);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){XinlicepingEntity xinliceping = xinlicepingService.selectById(id);xinliceping.setClicktime(new Date());xinlicepingService.updateById(xinliceping);return R.ok().put("data", xinliceping);}/*** 赞或踩*/@RequestMapping("/thumbsup/{id}")public R vote(@PathVariable("id") String id,String type){XinlicepingEntity xinliceping = xinlicepingService.selectById(id);if(type.equals("1")) {xinliceping.setThumbsupnum(xinliceping.getThumbsupnum()+1);} else {xinliceping.setCrazilynum(xinliceping.getCrazilynum()+1);}xinlicepingService.updateById(xinliceping);return R.ok("投票成功");}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody XinlicepingEntity xinliceping, HttpServletRequest request){xinliceping.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(xinliceping);xinlicepingService.insert(xinliceping);return R.ok();}/*** 前端保存*/@IgnoreAuth@RequestMapping("/add")public R add(@RequestBody XinlicepingEntity xinliceping, HttpServletRequest request){xinliceping.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(xinliceping);xinlicepingService.insert(xinliceping);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody XinlicepingEntity xinliceping, HttpServletRequest request){//ValidatorUtils.validateEntity(xinliceping);xinlicepingService.updateById(xinliceping);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){xinlicepingService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 提醒接口*/@RequestMapping("/remind/{columnName}/{type}")public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map<String, Object> map) {map.put("column", columnName);map.put("type", type);if(type.equals("2")) {SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Calendar c = Calendar.getInstance();Date remindStartDate = null;Date remindEndDate = null;if(map.get("remindstart")!=null) {Integer remindStart = Integer.parseInt(map.get("remindstart").toString());c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart);remindStartDate = c.getTime();map.put("remindstart", sdf.format(remindStartDate));}if(map.get("remindend")!=null) {Integer remindEnd = Integer.parseInt(map.get("remindend").toString());c.setTime(new Date());c.add(Calendar.DAY_OF_MONTH,remindEnd);remindEndDate = c.getTime();map.put("remindend", sdf.format(remindEndDate));}}Wrapper<XinlicepingEntity> wrapper = new EntityWrapper<XinlicepingEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = xinlicepingService.selectCount(wrapper);return R.ok().put("count", count);}/*** 前端智能排序*/@IgnoreAuth@RequestMapping("/autoSort")public R autoSort(@RequestParam Map<String, Object> params,XinlicepingEntity xinliceping, HttpServletRequest request,String pre){EntityWrapper<XinlicepingEntity> ew = new EntityWrapper<XinlicepingEntity>();Map<String, Object> newMap = new HashMap<String, Object>();Map<String, Object> param = new HashMap<String, Object>();Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();while (it.hasNext()) {Map.Entry<String, Object> entry = it.next();String key = entry.getKey();String newKey = entry.getKey();if (pre.endsWith(".")) {newMap.put(pre + newKey, entry.getValue());} else if (StringUtils.isEmpty(pre)) {newMap.put(newKey, entry.getValue());} else {newMap.put(pre + "." + newKey, entry.getValue());}}params.put("sort", "clicktime");params.put("order", "desc");PageUtils page = xinlicepingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xinliceping), params), params));return R.ok().put("data", page);}}

 

 此源码非开源,若需要此源码可扫码添加微信或者qq:2214904953进行咨询!

2600多套项目欢迎咨询


http://www.ppmy.cn/ops/39102.html

相关文章

Vue 事件修饰符

1、prevent 阻止默认事件&#xff0c;a连接不跳转&#xff0c;执行showInfo方法 <a href"https://www.baidu.com/" click.prevent"showInfo">执行</a></a> 2、stop阻止冒泡&#xff0c;点击按钮,该方法不会连续重复执行 <div click&…

提取网页元数据的Python库之lassie使用详解

概要 Lassie是一个用于提取网页元数据的Python库,它能够智能地抓取网页的标题、描述、关键图像等内容。Lassie的设计目的是为了简化从各种类型的网页中提取关键信息的过程,适用于需要预览链接内容的应用场景。 安装 安装Lassie非常简单,可以通过Python的包管理器pip进行安…

会话劫持攻击就在我们身边,我们要如何防范

会话劫持攻击&#xff08;Session Hijacking&#xff09;是一种网络攻击方式&#xff0c;攻击者通过某种手段获取到用户的会话标识&#xff08;Session ID&#xff09;&#xff0c;然后使用这个会话标识冒充合法用户进行恶意操作。这种攻击方式允许攻击者以合法用户的身份访问受…

基于WPF的DynamicDataDisplay曲线显示

一、DynamicDataDisplay下载和引用 1.新建项目&#xff0c;下载DynamicDataDisplay引用&#xff1a; 如下图&#xff1a; 二、前端开发&#xff1a; <Border Grid.Row"0" Grid.Column"2" BorderBrush"Purple" BorderThickness"1"…

国产银河麒麟V10SP1系统下搭建TiDB数据库操作步骤图文

开发目的&#xff1a;在国产银河麒麟系统中搭建TiDB数据库运行环境。 开发工具&#xff1a;银河麒麟系统V10SP1TiDBMySql数据库8.0。 具体步骤&#xff1a; 1、在VmWare虚拟机中安装好国产银河麒麟V10Sp1操作系统。 2、打开终端命令&#xff0c;安装TiDB相关软件&#xff1…

Java基础知识(11)

Java基础知识&#xff08;11&#xff09; &#xff08;包括&#xff1a;IO流高级流&#xff0c;网络爬虫基础&#xff0c;Commons-i0工具包和Hutool工具包&#xff09; 目录 Java基础知识&#xff08;11&#xff09; 一.IO流高级流 1.缓冲流 【1】字节缓冲流 &#xff0…

分布式锁之RedissonLock

什么是Redisson&#xff1f; 俗话说他就是看门狗&#xff0c;看门狗机制是一种用于保持Redis连接活跃性的方法&#xff0c;通常用于分布式锁的场景。看门狗的工作原理是&#xff1a;当客户端获取到锁之后&#xff0c;会对Redis中的一个特定的键设置一个有限的过期时间&#xff…

AI 大模型训练平台

涉及重点技术内容包括&#xff1a; 数据预处理技术 利用数据挖掘、自然语言处理中的正则匹配、文本去重等技术&#xff0c;对收集的专家知识库、专业标准、知识、逻辑机理、运维经验与运行数据等资料进行冗余字符过滤、重复值删除等处理&#xff0c;提升整体预料质量。 2.指令…