基于javaweb的JSP+Servlet私人牙科诊所病历管理系统医院挂号(java+jsp+css+javascript+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

510023402402

530023402402

540023402402

550023402402

560023402402

570023402402

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
前台病人:
user1 123456
user2 123456

后台:
管理员账号/密码:admin/123456
挂号人员账号/密码:gh/123456
医生人员账号/密码:doctor/123456
收费人员账号/密码:sf/123456
药房人员账号/密码:yf/123456


预约挂号的操作流程:
1 前台user1:预约挂号
2 后台gh:受理
3 后台doctor:问诊
4 后台sf:收费
5 后台yf:确认取药
6 前台user1:查询病历(就诊信息)

基于javaweb的JSP+Servlet私人牙科诊所病历管理系统医院挂号(java+jsp+css+javascript+mysql)

项目介绍

本系统分为前后台,包括管理员、病人、挂号人员、收费人员、药房人员、医生人员等角色,其中前台只能由病人角色登录,其它角色可通过后台登录; 管理员角色包含以下功能: 登录页面,增加公告,公告管理,留言管理,增加用户,用户管理,增加科室,科室管理,药品管理,收费统计,挂号统计等功能。

病人角色包含以下功能: 注册账号,用户登录,用户登录后首页,预约挂号,个人信息修改,提交留言等功能。

环境需要

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.数据库:MySql 5.7版本; 6.是否Maven项目:否;

技术栈

1.后端技术:Servlet 2.前端技术:JSP+CSS+JavaScript

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中dbconnection.properties配置文件中的数据库配置改为自己的配置; 将项目中src/dao/CommDAO.java中第71行的数据库配置用户名密码改为自己的配置; 4. 运行项目,输入http://localhost:8080/srykzsblmis/ 登录 注:Tomcat中配置路径必须为srykzsblmis 管理员账号/密码:admin/123 病人账号/密码: xm/123 挂号人员账号/密码:gh/123 收费人员账号/密码:sf/123 药房人员账号/密码:yf/123 医生人员账号/密码:doctor1/123

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
			for(int i=0;i<aa.length;i++){
System.out.println(aa[i]);
}

}

}





package util;




public class PageManager {
private PageManager() {

}

// 默认一页最大记录数
public static final int DEFAULTPAGESIZE = 20;

// 分页段
public static final int segment = 10;

// 当前页数
protected int currentPage;

// 一页长度
protected int pageSize;

// 总页数
protected long pageNumber;

// 总记录数
protected long count;

// 数据
protected Collection collection;

// 数据查询对象
protected CommDAO dao = new CommDAO();

// 表现层代码
protected String info;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
		 response.reset();
response.setHeader("Cache-Control", "max-age=0" );
response.setHeader("Content-Disposition", "attachment; filename=" + filename);

try {
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
OutputStream fos = null;
// File f = new File(request.getRealPath("/upfile/")+"/"+filename);
//System.out.println(f);
bis = new BufferedInputStream((InputStream)new FileInputStream(request.getRealPath("/upfile/")+"/"+filename));
fos = response.getOutputStream();
bos = new BufferedOutputStream(fos);

int bytesRead = 0;
byte[] buffer = new byte[5 * 1024];
while ((bytesRead = bis.read(buffer)) != -1) {
bos.write(buffer, 0, bytesRead);
}
bos.close();
bis.close();
fos.close();

//new Info().delPic(request.getRealPath("/upfile/")+"/", filename);
} catch (Exception e) {
e.printStackTrace();
}finally{
}
}

/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}

}
package util;



public class SetChar extends HttpServlet implements Filter {
private FilterConfig filterConfig;

// Handle the passed-in FilterConfig
public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
    request.setAttribute("suc", "");
go("/admin/ypcfadd.jsp", request, response);
}

