当前位置: 首页 > news >正文

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

前言介绍 

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

本课题在充分研究了在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.lryc.cn/news/345208.html

相关文章:

  • 机器学习算法应用——K近邻分类器(KNN)
  • python数据分析——数据的选择和运算
  • 《CKA/CKAD应试指南/从docker到kubernetes 完全攻略》学习笔记 第8章 deployment
  • 步态识别论文(6)GaitDAN: Cross-view Gait Recognition via Adversarial Domain Adaptation
  • K8S中的弹性云服务如何搭建,可能遇到的问题,如何解决!(稳啦!!!!全都稳啦!!!)
  • 新增分类——后端
  • 20232801 2023-2024-2 《网络攻防实践》实践九报告
  • 类和对象--this引用原理
  • 力扣:416. 分割等和子集(Java,动态规划:01背包问题)
  • Vue进阶之Vue项目实战(一)
  • 预告 | 飞凌嵌入式邀您共聚2024上海充换电展
  • vite 打包配置并部署到 nginx
  • ResponseHttp
  • 【题解】非对称之美(规律)
  • 遇到如此反复的外贸客户,你可以这样做~
  • 【数据库】简单SQL语句
  • K邻算法:在风险传导中的创新应用与实践价值
  • 【小白的大模型之路】基础篇:Transformer细节
  • Golang | Leetcode Golang题解之第73题矩阵置零
  • JMeter性能压测脚本录制
  • 缓存雪崩、缓存击穿、缓存穿透是什么、之间的区别及解决办法
  • Pytorch张量广播
  • AI算法-高数2-导数定义和公式
  • Vitis HLS 学习笔记--AXI_STREAM_TO_MASTER
  • WPF之可翻转面板
  • 【深度学习】--slowfast视频理解数据集处理pipeline
  • ArcGIS10.2能用了10.2.2不行了(解决)
  • mysql查询表信息(表名、表结构、字段信息等)
  • 【MySQL探索之旅】JDBC (Java连接MySQL数据库)
  • tomcat-GC溢出