当前位置: 首页 > news >正文

SpringBoot+Vue医院预约挂号系统 附带详细运行指导视频

文章目录

  • 一、项目演示
  • 二、项目介绍
  • 三、运行截图
  • 四、主要代码
    • 1.保存预约挂号代码
    • 2.后台用户登录代码
    • 3.前台医生页面代码

一、项目演示

项目演示地址: 视频地址

二、项目介绍

项目描述:这是一个基于SpringBoot+Vue框架开发的医院预约挂号系统。首先,这是一个前后端分离的项目,代码简洁规范,注释说明详细,易于理解和学习。其次,这项目功能丰富,具有一个医院预约挂号系统该有的所有功能。

项目功能:此项目分为三个角色:患者医生管理员患者有登录注册、查看医生和科室信息、预约挂号、查看预约信息、查看就诊信息和医嘱、缴费就诊信息、查看个人病历、查看个人住院信息、缴费住院信息、查看个人检查报告信息、缴费检查报告信息、查看公告信息、修改个人信息等等功能。医生有登录、查看个人数据统计信息、查看患者信息、查看医生信息、修改个人信息、查看管理员信息、查看科室信息、查看排班信息、管理本人收到的预约挂号信息、管理本人的就诊信息、管理本人创建的住院登记信息、管理本人负责的检查报告信息、查看公告信息等等功能。管理员有查看所有数据统计、管理所有患者信息、管理所有医生信息、管理所有管理员信息、管理所有科室信息、管理所有排班信息、管理所有预约挂号信息、管理所有就诊信息、管理所有住院信息、管理所有检查报告信息、管理所有公告信息等等功能。

应用技术:SpringBoot + Vue3.0 + MySQL + MyBatis + Redis + ElementUI-Plus + Vite

运行环境:IntelliJ IDEA2019.3.5 + MySQL5.7 + Redis5.0.5 + JDK1.8 + Maven3.6.3 + Node14.16.1 + Visual Studio Code(以上工具在项目压缩包中都自带)

三、运行截图

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

四、主要代码

