Java毕设项目案例实战II基于Spring Boot的口腔管理平台(开发文档+数据库+源码)

[复制链接]
发表于 2025-11-10 22:29:00 | 显示全部楼层 |阅读模式
目次
一、媒介
二、技能先容
三、体系实现
四、核心代码
五、源码获取


   全栈码农以及结业计划实战开发,CSDN平台Java范畴新星创作者,专注于大弟子项目实战开发、解说和结业答疑辅导。获取源码接洽方式请检察文末
  一、媒介

随着口腔医疗行业的敏捷发展,医疗机构对于高效、智能的管理体系需求日益迫切。传统的纸质记载和人工管理方式不光服从低下,还轻易堕落,难以满意今世口腔医疗机构的运营需求。因此,我们开发了一款基于Spring Boot的口腔管理平台,旨在通过信息化本领,实现口腔医疗机构的高效、便捷管理。
该平台充实使用了Spring Boot框架的轻量级、高并发、易扩展等特性,连合前端技能和数据库体系,为口腔医疗机构提供了一个集患者信息管理、预约挂号、诊疗记载、费用结算、库存管理等多功能于一体的综合管理平台。通过该平台,医疗机构可以实现对患者信息的全面管理,优化诊疗流程,进步工作服从,同时为患者提供更加便捷、高效的医疗服务。
我们信托,该平台的推出将极大地推动口腔医疗行业的信息化历程,为口腔医疗机构的发展注入新的活力。在未来的日子里,我们将连续优化平台功能,提升用户体验,为口腔医疗行业的繁荣做出更大的贡献。
二、技能先容

   语言:Java
使用框架:Spring Boot
前端技能:JS、Vue 、css3
开发工具:IDEA/Eclipse
数据库:MySQL 5.7/8.0
数据库管理工具:phpstudy/Navicat
JDK版本:jdk1.8
Maven: apache-maven 3.8.1-bin
前端环境:Node.Js 12\14\16
  三、体系实现

管理员功能模块
管理员登录,通过填写注册时输入的用户名、暗码、脚色举行登录

个人中心,在个人中心页面中可以通过填写原暗码、新暗码、确认暗码等信息举行添加、修改。还可以根据必要对个人信息举行添加,修改或删除等详细使用 

会员管理,在会员管理页面中可以检察会员号、姓名、性别、手机、年事、性别、手机、邮箱、积分等信息,并可根据必要对会员管理举行详情、修改或删除等使用 

会员功能模块
会员登录进入口腔管理平台可以检察首页、个人中心、病例就诊信息管理、复查提示管理、预约挂号管理、我的收藏管理、订单管理等内容。

个人信息,在个人信息页面中通过填写会员号、姓名、性别、手机、年事、性别、手机、邮箱、积分等信息还可以根据必要对个人信息举行修改。

我的收藏管理,在我的收藏管理页面中可以检察收藏ID、表名、收藏名称、收藏图片等信息内容,而且根据必要对我的收藏管理举行修改或删除等其他详细使用 

前台首页功能模块
口腔管理平台,在口腔管理平台可以检察首页、牙齿保健产物、牙齿掩护小知识、留言反馈、个人中心、背景管理、购物车等内容

 登录、会员注册,通过会员注册获取会员号、暗码、姓名、年事、手机、邮箱等信息举行注册、登录

 牙齿保健产物,在牙齿保健产物页面可以填写产物名称、代价、产物编号、产物范例、积分、实用人群、使用方法、留意事项等信息举行立刻购买

四、核心代码

