• SSM+Vue+Element-UI实现大学生心理健康系统


    文末获取源码

    开发语言:Java
    框架:SSM
    JDK版本:JDK1.8
    服务器:tomcat7
    数据库:mysql 5.7/8.0
    数据库工具:Navicat11
    开发软件:eclipse/myeclipse/idea
    Maven包:Maven3.3.9
    浏览器:谷歌浏览器

    一、前言介绍  

    本系统主要论述了如何使用JAVA语言开发一个大学生心理健康系统 ,本系统将严格按照软件开发流程进行各个阶段的工作,采用B/S架构,面向对象编程思想进行项目开发。在引言中,作者将论述心灵治愈交流平台的当前背景以及系统开发的目的,后续章节将严格按照软件开发流程,对系统进行各个阶段分析设计。

    大学生心理健康系统的主要使用者分为管理员和学生、心理咨询师,实现功能包括(1)管理员:首页、个人中心、学生管理、心理知识管理、心理咨询师管理、在线预约管理、在线留言管理、心理问卷管理、问卷测评管理、问卷评分管理、系统管理,(2)学生:首页、个人中心、在线预约管理、在线留言管理、问卷测评管理、问卷评分管理、我的收藏管理;(3)心理咨询师:首页、个人中心、心理知识管理、在线预约管理、在线留言管理、心理问卷管理、问卷测评管理、问卷评分管理,(4)前台首页;首页、心理知识、心理咨询师、心理问卷、系统公告、个人中心、后台管理等功能。由于本网站的功能模块设计比较全面,所以使得整个心灵治愈交流平台信息管理的过程得以实现。

    本系统的使用可以实现本大学生心理健康系统管理的信息化,可以方便管理员进行更加方便快捷的管理,可以提高管理人员的工作效率。

    二、系统功能分析 

    本大学生心理健康系统主要包括三大功能模块,即学生功能模块、心理咨询师功能模块和管理员功能模块。

    1)管理员模块:系统中的核心用户是管理员,管理员登录后,通过管理员来管理后台系统。主要功能有:首页、个人中心、学生管理、心理知识管理、心理咨询师管理、在线预约管理、在线留言管理、心理问卷管理、问卷测评管理、问卷评分管理、系统管理等功能。 

    (2)学生:首页、个人中心、在线预约管理、在线留言管理、问卷测评管理、问卷评分管理、我的收藏管理。 

    3)心理咨询师:页、个人中心、心理知识管理、在线预约管理、在线留言管理、心理问卷管理、问卷测评管理、问卷评分管理。 

    三、系统展示

    首页 

    心理知识

    心理咨询师 心理问卷

     

    管理员功能模块 

    心理问卷管理 

    问卷测评管理

    部分核心代码 

    上传文件

    1. /**
    2. * 上传文件
    3. */
    4. @RequestMapping("/upload")
    5. public R upload(@RequestParam("file") MultipartFile file, String type,HttpServletRequest request) throws Exception {
    6. if (file.isEmpty()) {
    7. throw new EIException("上传文件不能为空");
    8. }
    9. String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
    10. String fileName = new Date().getTime()+"."+fileExt;
    11. File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
    12. file.transferTo(dest);
    13. if(StringUtils.isNotBlank(type) && type.equals("1")) {
    14. ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
    15. if(configEntity==null) {
    16. configEntity = new ConfigEntity();
    17. configEntity.setName("faceFile");
    18. configEntity.setValue(fileName);
    19. } else {
    20. configEntity.setValue(fileName);
    21. }
    22. configService.insertOrUpdate(configEntity);
    23. }
    24. return R.ok().put("file", fileName);
    25. }

    问卷测评

    1. /**
    2. * 问卷测评
    3. * 后端接口
    4. * @author
    5. * @email
    6. * @date 2021-03-25 11:38:38
    7. */
    8. @RestController
    9. @RequestMapping("/wenjuanceping")
    10. public class WenjuancepingController {
    11. @Autowired
    12. private WenjuancepingService wenjuancepingService;
    13. /**
    14. * 后端列表
    15. */
    16. @RequestMapping("/page")
    17. public R page(@RequestParam Map<String, Object> params,WenjuancepingEntity wenjuanceping,
    18. HttpServletRequest request){
    19. String tableName = request.getSession().getAttribute("tableName").toString();
    20. if(tableName.equals("xinlizixunshi")) {
    21. wenjuanceping.setZixunshizhanghao((String)request.getSession().getAttribute("username"));
    22. }
    23. if(tableName.equals("xuesheng")) {
    24. wenjuanceping.setXueshengzhanghao((String)request.getSession().getAttribute("username"));
    25. }
    26. EntityWrapper<WenjuancepingEntity> ew = new EntityWrapper<WenjuancepingEntity>();
    27. PageUtils page = wenjuancepingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wenjuanceping), params), params));
    28. return R.ok().put("data", page);
    29. }
    30. /**
    31. * 前端列表
    32. */
    33. @RequestMapping("/list")
    34. public R list(@RequestParam Map<String, Object> params,WenjuancepingEntity wenjuanceping, HttpServletRequest request){
    35. EntityWrapper<WenjuancepingEntity> ew = new EntityWrapper<WenjuancepingEntity>();
    36. PageUtils page = wenjuancepingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wenjuanceping), params), params));
    37. return R.ok().put("data", page);
    38. }
    39. /**
    40. * 列表
    41. */
    42. @RequestMapping("/lists")
    43. public R list( WenjuancepingEntity wenjuanceping){
    44. EntityWrapper<WenjuancepingEntity> ew = new EntityWrapper<WenjuancepingEntity>();
    45. ew.allEq(MPUtil.allEQMapPre( wenjuanceping, "wenjuanceping"));
    46. return R.ok().put("data", wenjuancepingService.selectListView(ew));
    47. }
    48. /**
    49. * 查询
    50. */
    51. @RequestMapping("/query")
    52. public R query(WenjuancepingEntity wenjuanceping){
    53. EntityWrapper< WenjuancepingEntity> ew = new EntityWrapper< WenjuancepingEntity>();
    54. ew.allEq(MPUtil.allEQMapPre( wenjuanceping, "wenjuanceping"));
    55. WenjuancepingView wenjuancepingView = wenjuancepingService.selectView(ew);
    56. return R.ok("查询问卷测评成功").put("data", wenjuancepingView);
    57. }
    58. /**
    59. * 后端详情
    60. */
    61. @RequestMapping("/info/{id}")
    62. public R info(@PathVariable("id") Long id){
    63. WenjuancepingEntity wenjuanceping = wenjuancepingService.selectById(id);
    64. return R.ok().put("data", wenjuanceping);
    65. }
    66. /**
    67. * 前端详情
    68. */
    69. @RequestMapping("/detail/{id}")
    70. public R detail(@PathVariable("id") Long id){
    71. WenjuancepingEntity wenjuanceping = wenjuancepingService.selectById(id);
    72. return R.ok().put("data", wenjuanceping);
    73. }
    74. /**
    75. * 后端保存
    76. */
    77. @RequestMapping("/save")
    78. public R save(@RequestBody WenjuancepingEntity wenjuanceping, HttpServletRequest request){
    79. wenjuanceping.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    80. //ValidatorUtils.validateEntity(wenjuanceping);
    81. wenjuancepingService.insert(wenjuanceping);
    82. return R.ok();
    83. }
    84. /**
    85. * 前端保存
    86. */
    87. @RequestMapping("/add")
    88. public R add(@RequestBody WenjuancepingEntity wenjuanceping, HttpServletRequest request){
    89. wenjuanceping.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    90. //ValidatorUtils.validateEntity(wenjuanceping);
    91. wenjuancepingService.insert(wenjuanceping);
    92. return R.ok();
    93. }
    94. /**
    95. * 修改
    96. */
    97. @RequestMapping("/update")
    98. public R update(@RequestBody WenjuancepingEntity wenjuanceping, HttpServletRequest request){
    99. //ValidatorUtils.validateEntity(wenjuanceping);
    100. wenjuancepingService.updateById(wenjuanceping);//全部更新
    101. return R.ok();
    102. }
    103. /**
    104. * 删除
    105. */
    106. @RequestMapping("/delete")
    107. public R delete(@RequestBody Long[] ids){
    108. wenjuancepingService.deleteBatchIds(Arrays.asList(ids));
    109. return R.ok();
    110. }
    111. /**
    112. * 提醒接口
    113. */
    114. @RequestMapping("/remind/{columnName}/{type}")
    115. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
    116. @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
    117. map.put("column", columnName);
    118. map.put("type", type);
    119. if(type.equals("2")) {
    120. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    121. Calendar c = Calendar.getInstance();
    122. Date remindStartDate = null;
    123. Date remindEndDate = null;
    124. if(map.get("remindstart")!=null) {
    125. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    126. c.setTime(new Date());
    127. c.add(Calendar.DAY_OF_MONTH,remindStart);
    128. remindStartDate = c.getTime();
    129. map.put("remindstart", sdf.format(remindStartDate));
    130. }
    131. if(map.get("remindend")!=null) {
    132. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    133. c.setTime(new Date());
    134. c.add(Calendar.DAY_OF_MONTH,remindEnd);
    135. remindEndDate = c.getTime();
    136. map.put("remindend", sdf.format(remindEndDate));
    137. }
    138. }
    139. Wrapper<WenjuancepingEntity> wrapper = new EntityWrapper<WenjuancepingEntity>();
    140. if(map.get("remindstart")!=null) {
    141. wrapper.ge(columnName, map.get("remindstart"));
    142. }
    143. if(map.get("remindend")!=null) {
    144. wrapper.le(columnName, map.get("remindend"));
    145. }
    146. String tableName = request.getSession().getAttribute("tableName").toString();
    147. if(tableName.equals("xinlizixunshi")) {
    148. wrapper.eq("zixunshizhanghao", (String)request.getSession().getAttribute("username"));
    149. }
    150. if(tableName.equals("xuesheng")) {
    151. wrapper.eq("xueshengzhanghao", (String)request.getSession().getAttribute("username"));
    152. }
    153. int count = wenjuancepingService.selectCount(wrapper);
    154. return R.ok().put("count", count);
    155. }
    156. }

    学生登录

    1. /**
    2. * 登录
    3. */
    4. @IgnoreAuth
    5. @RequestMapping(value = "/login")
    6. public R login(String username, String password, String captcha, HttpServletRequest request) {
    7. XueshengEntity user = xueshengService.selectOne(new EntityWrapper<XueshengEntity>().eq("xueshengzhanghao", username));
    8. if(user==null || !user.getMima().equals(password)) {
    9. return R.error("账号或密码不正确");
    10. }
    11. String token = tokenService.generateToken(user.getId(), username,"xuesheng", "学生" );
    12. return R.ok().put("token", token);
    13. }
  • 相关阅读:
    【数据结构】交换排序
    EasyExcel实现动态列解析和存表
    前后端分离前端部署方案是什么?
    volatile 关键字
    爆款视频怎么做?这里或许有答案
    2347. 最好的扑克手牌-双百代码
    【Leetcode】446. Arithmetic Slices II - Subsequence
    微信建行支付对接
    Magicodes.Pay已支持Volo Abp
    Java--Spring和MyBatis集成
  • 原文地址:https://blog.csdn.net/m0_49113107/article/details/126675256