//修改密码
if (ac.equals("uppass")) {
String id = request.getParameter("id");
String upass = request.getParameter("upass");
String tname = request.getParameter("tname");
String sex = request.getParameter("sex");
String birth = request.getParameter("birth");
String tel = request.getParameter("tel");
String ismarage = request.getParameter("ismarage");
String addr = request.getParameter("addr");
String email = request.getParameter("email");
String idcard = request.getParameter("idcard");
String byschool = request.getParameter("byschool");
String sql = "update sysuser set upass='" + upass + "',tname='" + tname + "',sex='" + sex + "' ,birth='" + birth + "',tel='" + tel + "',ismarage='" + ismarage + "',addr='" + addr + "',email='" + email + "'" +
" ,idcard='" + idcard + "',byschool='" + byschool + "' where id=" + id;
dao.commOper(sql);
request.setAttribute("suc", "");
go("/admin/uppass.jsp", request, response);
}
//退出
if (ac.equals("exit")) {
session.removeAttribute("admin");
request.setAttribute("suc", "");
go("/admin/login.jsp", request, response);
}
//新增挂号
if (ac.equals("ghadd")) {
String ghno = request.getParameter("ghno");
String tname = request.getParameter("tname");
String sex = request.getParameter("sex");
String age = request.getParameter("age");
String idcard = request.getParameter("idcard");
String tel = request.getParameter("tel");
String addr = request.getParameter("addr");
String ghdept = request.getParameter("ghdept");
String price = request.getParameter("price");
String status = "待问诊";
String delstatus = "0";
String oper = admin.get("uname").toString();
String savetime = Info.getDateStr();
dao.commOper("insert into ghinfo (ghno,tname,sex,age,idcard,tel,addr,ghdept,price,status,delstatus,oper,savetime) " +
" values('" + ghno + "','" + tname + "','" + sex + "','" + age + "','" + idcard + "','" + tel + "','" + addr + "','" + ghdept + "','" + price + "','" + status + "','" + delstatus + "','" + oper + "','" + savetime + "') ");
request.setAttribute("suc", "");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
    String savetime = Info.getDateStr();
String qystatus = "未取药";
String fkstatus = "未付款";
dao.commOper("update ghinfo set status='已问诊' where ghno='" + ghno + "'");
String sql = "insert into zd (ghno,bq,zd,info,numinfo,oper,savetime,qystatus,fkstatus) values" +
" ('" + ghno + "','" + bq + "','" + zd + "','" + info + "','" + numinfo + "','" + oper + "','" + savetime + "','" + qystatus + "','" + fkstatus + "') ";
dao.commOper(sql);
request.setAttribute("suc", "");
go("/admin/brwz.jsp?ghno=" + ghno, request, response);
}

//修改问诊
if (ac.equals("wzedit")) {
String ghno = request.getParameter("ghno");
String bq = request.getParameter("bq");
String zd = request.getParameter("zd");
String info = request.getParameter("Hidden1");
String numinfo = request.getParameter("Hidden2");
System.out.println("numinfo==" + numinfo);
String sql = "update zd set bq='" + bq + "',zd='" + zd + "',info='" + info + "',numinfo='" + numinfo + "' where ghno='" + ghno + "'";
dao.commOper(sql);
request.setAttribute("suc", "");
go("/admin/brwzedit.jsp?ghno=" + ghno, request, response);
}
//取药
if (ac.equals("qy")) {
String ghno = request.getParameter("ghno");
HashMap zdm = dao.select("select * from zd where ghno='" + ghno + "'").get(0);
String yinfo = zdm.get("info").toString();
String numinfo = zdm.get("numinfo").toString();
String a[] = yinfo.split("\\$");
String b[] = numinfo.split("\\$");
String is = "yes";
int m = 0;
for (int i = 0; i < a.length; i++) {
String ynos[] = a[i].split("\\-");
ArrayList amlist = (ArrayList) dao.select("select * from ypcf where yno='" + ynos[0] + "' and type='药品' ");
if (amlist.size() != 0) {
HashMap am = dao.select("select * from ypcf where yno='" + ynos[0] + "' and type='药品' ").get(0);
String yno = am.get("yno").toString();//药品编号
int num = Integer.parseInt(b[i]);//购买药品数量
//查药品数量
HashMap inmap = dao.select("select sum(num) as innum from kcrecord where type='in' and yno='" + ynos[0] + "' ").get(0);
HashMap outmap = dao.select("select sum(num) as outnum from kcrecord where type='out' and yno='" + ynos[0] + "' ").get(0);
int innum = 0;
int outnum = 0;
if (inmap.get("innum") != null) {
innum = Integer.parseInt(inmap.get("innum").toString());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// 表现层代码
protected String info;

// 请求路径
protected String path;

// 服务器请求对象
protected HttpServletRequest request;

/*
* 仅仅只是加到路径中去
*/
protected String parameter = "";

/**
*
* @param 下一页的分页链接
* @param 一页最大记录数
* @param 当前HttpServletRequest对象
* @param 数据库操作对象
*/
protected PageManager(String path, int pageSize, HttpServletRequest request) {
// 任意一个dao都行
this.currentPage = 1;
this.pageNumber = 1;
this.count = 0;
this.pageSize = pageSize <= 0 ? DEFAULTPAGESIZE : pageSize;
this.request = request;
this.path = path;

request.setAttribute("page", this);

try {
this.currentPage = Integer.parseInt(request
.getParameter("currentPage")) <= 0 ? 1 : Integer
.parseInt(request.getParameter("currentPage"));

} catch (Exception e) {

try {
this.currentPage = Integer.parseInt((String) request
.getSession().getAttribute("currentPage"));

} catch (Exception e1) {
this.currentPage = 1;

}

}


项目链接:
https://javayms.github.io?id=561122532008200rn
https://javayms.pages.dev?id=561122532008200rn