基于SSM框架的Java的医院管理系统的设计与实现+文档

news2024/10/7 18:31:50

  博主介绍:✌在职Java研发工程师、专注于程序设计、源码分享、技术交流、专注于Java技术领域和毕业设计

项目名称

基于SSM框架的Java的医院管理系统的设计与实现+文档

视频演示

视频去哪了呢?_哔哩哔哩_bilibili

系统介绍

摘  要

随着互联网技术的快速进步,人们的生活得到了极大的便利,同时也推动了许多行业的飞速发展。一款良好的医院管理系统,能整合医院的各个部门,如挂号预约、医生管理、科室管理、药品管理、处方管理等,实现信息的集中管理和自动化处理。通过使用医院管理系统,医院能够更有效地分配资源、降低成本、减少医疗错误,并提高患者满意度。

本系统采用JSP+SSM作为开发技术,构建了一个基于Java的瓦里克医院管理系统。该系统分为前台和后台,其中前台为患者,患者可注册登录、查看科室及医生资料、在线预约医生、个人信息维护等:后台包括医护人员和管理员:医生可查阅已预约患者信息、患者挂号信息及医嘱等。管理员能实现患者信息管理、医生信息管理、药品管理、科室信息管理、公告与留言管理等。通过这些功能模块的设计,基本实现了完整的预约医生管理流程。

医院管理系统为医疗行业带来了革命性的变革,它不仅提高了医院的管理水平,也推动了医疗服务质量的持续提升。随着技术的不断发展,未来医院管理系统将更加智能化、个性化,以满足不断变化的医疗需求。通过引入创新技术和优化管理流程,医院管理系统将继续为患者和医疗工作者创造更高效、安全、便捷的医疗环境。

3.2系统功能需求分析

3.2.1 管理员用例图

管理员负责对后台系统进行操作与维护。主要功能包括:角色管理、公告管理和维护模块等,管理员用例如图3-7所示。

图3-7 管理员用例图

3.2.2 患者用例图

患者在进入系统后,可以查看系统的简介信息,如医院公告和医生的相关信息等。在完成注册并登录后,患者可以进行在线预约医生、查询医疗知识等操作,并且有个人菜单。患者用例如图3-8所示。

图3-8 患者用例图

3.2.3 医生用例图

医生在登录系统后,可以查看患者预约申请信息、用户挂号信息以及开医嘱信息等操作。医生用例如图3-8所示。

图3-8 医生用例图

3.2.4 护士用例图

护士在登录系统后,可以查看患者个人信息、医嘱信息,并且具有患者咨询管理功能以及留言回复信息管理功能。护士用例如图3-9所示。

图3-9 护士用例图

3.2.5 后勤人员用例图

后勤人员包括维护人员和财务人员。

图3-10 后勤人员用例图

技术栈

1. 后端:Spring+SpringMVC+Mybatis
2. 前端:JSP+CSS+JavaScript+jQuery

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中springmvc-servlet.xml配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入http://localhost:8080/ 登录

运行截图

 用户管理控制层:

package com.houserss.controller;

import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.houserss.common.Const;
import com.houserss.common.Const.Role;
import com.houserss.common.ServerResponse;
import com.houserss.pojo.User;
import com.houserss.service.IUserService;
import com.houserss.service.impl.UserServiceImpl;
import com.houserss.util.MD5Util;
import com.houserss.util.TimeUtils;
import com.houserss.vo.DeleteHouseVo;
import com.houserss.vo.PageInfoVo;

/**
 * Created by admin
 */
@Controller
@RequestMapping("/user/")
public class UserController {
    @Autowired
    private IUserService iUserService;

    /**
     * 用户登录
     * @param username
     * @param password
     * @param session
     * @return
     */
    @RequestMapping(value = "login.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse<User> login(User user,String uvcode, HttpSession session){
        String code = (String)session.getAttribute("validationCode");
        if(StringUtils.isNotBlank(code)) {
            if(!code.equalsIgnoreCase(uvcode)) {
                return ServerResponse.createByErrorMessage("验证码不正确");
            }
        }
        ServerResponse<User> response = iUserService.login(user.getUsername(),user.getPassword());
        if(response.isSuccess()){
            session.setAttribute(Const.CURRENT_USER,response.getData());
        }
        return response;
    }

  
    
    
}

