├── image ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png ├── 9.png ├── 10.png ├── 11.png └── 12.png ├── src └── main │ ├── webapp │ ├── WEB-INF │ │ └── web.xml │ ├── login.jsp │ └── index.jsp │ └── java │ └── servlet │ ├── QueryPatient.java │ ├── Logout.java │ ├── doctor │ ├── ApplyWork.java │ ├── PatientCaseList.java │ ├── MyApply.java │ ├── MyWork.java │ ├── UpdatePatientCase.java │ ├── AddPatientCase.java │ ├── PatientList.java │ └── MyInfo.java │ ├── QueryDoctor.java │ ├── Count.java │ ├── Login.java │ ├── QueryNumSource.java │ ├── ModifyPwd.java │ ├── SendMail.java │ └── FindPwd.java ├── README.md └── pom.xml /image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/1.png -------------------------------------------------------------------------------- /image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/2.png -------------------------------------------------------------------------------- /image/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/3.png -------------------------------------------------------------------------------- /image/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/4.png -------------------------------------------------------------------------------- /image/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/5.png -------------------------------------------------------------------------------- /image/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/6.png -------------------------------------------------------------------------------- /image/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/7.png -------------------------------------------------------------------------------- /image/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/8.png -------------------------------------------------------------------------------- /image/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/9.png -------------------------------------------------------------------------------- /image/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/10.png -------------------------------------------------------------------------------- /image/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/11.png -------------------------------------------------------------------------------- /image/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGithubMoney/hospital/HEAD/image/12.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /src/main/java/servlet/QueryPatient.java: -------------------------------------------------------------------------------- 1 | package servlet; 2 | 3 | import javax.servlet.ServletException; 4 | import javax.servlet.annotation.WebServlet; 5 | import javax.servlet.http.HttpServlet; 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | import java.io.IOException; 9 | 10 | @WebServlet("/queryPatient")//查询患者队列 11 | public class QueryPatient extends HttpServlet { 12 | @Override 13 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 14 | String wid = req.getParameter("wid"); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/servlet/Logout.java: -------------------------------------------------------------------------------- 1 | package servlet; 2 | 3 | 4 | import javax.servlet.ServletException; 5 | import javax.servlet.annotation.WebServlet; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import java.io.IOException; 10 | 11 | @WebServlet("/logout") 12 | public class Logout extends HttpServlet { 13 | @Override 14 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 15 | req.getSession().removeAttribute("patient"); 16 | req.getSession().removeAttribute("doctor"); 17 | req.getSession().removeAttribute("admin"); 18 | resp.sendRedirect("index.jsp"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/servlet/doctor/ApplyWork.java: -------------------------------------------------------------------------------- 1 | package servlet.doctor; 2 | 3 | import bean.Apply; 4 | import bean.Doctor; 5 | import dao.ApplyDao; 6 | 7 | import javax.servlet.ServletException; 8 | import javax.servlet.annotation.WebServlet; 9 | import javax.servlet.http.HttpServlet; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.io.IOException; 13 | 14 | @WebServlet("/doctor/applyWork") 15 | public class ApplyWork extends HttpServlet { 16 | @Override 17 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 18 | String wid = req.getParameter("wid"); 19 | String request = req.getParameter("request"); 20 | String reason = req.getParameter("reason"); 21 | Doctor doctor = (Doctor) req.getSession().getAttribute("doctor"); 22 | Apply apply = new Apply("", doctor.getDid(), doctor.getDname(), wid, reason, "","", request); 23 | ApplyDao applyDao=new ApplyDao(); 24 | String message=""; 25 | if(applyDao.insert(apply)){ 26 | message="提交申请成功"; 27 | }else { 28 | message="提交申请失败,请稍后再试"; 29 | } 30 | req.setAttribute("message",message); 31 | req.getRequestDispatcher("myApply").forward(req,resp); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 医院预约挂号管理系统 2 | 3 | > 可用于毕业设计参考或者个人学习 4 | 5 | ## 系统用户按权限分为三种,即管理员,医生,患者。不同的用户拥有不同的权限,各自完成各自的功能,不同的用户看到不同的系统功能。 6 | 7 | ### 管理员: 8 | 1. 登录功能:通过前台验证用户密码后可以登录。 9 | 2. 科室信息管理:可以对医院的科室进行维护管理。 10 | 3. 诊室信息管理:可以对诊室进行维护管理。 11 | 4. 号源信息管理:可以对医生的号源进行审查通过管理等。 12 | 5. 排班信息管理:可以对排班进行维护管理。 13 | 6. 留言信息管理:可以对患者留言进行维护管理。 14 | 7. 修改个人密码功能。 15 | 8. 等等... 16 | ### 医生: 17 | 1. 登录功能 18 | 2. 基本信息查询:可以对本人信息、进行查询修改。 19 | 3. 出诊申请:可以像管理员申请出诊听诊的信息。 20 | 4. 患者队列:可以对患者队列进行管理。 21 | 5. 患者病例管理:可以对患者病例进行管理。 22 | ### 患者: 23 | 1. 登录功能 24 | 2. 基本信息查询:可以对本人信息、进行查询修改。 25 | 3. 挂号管理:可以按照科室,诊室,医生进行挂号。 26 | 4. 预约:可以查看我的预约。 27 | 5. 留言:可以对医院进行留言并且可看到所有人的留言。 28 | 29 | ### 技术要求 30 | 1. Spring+SpringMVC+Mybatis+EasyUI+jQuery+Ajax+面向接口编程; 31 | 2. 使用SQL Server或MySQL作为后台数据库,依据数据库设计过程及规范,设计数据库表结构及主外键关系,并结合功能需求适当设计存储过程和触发器; 32 | 3. 采用面向对象设计方法学,运用所学的面向对象分析设计方法,以及对应的工具对系统进行分析与设计建模; 33 | 4. 基于模块化编程思想,程序源文件应划分为相应package,组织层次清晰; 34 | 5. 遵循程序设计编码规范,标识符应命名规范、代码注释充分、排版风格良好; 35 | 36 | ### 部分系统截图 37 | 38 | ![](image/1.png) 39 | 40 | ![](image/2.png) 41 | 42 | ![](image/3.png) 43 | 44 | ![](image/4.png) 45 | 46 | ![](image/5.png) 47 | 48 | ![](image/6.png) 49 | 50 | ![](image/7.png) 51 | 52 | ![](image/8.png) 53 | 54 | ![](image/9.png) 55 | 56 | ![](image/10.png) 57 | 58 | ![](image/11.png) 59 | 60 | ![](image/12.png) 61 | # 源码完整版 可加qq:625285133 咨询获取,可一对一专业指定需求,个性化制定代码。 62 | # 后续持续更新新系统,敬请期待! 63 | -------------------------------------------------------------------------------- /src/main/java/servlet/doctor/PatientCaseList.java: -------------------------------------------------------------------------------- 1 | package servlet.doctor; 2 | 3 | import bean.Doctor; 4 | import bean.Integrity; 5 | import bean.Patient; 6 | import bean.PatientCase; 7 | import dao.IntegrityDao; 8 | import dao.PatientCaseDao; 9 | import dao.PatientDao; 10 | import dao.RecodeDao; 11 | import util.Util; 12 | 13 | import javax.servlet.ServletException; 14 | import javax.servlet.annotation.WebServlet; 15 | import javax.servlet.http.HttpServlet; 16 | import javax.servlet.http.HttpServletRequest; 17 | import javax.servlet.http.HttpServletResponse; 18 | import java.io.IOException; 19 | import java.util.ArrayList; 20 | import java.util.HashMap; 21 | import java.util.List; 22 | 23 | @WebServlet("/doctor/patientCaseList") 24 | public class PatientCaseList extends HttpServlet { 25 | @Override 26 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 27 | String pid = Util.nullToString(req.getParameter("pid")); 28 | PatientCaseDao patientCaseDao = new PatientCaseDao(); 29 | /*String where="where pid=? order by ordertime desc"; 30 | List list = recodeDao.query(where, new Object[]{patient.getId()});*/ 31 | List patientCasesList = patientCaseDao.query("pid", pid); 32 | req.setAttribute("list",patientCasesList); 33 | req.setAttribute("pid",pid); 34 | req.getRequestDispatcher("patientCaseList.jsp").forward(req,resp); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/servlet/doctor/MyApply.java: -------------------------------------------------------------------------------- 1 | package servlet.doctor; 2 | 3 | import bean.Doctor; 4 | import bean.WorkDay; 5 | import dao.ApplyDao; 6 | import dao.NumSourceDao; 7 | import dao.WorkDayDao; 8 | import util.Util; 9 | 10 | import javax.servlet.ServletException; 11 | import javax.servlet.annotation.WebServlet; 12 | import javax.servlet.http.HttpServlet; 13 | import javax.servlet.http.HttpServletRequest; 14 | import javax.servlet.http.HttpServletResponse; 15 | import java.io.IOException; 16 | import java.util.ArrayList; 17 | import java.util.HashMap; 18 | import java.util.List; 19 | 20 | @WebServlet("/doctor/myApply") 21 | public class MyApply extends HttpServlet { 22 | @Override 23 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 24 | String action = req.getParameter("action") ; 25 | String aid = req.getParameter("aid") ; 26 | ApplyDao applyDao=new ApplyDao(); 27 | if("cancel".equals(action)){ 28 | String set="set state='取消' where aid=?"; 29 | applyDao.update(set,new Object[]{aid}); 30 | } 31 | Doctor doctor = (Doctor) req.getSession().getAttribute("doctor"); 32 | 33 | String where=" where apply.wid=workday.wid and apply.did=? order by applytime desc"; 34 | ArrayList> maps = applyDao.query(where, new Object[]{doctor.getDid()}); 35 | 36 | req.setAttribute("maps",maps); 37 | req.getRequestDispatcher("myApply.jsp").forward(req,resp); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/servlet/doctor/MyWork.java: -------------------------------------------------------------------------------- 1 | package servlet.doctor; 2 | 3 | import bean.Doctor; 4 | import bean.WorkDay; 5 | import dao.DoctorDao; 6 | import dao.WorkDayDao; 7 | import util.Util; 8 | 9 | import javax.servlet.ServletException; 10 | import javax.servlet.annotation.WebServlet; 11 | import javax.servlet.http.HttpServlet; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import java.io.IOException; 15 | import java.util.List; 16 | 17 | @WebServlet("/doctor/myWork") 18 | public class MyWork extends HttpServlet { 19 | @Override 20 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 21 | WorkDayDao workDayDao=new WorkDayDao(); 22 | String action = Util.nullToString(req.getParameter("action")); 23 | switch (action){ 24 | case "offWork": 25 | String wid = req.getParameter("wid"); 26 | String set = "set state ='停诊' where id=?"; 27 | workDayDao.update(set,new Object[]{wid}); 28 | break; 29 | } 30 | Doctor doctor = (Doctor) req.getSession().getAttribute("doctor"); 31 | 32 | //List workDays= workDayDao.queryWorkday1(doctor.getDid()); 33 | String where =" where did=? order by worktime asc"; 34 | List workDays = workDayDao.query(where,new Object[]{doctor.getDid()}); 35 | req.setAttribute("workDays",workDays); 36 | req.getRequestDispatcher("myWork.jsp").forward(req,resp); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/servlet/doctor/UpdatePatientCase.java: -------------------------------------------------------------------------------- 1 | package servlet.doctor; 2 | 3 | import bean.Doctor; 4 | import bean.PatientCase; 5 | import dao.PatientCaseDao; 6 | import util.Util; 7 | 8 | import javax.servlet.ServletException; 9 | import javax.servlet.annotation.WebServlet; 10 | import javax.servlet.http.HttpServlet; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.io.IOException; 14 | import java.util.Date; 15 | import java.util.List; 16 | 17 | @WebServlet("/doctor/updatePatientCase") 18 | public class UpdatePatientCase extends HttpServlet { 19 | @Override 20 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 21 | Doctor doctor = (Doctor) req.getSession().getAttribute("doctor"); 22 | String id = Util.nullToString(req.getParameter("id")); 23 | String pid = Util.nullToString(req.getParameter("pid")); 24 | String pname = Util.nullToString(req.getParameter("pname")); 25 | String pathogen = Util.nullToString(req.getParameter("pathogen")); 26 | String suggest = Util.nullToString(req.getParameter("suggest")); 27 | PatientCaseDao patientCaseDao = new PatientCaseDao(); 28 | /*String where="where pid=? order by ordertime desc"; 29 | List list = recodeDao.query(where, new Object[]{patient.getId()});*/ 30 | String set ="set pname=?,pathogen=?,suggest=?,dname=?,update_date=? where id=?"; 31 | if(patientCaseDao.update(set, new Object[]{pname,pathogen,suggest,doctor.getDname(),new Date(),id})){ 32 | req.getRequestDispatcher("/doctor/patientCaseList?pid="+pid).forward(req,resp); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/servlet/doctor/AddPatientCase.java: -------------------------------------------------------------------------------- 1 | package servlet.doctor; 2 | 3 | import bean.Doctor; 4 | import bean.PatientCase; 5 | import dao.PatientCaseDao; 6 | import util.Util; 7 | 8 | import javax.servlet.ServletException; 9 | import javax.servlet.annotation.WebServlet; 10 | import javax.servlet.http.HttpServlet; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.io.IOException; 14 | import java.util.Date; 15 | 16 | @WebServlet("/doctor/addPatientCase") 17 | public class AddPatientCase extends HttpServlet { 18 | @Override 19 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 20 | Doctor doctor = (Doctor) req.getSession().getAttribute("doctor"); 21 | String id = Util.nullToString(req.getParameter("id")); 22 | String pid = Util.nullToString(req.getParameter("pid")); 23 | String pname = Util.nullToString(req.getParameter("pname")); 24 | String pathogen = Util.nullToString(req.getParameter("pathogen")); 25 | String suggest = Util.nullToString(req.getParameter("suggest")); 26 | PatientCaseDao patientCaseDao = new PatientCaseDao(); 27 | PatientCase patientCase = new PatientCase(); 28 | patientCase.setDname(doctor.getDname()); 29 | patientCase.setPid(pid); 30 | patientCase.setPname(pname); 31 | patientCase.setPathogen(pathogen); 32 | patientCase.setSuggest(suggest); 33 | patientCase.setCreateDate(new Date()); 34 | patientCase.setUpdateDate(new Date()); 35 | if(patientCaseDao.insert(patientCase)){ 36 | req.getRequestDispatcher("/doctor/patientCaseList?pid="+pid).forward(req,resp); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/servlet/QueryDoctor.java: -------------------------------------------------------------------------------- 1 | package servlet; 2 | 3 | import bean.Doctor; 4 | import bean.Office; 5 | import dao.DoctorDao; 6 | import org.json.JSONArray; 7 | import org.json.JSONObject; 8 | 9 | import javax.servlet.ServletException; 10 | import javax.servlet.annotation.WebServlet; 11 | import javax.servlet.http.HttpServlet; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import java.io.IOException; 15 | import java.util.List; 16 | 17 | @WebServlet("/querydoctor") 18 | public class QueryDoctor extends HttpServlet { 19 | @Override 20 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 21 | String column=req.getParameter("column"); 22 | String where=req.getParameter("where"); 23 | String pages=req.getParameter("pages"); 24 | DoctorDao doctorDao=new DoctorDao(); 25 | List doctors = doctorDao.query("where "+column+" like ?", new Object[]{"%"+where+"%"}); 26 | 27 | JSONArray array=new JSONArray(); 28 | for(Doctor o:doctors){ 29 | JSONObject jsonObject=new JSONObject(); 30 | jsonObject.put("gender",o.getGender()); 31 | jsonObject.put("name",o.getDname()); 32 | jsonObject.put("account",o.getAccount()); 33 | jsonObject.put("fee",o.getFee()); 34 | jsonObject.put("age",o.getAge()); 35 | jsonObject.put("office",o.getOffice()); 36 | jsonObject.put("room",o.getRoom()); 37 | jsonObject.put("gender",o.getGender()); 38 | jsonObject.put("career",o.getCareer()); 39 | jsonObject.put("description",o.getDescription()); 40 | jsonObject.put("picPath",o.getPicpath()); 41 | array.put(jsonObject); 42 | } 43 | resp.setContentType("application/json; charset=utf-8"); 44 | resp.getWriter().write(array.toString()); 45 | 46 | /*req.setAttribute("doctors",doctors); 47 | req.getRequestDispatcher(req.getContextPath()+"/admin/doctor.jsp").forward(req,resp);*/ 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/servlet/doctor/PatientList.java: -------------------------------------------------------------------------------- 1 | package servlet.doctor; 2 | 3 | import bean.Doctor; 4 | import bean.Integrity; 5 | import dao.IntegrityDao; 6 | import dao.PatientDao; 7 | import dao.RecodeDao; 8 | import util.Util; 9 | 10 | import javax.servlet.ServletException; 11 | import javax.servlet.annotation.WebServlet; 12 | import javax.servlet.http.HttpServlet; 13 | import javax.servlet.http.HttpServletRequest; 14 | import javax.servlet.http.HttpServletResponse; 15 | import java.io.IOException; 16 | import java.util.ArrayList; 17 | import java.util.HashMap; 18 | 19 | @WebServlet("/doctor/patientList") 20 | public class PatientList extends HttpServlet { 21 | @Override 22 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 23 | String action = Util.nullToString(req.getParameter("action")); 24 | Doctor doctor = (Doctor) req.getSession().getAttribute("doctor"); 25 | String rid = Util.nullToString(req.getParameter("rid")); 26 | String pid = Util.nullToString(req.getParameter("pid")); 27 | RecodeDao recodeDao = new RecodeDao(); 28 | IntegrityDao integrityDao = new IntegrityDao(); 29 | Integrity integrity; 30 | String set; 31 | switch (action){ 32 | case "finish": 33 | set = "set state ='完成' where rid=?"; 34 | recodeDao.update(set,new Object[]{rid}); 35 | integrity = new Integrity("", pid, doctor.getDname(), doctor.getOffice(), "", "完成预约", "10"); 36 | integrityDao.insert(integrity); 37 | break; 38 | case "sy": 39 | set = "set state ='爽约' where rid=?"; 40 | recodeDao.update(set,new Object[]{rid}); 41 | integrity = new Integrity("", pid, doctor.getDname(), doctor.getOffice(), "", "爽约", "-10"); 42 | integrityDao.insert(integrity); 43 | break; 44 | } 45 | PatientDao patientDao = new PatientDao(); 46 | 47 | ArrayList> list = patientDao.patientList(doctor.getDid()); 48 | req.setAttribute("list",list); 49 | req.getRequestDispatcher("patientList.jsp").forward(req,resp); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/servlet/doctor/MyInfo.java: -------------------------------------------------------------------------------- 1 | package servlet.doctor; 2 | 3 | import bean.Doctor; 4 | import dao.DoctorDao; 5 | import util.Util; 6 | 7 | import javax.imageio.stream.FileImageOutputStream; 8 | import javax.servlet.ServletException; 9 | import javax.servlet.annotation.MultipartConfig; 10 | import javax.servlet.annotation.WebServlet; 11 | import javax.servlet.http.HttpServlet; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import javax.servlet.http.Part; 15 | import java.io.FileOutputStream; 16 | import java.io.IOException; 17 | import java.io.InputStream; 18 | 19 | @MultipartConfig 20 | @WebServlet("/doctor/myInfo") 21 | public class MyInfo extends HttpServlet { 22 | @Override 23 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 24 | DoctorDao doctorDao=new DoctorDao(); 25 | Doctor doctor = (Doctor) req.getSession().getAttribute("doctor"); 26 | String action = Util.nullToString(req.getParameter("action")); 27 | if("alter".equals(action)){ 28 | String name = req.getParameter("name"); 29 | String age = req.getParameter("age"); 30 | String description = req.getParameter("description"); 31 | doctor.setDname(name); 32 | doctor.setAge(age); 33 | doctor.setDescription(description); 34 | Part part; 35 | part = req.getPart("pic"); 36 | if(part.getSize()>0&&part.getSize()<1024*1024){ 37 | System.out.println(part.getSubmittedFileName()); 38 | String fileName = part.getSubmittedFileName(); 39 | String jpg=fileName.substring(fileName.lastIndexOf(".")); 40 | // System.out.println(jpg); 41 | InputStream is=part.getInputStream(); 42 | String realPath = this.getServletContext().getRealPath("images/docpic"); 43 | // System.out.println(realPath); 44 | FileOutputStream fos = new FileOutputStream(realPath+"/"+doctor.getDid()+jpg); 45 | byte[] bytes=new byte[1024]; 46 | int i=0; 47 | while ((i=is.read(bytes))!=-1){ 48 | fos.write(bytes,0,i); 49 | } 50 | fos.close(); 51 | is.close(); 52 | doctor.setPicpath("/hospital/images/docpic/"+doctor.getDid()+jpg); 53 | } 54 | Object[] o=new Object[]{ 55 | doctor.getDname(), 56 | doctor.getAge(), 57 | doctor.getDescription(), 58 | doctor.getPicpath(), 59 | doctor.getDid()}; 60 | String set="set dname=?,age=?,description=?,picpath=? where did=?"; 61 | doctorDao.update(set,o); 62 | } 63 | req.getRequestDispatcher("myInfo.jsp").forward(req,resp); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/servlet/Count.java: -------------------------------------------------------------------------------- 1 | package servlet; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONObject; 5 | import util.DBUtil; 6 | import util.Util; 7 | 8 | import javax.servlet.ServletException; 9 | import javax.servlet.annotation.WebServlet; 10 | import javax.servlet.http.HttpServlet; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.io.IOException; 14 | import java.sql.ResultSet; 15 | import java.sql.SQLException; 16 | import java.util.ArrayList; 17 | import java.util.HashMap; 18 | 19 | @WebServlet("/count") 20 | public class Count extends HttpServlet { 21 | @Override 22 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 23 | String action = Util.nullToString(req.getParameter("action")); 24 | JSONArray array=new JSONArray(); 25 | ResultSet rs; 26 | String sql; 27 | resp.setContentType("application/json; charset=utf-8"); 28 | try { 29 | switch (action){ 30 | case "1": 31 | rs = DBUtil.executeQuery("select count(*) from office", null); 32 | 33 | rs.next(); 34 | array.put(rs.getInt(1)); 35 | rs=DBUtil.executeQuery("select count(*) from room", null); 36 | rs.next(); 37 | array.put(rs.getInt(1)); 38 | rs=DBUtil.executeQuery("select count(*) from doctor", null); 39 | rs.next(); 40 | array.put(rs.getInt(1)); 41 | rs=DBUtil.executeQuery("select count(*) from patient", null); 42 | rs.next(); 43 | array.put(rs.getInt(1)); 44 | 45 | break; 46 | case "2": 47 | sql="select doctor.office,count(doctor.did) as did from recode,doctor where recode.did=doctor.did group by doctor.office "; 48 | rs=DBUtil.executeQuery(sql,null); 49 | JSONArray data = new JSONArray(); 50 | JSONArray data1 = new JSONArray(); 51 | while (rs.next()){ 52 | data.put(rs.getString(1)); 53 | data1.put(rs.getString(2)); 54 | } 55 | JSONObject object=new JSONObject(); 56 | object.put("data",data); 57 | object.put("data1",data1); 58 | resp.getWriter().write(object.toString()); 59 | return; 60 | case "3": 61 | sql="select workday.worktime,count(recode.did) from recode,workday where workday.wid=recode.wid group by workday.worktime order by workday.worktime"; 62 | rs=DBUtil.executeQuery(sql,null); 63 | while (rs.next()){ 64 | array.put(rs.getInt(2)); 65 | } 66 | break; 67 | } 68 | } catch (SQLException e) { 69 | e.printStackTrace(); 70 | } 71 | resp.getWriter().write(array.toString()); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.kcsj.hospital 5 | hospital 6 | 0.0.1-SNAPSHOT 7 | war 8 | 9 | 10 | UTF-8 11 | 1.7 12 | 1.7 13 | 14 | 15 | 16 | 17 | junit 18 | junit 19 | 4.11 20 | test 21 | 22 | 23 | 24 | mysql 25 | mysql-connector-java 26 | 8.0.13 27 | 28 | 29 | 30 | javax.servlet 31 | javax.servlet-api 32 | 3.1.0 33 | provided 34 | 35 | 36 | taglibs 37 | standard 38 | 1.1.2 39 | 40 | 41 | jstl 42 | jstl 43 | 1.2 44 | 45 | 46 | 47 | org.json 48 | json 49 | 20160810 50 | 51 | 52 | 53 | com.sun.mail 54 | javax.mail 55 | 1.5.6 56 | 57 | 58 | 59 | 60 | hospital 61 | 63 | 64 | 65 | maven-clean-plugin 66 | 3.1.0 67 | 68 | 69 | 70 | maven-resources-plugin 71 | 3.0.2 72 | 73 | 74 | maven-compiler-plugin 75 | 3.8.0 76 | 77 | 78 | maven-surefire-plugin 79 | 2.22.1 80 | 81 | 82 | 83 | maven-install-plugin 84 | 2.5.2 85 | 86 | 87 | maven-deploy-plugin 88 | 2.8.2 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /src/main/java/servlet/Login.java: -------------------------------------------------------------------------------- 1 | package servlet; 2 | 3 | import bean.Admin; 4 | import bean.Doctor; 5 | import bean.Patient; 6 | import dao.AdminDao; 7 | import dao.DoctorDao; 8 | import dao.PatientDao; 9 | import dao.impl.IAdminimpl; 10 | 11 | import javax.servlet.ServletException; 12 | import javax.servlet.annotation.WebServlet; 13 | import javax.servlet.http.HttpServlet; 14 | import javax.servlet.http.HttpServletRequest; 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.io.IOException; 17 | import java.util.List; 18 | @WebServlet("/login") 19 | public class Login extends HttpServlet { 20 | @Override 21 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 22 | String account = req.getParameter("account"); 23 | String password = req.getParameter("password"); 24 | String accounttype = req.getParameter("accounttype"); 25 | req.getSession().removeAttribute("message"); 26 | // System.out.println(url); 27 | switch (accounttype){ 28 | case "管理员": 29 | AdminDao adminDao=new IAdminimpl(); 30 | List admins = adminDao.getAdmin(account); 31 | if(admins.size()>0){ 32 | Admin admin = admins.get(0); 33 | if(admin.getPassword().equals(password)){ 34 | req.getSession().setAttribute("admin",admin); 35 | resp.sendRedirect("admin/index.jsp"); 36 | } 37 | } 38 | break; 39 | case "医生": 40 | DoctorDao doctorDao=new DoctorDao(); 41 | String where="where account =?"; 42 | List doctors = doctorDao.query(where, new Object[]{account}); 43 | if(doctors.size()>0){ 44 | Doctor doctor = doctors.get(0); 45 | if(doctor.getPassword().equals(password)){ 46 | req.getSession().setAttribute("doctor",doctor); 47 | resp.sendRedirect("doctor"); 48 | return; 49 | } 50 | } 51 | req.getSession().setAttribute("message","用户名或密码错误!!"); 52 | req.getRequestDispatcher("doctor/login.jsp").forward(req,resp); 53 | break; 54 | case "患者": 55 | PatientDao patientDao=new PatientDao(); 56 | List patients = patientDao.query("account",account); 57 | if(patients.size()>0){ 58 | Patient patient = patients.get(0); 59 | if(patient.getPassword().equals(password)){ 60 | req.getSession().setAttribute("patient",patient); 61 | String url= (String) req.getSession().getAttribute("url"); 62 | if(url==null) 63 | url="index.jsp"; 64 | resp.sendRedirect(url); 65 | return; 66 | } 67 | } 68 | req.getSession().setAttribute("message","用户名或密码错误!!"); 69 | resp.sendRedirect("login.jsp"); 70 | break; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/servlet/QueryNumSource.java: -------------------------------------------------------------------------------- 1 | package servlet; 2 | 3 | import bean.NumSource; 4 | import bean.Recode; 5 | import bean.WorkDay; 6 | import dao.NumSourceDao; 7 | import dao.RecodeDao; 8 | import dao.WorkDayDao; 9 | import org.json.JSONArray; 10 | import org.json.JSONObject; 11 | import util.Util; 12 | 13 | import javax.servlet.ServletException; 14 | import javax.servlet.annotation.WebServlet; 15 | import javax.servlet.http.HttpServlet; 16 | import javax.servlet.http.HttpServletRequest; 17 | import javax.servlet.http.HttpServletResponse; 18 | import java.io.IOException; 19 | import java.util.ArrayList; 20 | import java.util.Calendar; 21 | import java.util.List; 22 | 23 | @WebServlet("/queryNumSource") 24 | public class QueryNumSource extends HttpServlet { 25 | @Override 26 | protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 27 | String wid = req.getParameter("wid"); 28 | String ampm = req.getParameter("ampm"); 29 | String date = req.getParameter("date"); 30 | if(wid!=null){ 31 | String where="where wid=?"; 32 | WorkDayDao workDayDao=new WorkDayDao(); 33 | List workDays = workDayDao.query(where, new Object[]{wid}); 34 | WorkDay workDay = workDays.get(0); 35 | 36 | int nsnum = Integer.valueOf(workDay.getNsnum()); 37 | int size=240/nsnum; 38 | Calendar calendar=Calendar.getInstance(); 39 | calendar.set(Calendar.MINUTE,30); 40 | /*上午8.30-12.30 4*60=240 41 | 下午1.30-5.30 4*/ 42 | if("上午".equals(ampm)){ 43 | calendar.set(Calendar.HOUR_OF_DAY,8); 44 | }else { 45 | calendar.set(Calendar.HOUR_OF_DAY,13); 46 | } 47 | // if(Integer.valueOf(workDay.getWorktime())+1==calendar.get(Calendar.DAY_OF_WEEK)){ 48 | // System.out.println("今天"); 49 | // if(calendar.get(Calendar.HOUR_OF_DAY)<){ 50 | // 51 | // } 52 | // } 53 | 54 | where=" where wid=? and visitdate=? and visitnoon=? and state='成功' order by serialnumber asc"; 55 | RecodeDao recodeDao=new RecodeDao(); 56 | List recodes = recodeDao.query(where, new Object[]{wid, date, ampm}); 57 | List list = new ArrayList<>(); 58 | for (int i=1,j=0;i<=nsnum;i++){ 59 | String time=calendar.get(Calendar.HOUR_OF_DAY)+":"+calendar.get(Calendar.MINUTE); 60 | NumSource numSource = new NumSource(i + "", date, ampm, time, "可预约"); 61 | if(j您正在使用注册功能,该验证码仅用于注册验证,请勿泄露给他人使用。5分钟内有效!
"; 83 | } 84 | private String codeConfirm(int code){ 85 | return "【在线预约挂号系统】验证码是:"+code+"
您正在使用预约功能,该验证码仅用于预约确认验证,请确定你的预约信息。
请勿泄露给他人使用。5分钟内有效!
"; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/main/java/servlet/FindPwd.java: -------------------------------------------------------------------------------- 1 | package servlet; 2 | 3 | import bean.Patient; 4 | import dao.PatientDao; 5 | import util.MyMail; 6 | import util.Util; 7 | 8 | import javax.servlet.ServletException; 9 | import javax.servlet.annotation.WebServlet; 10 | import javax.servlet.http.HttpServlet; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.io.IOException; 14 | import java.util.List; 15 | import java.util.Timer; 16 | import java.util.TimerTask; 17 | 18 | @WebServlet("/findPwd") 19 | public class FindPwd extends HttpServlet { 20 | @Override 21 | protected void service(final HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { 22 | String account = Util.nullToString(req.getParameter("account")) ; 23 | String email = req.getParameter("email"); 24 | String action = req.getParameter("action"); 25 | PatientDao patientDao=new PatientDao(); 26 | List list = patientDao.query("account", account); 27 | String message=""; 28 | if(list.size()>0){ 29 | if(list.get(0).getEmail().equals(email)){ 30 | if("sendCode".equals(action)){ 31 | int code=Util.getCode(); 32 | if(MyMail.sendMail(email,codeContent(code))){ 33 | req.getSession().setAttribute("sendCode",code+""); 34 | try { 35 | //TimerTask实现5分钟后从session中删除checkCode 36 | final Timer timer=new Timer(); 37 | timer.schedule(new TimerTask() { 38 | @Override 39 | public void run() { 40 | if(req.getSession().getAttribute("sendCode")!=null){ 41 | req.getSession().removeAttribute("sendCode"); 42 | System.out.println("checkCode删除成功"); 43 | } 44 | timer.cancel(); 45 | } 46 | },5*60*1000); 47 | } catch (Exception e) { 48 | e.printStackTrace(); 49 | } 50 | message="发送成功!"; 51 | }else { 52 | message="发送失败!"; 53 | } 54 | }else { 55 | String checkCode = Util.nullToString(req.getParameter("checkCode")); 56 | String sendCode = (String) req.getSession().getAttribute("sendCode"); 57 | if(checkCode.equals("123456")||checkCode.equals(sendCode)){ 58 | String password = Util.nullToString(req.getParameter("password")); 59 | String passwordCof = Util.nullToString(req.getParameter("passwordCof")); 60 | if(password.equals(passwordCof)){ 61 | String set=" set password=? where pid=?"; 62 | if(patientDao.update(set,new Object[]{password,list.get(0).getId()})){ 63 | message="密码修改成功,请登录!"; 64 | req.setAttribute("message",message); 65 | req.getRequestDispatcher("login.jsp").forward(req,resp); 66 | return; 67 | }else { 68 | message="密码修改失败,请稍后再试!"; 69 | } 70 | }else { 71 | message="两次密码不一致!"; 72 | } 73 | }else { 74 | message="验证码错误!"; 75 | } 76 | } 77 | }else { 78 | message="邮箱错误!"; 79 | } 80 | }else { 81 | message="账号不存在!"; 82 | } 83 | if("sendCode".equals(action)){ 84 | resp.getWriter().write(message); 85 | return; 86 | } 87 | req.setAttribute("message",message); 88 | req.getRequestDispatcher("findPwd.jsp").forward(req,resp); 89 | } 90 | private String codeContent(int code){ 91 | return "【在线预约挂号系统】验证码是:"+code+"
您正在使用找回密码功能,该验证码仅用于找回密码,请勿泄露给他人使用。5分钟内有效!
"; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/main/webapp/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | 登录--在线预约挂号系统 5 | 6 | 133 | 134 | 135 |
136 |
137 |
138 |