1、登录模块
  1. package com.controller;
  2. import java.util.Arrays;
  3. import java.util.Calendar;
  4. import java.util.Date;
  5. import java.util.Map;
  6. import javax.servlet.http.HttpServletRequest;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.stereotype.Controller;
  9. import org.springframework.web.bind.annotation.GetMapping;
  10. import org.springframework.web.bind.annotation.PathVariable;
  11. import org.springframework.web.bind.annotation.PostMapping;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RequestParam;
  15. import org.springframework.web.bind.annotation.ResponseBody;
  16. import org.springframework.web.bind.annotation.RestController;
  17. import com.annotation.IgnoreAuth;
  18. import com.baomidou.mybatisplus.mapper.EntityWrapper;
  19. import com.entity.TokenEntity;
  20. import com.entity.UserEntity;
  21. import com.service.TokenService;
  22. import com.service.UserService;
  23. import com.utils.CommonUtil;
  24. import com.utils.MD5Util;
  25. import com.utils.MPUtil;
  26. import com.utils.PageUtils;
  27. import com.utils.R;
  28. import com.utils.ValidatorUtils;
  29. /**
  30. * 登录相关
  31. */
  32. @RequestMapping("users")
  33. @RestController
  34. public class UserController{
  35.        
  36.         @Autowired
  37.         private UserService userService;
  38.        
  39.         @Autowired
  40.         private TokenService tokenService;
  41.         /**
  42.          * 登录
  43.          */
  44.         @IgnoreAuth
  45.         @PostMapping(value = "/login")
  46.         public R login(String username, String password, String captcha, HttpServletRequest request) {
  47.                 UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
  48.                 if(user==null || !user.getPassword().equals(password)) {
  49.                         return R.error("账号或密码不正确");
  50.                 }
  51.                 String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
  52.                 return R.ok().put("token", token);
  53.         }
  54.        
  55.         /**
  56.          * 注册
  57.          */
  58.         @IgnoreAuth
  59.         @PostMapping(value = "/register")
  60.         public R register(@RequestBody UserEntity user){
  61. //            ValidatorUtils.validateEntity(user);
  62.             if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
  63.                     return R.error("用户已存在");
  64.             }
  65.         userService.insert(user);
  66.         return R.ok();
  67.     }
  68.         /**
  69.          * 退出
  70.          */
  71.         @GetMapping(value = "logout")
  72.         public R logout(HttpServletRequest request) {
  73.                 request.getSession().invalidate();
  74.                 return R.ok("退出成功");
  75.         }
  76.        
  77.         /**
  78.      * 密码重置
  79.      */
  80.     @IgnoreAuth
  81.         @RequestMapping(value = "/resetPass")
  82.     public R resetPass(String username, HttpServletRequest request){
  83.             UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
  84.             if(user==null) {
  85.                     return R.error("账号不存在");
  86.             }
  87.             user.setPassword("123456");
  88.         userService.update(user,null);
  89.         return R.ok("密码已重置为:123456");
  90.     }
  91.        
  92.         /**
  93.      * 列表
  94.      */
  95.     @RequestMapping("/page")
  96.     public R page(@RequestParam Map<String, Object> params,UserEntity user){
  97.         EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
  98.             PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
  99.         return R.ok().put("data", page);
  100.     }
  101.         /**
  102.      * 列表
  103.      */
  104.     @RequestMapping("/list")
  105.     public R list( UserEntity user){
  106.                EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
  107.               ew.allEq(MPUtil.allEQMapPre( user, "user"));
  108.         return R.ok().put("data", userService.selectListView(ew));
  109.     }
  110.     /**
  111.      * 信息
  112.      */
  113.     @RequestMapping("/info/{id}")
  114.     public R info(@PathVariable("id") String id){
  115.         UserEntity user = userService.selectById(id);
  116.         return R.ok().put("data", user);
  117.     }
  118.    
  119.     /**
  120.      * 获取用户的session用户信息
  121.      */
  122.     @RequestMapping("/session")
  123.     public R getCurrUser(HttpServletRequest request){
  124.             Long id = (Long)request.getSession().getAttribute("userId");
  125.         UserEntity user = userService.selectById(id);
  126.         return R.ok().put("data", user);
  127.     }
  128.     /**
  129.      * 保存
  130.      */
  131.     @PostMapping("/save")
  132.     public R save(@RequestBody UserEntity user){
  133. //            ValidatorUtils.validateEntity(user);
  134.             if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
  135.                     return R.error("用户已存在");
  136.             }
  137.         userService.insert(user);
  138.         return R.ok();
  139.     }
  140.     /**
  141.      * 修改
  142.      */
  143.     @RequestMapping("/update")
  144.     public R update(@RequestBody UserEntity user){
  145. //        ValidatorUtils.validateEntity(user);
  146.         userService.updateById(user);//全部更新
  147.         return R.ok();
  148.     }
  149.     /**
  150.      * 删除
  151.      */
  152.     @RequestMapping("/delete")
  153.     public R delete(@RequestBody Long[] ids){
  154.         userService.deleteBatchIds(Arrays.asList(ids));
  155.         return R.ok();
  156.     }
  157. }
