欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Java 实战练手项目之医院预约挂号系统的实现流程

程序员文章站 2022-03-05 17:30:36
一、项目简述功能: 用户分为患者,医生,管理员,患者可进行注册选择医生 挂号,选择日期,选择号源,医生可进行接诊,管理员可 对用户,医生信息的维护等等功能。二、项目运行环境配置: jdk1.8 + t...

一、项目简述

功能: 用户分为患者,医生,管理员,患者可进行注册选择医生 挂号,选择日期,选择号源,医生可进行接诊,管理员可 对用户,医生信息的维护等等功能。

二、项目运行

环境配置: jdk1.8 + tomcat8.5 + mysql + eclispe (intellij idea,eclispe,myeclispe,sts 都支持)

项目技术: jdbc+ servlert + jsp + css + javascript + jquery + ajax + fileupload等等。

Java 实战练手项目之医院预约挂号系统的实现流程

Java 实战练手项目之医院预约挂号系统的实现流程

Java 实战练手项目之医院预约挂号系统的实现流程

Java 实战练手项目之医院预约挂号系统的实现流程

Java 实战练手项目之医院预约挂号系统的实现流程

登录拦截器代码:

/**
 * 登录拦截器
 * @author administrator
 *
 */
@component
public class logininterceptor implements handlerinterceptor{
 
	private logger log = loggerfactory.getlogger(logininterceptor.class);
	@autowired
	private siteconfig siteconfig;
	
	@override
	public boolean  prehandle(httpservletrequest request, httpservletresponse response, object handler){
		string requesturi = request.getrequesturi();
		httpsession session = request.getsession();
		session.setattribute(sessionconstant.session_user_auth_key, appconfig.order_auth);
 
		object attribute = session.getattribute(sessionconstant.session_user_login_key);
		if(attribute == null){
			log.info("用户还未登录或者session失效,重定向到登录页面,当前url=" + requesturi);
			//首先判断是否是ajax请求
			if(stringutil.isajax(request)){
				//表示是ajax请求
				try {
					response.setcharacterencoding("utf-8");
					response.getwriter().write(json.tojsonstring(codemsg.user_session_expired));
				} catch (ioexception e) {
					// todo auto-generated catch block
					e.printstacktrace();
				}
				return false;
			}
			//说明是普通的请求,可直接重定向到登录页面
			//用户还未登录或者session失效,重定向到登录页面
			try {
				response.sendredirect("/system/login");
			} catch (ioexception e) {
				// todo auto-generated catch block
				e.printstacktrace();
			}
			return false;
		}
		log.info("该请求符合登录要求,放行" + requesturi);
		if(!stringutil.isajax(request)){
			//若不是ajax请求,则将菜单信息放入页面模板变量
			user user = (user)attribute;
			list<menu> authorities = user.getrole().getauthorities();
			request.setattribute("usertopmenus", menuutil.gettopmenus(authorities));
			list<menu> secondmenus = menuutil.getsecondmenus(user.getrole().getauthorities());
			request.setattribute("usersecondmenus", secondmenus);
			request.setattribute("userthirdmenus", menuutil.getchildren(menuutil.getmenuidbyurl(requesturi,secondmenus),authorities));
			request.setattribute("sitename", siteconfig.getsitename());
			request.setattribute("siteurl", siteconfig.getsiteurl());
		}
		return true;
	}
}

医院预约挂号系统后台管理页面代码:

<!doctype html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>${sitename!""}后台管理系统主页</title>
    <#include "../common/header.ftl"/>
 
</head>
 
