当前位置:首页 » 《关注互联网》 » 正文

IDEA+Java+SSH+Mysql实现Web医院在线挂号系统【建议收藏】_水坚石青的博客

23 人参与  2021年08月19日 07:23  分类 : 《关注互联网》  评论

点击全文阅读


目录

一、系统介绍

1.开发环境

2.技术选型

3.系统功能

4.数据库

五、工程截图

二、系统展示

1.前台-系统首页

2.前台-医生查询

3.前台-公告信息

4.前台-用户注册

5.用户-主页

6.用户-修改信息

7.用户-挂号信息

8.管理员-登录

9.管理员-主页

10.管理员-修改密码

11.管理员-医院信息管理

12.管理员-科室信息管理

13.管理员-医生信息管理

14.管理员-会员信息管理

15.管理员-系统公告管理

 三、部分代码

gonggaoAction

guahaoAction

indexAction

keshiAction

UserAction

yiyuanAction

zhuanjiaAction

四、其他

1.其他系统实现

1.JavaWeb系统系列实现

2.JavaSwing系统系列实现

2.获取源码

3.运行项目

4.备注

5.支持博主

6.鸡汤


JavaWeb系统系列实现

Java+JSP实现学生图书管理系统

Java+JSP实现学生信息管理系统

Java+JSP实现用户信息管理系统

Java+Servlet+JSP实现航空订票系统

Java+Servlet+JSP实现新闻发布系统

Java+Servlet+JSP学生宿舍管理系统

Java+Servlet+JSP实现学生信息管理系统

Java+Servlet+JSP实现学生选课管理系统

Java+Servlet+JSP实现学生成绩管理系统-1

Java+Servlet+JSP实现学生成绩管理系统-2

Java+Servlet+JSP实现宠物诊所管理系统

Java+SSM+JSP实现网上考试系统

Java+SSH+JSP实现在线考试系统

Java+Springboot+Mybatis+Bootstrap+Maven实现网上商城系统

该系统包含数据库,论文,任务书等,请在获取源码中下载!!!

走过路过不要错过,点赞加关注的脱单暴富,走上人生巅峰!!!

一、系统介绍

1.开发环境

开发工具:IDEA2018.2

JDK版本:jdk1.8

Mysql版本:8.0.13

2.技术选型

后端:Java+Struts+Spring+Hibernate进行开发。

前端:JSP+HTML+CSS。

3.系统功能

医院挂号系统主要用于实现医院的挂号

前台基本功能包括:用户注册、用户登录、医院查询、挂号、取消挂号、修改个人信息、退出等。
后台基本功能包括:系统管理员登录、医院管理、科室管理、公告管理、退出系统等。

本系统结构如下:
1.前台功能
用户注册:注册功能;
用户登录:登录功能;
医院查询:选择医院、科室查询该医院下的医生信息
挂号:选择医生后点击挂号,填写信息完成挂号
管理中心:点击管理中心可以修改个人信息、取消挂号    
2.系统管理员
登录模块:实现管理员登录功能;
医院管理模块:实现医院的增加、删除功能;
科室管理模块:实现科室的增加、删除功能;
公告管理模块:实现公告的增加、删除功能;
退出系统模块:实现用户的退出功能;

4.数据库