1.保存预约挂号代码

 /*** 保存预约挂号信息* @param appointDTO* @return*/@Overridepublic ResponseDTO<Boolean> saveAppoint(AppointDTO appointDTO) {// 进行统一表单验证CodeMsg validate = ValidateEntityUtil.validate(appointDTO);if (!validate.getCode().equals(CodeMsg.SUCCESS.getCode())) {return ResponseDTO.errorByMsg(validate);}Appoint appoint = CopyUtil.copy(appointDTO, Appoint.class);if(CommonUtil.isEmpty(appoint.getId())) {// 添加操作// 判断是否已经预约AppointExample appointExample = new AppointExample();appointExample.createCriteria().andScheduleIdEqualTo(appoint.getScheduleId()).andUserIdEqualTo(appoint.getUserId());if(appointMapper.countByExample(appointExample) > 0) {return ResponseDTO.errorByMsg(CodeMsg.APPOINT_EXIST);}// 判断预约挂号人数是否已满Schedule schedule = scheduleMapper.selectByPrimaryKey(appoint.getScheduleId());if(schedule.getNowNum() + 1 > schedule.getMaxNum()) {return ResponseDTO.errorByMsg(CodeMsg.APPOINT_NUM_NOT_ENOUGH);}appoint.setId(UuidUtil.getShortUuid());appoint.setCreateTime(new Date());if(appointMapper.insertSelective(appoint) == 0) {return ResponseDTO.errorByMsg(CodeMsg.APPOINT_ADD_ERROR);}schedule.setNowNum(schedule.getNowNum() + 1);scheduleMapper.updateByPrimaryKeySelective(schedule);} else {// 修改操作Appoint appointDB = appointMapper.selectByPrimaryKey(appoint.getId());if(appointDB == null) {return ResponseDTO.errorByMsg(CodeMsg.APPOINT_NOT_EXIST);}DoctorExample doctorExample = new DoctorExample();doctorExample.createCriteria().andUserIdEqualTo(appointDB.getDoctorId());List<Doctor> doctorList = doctorMapper.selectByExample(doctorExample);if(doctorList.size() == 0) {return ResponseDTO.errorByMsg(CodeMsg.APPOINT_DOCTOR_NOT_EXIST);}if(AppointStateEnum.CANCEL.getCode().equals(appointDB.getState())) {return ResponseDTO.errorByMsg(CodeMsg.APPOINT_CANCEL);}if(AppointStateEnum.YES.getCode().equals(appointDB.getState())) {return ResponseDTO.errorByMsg(CodeMsg.APPOINT_CALL);}if(appointMapper.updateByPrimaryKeySelective(appoint) == 0) {return ResponseDTO.errorByMsg(CodeMsg.APPOINT_EDIT_ERROR);}// 如果是取消,减少已预约数量if(AppointStateEnum.CANCEL.getCode().equals(appoint.getState())) {Schedule schedule = scheduleMapper.selectByPrimaryKey(appoint.getScheduleId());if(schedule != null) {schedule.setNowNum(schedule.getNowNum() - 1);scheduleMapper.updateByPrimaryKeySelective(schedule);}}// 如果是叫号,添加对应就诊信息if(AppointStateEnum.YES.getCode().equals(appoint.getState())) {Record record = new Record();record.setId(UuidUtil.getShortUuid());record.setCreateTime(new Date());record.setPrice(doctorList.get(0).getPrice());record.setPriceInfo("挂号费:" + doctorList.get(0).getPrice() + "元");record.setDoctorId(appointDB.getDoctorId());record.setUserId(appointDB.getUserId());recordMapper.insertSelective(record);}}return ResponseDTO.success(true);}

2.后台用户登录代码

/*** 后台用户登录操作* @param userDTO* @return*/
@Override
public ResponseDTO<UserDTO> adminLogin(UserDTO userDTO) {// 进行是否为空判断if(CommonUtil.isEmpty(userDTO.getPhone())){return ResponseDTO.errorByMsg(CodeMsg.PHONE_EMPTY);}if(CommonUtil.isEmpty(userDTO.getPassword())){return ResponseDTO.errorByMsg(CodeMsg.PASSWORD_EMPTY);}// 对比姓名和密码是否正确UserExample userExample = new UserExample();userExample.createCriteria().andPhoneEqualTo(userDTO.getPhone()).andPasswordEqualTo(userDTO.getPassword()).andRoleIdEqualTo(userDTO.getRoleId());List<User> userList = userMapper.selectByExample(userExample);if(userList == null || userList.size() != 1){return ResponseDTO.errorByMsg(CodeMsg.PHONE_PASSWORD_ERROR);}// 生成登录token并存入Redis中UserDTO selectedUserDTO = CopyUtil.copy(userList.get(0), UserDTO.class);if(RoleEnum.DOCTOR.getCode().equals(selectedUserDTO.getRoleId())) {DoctorExample doctorExample = new DoctorExample();doctorExample.createCriteria().andUserIdEqualTo(selectedUserDTO.getId());List<Doctor> doctorList = doctorMapper.selectByExample(doctorExample);if(doctorList.size() > 0) {DoctorDTO doctorDTO = CopyUtil.copy(doctorList.get(0), DoctorDTO.class);Department department = departmentMapper.selectByPrimaryKey(doctorDTO.getDepartmentId());doctorDTO.setDepartmentDTO(CopyUtil.copy(department, DepartmentDTO.class));selectedUserDTO.setDoctorDTO(doctorDTO);}}String token = UuidUtil.getShortUuid();selectedUserDTO.setToken(token);//把token存入redis中 有效期1小时stringRedisTemplate.opsForValue().set("USER_" + token, JSON.toJSONString(selectedUserDTO), 3600, TimeUnit.SECONDS);return ResponseDTO.successByMsg(selectedUserDTO, "登录成功!");
}

3.前台医生页面代码

<template><div class="channel-container"><divv-for="(item, index) in departmentList":key="index"@click="changeDepartment(item.id)":class="'channel' +(item.id === searchParam.doctorDTO?.departmentId ? ' active' : '')"v-text="item.name"></div></div><el-empty v-if="doctorList.length === 0" description="暂无数据🌻" /><div class="doctor-list"><div v-for="(item, index) in doctorList" class="card" :key="index"><img class="image" :src="filterPhoto(item.headPic)" /><div class="info"><div class="username" v-text="item.username"></div><el-tag effect="dark" round type="primary">{{ item.doctorDTO.job }}</el-tag></div><divclass="description":title="item.doctorDTO.info"v-text="item.doctorDTO.info"></div><div class="price"><div class="label">挂号费:</div><div class="value" v-text="'' + item.doctorDTO.price"></div></div><el-button type="primary" @click="openAppointDialog(item.id)">挂号</el-button></div><Dialogref="appointDialogRef"width="30%"title="预约挂号"@onConfirm="saveAppoint"><template #content><el-form :model="appointForm" v-loading="loading" label-width="100px"><el-form-item label="预约日期"><el-date-picker@change="changeAppointDate":clearable="false"v-model="appointForm.appointDate":disabled-date="disableBeforeToday"value-format="YYYY-MM-DD"/></el-form-item><el-form-item label="预约时间"><el-selectstyle="width: 220px"v-model="appointForm.appointTime"placeholder="请选择预约时间"><template v-for="(item, index) in scheduleList" :key="index"><el-option v-if="item.workTime === 1" label="上午" :value="1" /><el-option v-if="item.workTime === 2" label="下午" :value="2" /></template></el-select></el-form-item><el-form-item label="剩余数量"><div v-text="getRemainNum(appointForm.appointTime)"></div></el-form-item></el-form></template></Dialog></div>
</template>
http://www.dtcms.com/a/434367.html

相关文章:

  • 85-dify案例分享-不用等 OpenAI 邀请,Dify+Sora2工作流实测:写实动漫视频随手做,插件+教程全送
  • GUI高级工程师面试题
  • 经典网站设计风格网站建设产品介绍
  • 基于单片机的人体心率、体温监测系统(论文+源码)
  • WinScp下载与安装
  • 普中stm32大Dap烧录流程
  • 宝安附近做网站公司网站做好了前端 后端怎么做
  • 新媒体营销h5制作网站中国水土保持生态建设网站
  • ubuntu 服务器(带NVLink)更新显卡驱动 (巨坑!!)
  • jQuery提供了多种选择器,可以快速获取DOM元素
  • 【LaTeX】 6 LaTeX 扩展功能
  • 软件测试基础-03(缺陷)
  • 重庆建设公司网站做网站的工作好吗
  • GitHub 热榜项目 - 日榜(2025-10-02)
  • PEFT实战LoRA微调OpenAI Whisper 中文语音识别
  • Django第三方扩展详解:提升开发效率的利器
  • 正能量不良网站直接进入自助建站系统模板
  • 考研复习-线性代数强化-向量组和方程组特征值
  • Chromium 138 编译指南 - Android 篇:环境搭建与准备(一)
  • 2023 年真题配套词汇单词笔记(考研真相)
  • Android 窗口结构(三) Home Task 添加Home ActivityRecord
  • 峨边网站建设网站iis安全配置
  • CMU与谷歌提出FM-SIREN:受奈奎斯特定理启发,让神经元“各司其职”,特征冗余降低50%
  • 【软件安全】fgets / strncpy / gets(不安全) / snprintf的对比
  • 济南免费做网站四平网站建设联系方式
  • 向量数据库前沿:Faiss 向量数据库的配置与使用
  • 机床铸铁底座在高端机床行业中的核心作用
  • 我为您整理出了 Coolify 可以添加的所有服务类型,并附上其用途说明。
  • 《回溯 C++98:string 核心机制拆解 —— 从拷贝策略到高效 swap》
  • JAVA过时了吗?