<body>
<div class="lyear-layout-web">
    <!--左侧导航-->
    <aside class="lyear-layout-sidebar">
 
        <!-- logo -->
        <div id="logo" class="sidebar-header">
            <a href="/system/index" rel="external nofollow" ><img src="/admin/images/logo-sidebar.png" title="${sitename!""}"
                                         alt="${sitename!""}"/></a>
        </div>
        <div class="lyear-layout-sidebar-scroll">
            <#include "../common/left-menu.ftl"/>
        </div>
 
    </aside>
    <!--end 左侧导航-->
 
    <#include "../common/header-menu.ftl"/>
 
    <!--页面主要内容-->
    <main class="lyear-layout-content">
 
        <div class="container-fluid">
 
            <div class="row">
                <div class="col-sm-6 col-lg-3">
                    <div class="card bg-primary">
                        <div class="card-body clearfix">
                            <div class="pull-right">
                                <p class="h6 text-white m-t-0">备份文件</p>
                                <p class="h3 text-white m-b-0">${databasebackuptotal!"0"}</p>
                            </div>
                            <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i
                                            class="mdi mdi-database fa-1-5x"></i></span></div>
                        </div>
                    </div>
                </div>
 
                <div class="col-sm-6 col-lg-3">
                    <div class="card bg-danger">
                        <div class="card-body clearfix">
                            <div class="pull-right">
                                <p class="h6 text-white m-t-0">用户总数</p>
                                <p class="h3 text-white m-b-0">${usertotal!"0"}</p>
                            </div>
                            <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i
                                            class="mdi mdi-account fa-1-5x"></i></span></div>
                        </div>
                    </div>
                </div>
 
                <div class="col-sm-6 col-lg-3">
                    <div class="card bg-success">
                        <div class="card-body clearfix">
                            <div class="pull-right">
                                <p class="h6 text-white m-t-0">当前在线用户</p>
                                <p class="h3 text-white m-b-0">${onlineusertotal!"0"}</p>
                            </div>
                            <div class="pull-left"><span class="img-avatar img-avatar-48 bg-translucent"><i
                                            class="mdi mdi-account-multiple fa-1-5x"></i></span></div>
                        </div>
                    </div>
                </div>
 
                <div class="col-sm-6 col-lg-3">
                    <div class="card bg-purple">
                        <div class="card-body clearfix">
                            <div class="pull-right">
                                <p class="h6 text-white m-t-0">操作日志</p>
                                <p class="h3 text-white m-b-0">${operatorlogtotal!"0"}条</p>
                            </div>
                            <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-keyboard-close fa-1-5x"></i></span> </div>
                        </div>
                    </div>
                </div>
            </div>
 
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-toolbar clearfix">
                            <#include "../common/third-menu.ftl"/>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>医生编号</th>
                                        <th>医生名称</th>
                                        <th>病人名称</th>
                                        <th>所属科室</th>
                                        <th>支付状态</th>
                                        <th>出诊状态</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <#if orderreceivings?size gt 0>
                                        <#list orderreceivings as orderreceiving>
                                            <tr>
                                                <td style="vertical-align:middle;">${orderreceiving.doctor.doctordno}</td>
                                                <td style="vertical-align:middle;">${orderreceiving.doctor.user.name}</td>
                                                <td style="vertical-align:middle;">${orderreceiving.orderregistration.patient.user.name}</td>
                                                <td style="vertical-align:middle;">${orderreceiving.doctor.department.name}</td>
 
                                                <td style="vertical-align:middle;">
                                                    <#if orderreceiving.paystatus == 1>
                                                        <font class="text-warning">未支付</font>
                                                    <#else>
                                                        <font class="text-success">已支付</font>
                                                    </#if>
                                                </td>
                                                <td style="vertical-align:middle;">
                                                    <#if orderreceiving.status == 1>
                                                        <font class="text-warning">未完成</font>
                                                    <#else>
                                                        <font class="text-success" id="tab1">已完成</font>
                                                    </#if>
 
                                                </td>
                                            </tr>
                                        </#list>
                                    </#if>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
        <!--end 页面主要内容-->
    </div>
</div>
<#include "../common/footer.ftl"/>
<script type="text/javascript" src="/admin/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/admin/js/main.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
 
    });
 
</script>
</body>
</html>

到此这篇关于java 实战练手项目之医院预约挂号系统的实现流程的文章就介绍到这了,更多相关java 医院预约挂号系统内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!