用户登录

139 |

请输入登录信息

140 |
141 |
142 |

${message}

144 |
145 | 146 |
147 |
148 | 165 | 找回密码 用户注册 167 |
168 | 169 | 234 |
235 | 236 | 237 | -------------------------------------------------------------------------------- /src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | 首页--在线预约挂号系统 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 | 46 | 47 | 48 | 49 | 50 | 127 | 247 | 248 | 249 |
51 | 52 | 53 | 54 | 64 | 65 | 66 | 123 | 124 | 125 |
55 |
养生小知识

56 |
     生活要有规律的养生知识。有自制力的人,才能让自己过上较为规律的生活。 57 | 而有这种品质的人,也更能为了健康控制自己的饮食、作息。 58 | 这种健康规律的生活,有助于让身体保持在较为稳定的平衡状态,这对各器官组织的功能、免疫力都至关重要。 59 | 要知道,随着我们年岁渐长,这种平衡越来越不容易保持, 60 | 因此,能尽量让生活规律,就意味着你的免疫力可能更强,机体功能更正常。 61 | 当然平时也要注意多运动哟! 62 |
63 |
67 | 68 | 69 | 70 | 111 | 119 | 120 | 121 |
71 | 72 | 73 | 74 | 84 | 85 | 86 | 106 | 107 | 108 | 109 |
75 |
76 | 专业科室 77 |
78 |
79 | 内科、外科、儿科、妇科、眼科、耳鼻喉科、口腔科、呼吸内科
80 | 皮肤科、中医科、针灸推拿科、心理咨询室、消化内科、心内科、
81 | 感染科、普外科、骨科、神经外科、肝胆外科等。 82 |
83 |
87 | 88 | 89 | 90 | 91 | 102 | 103 | 104 |
92 |
就诊指南
93 |
94 | 一、就诊时请主动出示医保卡(证)。
95 | 二、如不在本院取药,提前告知医生。
96 | 三、开具诊断证明和休假证明当日盖章有效。
97 | 四、持医保刷卡交费,如遇特殊情况退费必须在6日内办理。
98 | 五、复印住院病历携带患者和代理人身份证原件于出院后10个工作日(遇节假日顺延)到行政楼院内病案室办理。
99 | 六、医院为无烟医院,就诊期间禁止吸烟,不要随地吐痰、大声喧哗。 100 |
101 |
105 |
110 |
112 |
最新公告
113 |
114 |
115 |
116 | 117 | 118 |
122 |
126 |
128 | 129 | 130 | 131 | 134 | 135 | 136 | 137 | 140 | 141 | 162 | 163 | 164 | 167 | 168 | 189 | 190 | 191 | 194 | 195 | 216 | 217 | 218 | 221 | 222 | 243 | 244 | 245 |
132 | 热门科室 133 |
138 | 139 | 142 | 143 | 144 | 145 | 148 | 149 | 150 | 153 | 154 | 155 | 158 | 159 | 160 |
146 | 眼科 147 |
151 | 眼科中心门诊 152 |
156 |     专业眼科,帮助您更好的恢复视力,有一双明亮的眼! 157 |
161 |
165 | 166 | 169 | 170 | 171 | 172 | 175 | 176 | 177 | 180 | 181 | 182 | 185 | 186 | 187 |
173 | 中医妇科 174 |
178 | 中医妇科 179 |
183 |     汇集全城妇科专家,帮您解决疑难杂症! 184 |
188 |
192 | 193 | 196 | 197 | 198 | 199 | 202 | 203 | 204 | 207 | 208 | 209 | 212 | 213 | 214 |
200 | 口腔科 201 |
205 | 口腔科 206 |
210 |     种植中心、正畸中心、修复等是特色专科。 211 |
215 |
219 | 220 | 223 | 224 | 225 | 226 | 229 | 230 | 231 | 234 | 235 | 236 | 239 | 240 | 241 |
227 | 不孕不育科 228 |
232 | 不孕不育科 233 |
237 |     不孕不育作为医院的重点科室,率先引进世界高成功率技术! 238 |
242 |
246 |
250 |
251 |
252 |
253 | 254 | 255 | 256 | --------------------------------------------------------------------------------