管理员管理控制层:


package com.sxl.controller.admin;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sxl.controller.MyController;

@Controller("adminController")
@RequestMapping(value = "/admin")
public class AdminController extends MyController {
	

	@RequestMapping(value = "/index")
	public String frame(Model model, HttpServletRequest request)throws Exception {
		return "/admin/index";
	}
	
	@RequestMapping(value = "/main")
	public String main(Model model, HttpServletRequest request)throws Exception {
		return "/admin/main";
	}
	
	@RequestMapping(value = "/tj1")
	public String tj1(Model model, HttpServletRequest request)throws Exception {
		String sql="select DATE_FORMAT(insertDate,'%Y-%m-%d') dates,sum(allPrice) price from t_order order by DATE_FORMAT(insertDate,'%Y-%m-%d')  desc";
		List<Map> list = db.queryForList(sql);
		model.addAttribute("list", list);
		System.out.println(list);
		return "/admin/tj/tj1";
	}
	
	
	@RequestMapping(value = "/password")
	public String password(Model model, HttpServletRequest request)throws Exception {
		return "/admin/password";
	}
	
	
	@RequestMapping(value = "/changePassword")
	public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String oldPassword,String newPassword) throws Exception {
		Map admin = getAdmin(request);
		if(oldPassword.equals(admin.get("password").toString())){
			String sql="update t_admin set password=? where id=?";
			db.update(sql, new Object[]{newPassword,admin.get("id")});
			return renderData(true,"1",null);
		}else{
			return renderData(false,"1",null);
		}
	}
}

修改密码业务逻辑:


package com.sxl.controller.admin;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sxl.controller.MyController;

@Controller("userController")
@RequestMapping(value = "/user")
public class UserController extends MyController {
	

	@RequestMapping(value = "/index")
	public String frame(Model model, HttpServletRequest request)throws Exception {
		return "/user/index";
	}
	
	@RequestMapping(value = "/main")
	public String main(Model model, HttpServletRequest request)throws Exception {
		return "/user/main";
	}
	
	
	@RequestMapping(value = "/password")
	public String password(Model model, HttpServletRequest request)throws Exception {
		return "/user/password";
	}
	
	
	@RequestMapping(value = "/changePassword")
	public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String oldPassword,String newPassword) throws Exception {
		Map user = getUser(request);
		if(oldPassword.equals(user.get("password").toString())){
			String sql="update t_user set password=? where id=?";
			db.update(sql, new Object[]{newPassword,user.get("id")});
			return renderData(true,"1",null);
		}else{
			return renderData(false,"1",null);
		}
	}
	@RequestMapping(value = "/mine")
	public String mine(Model model, HttpServletRequest request)throws Exception {
Map user =getUser(request);Map map = db.queryForMap("select * from t_user where id=?",new Object[]{user.get("id")});model.addAttribute("map", map);		return "/user/mine";
	}
	
	

	@RequestMapping(value = "/mineSave")
	public ResponseEntity<String> mineSave(Model model,HttpServletRequest request,Long id
		,String username,String password,String name,String gh,String mobile) throws Exception{
		int result = 0;
			String sql="update t_user set name=?,gh=?,mobile=? where id=?";
			result = db.update(sql, new Object[]{name,gh,mobile,id});
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}
	}

通用管理模块:

package com.sxl.controller;


import java.nio.charset.Charset;
import java.util.Locale;
import java.util.ResourceBundle;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.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 com.sxl.util.JacksonJsonUtil;
import com.sxl.util.StringUtil;
import com.sxl.util.SystemProperties;


public class BaseController {
	public static final Long EXPIRES_IN = 1000 * 3600 * 24 * 1L;// 1天

	@Autowired
	private SystemProperties systemProperties;

	/**
	 * 获得配置文件内容
	 */
	public String getConfig(String key) {
		return systemProperties.getProperties(key);
	}

	/**
	 * 返回服务器地址 like http://192.168.1.1:8441/UUBean/
	 */
	public String getHostUrl(HttpServletRequest request) {
		String hostName = request.getServerName();
		Integer hostPort = request.getServerPort();
		String path = request.getContextPath();

		if (hostPort == 80) {
			return "http://" + hostName + path + "/";
		} else {
			return "http://" + hostName + ":" + hostPort + path + "/";
		}
	}

