基于javaweb的SpringBoot医疗病历交互系统(java+springboot+mybaits+vue+elementui+mysql)

运行环境

Java≥8、MySQL≥5.7、Node.js≥14

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可

❗没学过node.js的不要搞前后端分离项目

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

161125020706

181125020706

191125020706

201125020706

211125020706

221125020706

231125020706

241125020706

251125020706

261125020706

基于javaweb的SpringBoot医疗病历交互系统(java+springboot+mybaits+vue+elementui+mysql)

项目介绍

springboot基于B2B平台的医疗病历交互系统

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 

4.数据库:MySql 5.7/8.0版本均可;

5.是否Maven项目:是;

技术栈

后端:SpringBoot+Mybaits

前端:Vue + elementui

使用说明

项目运行:

  1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;

  2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;

  3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;

  4. 运行项目,在浏览器中输入地址:

前台地址:http://localhost:8080/springbootrpj39/front/index.html

后台地址

http://localhost:8080/springbootrpj39/admin/dist/index.html

管理员 abo 密码 abo

用户:用户1 密码: 123456

注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。

病人控制器: 

/**

  • 病人控制器

*/

@Controller

@RequestMapping(“/info”)

public class InfoController extends BaseController {

private String PREFIX = “/user/info/“;

@Autowired

private IInfoService infoService;

/**

  • 跳转到病人首页

*/

@RequestMapping(“”)

public String index() {

return PREFIX + “info.html”;

/**

  • 跳转到添加病人

*/

@RequestMapping(“/info_add”)

public String infoAdd() {

return PREFIX + “info_add.html”;

/**

  • 跳转到修改病人

*/

@RequestMapping(“/info_update/{infoId}”)

public String infoUpdate(@PathVariable Integer infoId, Model model) {

Info info = infoService.selectById(infoId);

model.addAttribute(“item”,info);

LogObjectHolder.me().set(info);

return PREFIX + “info_edit.html”;

/**

  • 获取病人列表

*/

@RequestMapping(value = “/list”)

@ResponseBody

public Object list(String condition) {

return infoService.selectList(null);

/**

  • 新增病人

*/

@RequestMapping(value = “/add”)

@ResponseBody

public Object add(Info info) {

infoService.insert(info);

return SUCCESS_TIP;

/**

  • 删除病人

*/

@RequestMapping(value = “/delete”)

@ResponseBody

public Object delete(@RequestParam Integer infoId) {

infoService.deleteById(infoId);

return SUCCESS_TIP;

/**

  • 修改病人

*/

@RequestMapping(value = “/update”)

@ResponseBody

public Object update(Info info) {

infoService.updateById(info);

return SUCCESS_TIP;

/**

  • 病人详情

*/

@RequestMapping(value = “/detail/{infoId}”)

@ResponseBody

public Object detail(@PathVariable(“infoId”) Integer infoId) {

return infoService.selectById(infoId);

角色控制器:

/**

  • 角色控制器

*/

@Controller

@RequestMapping(“/role”)

public class RoleController extends BaseController {

private static String PREFIX = “/system/role”;

@Autowired

private IUserService userService;

@Autowired

private IRoleService roleService;

/**

  • 跳转到角色列表页面

*/

@RequestMapping(“”)

public String index() {

return PREFIX + “/role.html”;

/**

  • 跳转到添加角色

*/

@RequestMapping(value = “/role_add”)

public String roleAdd() {

return PREFIX + “/role_add.html”;

/**

  • 跳转到修改角色

*/

@Permission

@RequestMapping(value = “/role_edit/{roleId}”)

public String roleEdit(@PathVariable Integer roleId, Model model) {

if (ToolUtil.isEmpty(roleId)) {

throw new ServiceException(BizExceptionEnum.REQUEST_NULL);

Role role = this.roleService.selectById(roleId);

model.addAttribute(role);

model.addAttribute(“pName”, ConstantFactory.me().getSingleRoleName(role.getPid()));

model.addAttribute(“deptName”, ConstantFactory.me().getDeptName(role.getDeptid()));

LogObjectHolder.me().set(role);

return PREFIX + “/role_edit.html”;

/**

  • 跳转到角色分配

*/

@Permission

@RequestMapping(value = “/role_assign/{roleId}”)

public String roleAssign(@PathVariable(“roleId”) Integer roleId, Model model) {

if (ToolUtil.isEmpty(roleId)) {

throw new ServiceException(BizExceptionEnum.REQUEST_NULL);

model.addAttribute(“roleId”, roleId);

model.addAttribute(“roleName”, ConstantFactory.me().getSingleRoleName(roleId));

return PREFIX + “/role_assign.html”;

/**

  • 获取角色列表

*/

@Permission

@RequestMapping(value = “/list”)

@ResponseBody

public Object list(@RequestParam(required = false) String roleName) {

List<Map<String, Object>> roles = this.roleService.selectRoles(super.getPara(“roleName”));

return super.warpObject(new RoleWarpper(roles));

/**

  • 角色新增

*/

@RequestMapping(value = “/add”)

@BussinessLog(value = “添加角色”, key = “name”, dict = RoleDict.class)

@Permission(Const.ADMIN_NAME)

@ResponseBody

public ResponseData add(@Valid Role role, BindingResult result) {

if (result.hasErrors()) {

throw new ServiceException(BizExceptionEnum.REQUEST_NULL);

role.setId(null);

this.roleService.insert(role);

return SUCCESS_TIP;

/**

  • 角色修改

*/

@RequestMapping(value = “/edit”)

@BussinessLog(value = “修改角色”, key = “name”, dict = RoleDict.class)

@Permission(Const.ADMIN_NAME)

@ResponseBody

public ResponseData edit(@Valid Role role, BindingResult result) {

if (result.hasErrors()) {

throw new ServiceException(BizExceptionEnum.REQUEST_NULL);

this.roleService.updateById(role);

//删除缓存

CacheUtil.removeAll(Cache.CONSTANT);

return SUCCESS_TIP;

/**

  • 删除角色

*/

@RequestMapping(value = “/remove”)

@BussinessLog(value = “删除角色”, key = “roleId”, dict = RoleDict.class)

@Permission(Const.ADMIN_NAME)

@ResponseBody

public ResponseData remove(@RequestParam Integer roleId) {

if (ToolUtil.isEmpty(roleId)) {

throw new ServiceException(BizExceptionEnum.REQUEST_NULL);

//不能删除超级管理员角色

if (roleId.equals(Const.ADMIN_ROLE_ID)) {

throw new ServiceException(BizExceptionEnum.CANT_DELETE_ADMIN);

//缓存被删除的角色名称

LogObjectHolder.me().set(ConstantFactory.me().getSingleRoleName(roleId));

this.roleService.delRoleById(roleId);

//删除缓存

CacheUtil.removeAll(Cache.CONSTANT);

return SUCCESS_TIP;

/**

  • 查看角色

*/

@RequestMapping(value = “/view/{roleId}”)

@ResponseBody

public ResponseData view(@PathVariable Integer roleId) {

if (ToolUtil.isEmpty(roleId)) {

throw new ServiceException(BizExceptionEnum.REQUEST_NULL);

this.roleService.selectById(roleId);

return SUCCESS_TIP;

/**

  • 配置权限

*/

@RequestMapping(“/setAuthority”)

@BussinessLog(value = “配置权限”, key = “roleId,ids”, dict = RoleDict.class)

@Permission(Const.ADMIN_NAME)

@ResponseBody

public ResponseData setAuthority(@RequestParam(“roleId”) Integer roleId, @RequestParam(“ids”) String ids) {

if (ToolUtil.isOneEmpty(roleId)) {

throw new ServiceException(BizExceptionEnum.REQUEST_NULL);

this.roleService.setAuthority(roleId, ids);

return SUCCESS_TIP;

/**

  • 获取角色列表

*/

@RequestMapping(value = “/roleTreeList”)

@ResponseBody

public List roleTreeList() {

List roleTreeList = this.roleService.roleTreeList();

roleTreeList.add(ZTreeNode.createParent());

return roleTreeList;

/**

  • 获取角色列表

*/

@RequestMapping(value = “/roleTreeListByUserId/{userId}”)

@ResponseBody

public List roleTreeListByUserId(@PathVariable Integer userId) {

User theUser = this.userService.selectById(userId);

String roleid = theUser.getRoleid();

if (ToolUtil.isEmpty(roleid)) {

return this.roleService.roleTreeList();

} else {

String[] strArray = roleid.split(“,”);

return this.roleService.roleTreeListByRoleId(strArray);

登录控制器:

/**

  • 登录控制器

*/

@Controller

public class LoginController extends BaseController {

@Autowired

private IMenuService menuService;

@Autowired

private IUserService userService;

/**

  • 跳转到主页

*/

@RequestMapping(value = “/“, method = RequestMethod.GET)

public String index(Model model) {

//获取菜单列表

List roleList = ShiroKit.getUser().getRoleList();

if (roleList == null || roleList.size() == 0) {

ShiroKit.getSubject().logout();

model.addAttribute(“tips”, “该用户没有角色,无法登陆”);

return “/login.html”;

List menus = menuService.getMenusByRoleIds(roleList);

List titles = MenuNode.buildTitle(menus);

titles = ApiMenuFilter.build(titles);

model.addAttribute(“titles”, titles);

//获取用户头像

Integer id = ShiroKit.getUser().getId();

User user = userService.selectById(id);

String avatar = user.getAvatar();

model.addAttribute(“avatar”, avatar);

return “/index.html”;

/**

  • 跳转到登录页面

*/

@RequestMapping(value = “/login”, method = RequestMethod.GET)

public String login() {

if (ShiroKit.isAuthenticated() || ShiroKit.getUser() != null) {

return REDIRECT + “/“;

} else {

return “/login.html”;

/**

  • 点击登录执行的动作

*/

@RequestMapping(value = “/login”, method = RequestMethod.POST)

public String loginVali() {

String username = super.getPara(“username”).trim();

String password = super.getPara(“password”).trim();

String remember = super.getPara(“remember”);

//验证验证码是否正确

if (KaptchaUtil.getKaptchaOnOff()) {

String kaptcha = super.getPara(“kaptcha”).trim();

String code = (String) super.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY);

if (ToolUtil.isEmpty(kaptcha) || !kaptcha.equalsIgnoreCase(code)) {

throw new InvalidKaptchaException();

Subject currentUser = ShiroKit.getSubject();

UsernamePasswordToken token = new UsernamePasswordToken(username, password.toCharArray());

if (“on”.equals(remember)) {

token.setRememberMe(true);

} else {

token.setRememberMe(false);

currentUser.login(token);

ShiroUser shiroUser = ShiroKit.getUser();

super.getSession().setAttribute(“shiroUser”, shiroUser);

super.getSession().setAttribute(“username”, shiroUser.getAccount());

LogManager.me().executeLog(LogTaskFactory.loginLog(shiroUser.getId(), getIp()));

ShiroKit.getSession().setAttribute(“sessionFlag”, true);

return REDIRECT + “/“;

/**

  • 退出登录

*/

@RequestMapping(value = “/logout”, method = RequestMethod.GET)

public String logOut() {

LogManager.me().executeLog(LogTaskFactory.exitLog(ShiroKit.getUser().getId(), getIp()));

ShiroKit.getSubject().logout();

deleteAllCookie();

return REDIRECT + “/login”;


项目链接:
https://javayms.github.io?id=271125130706201qh
https://javayms.pages.dev?id=271125130706201qh