> 文档中心 > java课程设计:基于SSM实现个人健康管理系统

java课程设计:基于SSM实现个人健康管理系统


作者主页:编程指南针

作者简介:Java领域优质创作者、CSDN博客专家 、掘金特邀作者、多年架构师设计经验、腾讯课堂常驻讲师

主要内容:Java项目、毕业设计、简历模板、学习资料、面试题库、技术互助

文末获取源码 

一,项目简介

本次开发设计的个人健康管理系统,主要基于SSM实现对个人健康信息的管理,实现在疫情期间进行个人健康状态的上报管理,便于对个人的健康状况及时进行了解,以便于疫情的防控。主要包含注册登陆,个人每日健康上报,历史上报记录查询,个人信息修改,图形报表展示报告等几个模块。

二,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

开发技术:spring+springmvc+mybatis+mysql+jsp+bootstrap

三,系统展示

 项目展示:

用户登陆功能展示:

用户在线注册功能:

个人健康信息记录上报

每日健康打卡

查看个人历史上报记录:

修改个人上报详情信息:

个人健康报告查询:

四,核心代码展示

package top.beansprout.health.controller;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;import top.beansprout.health.constant.SysConstant;import top.beansprout.health.model.vo.BusinessException;import top.beansprout.health.model.vo.UserLoginVo;import top.beansprout.health.util.PublicUtils;/**  * 

Title: BaseController

*

Description: 基本信息处理

* */public class BaseController {@Autowiredprivate HttpServletRequest request;public UserLoginVo getUserInfo() {final Object userObject = request.getSession().getAttribute(SysConstant.INIT_FIELD_USER_VO);if (PublicUtils.isNotBlank(userObject))return (UserLoginVo) userObject;throw new BusinessException("login", "身份信息已过期,请重新登录");}public int getUserId() {return getUserInfo().getId();}}
package top.beansprout.health.controller;import java.util.Date;import javax.validation.Valid;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.format.annotation.DateTimeFormat;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.DeleteMapping;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.ResponseBody;import top.beansprout.health.model.dto.BodyInfoQuery;import top.beansprout.health.model.dto.BodyInfoSaveDto;import top.beansprout.health.model.vo.R;import top.beansprout.health.service.HealthService;/** * 

Title: HealthController

*

Description: 健康管理接口

* */@Controller@RequestMapping("/health")public class HealthController extends BaseController {@Autowiredprivate HealthService healthService;// 保存身体信息@ResponseBody@PostMapping("/saveBodyInfo")public R saveBodyInfo(@RequestBody @Valid BodyInfoSaveDto bodyInfoSaveDto) {healthService.saveBodyInfo(getUserId(), bodyInfoSaveDto);return R.okAsAjax();}// 身体信息列表@ResponseBody@GetMapping("/bodyInfoList")public R bodyInfoList(@Valid BodyInfoQuery bodyInfoQuery) {return R.okAsAjax(healthService.bodyInfoList(getUserId(), bodyInfoQuery));}// 删除身体信息@ResponseBody@DeleteMapping("/{id}")public R saveBodyInfo(@PathVariable int id) {healthService.deleteBodyInfo(getUserId(), id);return R.okAsAjax();}// 获取身体信息@ResponseBody@GetMapping("/{id}")public R getBodyInfo(@PathVariable int id) {return R.okAsAjax(healthService.getBodyInfo(getUserId(), id));}// 身体信息统计@ResponseBody@GetMapping("/bodyInfoStatistics")public R bodyInfoStatistics(@DateTimeFormat(pattern = "yyyy-MM-dd") Date date) {return R.okAsAjax(healthService.getBodyStatistics(getUserId(), date));}}

package top.beansprout.health.controller;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.GetMapping;/**  * 

Title: PageController

*

Description: 页面管理

* */@Controllerpublic class PageController {// 根页面@GetMapping("/")public String rootView() {return "redirect:/login";}// 登录页面@GetMapping("/login")public String loginView() {return "../../index";}// 注册页面@GetMapping("/register")public String registerView() {return "register";}// 主页面@GetMapping("/home")public String homeView() {return "home";}// 用户信息页面@GetMapping("/userInfo")public String userInfoView() {return "userInfo";}// 用户信息页面@GetMapping("/updatePassword")public String updatePasswordView() {return "updatePassword";}// 用户身体信息录入页面@GetMapping("/bodyInfoInput")public String bodyInfoInputView() {return "bodyInfoInput";}// 用户身体信息列表页面@GetMapping("/bodyInofList")public String bodyInofListView() {return "bodyInofList";}// 用户身体信息统计页面@GetMapping("/bodyInofStatistics")public String bodyInofStatisticsView() {return "bodyInofStatistics";}}
package top.beansprout.health.controller;import javax.servlet.http.HttpServletRequest;import javax.validation.Valid;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.http.MediaType;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.PutMapping;import org.springframework.web.bind.annotation.RequestBody;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody;import top.beansprout.health.model.dto.UserLoginDto;import top.beansprout.health.model.dto.UserRegisterDto;import top.beansprout.health.model.dto.UserUpdateInfoDto;import top.beansprout.health.model.dto.UserUpdatePasswordDto;import top.beansprout.health.model.vo.R;import top.beansprout.health.service.UserService;/** * 

Title: UserController

*

Description: 用户管理接口

* */@Controller@RequestMapping("/user")public class UserController extends BaseController {@Autowiredprivate UserService userService;// 登录@ResponseBody@PostMapping("/login")public R login(@Valid UserLoginDto userLoginDto) {return R.okAsAjax(userService.login(userLoginDto));}// 注册@ResponseBody@PostMapping("/register")public R register(@Valid UserRegisterDto userRegisterDto) {userService.register(userRegisterDto);return R.okAsAjax();}// 登出@GetMapping("/logout")public String logout(HttpServletRequest request) {userService.logout(request);return "redirect:/login?target=redirect";}// 修改密码@ResponseBody@PutMapping("/updatePassword")public R updatePassword(HttpServletRequest request, @RequestBody @Valid UserUpdatePasswordDto updatePasswordDto) {userService.updatePassword(request, getUserId(), updatePasswordDto);return R.okAsAjax();}// 修改用户信息@ResponseBody@PostMapping(value = "/updateUserInfo", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)public R updateUserInfo(@Valid UserUpdateInfoDto userUpdateInfoDto) {return R.okAsAjax(userService.updateUserInfo(getUserId(), userUpdateInfoDto));}}

五,项目总结

本项目实现,简洁大方,主要完成个人健康状况申报功能,适合做课设或作业使用