	/***
	 * 获取当前的website路径 String
	 */
	public static String getWebSite(HttpServletRequest request) {
		String returnUrl = request.getScheme() + "://"
				+ request.getServerName();

		if (request.getServerPort() != 80) {
			returnUrl += ":" + request.getServerPort();
		}

		returnUrl += request.getContextPath();

		return returnUrl;
	}



	/**
	 * 初始化HTTP头.
	 * 
	 * @return HttpHeaders
	 */
	public HttpHeaders initHttpHeaders() {
		HttpHeaders headers = new HttpHeaders();
		MediaType mediaType = new MediaType("text", "html",
				Charset.forName("utf-8"));
		headers.setContentType(mediaType);
		return headers;
	}

	/**
	 * 返回 信息数据
	 * 
	 * @param status
	 * @param msg
	 * @return
	 */
	public ResponseEntity<String> renderMsg(Boolean status, String msg) {
		if (StringUtils.isEmpty(msg)) {
			msg = "";
		}
		String str = "{\"status\":\"" + status + "\",\"msg\":\"" + msg + "\"}";
		ResponseEntity<String> responseEntity = new ResponseEntity<String>(str,
				initHttpHeaders(), HttpStatus.OK);
		return responseEntity;
	}

	/**
	 * 返回obj数据
	 * 
	 * @param status
	 * @param msg
	 * @param obj
	 * @return
	 */
	public ResponseEntity<String> renderData(Boolean status, String msg,
			Object obj) {
		if (StringUtils.isEmpty(msg)) {
			msg = "";
		}
		StringBuffer sb = new StringBuffer();
		sb.append("{");
		sb.append("\"status\":\"" + status + "\",\"msg\":\"" + msg + "\",");
		sb.append("\"data\":" + JacksonJsonUtil.toJson(obj) + "");
		sb.append("}");

		ResponseEntity<String> responseEntity = new ResponseEntity<String>(
				sb.toString(), initHttpHeaders(), HttpStatus.OK);
		return responseEntity;
	}


	/***
	 * 获取IP(如果是多级代理,则得到的是一串IP值)
	 */
	public static String getIpAddr(HttpServletRequest request) {
		String ip = request.getHeader("x-forwarded-for");
		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
			ip = request.getHeader("Proxy-Client-IP");
		}

		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
			ip = request.getHeader("WL-Proxy-Client-IP");
		}

		if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
			ip = request.getRemoteAddr();
		}

		if (ip != null && ip.length() > 0) {
			String[] ips = ip.split(",");
			for (int i = 0; i < ips.length; i++) {
				if (!"unknown".equalsIgnoreCase(ips[i])) {
					ip = ips[i];
					break;
				}
			}
		}

		return ip;
	}

	/**
	 * 国际化获得语言内容
	 * 
	 * @param key
	 *            语言key
	 * @param args
	 * @param argsSplit
	 * @param defaultMessage
	 * @param locale
	 * @return
	 */
	public static String getLanguage(String key, String args, String argsSplit,
			String defaultMessage, String locale) {
		String language = "zh";
		String contry = "cn";
		String returnValue = defaultMessage;

		if (!StringUtil.isEmpty(locale)) {
			try {
				String[] localeArray = locale.split("_");
				language = localeArray[0];
				contry = localeArray[1];
			} catch (Exception e) {
			}
		}

		try {
			ResourceBundle resource = ResourceBundle.getBundle("lang.resource",
					new Locale(language, contry));
			returnValue = resource.getString(key);
			if (!StringUtil.isEmpty(args)) {
				String[] argsArray = args.split(argsSplit);
				for (int i = 0; i < argsArray.length; i++) {
					returnValue = returnValue.replace("{" + i + "}",
							argsArray[i]);
				}
			}
		} catch (Exception e) {
		}

		return returnValue;
	}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/651870.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

ARM-驱动

字符设备驱动的内部实现&#xff1a; 文件存在文件系统中&#xff0c;会有一个标识inode号&#xff0c;基于这个标识找到了struct_inode结构体&#xff08;保存当前文件信息&#xff09;&#xff0c;struct_inode结构体中有一个struct cdev *i_cdev类型的字符设备指针&#x…

