1 概述
系统主要为用户提供了医生、患者、管理员三种权限的用户,实现了前台患者查看信息、在线挂号、登录、注册等;后台医生管理坐诊信息、管理就诊信息、修改密码;后台管理员管理公告、管理科室、管理就诊、管理用户、修改密码等。在设计方面,本系统采用MVC模式,同时使用JSP技术进行动态页面的设计,使用Ajax进行页面异步交互。后台数据库选用mysql数据库。
2 数据库表
表5 挂号就诊信息
字段名称 | 字段大小 | 字段类型 | 说明 |
orderId | 4 | int | 订单编号 |
goodsId | 4 | int | 商品编号 |
status | 4 | int | 状态0已挂号,1检查缴费,100治疗完毕买药,101复诊 |
表6 科室信息
字段名称 | 字段大小 | 字段类型 | 说明 |
typeId | 4 | int | 编号 |
typeName | 20 | varchar | 名称 |
表7 在线挂号信息
字段名称 | 字段大小 | 字段类型 | 说明 |
orderId | 4 | 长整型(3) | 在线挂号编号 |
goodsId | 4 | 长整型(3) | 经验编号 |
status | 4 | 长整型(3) | 状态0未确认,1已确认,100在线挂号,101退约 |
3 关键代码
package com.control.admin;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.dao.CustomerInfoDAO;
import com.util.PublicToolCheckParam;
import com.util.PublicToolShowCustomerInfoList;
import com.util.Validate;
public class ManageCustomerInfo extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = 3099608914702213565L;
static CustomerInfoDAO cdao = new CustomerInfoDAO();
public static void coolCustomerInfo(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String customerId = Validate.replaceHtml(request
.getParameter("customerId"));
String isCooled = Validate
.replaceHtml(request.getParameter("isCooled"));
if (PublicToolCheckParam.checkNullAndEmpty(customerId)
&& PublicToolCheckParam.checkNullAndEmpty(isCooled)) {
cdao.coolCustomer(Integer.parseInt(customerId),
Integer.parseInt(isCooled));
String isSearching = Validate.replaceHtml(request
.getParameter("isSearching"));
String currentPage = Validate.replaceHtml(request.getParameter("currentPage"));
if (PublicToolCheckParam.checkNullAndEmpty(isSearching)) {
String key = Validate.replaceHtml(request.getParameter("key"));
PublicToolShowCustomerInfoList.searchCustomerInfo(request,
response, currentPage, key);
request.setAttribute("key", key);
request.setAttribute("isSearching", "yes");
} else {
PublicToolShowCustomerInfoList.showCustomerInfoList(request,
response, currentPage);
}
}
request.getRequestDispatcher("../admin/manageCustomerInfo.jsp")
.forward(request, response);
}
public static void coolMoreCustomerInfo(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String currentPage = Validate.replaceHtml(request.getParameter("currentPage"));
String[] ckb = request.getParameterValues("ckb");
if (ckb != null) {
for (int i = 0; i < ckb.length; i++) {
// cdao.coolCustomer(Integer.parseInt(ckb[i]));
}
}
PublicToolShowCustomerInfoList.showCustomerInfoList(request, response,
currentPage);
request.getRequestDispatcher("../admin/manageCustomerInfo.jsp")
.forward(request, response);
}
public static void searchCustomerInfo(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String currentPage = Validate.replaceHtml(request.getParameter("currentPage"));
String key = Validate.replaceHtml(request.getParameter("key"));
PublicToolShowCustomerInfoList.searchCustomerInfo(request, response,
currentPage, key);
request.setAttribute("isSearching", "yes");
request.setAttribute("key", key);
CustomerInfoDAO cdao = new CustomerInfoDAO();
int dongjie = cdao.getsdongjie(key);
int zhengchang = cdao.getszhengchang(key);
request.setAttribute("dongjie", dongjie);
request.setAttribute("zhengchang", zhengchang);
request.getRequestDispatcher("../admin/manageCustomerInfo.jsp")
.forward(request, response);
}
public static void showManageCustomerInfoPage(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
CustomerInfoDAO cdao = new CustomerInfoDAO();
int dongjie = cdao.getdongjie();
int zhengchang = cdao.getzhengchang();
request.setAttribute("dongjie", dongjie);
request.setAttribute("zhengchang", zhengchang);
String currentPage = Validate.replaceHtml(request.getParameter("currentPage"));
PublicToolShowCustomerInfoList.showCustomerInfoList(request, response,
currentPage);
request.getRequestDispatcher("../admin/manageCustomerInfo.jsp")
.forward(request, response);
}
/**
* Constructor of the object.
*/
public ManageCustomerInfo() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
* <p>
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
/**
* The doPost method of the servlet. <br>
* <p>
* This method is called when a form has its tag value method equals to
* post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String method = Validate.replaceHtml(request.getParameter("method"));
if (PublicToolCheckParam.checkNullAndEmpty(method)) {
if (method.equals("showManageCustomerInfoPage")) {
showManageCustomerInfoPage(request, response);
} else if (method.equals("cool")) {
coolCustomerInfo(request, response);
} else if (method.equals("coolMore")) {
coolMoreCustomerInfo(request, response);
} else if (method.equals("search")) {
searchCustomerInfo(request, response);
}
}
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
}
4 效果演示
idea或eclipse开发,mysql数据库