——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明







基于javaweb的SpringBoot大学生健康档案管理系统(java+mybatis+springboot+maven+vue+mysql)
项目介绍
大学生健康档案管理系统,目前演示数据中主要包括三种角色:管理员、医生、学生;其中管理员包含最高权限;可对体检表,健康文档,体检数据图标展示等进行管理,以及权限管理,指定不同科室医生进行不同的操作。此项目为前后端分离项目,后端API接口为SpringBoot项目;前端为vue项目;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 8.0版本;
软件架构说明
安装教程
运行项目成功后,在浏览器中输入地址:http://localhost:8083 即可登录;
管理员账号:admin 密码:123456
外科医生账号:waike 密码:123
学生账号:631507030104 密码:123
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| @GetMapping(value = "delete/{id}") @RequiresPermissions("resource:delete") public ResponseEntity<String> delete(@PathVariable("id") Integer id) { ResponseEntity<String> data = super.delete(id); if (data.getStatusCodeValue() == PASS_CODE){ shiroService.updatePermission(); } return data;
} } package com.cqjtu.studentdocument.controller;
@Slf4j public abstract class BaseController<S extends BaseService<T>,T,ID extends Serializable> {
@Autowired protected S service;
@ApiOperation(value = "基础接口: 新增操作") @PostMapping(value = "add") public ResponseEntity<T> save(@RequestBody T entity){ try { if ( service.insert(entity)<1){ throw new MyException(ExceptionEnums.ADD_ERROR); } }catch (Exception e){
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| @GetMapping(value = "delete/{id}") public ResponseEntity<String> delete(@PathVariable("id")Integer id) { return super.delete(id); }
@ApiOperation(value = "用户登录接口") @RequestMapping("login") public ResponseEntity<User> login(@RequestBody User entity, HttpServletRequest request){ UsernamePasswordToken token = new UsernamePasswordToken(entity.getUsername(), entity.getPassword()); Subject subject = SecurityUtils.getSubject(); try { subject.login(token); User user = (User) subject.getPrincipal(); return ResponseEntity.ok(user); } catch (Exception e) { log.info("登陆失败:"+e.getMessage()); throw e; } }
@ApiOperation(value = "用户注销接口") @GetMapping("/loginOut") public ResponseEntity<String> loginOut(){ Subject subject = SecurityUtils.getSubject(); if (subject!=null){ subject.logout(); } return ResponseEntity.ok("退出登录");
}
@ApiOperation(value = "获取所有相应角色用户") @GetMapping("/getAllStudent/{roleId}") public ResponseEntity<List<User>> getAllStudent(@PathVariable("roleId") String roleId){ Example example = new Example(User.class); example.createCriteria().andEqualTo("roleId",roleId); List<User> users = this.service.selectByExample(example); return ResponseEntity.ok(users); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| @GetMapping("/getRoles/{resourceId}") @ResponseBody @ApiOperation(value = "获取某个资源下面所有绑定的角色") List<Integer> getRoleListByResourceId(@PathVariable("resourceId") Integer resourceId){ return this.service.getRoleIds(resourceId); }
@PostMapping("/saveBind") @ApiOperation(value = "删除原资源下面的所有角色,然后加上现在的所有角色") ResponseEntity<String> saveBind(@RequestBody BindInfo bindInfo){ try { if (Objects.equals(bindInfo.getRoleList(),this.getRoleListByResourceId(bindInfo.getResourceId()))){ return ResponseEntity.ok("资源信息已保存,权限信息未发生更改!"); }else { this.service.deleteBindInfo(bindInfo.getResourceId()); this.service.addBindInfo(bindInfo.getResourceId(),bindInfo.getRoleList()); } }catch (Exception e){ throw new MyException(ExceptionEnums.UPDATE_ERROR); } return ResponseEntity.ok("更新权限信息成功"); } } package com.cqjtu.studentdocument.controller;
@Api(description = "健康文档相关接口") @Controller @RequestMapping(value = "api/healthDocument") public class HealthDocumentController extends BaseController<HealthDocumentService,HealthDocument,Integer> {
@Override @RequiresPermissions("healthDocument:add") public ResponseEntity<HealthDocument> save(@RequestBody HealthDocument entity) { if (entity.getIsPublished()==1){ entity.setPublishData(new Date()); } return super.save(entity); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
@Api(description = "角色资源绑定相关接口") @Controller @RequestMapping(value = "api/roleResourceBind") public class RoleResourceBindController extends BaseController<RoleResourceBindService,RoleResourceBind,Integer> {
@GetMapping("/getRoles/{resourceId}") @ResponseBody @ApiOperation(value = "获取某个资源下面所有绑定的角色") List<Integer> getRoleListByResourceId(@PathVariable("resourceId") Integer resourceId){ return this.service.getRoleIds(resourceId); }
@PostMapping("/saveBind") @ApiOperation(value = "删除原资源下面的所有角色,然后加上现在的所有角色") ResponseEntity<String> saveBind(@RequestBody BindInfo bindInfo){ try { if (Objects.equals(bindInfo.getRoleList(),this.getRoleListByResourceId(bindInfo.getResourceId()))){ return ResponseEntity.ok("资源信息已保存,权限信息未发生更改!"); }else { this.service.deleteBindInfo(bindInfo.getResourceId()); this.service.addBindInfo(bindInfo.getResourceId(),bindInfo.getRoleList()); } }catch (Exception e){ throw new MyException(ExceptionEnums.UPDATE_ERROR); } return ResponseEntity.ok("更新权限信息成功"); } } package com.cqjtu.studentdocument.controller;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| @Autowired protected S service;
@ApiOperation(value = "基础接口: 新增操作") @PostMapping(value = "add") public ResponseEntity<T> save(@RequestBody T entity){ try { if ( service.insert(entity)<1){ throw new MyException(ExceptionEnums.ADD_ERROR); } }catch (Exception e){ log.error(e.getMessage()); throw new MyException(ExceptionEnums.ADD_ERROR); } return ResponseEntity.ok(entity); }
@ApiOperation(value = "基础接口: 返回指定ID的数据") @GetMapping(value = "get/{id}") public ResponseEntity<T> get(@PathVariable("id")ID id){ T t = null; try { t = service.selectByKey(id); }catch (Exception e){ log.error(e.getMessage()); throw new MyException(ExceptionEnums.GET_ITEM); } return ResponseEntity.ok(t); }
@ApiOperation(value = "基础接口: 返回所有数据") @GetMapping(value = "all") public ResponseEntity<List<T>> all(){ List<T> list; try { list = service.selectAll(); }catch (Exception e){ log.error(e.getMessage()); throw new MyException(ExceptionEnums.GET_LIST_ERROR); } return ResponseEntity.ok(list); }
@ApiOperation(value = "基础接口: 分页返回数据") @PostMapping(value = "page") public ResponseEntity<PageInfo<T>> page(@RequestBody Condition condition){ PageInfo<T> page ;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| */ @Slf4j public abstract class BaseController<S extends BaseService<T>,T,ID extends Serializable> {
@Autowired protected S service;
@ApiOperation(value = "基础接口: 新增操作") @PostMapping(value = "add") public ResponseEntity<T> save(@RequestBody T entity){ try { if ( service.insert(entity)<1){ throw new MyException(ExceptionEnums.ADD_ERROR); } }catch (Exception e){ log.error(e.getMessage()); throw new MyException(ExceptionEnums.ADD_ERROR); } return ResponseEntity.ok(entity); }
@ApiOperation(value = "基础接口: 返回指定ID的数据") @GetMapping(value = "get/{id}") public ResponseEntity<T> get(@PathVariable("id")ID id){ T t = null; try { t = service.selectByKey(id); }catch (Exception e){ log.error(e.getMessage()); throw new MyException(ExceptionEnums.GET_ITEM); } return ResponseEntity.ok(t); }
@ApiOperation(value = "基础接口: 返回所有数据") @GetMapping(value = "all") public ResponseEntity<List<T>> all(){ List<T> list; try { list = service.selectAll(); }catch (Exception e){ log.error(e.getMessage()); throw new MyException(ExceptionEnums.GET_LIST_ERROR); } return ResponseEntity.ok(list);
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=041222062008200we
https://javayms.pages.dev?id=041222062008200we