糖基化修饰1240252-34-9,Fmoc-Thr((Ac4Galβ1-3)Ac3GlcNAcβ1-6AcGalNAcα)-OH,反应特点及性质研究

文章关键词&#xff1a;糖化学试剂&#xff0c;多肽合成&#xff0c;Fmoc-保护氨基酸&#xff0c;糖基化修饰 Fmoc-Thr((Ac4Galβ1-3)Ac3GlcNAcβ1-6AcGalNAcα)-OH &#xff08;文章编辑来源于&#xff1a;西安凯新生物科技有限公司小编WMJ&#xff09;​ 一、Product stru…

Golang每日一练(leetDay0098) 生命、Nim、猜数字游戏

目录 289. 生命游戏 Game Of Life 292. Nim 游戏 Nim Game 299. 猜数字游戏 Bulls and Cows &#x1f31f; 每日一练刷题专栏 &#x1f31f; Rust每日一练 专栏 Golang每日一练 专栏 Python每日一练 专栏 C/C每日一练 专栏 Java每日一练 专栏 289. 生命游戏 Game Of L…

牛客小白月赛56

今天无聊vp了一下 A.省略 B.最优肯定是全部都是1 C.直接统计每个余数下可以填多少个数&#xff0c;然后排序从小到大的排序输出即可 #include <iostream> #include <cstring> #include <algorithm> #include <vector> #include <queue> #inc…

Linux yum常用命令

Linux服务器安装成功后&#xff0c;我们会经常使用yum安装rpm包以满足使用的需要。使用yum源安装rpm包有两种方式&#xff1a; 方式一&#xff1a; 搭建本地yum源环境&#xff0c;进行rpm包的安装&#xff0c;具体搭建方式&#xff0c;参考(chapter-5)&#xff1a; Linux常规…

Android12之如何查看hidl服务(一百五十五)

简介&#xff1a; CSDN博客专家&#xff0c;专注Android/Linux系统&#xff0c;分享多mic语音方案、音视频、编解码等技术&#xff0c;与大家一起成长&#xff01; 优质专栏&#xff1a;Audio工程师进阶系列【原创干货持续更新中……】&#x1f680; 人生格言&#xff1a; 人生…

关闭网络钓鱼攻击 - 类型、方法、检测、预防清单

在当今互联互通的世界中&#xff0c;数字通信和交易占主导地位&#xff0c;网络钓鱼攻击已成为一种无处不在的威胁。 通过伪装成可信赖的实体&#xff0c;网络钓鱼攻击欺骗用户和组织泄露敏感信息&#xff0c;例如密码、财务数据和个人详细信息。 网络钓鱼攻击是网络罪犯使用…

【SpringCloud入门】-- 认识SpringCloudAlibabaNacos服务注册和配置中心

目录 1.Nacos是什么&#xff1f; 2.Nacos能干什么&#xff1f; 3. 各种服务注册中心比较 4.Nacos安装与运行 5.介绍一下Nacos图形化界面 6.NameSpace&#xff0c;Group&#xff0c;Data ID三者的关系&#xff1f;为什么这样设计&#xff1f; 7.Nacos集群和持久化配置 前…

MATLAB与自动化控制:控制系统设计、仿真和实现的应用和优化

章节一&#xff1a;介绍 自动化控制系统是现代工程中的关键组成部分&#xff0c;它在许多领域中发挥着重要作用&#xff0c;如机械工程、电气工程和航空航天工程等。在控制系统设计、仿真和实现过程中&#xff0c;MATLAB成为了一种强大的工具。本文将探讨MATLAB在自动化控制中…

用户模块封装数据模型层

数据模型层 数据模型层&#xff08;Data Model Layer&#xff09;是指在应用程序中用于表示和处理数据的模型层。这一层通常是应用程序的核心&#xff0c;因为它 负责从各种数据源获取数据并保证这些数据与应用程序的功能相匹配 。 在一个应用程序中&#xff0c;数据模型层通…

MidJourney使用教程:二 初识Prompts