/*
 Navicat Premium Data Transfer

 Source Server         : MySQL
 Source Server Type    : MySQL
 Source Server Version : 80013
 Source Host           : 127.0.0.1:3306
 Source Schema         : ssh_hospital_registration

 Target Server Type    : MySQL
 Target Server Version : 80013
 File Encoding         : 65001

 Date: 11/08/2021 23:31:01
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_admin
-- ----------------------------
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin`  (
  `userId` int(11) NOT NULL,
  `userName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `userPw` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`userId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_admin
-- ----------------------------
INSERT INTO `t_admin` VALUES (1, 'admin', 'admin');

-- ----------------------------
-- Table structure for t_gonggao
-- ----------------------------
DROP TABLE IF EXISTS `t_gonggao`;
CREATE TABLE `t_gonggao`  (
  `id` int(11) NOT NULL,
  `biaoti` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `neirong` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `shijian` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_gonggao
-- ----------------------------
INSERT INTO `t_gonggao` VALUES (1, '疫情防控公告', '针对国内外疫情防控形势的新变化,为贯彻落实常态化疫情防控工作中“外防输入、内防反弹”的要求,进一步强化医院感染防控的各项措施,最大限度地降低院内感染发生风险,切实保障人民群众的健康和安全', '2021-08-11 21:20');
INSERT INTO `t_gonggao` VALUES (2, '关于感染科门诊搬迁的通知', '我院感染科门诊现已搬至3号楼2楼(该门诊候诊区有独立的自助挂号收费系统),请从西边楼梯上二楼,由此给您带来的不便,敬请谅解!', '2021-08-11 21:20');

-- ----------------------------
-- Table structure for t_guahao
-- ----------------------------
DROP TABLE IF EXISTS `t_guahao`;
CREATE TABLE `t_guahao`  (
  `id` int(11) NOT NULL DEFAULT 0,
  `zhuanjiaId` int(11) NULL DEFAULT NULL,
  `userId` int(11) NULL DEFAULT NULL,
  `riqi` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `jibing` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `xingming` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `lianxi` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_guahao
-- ----------------------------
INSERT INTO `t_guahao` VALUES (1, 2, 1, '2021-08-12', '1', '1', '1');
INSERT INTO `t_guahao` VALUES (2, 2, 2, '2021-08-12', '1', '1', '1');

-- ----------------------------
-- Table structure for t_keshi
-- ----------------------------
DROP TABLE IF EXISTS `t_keshi`;
CREATE TABLE `t_keshi`  (
  `keshi_id` int(11) NOT NULL,
  `keshi_anme` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `del` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`keshi_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_keshi
-- ----------------------------
INSERT INTO `t_keshi` VALUES (2, '内科', 'no');
INSERT INTO `t_keshi` VALUES (3, '外科', 'no');
INSERT INTO `t_keshi` VALUES (4, '胸科', 'no');
INSERT INTO `t_keshi` VALUES (5, '骨科', 'no');

-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user`  (
  `user_id` int(11) NOT NULL,
  `user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_pw` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_realname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_address` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_tel` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `user_del` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_user
-- ----------------------------
INSERT INTO `t_user` VALUES (1, 'liusan', '000000', '刘三', '北京路1', '13444444444', 'liusan@163.com', 'no');
INSERT INTO `t_user` VALUES (2, 'zhangsan', '000000', '张三', '湖北武汉', '123456', '123456@qq.com', 'no');

-- ----------------------------
-- Table structure for t_yiyuan
-- ----------------------------
DROP TABLE IF EXISTS `t_yiyuan`;
CREATE TABLE `t_yiyuan`  (
  `id` int(11) NOT NULL,
  `mingcheng` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `dizhi` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `dianhua` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `del` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_yiyuan
-- ----------------------------
INSERT INTO `t_yiyuan` VALUES (2, '北京大学第三医院 ', '海淀区花园北路49号', '010-82266699', 'no');
INSERT INTO `t_yiyuan` VALUES (3, '阜外心血管病医院', '西城区北礼士路167号', '010-88398866', 'no');
INSERT INTO `t_yiyuan` VALUES (4, '北京大学人民医院', '西城区西直门南大街', '010-66583666', 'no');
INSERT INTO `t_yiyuan` VALUES (5, '1', '1', '1', 'yes');

-- ----------------------------
-- Table structure for t_zhuanjia
-- ----------------------------
DROP TABLE IF EXISTS `t_zhuanjia`;
CREATE TABLE `t_zhuanjia`  (
  `id` int(11) NOT NULL DEFAULT 0,
  `yiyuanId` int(11) NULL DEFAULT NULL,
  `keshiId` int(11) NULL DEFAULT NULL,
  `xingming` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `xingbie` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `nianling` int(11) NULL DEFAULT NULL,
  `shanchang` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `leixing` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `fujian` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `del` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of t_zhuanjia
-- ----------------------------
INSERT INTO `t_zhuanjia` VALUES (2, 2, 2, '王晓光', '男', 40, '各类心脑血管各类疾病病', '专家门诊', '/upload/1362249942828.jpg', 'no');
INSERT INTO `t_zhuanjia` VALUES (3, 2, 2, '张大海', '男', 40, '各类心血管外科各种疾病', '专家门诊', '/upload/1362250001253.jpg', 'no');
INSERT INTO `t_zhuanjia` VALUES (4, 2, 2, '刘莉莉', '男', 52, '各类口腔科疾病药到病除', '普通门诊', '/upload/1362250044364.jpg', 'no');

SET FOREIGN_KEY_CHECKS = 1;

五、工程截图

二、系统展示

1.前台-系统首页

2.前台-医生查询

3.前台-公告信息

4.前台-用户注册

5.用户-主页

6.用户-修改信息

7.用户-挂号信息

8.管理员-登录

9.管理员-主页

10.管理员-修改密码

11.管理员-医院信息管理

12.管理员-科室信息管理

13.管理员-医生信息管理

14.管理员-会员信息管理

15.管理员-系统公告管理

 三、部分代码

gonggaoAction

package com.action;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.dao.TGonggaoDAO;
import com.model.TAdmin;
import com.model.TGonggao;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class gonggaoAction extends ActionSupport {
    private Integer id;
    private String biaoti;
    private String neirong;
    private String shijian;

    private String message;
    private String path;

    private TGonggaoDAO gonggaoDAO;

    public String gonggaoAdd() {
        TGonggao gonggao = new TGonggao();
        gonggao.setBiaoti(biaoti);
        gonggao.setNeirong(neirong);
        gonggao.setShijian(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()));
        gonggaoDAO.save(gonggao);
        this.setMessage("公告添加完毕");
        this.setPath("gonggaoMana.action");
        return "succeed";
    }


    public String gonggaoMana() {
        List gonggaoList = gonggaoDAO.findAll();
        Map request = (Map) ServletActionContext.getContext().get("request");
        request.put("gonggaoList", gonggaoList);
        return ActionSupport.SUCCESS;
    }

    public String gonggaoDel() {
        TGonggao gonggao = gonggaoDAO.findById(id);
        gonggaoDAO.delete(gonggao);
        this.setMessage("公告删除完毕");
        this.setPath("gonggaoMana.action");
        return "succeed";
    }


    public String gonggaoDetailHou() {
        TGonggao gonggao = gonggaoDAO.findById(id);
        Map request = (Map) ServletActionContext.getContext().get("request");
        request.put("gonggao", gonggao);
        return ActionSupport.SUCCESS;
    }


    public String gonggaoAll() {
        List gonggaoList = gonggaoDAO.findAll();
        Map request = (Map) ServletActionContext.getContext().get("request");
        request.put("gonggaoList", gonggaoList);
        return ActionSupport.SUCCESS;
    }

    public String gonggaoDetailQian() {
        TGonggao gonggao = gonggaoDAO.findById(id);
        Map request = (Map) ServletActionContext.getContext().get("request");
        request.put("gonggao", gonggao);

        return ActionSupport.SUCCESS;
    }


    public String getBiaoti() {
        return biaoti;
    }


    public void setBiaoti(String biaoti) {
        this.biaoti = biaoti;
    }


    public TGonggaoDAO getGonggaoDAO() {
        return gonggaoDAO;
    }


    public void setGonggaoDAO(TGonggaoDAO gonggaoDAO) {
        this.gonggaoDAO = gonggaoDAO;
    }


    public Integer getId() {
        return id;
    }


    public void setId(Integer id) {
        this.id = id;
    }


    public String getMessage() {
        return message;
    }


    public void setMessage(String message) {
        this.message = message;
    }


    public String getNeirong() {
        return neirong;
    }


    public void setNeirong(String neirong) {
        this.neirong = neirong;
    }


    public String getPath() {
        return path;
    }


    public void setPath(String path) {
        this.path = path;
    }


    public String getShijian() {
        return shijian;
    }


    public void setShijian(String shijian) {
        this.shijian = shijian;
    }

}


guahaoAction

package com.action;

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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.dao.TGuahaoDAO;
import com.dao.TZhuanjiaDAO;
import com.model.TGuahao;
import com.model.TUser;
import com.model.TZhuanjia;
import com.opensymphony.xwork2.ActionSupport;

public class guahaoAction extends ActionSupport
{
	private Integer id;
	private Integer zhuanjiaId;
	private Integer userId;
	private String riqi;

	private String jibing;
	private String xingming;
	private String lianxi;
	
	private String message;
	private String path;
	
	private TGuahaoDAO guahaoDAO;
	private TZhuanjiaDAO zhuanjiaDAO;
	
	public String guahaoAdd()
	{
		HttpServletRequest request=ServletActionContext.getRequest();
		HttpSession session=request.getSession();
		TUser user=(TUser)session.getAttribute("user");
		
		
		TGuahao guahao=new TGuahao();
		
		guahao.setZhuanjiaId(zhuanjiaId);
		guahao.setUserId(user.getUserId());
		guahao.setRiqi(riqi);
		guahao.setJibing(jibing);
		
		guahao.setXingming(xingming);
		guahao.setLianxi(lianxi);
		
		guahaoDAO.save(guahao);
		
		
		this.setMessage("成功挂号");
		this.setPath("index.action");
		return "succeed";
	}
	
	
	public String guahaoDel()
	{   
		HttpServletRequest request=ServletActionContext.getRequest();
		
		TGuahao guahao=guahaoDAO.findById(id);
		guahaoDAO.delete(guahao);
		
		request.setAttribute("msg", "成功取消挂号");
		return "msg";
	}
	
	

	public String guahaoMana_user()
	{
		HttpServletRequest request=ServletActionContext.getRequest();
		HttpSession session=request.getSession();
		TUser user=(TUser)session.getAttribute("user");
		
		String sql="from TGuahao where userId="+user.getUserId();
		List guahaoList =guahaoDAO.getHibernateTemplate().find(sql);
		for(int i=0;i<guahaoList.size();i++)
		{
			TGuahao guahao=(TGuahao)guahaoList.get(i);
			guahao.setZhuanjia(zhuanjiaDAO.findById(guahao.getZhuanjiaId()));
		}
		
		request.setAttribute("guahaoList", guahaoList);
		return ActionSupport.SUCCESS;
	}
	
	
	
	public String guahaoMana_zhuanjia()
	{
		HttpServletRequest request=ServletActionContext.getRequest();
		HttpSession session=request.getSession();
		TZhuanjia zhuanjia=(TZhuanjia)session.getAttribute("zhuanjia");
		
		String sql="from TGuahao where zhuanjiaId="+zhuanjia.getId();
		List guahaoList =guahaoDAO.getHibernateTemplate().find(sql);
		for(int i=0;i<guahaoList.size();i++)
		{
			TGuahao guahao=(TGuahao)guahaoList.get(i);
			guahao.setZhuanjia(zhuanjiaDAO.findById(guahao.getZhuanjiaId()));
		}
		
		request.setAttribute("guahaoList", guahaoList);
		return ActionSupport.SUCCESS;
	}
	
	
	public TGuahaoDAO getGuahaoDAO()
	{
		return guahaoDAO;
	}


	public void setGuahaoDAO(TGuahaoDAO guahaoDAO)
	{
		this.guahaoDAO = guahaoDAO;
	}


	public TZhuanjiaDAO getZhuanjiaDAO()
	{
		return zhuanjiaDAO;
	}


	public String getMessage()
	{
		return message;
	}


	public void setMessage(String message)
	{
		this.message = message;
	}


	public String getPath()
	{
		return path;
	}


	public void setPath(String path)
	{
		this.path = path;
	}


	public void setZhuanjiaDAO(TZhuanjiaDAO zhuanjiaDAO)
	{
		this.zhuanjiaDAO = zhuanjiaDAO;
	}


	public Integer getId()
	{
		return id;
	}


	public void setId(Integer id)
	{
		this.id = id;
	}


	public String getJibing()
	{
		return jibing;
	}


	public void setJibing(String jibing)
	{
		this.jibing = jibing;
	}


	public String getLianxi()
	{
		return lianxi;
	}


	public void setLianxi(String lianxi)
	{
		this.lianxi = lianxi;
	}


	

	public String getRiqi()
	{
		return riqi;
	}


	public void setRiqi(String riqi)
	{
		this.riqi = riqi;
	}


	public Integer getUserId()
	{
		return userId;
	}


	public void setUserId(Integer userId)
	{
		this.userId = userId;
	}


	public String getXingming()
	{
		return xingming;
	}


	public void setXingming(String xingming)
	{
		this.xingming = xingming;
	}


	public Integer getZhuanjiaId()
	{
		return zhuanjiaId;
	}


	public void setZhuanjiaId(Integer zhuanjiaId)
	{
		this.zhuanjiaId = zhuanjiaId;
	}

}


indexAction

package com.action;





import com.opensymphony.xwork2.ActionSupport;

public class indexAction extends ActionSupport
{
	
	public String index()
	{
		
		return ActionSupport.SUCCESS;
	}
}


keshiAction

package com.action;

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

import org.apache.struts2.ServletActionContext;

import com.dao.TKeshiDAO;
import com.dao.TZhuanjiaDAO;
import com.model.TKeshi;
import com.opensymphony.xwork2.ActionSupport;

public class keshiAction extends ActionSupport
{
	private int keshiId;
	private String keshiAnme;
	private String keshiJianjie;
	
	private String message;
	private String path;
	
	private TKeshiDAO keshiDAO;
	private TZhuanjiaDAO zhuanjiaDAO;
	
	public String keshiAdd()
	{
		TKeshi keshi=new TKeshi();
		keshi.setKeshiAnme(keshiAnme);
		keshi.setDel("no");
		keshiDAO.save(keshi);
		this.setMessage("操作成功");
		this.setPath("keshiMana.action");
		return "succeed";
	}
	
	
	public String keshiMana()
	{
		String sql="from TKeshi where del='no'";
		List keshiList=keshiDAO.getHibernateTemplate().find(sql);
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("keshiList", keshiList);
		return ActionSupport.SUCCESS;
	}
	
	
	public String keshiDel()
	{
		TKeshi keshi=keshiDAO.findById(keshiId);
		keshi.setDel("yes");
		keshiDAO.attachDirty(keshi);
		this.setMessage("操作成功");
		this.setPath("keshiMana.action");
		return "succeed";
	}
	
	
	
	

	public String getKeshiAnme()
	{
		return keshiAnme;
	}

	public void setKeshiAnme(String keshiAnme)
	{
		this.keshiAnme = keshiAnme;
	}

	public TKeshiDAO getKeshiDAO()
	{
		return keshiDAO;
	}

	public void setKeshiDAO(TKeshiDAO keshiDAO)
	{
		this.keshiDAO = keshiDAO;
	}

	public TZhuanjiaDAO getZhuanjiaDAO() {
		return zhuanjiaDAO;
	}


	public void setZhuanjiaDAO(TZhuanjiaDAO zhuanjiaDAO) {
		this.zhuanjiaDAO = zhuanjiaDAO;
	}


	public int getKeshiId()
	{
		return keshiId;
	}

	public void setKeshiId(int keshiId)
	{
		this.keshiId = keshiId;
	}

	public String getKeshiJianjie()
	{
		return keshiJianjie;
	}

	public void setKeshiJianjie(String keshiJianjie)
	{
		this.keshiJianjie = keshiJianjie;
	}

	public String getMessage()
	{
		return message;
	}

	public void setMessage(String message)
	{
		this.message = message;
	}

	public String getPath()
	{
		return path;
	}

	public void setPath(String path)
	{
		this.path = path;
	}
	

}


UserAction

package com.action;

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

import org.apache.struts2.ServletActionContext;

import com.dao.TUserDAO;
import com.model.TUser;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport
{
    private int userId;
	private String userName;
	private String userPw;
	private String userRealname;
	
	private String userAddress;
	private String userTel;
	private String userEmail;
	private String userDel;
   
	
	
	
	private String message;
	private String path;
	
	private TUserDAO userDAO;
	
	
	
	public String userReg()
	{
		TUser user=new TUser();
		
		user.setUserName(userName);
		user.setUserPw(userPw);
		user.setUserAddress(userAddress);
		user.setUserTel(userTel);
		
		user.setUserRealname(userRealname);
		user.setUserEmail(userEmail);
		user.setUserDel("no");
		
		userDAO.save(user);
		
		this.setMessage("注册成功,请登录");
		this.setPath("qiantai/default.jsp");
		return "succeed";
	}
	
	
	public String userLogin()
	{
		String sql="from TUser where userName=? and userPw=? and userDel='no'";
		Object[] con={userName,userPw};
		List userList=userDAO.getHibernateTemplate().find(sql,con);
		
		System.out.println(userList.size()+"%%");
		if(userList.size()==0)
		{
			this.setMessage("用户名或密码错误");
			this.setPath("qiantai/default.jsp");
		}
		else
		{
			 Map session= ServletActionContext.getContext().getSession();
			 TUser user=(TUser)userList.get(0);
			 session.put("user", user);
			 session.put("userType", 2);
			 
			 this.setMessage("成功登录");
			 this.setPath("qiantai/default.jsp");
		}
		
		return "succeed";
	}
	
	public String userLogout()
	{
		Map session= ServletActionContext.getContext().getSession();
		session.put("user", null);
		session.put("userType", null);
		 
		this.setMessage("安全退出系统");
		this.setPath("qiantai/default.jsp");
		return "succeed";
	}
	
	public String userEdit()
	{
		TUser user=userDAO.findById(userId);
		
		user.setUserName(userName);
		user.setUserPw(userPw);
		user.setUserAddress(userAddress);
		user.setUserTel(userTel);
		
		user.setUserRealname(userRealname);
		user.setUserEmail(userEmail);
		user.setUserDel("no");
		
		userDAO.attachDirty(user);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("msg", "修改成功,重新登陆后生效");
		return "msg";
	}
	
	
	
	
	public String userMana()
	{
		String sql="from TUser where userDel='no'";
		List userList=userDAO.getHibernateTemplate().find(sql);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("userList", userList);
		return ActionSupport.SUCCESS;
	}
	
	
	
	public String userDel()
	{
		TUser user=userDAO.findById(userId);
		user.setUserDel("yes");
		
		userDAO.attachDirty(user);
		this.setMessage("删除成功");
		this.setPath("userMana.action");
		return "succeed";
	}
	
	
	
	
	
	public int getUserId()
	{
		return userId;
	}
	public void setUserId(int userId)
	{
		this.userId = userId;
	}
	public String getUserName()
	{
		return userName;
	}
	public void setUserName(String userName)
	{
		this.userName = userName;
	}
	public String getUserPw()
	{
		return userPw;
	}
	public void setUserPw(String userPw)
	{
		this.userPw = userPw;
	}
	public String getUserRealname()
	{
		return userRealname;
	}
	public void setUserRealname(String userRealname)
	{
		this.userRealname = userRealname;
	}
	public String getUserAddress()
	{
		return userAddress;
	}
	public void setUserAddress(String userAddress)
	{
		this.userAddress = userAddress;
	}
	public String getUserTel()
	{
		return userTel;
	}
	public void setUserTel(String userTel)
	{
		this.userTel = userTel;
	}
	public String getUserEmail()
	{
		return userEmail;
	}
	public void setUserEmail(String userEmail)
	{
		this.userEmail = userEmail;
	}
	public String getUserDel()
	{
		return userDel;
	}
	public void setUserDel(String userDel)
	{
		this.userDel = userDel;
	}
	public String getMessage()
	{
		return message;
	}
	public void setMessage(String message)
	{
		this.message = message;
	}
	public String getPath()
	{
		return path;
	}
	public void setPath(String path)
	{
		this.path = path;
	}
	public TUserDAO getUserDAO()
	{
		return userDAO;
	}
	public void setUserDAO(TUserDAO userDAO)
	{
		this.userDAO = userDAO;
	}
	
}


yiyuanAction

package com.action;

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

import org.apache.struts2.ServletActionContext;

import com.dao.TYiyuanDAO;
import com.dao.TZhuanjiaDAO;
import com.model.TYiyuan;
import com.opensymphony.xwork2.ActionSupport;

public class yiyuanAction extends ActionSupport
{
	private Integer id;
	private String mingcheng;
	private String dizhi;
	private String dianhua;
	
	private String del;
	
	private String message;
	private String path;
	
	private TYiyuanDAO yiyuanDAO;
	
	public String yiyuanAdd()
	{
		TYiyuan yiyuan=new TYiyuan();
		
		yiyuan.setMingcheng(mingcheng);
		yiyuan.setDizhi(dizhi);
		yiyuan.setDianhua(dianhua);
		yiyuan.setDel("no");
		
		yiyuanDAO.save(yiyuan);
		this.setMessage("操作成功");
		this.setPath("yiyuanMana.action");
		return "succeed";
	}
	
	
	public String yiyuanMana()
	{
		String sql="from TYiyuan where del='no'";
		List yiyuanList=yiyuanDAO.getHibernateTemplate().find(sql);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("yiyuanList", yiyuanList);
		return ActionSupport.SUCCESS;
	}
	
	
	public String yiyuanDel()
	{
		TYiyuan yiyuan=yiyuanDAO.findById(id);
		yiyuan.setDel("yes");
		
		yiyuanDAO.attachDirty(yiyuan);
		this.setMessage("操作成功");
		this.setPath("yiyuanMana.action");
		return "succeed";
	}
	
	
	
	
	public String yiyuanAll()
	{
		String sql="from TYiyuan where del='no'";
		List yiyuanList=yiyuanDAO.getHibernateTemplate().find(sql);
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("yiyuanList", yiyuanList);
		return ActionSupport.SUCCESS;
	}


	public Integer getId()
	{
		return id;
	}


	public void setId(Integer id)
	{
		this.id = id;
	}


	public String getMingcheng()
	{
		return mingcheng;
	}


	public void setMingcheng(String mingcheng)
	{
		this.mingcheng = mingcheng;
	}


	public String getDizhi()
	{
		return dizhi;
	}


	public void setDizhi(String dizhi)
	{
		this.dizhi = dizhi;
	}


	public String getDianhua()
	{
		return dianhua;
	}


	public void setDianhua(String dianhua)
	{
		this.dianhua = dianhua;
	}


	public String getDel()
	{
		return del;
	}


	public void setDel(String del)
	{
		this.del = del;
	}


	public String getMessage()
	{
		return message;
	}


	public void setMessage(String message)
	{
		this.message = message;
	}


	public String getPath()
	{
		return path;
	}


	public void setPath(String path)
	{
		this.path = path;
	}


	public TYiyuanDAO getYiyuanDAO()
	{
		return yiyuanDAO;
	}


	public void setYiyuanDAO(TYiyuanDAO yiyuanDAO)
	{
		this.yiyuanDAO = yiyuanDAO;
	}
	
}


zhuanjiaAction

package com.action;

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

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.dao.TKeshiDAO;
import com.dao.TYiyuanDAO;
import com.dao.TZhuanjiaDAO;
import com.model.TZhuanjia;
import com.opensymphony.xwork2.ActionSupport;

public class zhuanjiaAction extends ActionSupport
{
	private Integer id;
	private int yiyuanId;
	private int keshiId;
	private String xingming;
	
	private String xingbie;
	private Integer nianling;
	private String shanchang;
	private String leixing;//专家门诊--普通门诊
	
	private String fujian;
	private String del;
	
	private TZhuanjiaDAO zhuanjiaDAO;
	private TKeshiDAO keshiDAO;
	private TYiyuanDAO yiyuanDAO;
	
	public String zhuanjiaAdd()
	{
		TZhuanjia zhuanjia=new TZhuanjia();
		
		//zhuanjia.setId(0);]
		zhuanjia.setYiyuanId(yiyuanId);
		zhuanjia.setKeshiId(keshiId);
		zhuanjia.setXingming(xingming);
		
		zhuanjia.setXingbie(xingbie);
		zhuanjia.setNianling(nianling);
		zhuanjia.setShanchang(shanchang);
		zhuanjia.setLeixing(leixing);
		
		zhuanjia.setFujian(fujian);
		zhuanjia.setDel("no");
		
		zhuanjiaDAO.save(zhuanjia);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("msg", "信息添加完毕");
		return "msg";
	}
	
	
	public String zhuanjiaMana()
	{
		String sql="from TZhuanjia where del='no' order by yiyuanId,keshiId";
		List zhuanjiaList =zhuanjiaDAO.getHibernateTemplate().find(sql);
		for(int i=0;i<zhuanjiaList.size();i++)
		{
			TZhuanjia zhuanjia=(TZhuanjia)zhuanjiaList.get(i);
			zhuanjia.setKeshi(keshiDAO.findById(zhuanjia.getKeshiId()));
			zhuanjia.setYiyuan(yiyuanDAO.findById(zhuanjia.getYiyuanId()));
		}
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("zhuanjiaList", zhuanjiaList);
		return ActionSupport.SUCCESS;
	}
	
	public String zhuanjiaDel()
	{   
		String sql="update TZhuanjia set del='yes' where id="+id;
		zhuanjiaDAO.getHibernateTemplate().bulkUpdate(sql);
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("msg", "信息删除完毕");
		return "msg";
	}
	
	
	public String zhuanjiaAllByYiyuan()
	{
		String sql="from TZhuanjia where del='no' and yiyuanId="+yiyuanId;
		List zhuanjiaList =zhuanjiaDAO.getHibernateTemplate().find(sql);
		for(int i=0;i<zhuanjiaList.size();i++)
		{
			TZhuanjia zhuanjia=(TZhuanjia)zhuanjiaList.get(i);
			zhuanjia.setKeshi(keshiDAO.findById(zhuanjia.getKeshiId()));
			zhuanjia.setYiyuan(yiyuanDAO.findById(zhuanjia.getYiyuanId()));
		}
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("zhuanjiaList", zhuanjiaList);
		return ActionSupport.SUCCESS;
	}
	
	
	public String zhuanjiaDetailQian()
	{
		TZhuanjia zhuanjia=zhuanjiaDAO.findById(id);
		zhuanjia.setKeshi(keshiDAO.findById(zhuanjia.getKeshiId()));
		zhuanjia.setYiyuan(yiyuanDAO.findById(zhuanjia.getYiyuanId()));
		
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("zhuanjia", zhuanjia);
		return ActionSupport.SUCCESS;
	}

	
	public String zhuanjiaRes()
	{
		StringBuffer sql=new StringBuffer("from TZhuanjia where del='no' and yiyuanId="+yiyuanId);
		sql.append(" and keshiId="+keshiId);
		sql.append(" and leixing like '%"+leixing.trim()+"%'");
		sql.append(" and xingming like '%"+xingming.trim()+"%'");
		
		List zhuanjiaList =zhuanjiaDAO.getHibernateTemplate().find(sql.toString());
		
		
		for(int i=0;i<zhuanjiaList.size();i++)
		{
			TZhuanjia zhuanjia=(TZhuanjia)zhuanjiaList.get(i);
			zhuanjia.setKeshi(keshiDAO.findById(zhuanjia.getKeshiId()));
			zhuanjia.setYiyuan(yiyuanDAO.findById(zhuanjia.getYiyuanId()));
		}
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("zhuanjiaList", zhuanjiaList);
		return ActionSupport.SUCCESS;
	}

	public Integer getId()
	{
		return id;
	}


	public void setId(Integer id)
	{
		this.id = id;
	}


	public int getYiyuanId()
	{
		return yiyuanId;
	}


	public void setYiyuanId(int yiyuanId)
	{
		this.yiyuanId = yiyuanId;
	}


	public int getKeshiId()
	{
		return keshiId;
	}


	public void setKeshiId(int keshiId)
	{
		this.keshiId = keshiId;
	}


	public String getXingming()
	{
		return xingming;
	}


	public void setXingming(String xingming)
	{
		this.xingming = xingming;
	}


	public String getXingbie()
	{
		return xingbie;
	}


	public void setXingbie(String xingbie)
	{
		this.xingbie = xingbie;
	}


	public Integer getNianling()
	{
		return nianling;
	}


	public void setNianling(Integer nianling)
	{
		this.nianling = nianling;
	}


	public String getShanchang()
	{
		return shanchang;
	}


	public void setShanchang(String shanchang)
	{
		this.shanchang = shanchang;
	}


	public String getLeixing()
	{
		return leixing;
	}


	public void setLeixing(String leixing)
	{
		this.leixing = leixing;
	}


	public String getFujian()
	{
		return fujian;
	}


	public void setFujian(String fujian)
	{
		this.fujian = fujian;
	}


	public String getDel()
	{
		return del;
	}


	public void setDel(String del)
	{
		this.del = del;
	}


	public TZhuanjiaDAO getZhuanjiaDAO()
	{
		return zhuanjiaDAO;
	}


	public void setZhuanjiaDAO(TZhuanjiaDAO zhuanjiaDAO)
	{
		this.zhuanjiaDAO = zhuanjiaDAO;
	}


	public TKeshiDAO getKeshiDAO()
	{
		return keshiDAO;
	}


	public void setKeshiDAO(TKeshiDAO keshiDAO)
	{
		this.keshiDAO = keshiDAO;
	}


	public TYiyuanDAO getYiyuanDAO()
	{
		return yiyuanDAO;
	}


	public void setYiyuanDAO(TYiyuanDAO yiyuanDAO)
	{
		this.yiyuanDAO = yiyuanDAO;
	}

}

四、其他

1.其他系统实现

1.JavaWeb系统系列实现

Java+JSP实现学生图书管理系统

Java+JSP实现学生信息管理系统

Java+JSP实现用户信息管理系统

Java+Servlet+JSP实现航空订票系统

Java+Servlet+JSP实现新闻发布系统

Java+Servlet+JSP实现停车场管理系统

Java+Servlet+JSP实现学生信息管理系统

Java+Servlet+JSP实现学生选课管理系统

Java+Servlet+JSP实现学生成绩管理系统-1

Java+Servlet+JSP实现学生成绩管理系统-2

Java+Servlet+JSP实现宠物诊所管理系统

Java+SSM+JSP实现网上考试系统

Java+SSH+JSP实现在线考试系统

Java+Springboot+Mybatis+Bootstrap+Maven实现网上商城系统

2.JavaSwing系统系列实现

Java+Swing实现斗地主游戏

Java+Swing实现图书管理系统

Java+Swing实现医院管理系统

Java+Swing实现考试管理系统

Java+Swing实现仓库管理系统-1

Java+Swing实现仓库管理系统-2

Java+Swing实现自助取款机系统

Java+Swing实现通讯录管理系统

Java+Swing实现停车场管理系统

Java+Swing实现学生信息管理系统

Java+Swing实现学生宿舍管理系统

Java+Swing实现学生选课管理系统

Java+Swing实现学生成绩管理系统

Java+Swing实现学校教材管理系统

Java+Swing实现学校教务管理系统

Java+Swing实现企业人事管理系统

Java+Swing实现电子相册管理系统

Java+Swing实现超市管理系统-TXT存储数据

Java+Swing实现自助取款机系统-TXT存储数据

Java+Swing实现宠物商店管理系统-TXT存储数据

2.获取源码

点击以下链接获取源码,数据库文件在sql文件下面。论文、答辩PPT、开题报告、任务书在论文相关里面。

Java+SSH+Jsp+Mysql医院挂号系统

3.运行项目

请点击以下链接,部署你的项目。

IDEA如何导入JavaWeb项目超详细视频教程

4.备注

如有侵权请联系我删除。

5.支持博主

如果您觉得此文对您有帮助,请点赞加关注加收藏。祝您生活愉快!想要获取其他资源可关注左侧


点击全文阅读


本文链接:http://m.zhangshiyu.com/post/25714.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1