项目介绍
医院管理系统,分为管理员、医生、病人三种角色;
管理员主要功能包括:
首页、系统管理:医生管理、患者管理、药品管理;预约管理;病史管理;住院信息管理;管理员用户管理;
医生主要功能包括:首页、就医/查看病史;
病人主要功能包括:首页、病史、住院信息、挂号;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目
6.数据库:MySql 5.7版本;
技术栈
后端:SpringBoot
前端:Layui+Freemaker
使用说明
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
Doctor loginDoctorUser = doctorService.findByLoginDoctorUser();
Long doctorId = loginDoctorUser.getId();
model.addAttribute("title","住院信息");
model.addAttribute("pageBean",bedAllotService.findByDoctor(pageBean,doctorId));
return "admin/doctor/bedAllot";
}
}
病房管理控制层:
/***
* 病房管理控制层
*/
@Controller
@RequestMapping("/room")
public class RoomController {
@Autowired
private RoomService roomService;
@Autowired
private OperaterLogService operaterLogService;
@Autowired
private BedService bedService;
@Autowired
private RoomTypeService roomTypeService;
/***
* 病房分页查询
* @param model
* @param pageBean
* @param room
* @return
*/
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Result<Boolean> add(Doctor doctor) {
CodeMsg validate = ValidateEntityUtil.validate(doctor);
if (validate.getCode() != CodeMsg.SUCCESS.getCode()) {
return Result.error(validate);
}
if(Objects.isNull(doctor.getUser().getEmail())){
return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_EMAIL);
}
if(Objects.isNull(doctor.getUser().getMobile())){
return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_MOBILE);
}
if (!StringUtil.emailFormat(doctor.getUser().getEmail())) {
return Result.error(CodeMsg.ADMIN_PUBLIC_EMAIL);
}
if (!StringUtil.isMobile(doctor.getUser().getMobile())) {
return Result.error(CodeMsg.ADMIN_PUBLIC_MOBILE);
}
@ResponseBody
public Result<Boolean> delete(@RequestParam(name = "id", required = true) Long id) {
try {
Doctor doctor = doctorService.find(id);
doctorService.deleteById(id);
userService.delete(doctor.getUser().getId());
} catch (Exception e) {
return Result.error(CodeMsg.ADMIN_DOCTOR_DELETE_ERROR);
}
operaterLogService.add("添加用户,用户ID:" + id);
return Result.success(true);
}
/**
* 修改个人出诊状态页面
* @param model
* @param id
* @return
*/
@RequestMapping(value="/delete",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
try {
roomService.delete(id);
} catch (Exception e) {
return Result.error(CodeMsg.ADMIN_ROOM_DELETE_ERROR);
}
operaterLogService.add("删除病房,病房ID:" + id);
return Result.success(true);
}
}
用户管理控制层:
@RestController
@RequestMapping(value = "/user")
@Api(tags = "用户管理API")
public class UserController {
@Autowired
private IUserService iUserService;
/**
* 登录验证
*
* 新增病房页面
* @param model
* @return
*/
@RequestMapping(value="/add")
public String add(Model model){
model.addAttribute("roomType",roomTypeService.findList());
return "admin/room/add";
}
/**
* 病房添加表单提交处理
* @param room
* @return
*/
@RequestMapping(value="/add",method= RequestMethod.POST)
@ResponseBody
public Result<Boolean> add(Room room){
//用统一验证实体方法验证是否合法
CodeMsg validate = ValidateEntityUtil.validate(room);
if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
return Result.error(validate);
}
//设置可用床数
@RequestMapping(value="/edit",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> edit(Room room){
//用统一验证实体方法验证是否合法
CodeMsg validate = ValidateEntityUtil.validate(room);
if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
return Result.error(validate);
}
if(room.getId() == null || room.getId().longValue() <= 0){
return Result.error(CodeMsg.ADMIN_ROOM_NO_EXIST);
}
if(roomService.isExistRoomNo(room.getRoomNo(),room.getId())){
return Result.error(CodeMsg.ADMIN_ROOM_EXIST);
public BaseResponse<String> registered(@RequestBody @Validated UserRegisterReqVO reqVO, Model model) {
return iUserService.saveUserAndSendEmail(reqVO);
}
/**
* 获取登录日志
*
* @param reqVO
* @return
*/
@RequestMapping(value = "/getLoginfor",method = RequestMethod.GET)
public PageRspVO<LoginInforRspVO> getLoginfor(BasePageReqVO reqVO) {
return iUserService.getLoginfor(reqVO);
}
/**
* 修改密码
*
* @param reqVO
* @return
*/
@PostMapping(value = "/changePassword")
return "admin/doctor/doctorInformation";
}
/**
* 医生完成出诊订单
* @param id
* @return
*/
@RequestMapping(value = "/orderRecord",method = RequestMethod.POST)
@ResponseBody
public Result<Boolean>modifyVisitStatus(Long id){
boolean flag = doctorService.modifyVisitStatus(id);
if (flag){
return Result.success(true);
}
return Result.error(CodeMsg.ADMIN_DOCTOR_CANNOT_REPEATED);
}
/**
* 管理员查看所有订单信息
BeanUtils.copyProperties(room, findById, "id","createTime","updateTime","total","usable");
if(roomService.save(findById) == null){
return Result.error(CodeMsg.ADMIN_ROOM_EDIT_ERROR);
}
operaterLogService.add("编辑病房,病房号:" + room.getRoomNo());
return Result.success(true);
}*/
/**
* 删除病房
* @param id
* @return
*/
@RequestMapping(value="/delete",method=RequestMethod.POST)
@ResponseBody
public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
try {
roomService.delete(id);
} catch (Exception e) {
return Result.error(CodeMsg.ADMIN_ROOM_DELETE_ERROR);
}
operaterLogService.add("删除病房,病房ID:" + id);
return Result.success(true);
}
}
用户管理控制层:
model.addAttribute("title","病房列表");
model.addAttribute("roomNo", room.getRoomNo());
model.addAttribute("pageBean",roomService.findAll(room,pageBean));
return "admin/room/list";
}
/**
* 新增病房页面
* @param model
* @return
*/
@RequestMapping(value="/add")
public String add(Model model){
model.addAttribute("roomType",roomTypeService.findList());
return "admin/room/add";
}
/**
* 病房添加表单提交处理
* @param room
* @return
*/
@RequestMapping(value="/add",method= RequestMethod.POST)
@ResponseBody
public Result<Boolean> add(Room room){
//用统一验证实体方法验证是否合法
CodeMsg validate = ValidateEntityUtil.validate(room);