最近AIGC这么火&#xff0c;除了chatGPT以外&#xff0c;这种图像类的产品也是非常有意思&#xff0c;其中就有MidJourney和Stable Diffusion这俩个比较出圈。这里我先选择MidJourney来体验并整理出一个教程。一方面MidJourney最简单&#xff0c;能当路Discord&#xff0c;注册…

正则替换的方式删除特定的内容

以前&#xff0c;公司网络限制&#xff0c;无法通过用户名密码登录某些网站&#xff0c;但是可以通过浏览器打开网站&#xff0c;而这些网站有个问题&#xff0c;非登录用户&#xff0c;不能复制博客中的代码&#xff0c;这个就有些麻烦了。 好在&#xff0c;这些代码是可以通过…

6.vue3医疗在线问诊项目 - _极速问诊-订单选择页面 ==> 问诊级别(普通/三甲)、科室选择(一级科室、二级科室)、病情描述、选择患者

6.vue3医疗在线问诊项目 - _极速问诊-订单选择页面 > 问诊级别&#xff08;普通/三甲&#xff09;、科室选择&#xff08;一级科室、二级科室&#xff09;、病情描述、选择患者 极速问诊-选择问诊级别-路由{#consult-change-type} 完成选择三甲还是普通问诊页面&#xff0c…

【Hadoop】大数据开发环境配置

【Hadoop】大数据开发环境配置 文章目录 【Hadoop】大数据开发环境配置1 设置静态ip2 设置主机名3 关闭防火墙4 ssh免密码登录5 JDK配置6 hadoop安装并配置6.1 集群节点之间时间同步6.2 SSH免密码登录完善6.3 hadoop配置 1 设置静态ip 进入ifcfg-ens33文件 vi /etc/sysconfig/n…

JAVA图形界面GUI

目录 一、窗口、窗格、按钮、标签 设置一个窗口JFrame 设置一个窗格JPanel和按钮JButton 设置一个标签JLabel 标准写法 二、监听器ActionListener 用内部类实现 用匿名内部类实现 用LAMADA表达式实现 三、文本域、复选框、下拉列表 JTextField单行文本域 JCheckBox复选…

智能算法终极大比拼,以CEC2017测试函数为例,十种智能算法直接打包带走,不含任何套路

包含人工蜂群(ABC)、灰狼(GWO)、差分进化(DE)、粒子群(PSO)、麻雀优化(SSA)、蜣螂优化(DBO)、白鲸优化(BWO)、遗传算法(GA)、粒子群算法(PSO)&#xff0c;基于反向动态学习的差分进化算法&#xff0c;共十种算法&#xff0c;直接一文全部搞定&#xff01; 其中基于反向动态学习…

Dalamud 插件开发白皮书 P1 - Getting started

文章目录 从哪里开始 How do I get started?Dalamud 插件例子Dalamud 底层探究XIVLauncher 启动器 在哪里寻找帮助 Where do I ask for help?如何热重载插件 How do I hot-reload my plugin?如何调试插件&#xff0c;甚至游戏&#xff1f;如何在编码过程中使用 How do I use…

国内几款强大的语言模型

写在前面 Hello大家好&#xff0c; 我是【麟-小白】&#xff0c;一位软件工程专业的学生&#xff0c;喜好计算机知识。希望大家能够一起学习进步呀&#xff01;本人是一名在读大学生&#xff0c;专业水平有限&#xff0c;如发现错误或不足之处&#xff0c;请多多指正&#xff0…

STC15WProteus仿真红绿灯直行左右转紧急模式STC15W4K32S4-0041

STC15WProteus仿真红绿灯直行左右转紧急模式STC15W4K32S4-0041 Proteus仿真小实验&#xff1a; STC15WProteus仿真红绿灯直行左右转紧急模式STC15W4K32S4-0041 功能&#xff1a; 硬件组成&#xff1a;STC15W4K32S4单片机 2位数码管5个LED灯&#xff08;红 黄 ←绿 ↑绿 →绿…

《网络基础之socket理解》

【一】socket是什么 从字面上的意思来理解&#xff0c;这玩意的中文含义叫插座&#xff0c;对你想的没错&#xff0c;就是你家用来插电器的插座&#xff0c;只不过你家的插座是用来导电的&#xff0c;而网络里面的socket是用来传导信息的。 【二】网络socket传送数据流程 我们…