复制代码
2、文件上传模块
  1. package com.controller;
  2. import java.io.File;
  3. import java.io.FileNotFoundException;
  4. import java.io.IOException;
  5. import java.util.Arrays;
  6. import java.util.Date;
  7. import java.util.HashMap;
  8. import java.util.List;
  9. import java.util.Map;
  10. import java.util.Random;
  11. import java.util.UUID;
  12. import org.apache.commons.io.FileUtils;
  13. import org.apache.commons.lang3.StringUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.http.HttpHeaders;
  16. import org.springframework.http.HttpStatus;
  17. import org.springframework.http.MediaType;
  18. import org.springframework.http.ResponseEntity;
  19. import org.springframework.util.ResourceUtils;
  20. import org.springframework.web.bind.annotation.PathVariable;
  21. import org.springframework.web.bind.annotation.RequestBody;
  22. import org.springframework.web.bind.annotation.RequestMapping;
  23. import org.springframework.web.bind.annotation.RequestParam;
  24. import org.springframework.web.bind.annotation.RestController;
  25. import org.springframework.web.multipart.MultipartFile;
  26. import com.annotation.IgnoreAuth;
  27. import com.baomidou.mybatisplus.mapper.EntityWrapper;
  28. import com.entity.ConfigEntity;
  29. import com.entity.EIException;
  30. import com.service.ConfigService;
  31. import com.utils.R;
  32. /**
  33. * 上传文件映射表
  34. */
  35. @RestController
  36. @RequestMapping("file")
  37. @SuppressWarnings({"unchecked","rawtypes"})
  38. public class FileController{
  39.         @Autowired
  40.     private ConfigService configService;
  41.         /**
  42.          * 上传文件
  43.          */
  44.         @RequestMapping("/upload")
  45.         public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
  46.                 if (file.isEmpty()) {
  47.                         throw new EIException("上传文件不能为空");
  48.                 }
  49.                 String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
  50.                 File path = new File(ResourceUtils.getURL("classpath:static").getPath());
  51.                 if(!path.exists()) {
  52.                     path = new File("");
  53.                 }
  54.                 File upload = new File(path.getAbsolutePath(),"/upload/");
  55.                 if(!upload.exists()) {
  56.                     upload.mkdirs();
  57.                 }
  58.                 String fileName = new Date().getTime()+"."+fileExt;
  59.                 File dest = new File(upload.getAbsolutePath()+"/"+fileName);
  60.                 file.transferTo(dest);
  61.                 FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));
  62.                 if(StringUtils.isNotBlank(type) && type.equals("1")) {
  63.                         ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
  64.                         if(configEntity==null) {
  65.                                 configEntity = new ConfigEntity();
  66.                                 configEntity.setName("faceFile");
  67.                                 configEntity.setValue(fileName);
  68.                         } else {
  69.                                 configEntity.setValue(fileName);
  70.                         }
  71.                         configService.insertOrUpdate(configEntity);
  72.                 }
  73.                 return R.ok().put("file", fileName);
  74.         }
  75.        
  76.         /**
  77.          * 下载文件
  78.          */
  79.         @IgnoreAuth
  80.         @RequestMapping("/download")
  81.         public ResponseEntity<byte[]> download(@RequestParam String fileName) {
  82.                 try {
  83.                         File path = new File(ResourceUtils.getURL("classpath:static").getPath());
  84.                         if(!path.exists()) {
  85.                             path = new File("");
  86.                         }
  87.                         File upload = new File(path.getAbsolutePath(),"/upload/");
  88.                         if(!upload.exists()) {
  89.                             upload.mkdirs();
  90.                         }
  91.                         File file = new File(upload.getAbsolutePath()+"/"+fileName);
  92.                         if(file.exists()){
  93.                                 /*if(!fileService.canRead(file, SessionManager.getSessionUser())){
  94.                                         getResponse().sendError(403);
  95.                                 }*/
  96.                                 HttpHeaders headers = new HttpHeaders();
  97.                             headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);   
  98.                             headers.setContentDispositionFormData("attachment", fileName);   
  99.                             return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
  100.                         }
  101.                 } catch (IOException e) {
  102.                         e.printStackTrace();
  103.                 }
  104.                 return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
  105.         }
  106.        
  107. }
复制代码
3、代码封装
  1. package com.utils;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. /**
  5. * 返回数据
  6. */
  7. public class R extends HashMap<String, Object> {
  8.         private static final long serialVersionUID = 1L;
  9.        
  10.         public R() {
  11.                 put("code", 0);
  12.         }
  13.        
  14.         public static R error() {
  15.                 return error(500, "未知异常,请联系管理员");
  16.         }
  17.        
  18.         public static R error(String msg) {
  19.                 return error(500, msg);
  20.         }
  21.        
  22.         public static R error(int code, String msg) {
  23.                 R r = new R();
  24.                 r.put("code", code);
  25.                 r.put("msg", msg);
  26.                 return r;
  27.         }
  28.         public static R ok(String msg) {
  29.                 R r = new R();
  30.                 r.put("msg", msg);
  31.                 return r;
  32.         }
  33.        
  34.         public static R ok(Map<String, Object> map) {
  35.                 R r = new R();
  36.                 r.putAll(map);
  37.                 return r;
  38.         }
  39.        
  40.         public static R ok() {
  41.                 return new R();
  42.         }
  43.         public R put(String key, Object value) {
  44.                 super.put(key, value);
  45.                 return this;
  46.         }
  47. }
复制代码
  五、源码获取

   感谢各人点赞、收藏、关注、品评啦 、获取接洽方式在个人简介绿泡泡

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表