末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SpringBoot
前端:Vue、HTML
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是
目录
一、项目简介
二、系统总体设计
2.1系统结构
4.2数据库概念结构设计
三、系统项目截图
3.1前台首页
3.2后台管理
四、核心代码
4.1登录相关
4.2文件上传
4.3封装
一、项目简介
会员制医疗预约服务管理信息系统是针对会员制医疗预约服务管理方面必不可少的一个部分。在会员制医疗预约服务管理的整个过程中,会员制医疗预约服务管理系统担负着最重要的角色。为满足如今日益复杂的管理需求,各类的管理系统也在不断改进。本课题所设计的是会员制医疗预约服务管理信息系统,使用java进行开发,它的优点代码不能从浏览器查看,保密性非常好,比其他的系统更具安全性。java还容易修改和调试,毕竟社会是在不断发展过程中难免有更多需求,这点很重要。而且,本系统除了有对会员制医疗预约服务的管理,还添加了对用户的资料管理,这也是为了满足系统更深层次的需求。除了上述优势外,本系统还具有:查询迅速,搜索资料方便,可靠性强等等。
二、系统总体设计
2.1系统结构
会员制医疗预约服务管理信息系统,它是一个由人、电脑及其他组件构成的,一种能够收集、存储、加工、传送信息的系统。该系统可以帮助决策者找出当前急需解决的问题,然后将信息快速的反馈,使管理人员能够以最快的时间知道目前的现状,进行更进一步的计划。
当前MIS系统结构目前存在两种较为流行的结构:C/S和B/S两种。
C/S结构的系统:C/S结构就是客户机服务器结构,它可以法派任务到Client端和Server端来进行,充分利用两端硬件环境的优势,来降低系统的通讯的花费。客户端主要作用是处理人机交互,执行客户端应用程序,收集数据以及向服务器发送任务请求。服务器基本作用是执行后台程序,它主要对客户机的请求申请进行反馈,除此之外,它的作用还包括:数据库存储系统的共享管理、通讯管理、文件管理等等。
B/S结构的系统:这种网络结构简化了客户端,并把系统功能实现的中心集中到服务器上,在这种模式中,只需要一个浏览器就可以了。这种结构将很多的工作交于WEB服务器,只通过浏览器请求WEB服务,随后根据请求返回信息。
通常在只在企业网内部使用,采用C/S。而使用不仅限于内网的情况下使用B/S。考虑到本管理系统的一系列需求,所以,该系统开发使用B/S结构开发。其主要功能结构如下图所示。
4.2数据库概念结构设计
概念结构设计是根据用户需求形成的。用最常的E-R方法描述数据模型进行数据库的概念设计,首先设计局部的E-R模式,最后各局部ER模式综合成一个全局模式。然后再把概念模式转换成逻辑模式。将概念设计从设计过程中独立开来,设计复杂程度降低,不受特定DBMS的限制。
1.所有实体和属性的定义如下所示。
医院信息管理实体属性图
药品信息管理实体属性图
三、系统项目截图
3.1前台首页
会员制医疗预约服务管理信息系统,在系统首页可以查看首页,医院信息,坐诊信息,核酸检测,疾控通知,健康资讯,就诊引导,个人中心,后台管理等内容,并进行详细操作;
医院信息,在医院信息页面可以查看医院名称,医院地址,院长,成立时间,联系电话,医院简介,医院详情等内容,并进行收藏操作
坐诊信息,在坐诊信息页面可以查看医生姓名,工号,性别,医院名称,医院地址,科室名称,科室地址,挂号费,医生简介等内容,并进行预约,咨询和收藏操作
会员注册,在会员注册页面通过填写账号、密码、确认密码、姓名、身份证、手机号码等信息进行会员注册操作
个人中心,在个人中心页面通过填写账号、密码、姓名、性别、身份证、手机号码、上传图片等内容进行更新信息,并对我的收藏进行操作
3.2后台管理
管理员登录,管理员进入系统前在登录页面根据要求填写用户名和密码,选择角色等信息,点击登录进行登录操作
管理员登录系统后,可以对首页、个人中心、会员管理、医生管理、医院信息管理、科室信息管理、坐诊信息管理、核酸检测管理、挂号预约管理、药品信息管理、诊断信息管理、处方信息管理、住院信息管理、在线咨询管理、咨询回复管理、核酸预约管理、疾控通知管理、健康资讯管理、健康档案管理、系统管理等功能进行相应的操作管理
会员管理,在会员管理页面可以对索引,账号,密码,姓名,性别,身份证,手机号码,相片等内容进行详情,修改和删除等操作
医生管理,在医生管理页面可以对索引,工号,医生姓名,性别,身份证,手机号码,相片,医院名称,医院地址,科室名称,科室地址等内容进行详情,修改和删除等操作
医院信息管理,在医院信息管理页面可以对索引,医院名称,医院地址,医院图片,院长,成立时间,联系电话等内容进行详情,修改和删除等操作
科室信息管理,在科室信息管理页面可以对索引,科室名称,科室地址内容进行详情,修改和删除等操作;
坐诊信息管理,在坐诊信息管理页面可以对索引,工号,医生姓名,性别,医院名称,医院地址,科室名称,科室地址,相片,挂号费,审核回复,审核状态,审核等内容进行详情,修改和删除等操作
核酸检测管理,在核酸检测管理页面可以对索引,检测名称,检测封面,检测地点,检测类型,费用,发布时间等内容进行详情,修改和删除等操作
药品信息管理,在药品信息管理页面可以对索引,药品名称,药品图片,药品功效,服用方式,单价,生产商内容进行详情,修改和删除等操作;
处方信息管理,在处方信息管理页面可以对索引,工号,医生姓名,医院名称,科室名称,处分名称,药品名称,单价,数量,金额,账号,姓名,操作日期,是否支付等内容进行详情和删除等操作
在线咨询管理,在在线咨询管理页面可以对索引,工号,医生姓名,咨询内容,账号,姓名,咨询日期等内容进行详情和删除等操作
健康资讯管理,在健康资讯管理页面可以对索引,资讯标题,资讯封面,资讯类型,工号,医生姓名,发布时间等内容进行详情和删除等操作
四、核心代码
4.1登录相关
package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}
4.2文件上传
package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上传文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上传文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上传文件不能为空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}/*** 下载文件*/@IgnoreAuth@RequestMapping("/download")public ResponseEntity<byte[]> download(@RequestParam String fileName) {try {File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}File file = new File(upload.getAbsolutePath()+"/"+fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); headers.setContentDispositionFormData("attachment", fileName); return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);}}
4.3封装
package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回数据*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知异常,请联系管理员");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}