赞
踩
宿舍管理系统是一种教育管理系统,本系统具有多种优点,其中通用性、智能化、简单操作性等可以极大地提升用户体验,本系统适合于高校以及教育行业公司等进行使用。宿舍管理系统采用Jsp技术作为前端页面技术,主要逻辑技术语言为Java,后台数据库为MySQL。本系统实现了学生宿舍的基本管理功能,比如管理员管理、学生管理、宿舍管理、楼宇管理、学生状态管理。以上功能都在本系统中有所体现,本系统对于大学生宿舍管理实现信息化有着重要作用。本系统的使用,能够达到掌握宿舍情况,提高管理效率的目的。
数据字典
数据字典的意义是对系统中的数据进行汇总,数据字典对于研究系统开发中的数据存储结构有着重要的意义[16]。在研究数据字典前,需要先画出数据流图。根据数据流图来对数据进行描述和分类,它的出现可以形象的表述出数据流图和系统存储数据的类型和数据[17]。
宿舍管理系统的主要功能的数据库表有5个,具体数据字典如下。
表 admin
:
id
:类型为 varchar(32)
,主键,不允许为空,默认为空字符串。create_time
:类型为 timestamp
,可以为空,默认为当前时间戳,可被更新。update_time
:类型为 timestamp
,可以为空,默认为空。valid
:类型为 varchar(1)
,可以为空,默认为 NULL。version
:类型为 int(10)
,可以为空,默认为 NULL。name
:类型为 varchar(32)
,可以为空,默认为 NULL。password
:类型为 varchar(32)
,可以为空,默认为 NULL。表 building
:
id
:类型为 varchar(255)
,主键,不允许为空,默认为空字符串。create_time
:类型为 timestamp
,可以为空,默认为当前时间戳,可被更新。update_time
:类型为 timestamp
,可以为空,默认为空。valid
:类型为 varchar(255)
,可以为空,默认为 NULL。version
:类型为 int(11)
,可以为空,默认为 NULL。dormitory_manager_id
:类型为 varchar(255)
,可以为空,默认为 NULL。location
:类型为 varchar(255)
,可以为空,默认为 NULL。name
:类型为 varchar(255)
,可以为空,默认为 NULL。表 dormitory
:
id
:类型为 varchar(255)
,主键,不允许为空,默认为空字符串。create_time
:类型为 timestamp
,可以为空,默认为当前时间戳,可被更新。update_time
:类型为 timestamp
,可以为空,默认为空。valid
:类型为 varchar(255)
,可以为空,默认为 NULL。version
:类型为 int(11)
,可以为空,默认为 NULL。building_id
:类型为 varchar(255)
,可以为空,默认为 NULL。floor
:类型为 varchar(255)
,可以为空,默认为 NULL。lived_number
:类型为 int(11)
,可以为空,默认为 NULL。max_number
:类型为 int(11)
,可以为空,默认为 NULL。sn
:类型为 varchar(255)
,可以为空,默认为 NULL。表 dormitory_manager
:
id
:类型为 varchar(255)
,主键,不允许为空,默认为空字符串。create_time
:类型为 timestamp
,可以为空,默认为当前时间戳,可被更新。update_time
:类型为 timestamp
,可以为空,默认为空。valid
:类型为 varchar(255)
,可以为空,默认为 NULL。version
:类型为 int(11)
,可以为空,默认为 NULL。name
:类型为 varchar(255)
,可以为空,默认为 NULL。password
:类型为 varchar(255)
,可以为空,默认为 NULL。sex
:类型为 varchar(255)
,可以为空,默认为 NULL。sn
:类型为 varchar(255)
,可以为空,默认为 NULL。表 live
:
id
:类型为 varchar(255)
,主键,不允许为空,默认为空字符串。create_time
:类型为 timestamp
,可以为空,默认为当前时间戳,可被更新。update_time
:类型为 timestamp
,可以为空,默认为空。valid
:类型为 varchar(255)
,可以为空,默认为 NULL。version
:类型为 int(11)
,可以为空,默认为 NULL。dormitory_id
:类型为 varchar(255)
,可以为空,默认为 NULL。live_date
:类型为 timestamp
,可以为空,默认为 NULL。student_id
:类型为 varchar(255)
,可以为空,默认为 NULL。表 student
:
id
:类型为 varchar(255)
,不允许为空,默认为空字符串。create_time
:类型为 timestamp
,可以为空,默认为当前时间戳,可被更新。update_time
:类型为 timestamp
,可以为空,默认为空。valid
:类型为 varchar(255)
,可以为空,默认为 NULL。version
:类型为 int(11)
,可以为空,默认为 NULL。name
:类型为 varchar(255)
,可以为空,默认为 NULL。password
:类型为 varchar(255)
,可以为空,默认为 NULL。sex
:类型为 varchar(255)
,可以为空,默认为 NULL。sn
:类型为 varchar(255)
,可以为空,默认为 NULL。每个表中的字段都有相应的数据类型和约束,这些信息描述了如何存储和处理每个表中的数据。如果你对特定表或字段有更具体的问题,请随时提问。
absentrecord.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <!DOCTYPE html> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- 引入 Bootstrap --> <script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <!-- 引入 font-awesome --> <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <title>宿舍管理系统</title> </head> <body> <div class="container-fluid"> <div class="row"> <div class="col-sm-10"> <!-- 顶部搜索部分 --> <div class="panel panel-default"> <div class="panel-heading">搜索</div> <div class="panel-body"> <form role="form" class="form-inline" action="/absent?method=search" method="post"> <div class="form-group"> <label for="name">字段:</label> <select name="key" class="form-control"> <option value="buildingName">楼宇</option> <option value="dormitoryName">宿舍</option> </select> </div> <div class="form-group" style="margin-left: 20px"> <label for="value">值:</label> <input type="text" class="form-control" name="value" placeholder="字段值" maxlength="12" style="width: 130px"> </div> <div class="form-group " style="margin-left: 20px"> <button type="submit" class="btn btn-info "> <span style="margin-right: 5px" class="glyphicon glyphicon-search" aria-hidden="true"> </span>开始搜索 </button> </div> </form> </div> </div> <!-- 列表展示--> <div class="table-responsive"> <table class="table table-hover "> <thead> <tr> <th>ID</th> <th>楼宇</th> <th>宿舍</th> <th>姓名</th> <th>原因</th> <th>宿管</th> <th>日期</th> </tr> </thead> <tbody> <c:forEach items="${list}" var="absent"> <tr> <td>${absent.id}</td> <td>${absent.buildingName}</td> <td>${absent.dormitoryName}</td> <td>${absent.studentName}</td> <td>${absent.reason}</td> <td>${absent.dormitoryAdminName}</td> <td>${absent.createDate}</td> </tr> </c:forEach> </tbody> </table> </div> </div> </div> </div> </body> </html>
absentregister.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- 引入 Bootstrap --> <script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <!-- 引入 font-awesome --> <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <!-- 引入 datetimepicker --> <link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/moment.js/2.24.0/moment-with-locales.js"></script> <script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> <title>宿舍管理系统</title> </head> <body> <div class="container-fluid"> <form method="post" action="/absent?method=save" class="form-horizontal" style="margin-top: 0px" role="form" id="form_data" style="margin: 20px;"> <div role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="myModalLabel">添加缺寝信息</h4> </div> <div class="modal-body"> <form class="form-horizontal" role="form"> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">楼宇</label> <div class="col-sm-9"> <select id="building" required class="form-control" name="buildingId"> <c:forEach items="${buildingList}" var="building"> <option value="${building.id}">${building.name}</option> </c:forEach> </select> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">宿舍</label> <div class="col-sm-9"> <select id="dormitory" required class="form-control" name="dormitoryId"> <c:forEach items="${dormitoryList}" var="dormitory"> <option value="${dormitory.id}">${dormitory.name}</option> </c:forEach> </select> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">学生</label> <div class="col-sm-9"> <select id="student" required class="form-control" name="studentId"> <c:forEach items="${studentList}" var="student"> <option value="${student.id}">${student.name}</option> </c:forEach> </select> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">原因</label> <div class="col-sm-9"> <input type="text" required class="form-control" name="reason" placeholder="请输入缺寝原因"> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">日期</label> <div class="col-sm-9"> <div class='input-group date' id='datetimepicker'> <input type='text' name="date" required class="form-control"/> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </form> </div> <div class="modal-footer"> <button type="submit" class="btn btn-primary">提交</button> </div> </div> </div> </div> </form> </div> <script> $(function(){ $('#building').change(function(){ var id = $(this).val(); $.ajax({ url:"/dormitory?method=findByBuildingId&buildingId="+id, type:"post", dataType:"json", success:function (data) { var dormitoryList = $(data).get(0).dormitoryList var studentList = $(data).get(0).studentList var str = ''; for(var i = 0;i<dormitoryList.length;i++){ var dormitory = $(dormitoryList).get(i); str += '<option value="'+dormitory.id+'">'+dormitory.name+'</option>' } $('#dormitory').html(str); str = ''; for(var i = 0;i<studentList.length;i++){ var student = $(studentList).get(i); str += '<option value="'+student.id+'">'+student.name+'</option>' } $('#student').html(str); } }) }) $('#dormitory').change(function(){ var id = $(this).val(); $.ajax({ url:"/student?method=findByDormitoryId&dormitoryId="+id, type:"post", dataType:"json", success:function (data) { var str = ''; for(var i = 0;i<data.length;i++){ var student = $(data).get(i); str += '<option value="'+student.id+'">'+student.name+'</option>' } $('#student').html(str); } }) }) $('#datetimepicker').datetimepicker({ format: 'YYYY-MM-DD', locale: moment.locale('zh-cn'), }); }) </script> </body> </html>
adminmanager.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- 引入 Bootstrap --> <script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <!-- 引入 font-awesome --> <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <title>宿舍管理系统</title> </head> <body> <div class="container-fluid"> <div class="row"> <div class="col-sm-10"> <!-- 顶部搜索部分 --> <div class="panel panel-default"> <div class="panel-heading">搜索</div> <div class="panel-body"> <form role="form" class="form-inline" action="/dormitoryAdmin?method=search" method="post"> <div class="form-group"> <label for="name">字段:</label> <select name="key" class="form-control"> <option value="username">宿管用户名</option> <option value="name">宿管姓名</option> <option value="telephone">宿管电话</option> </select> </div> <div class="form-group" style="margin-left: 20px"> <label for="value">值:</label> <input type="text" class="form-control" name="value" placeholder="字段值" maxlength="12" style="width: 130px"> </div> <div class="form-group " style="margin-left: 20px"> <button type="submit" class="btn btn-info "> <span style="margin-right: 5px" class="glyphicon glyphicon-search" aria-hidden="true"> </span>开始搜索 </button> </div> <div class="form-group " style="margin-left: 48px"> <button type="button" class="btn btn-default" data-toggle="modal" data-target="#addUserModal"> <span style="margin-right: 5px" class="" aria-hidden="true"> <i class="fa fa-user-plus">添加宿管信息</i> </span> </button> </div> </form> </div> </div> <!-- 列表展示--> <div class="table-responsive"> <table class="table table-hover "> <thead> <tr> <th>ID</th> <th>用户名</th> <th>密码</th> <th>姓名</th> <th>性别</th> <th>联系电话</th> <th>操作</th> </tr> </thead> <tbody> <c:forEach items="${list}" var="dormitoryAdmin"> <tr> <td>${dormitoryAdmin.id}</td> <td>${dormitoryAdmin.username}</td> <td>${dormitoryAdmin.password}</td> <td>${dormitoryAdmin.name}</td> <td>${dormitoryAdmin.gender}</td> <td>${dormitoryAdmin.telephone}</td> <td> <div class="btn-group"> <button type="button" class="btn btn-default " data-id="${dormitoryAdmin.id}" data-username="${dormitoryAdmin.username}" data-password="${dormitoryAdmin.password}" data-name="${dormitoryAdmin.name}" data-gender="${dormitoryAdmin.gender}" data-telephone="${dormitoryAdmin.telephone}" data-toggle="modal" data-target="#updateUserModal"> <i class="fa fa-user-o">修改</i> </button> <button type="button" class="btn btn-danger " data-id="${dormitoryAdmin.id}" data-toggle="modal" onclick="" data-target="#delUserModal"> <i class="fa fa-user-times">删除</i> </button> </div> </td> </tr> </c:forEach> </tbody> </table> <!-- add框示例(Modal) --> <form method="post" action="/dormitoryAdmin?method=save" class="form-horizontal" style="margin-top: 0px" role="form" id="form_data" style="margin: 20px;"> <div class="modal fade" id="addUserModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> <h4 class="modal-title" id="myModalLabel">添加宿管信息</h4> </div> <div class="modal-body"> <form class="form-horizontal" role="form"> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">用户名</label> <div class="col-sm-9"> <input type="text" required class="form-control" id="username" name="username" placeholder="请输入用户名"> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">密码</label> <div class="col-sm-9"> <input type="text" required class="form-control" id="password" name="password" value="" placeholder="请输入密码"> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">姓名</label> <div class="col-sm-9"> <input type="text" required class="form-control" id="name" name="name" value="" placeholder="请输入姓名"> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">性别</label> <div class="col-sm-9"> <input type="radio" checked value="男" class="gender" name="gender"> 男 <input type="radio" value="女" class="gender" name="gender"> 女 </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">联系电话</label> <div class="col-sm-9"> <input type="text" required class="form-control" id="telephone" name="telephone" value="" placeholder="请输入联系电话"> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button type="submit" class="btn btn-primary">提交</button> </div> </div> </div> </div> </form> <!-- update框示例(Modal) --> <form method="post" action="/dormitoryAdmin?method=update" class="form-horizontal" style="margin-top: 0px" role="form" id="form_data" style="margin: 20px;"> <div class="modal fade" id="updateUserModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> <h4 class="modal-title" id="myModalLabel">用户信息</h4> </div> <div class="modal-body"> <form class="form-horizontal" role="form"> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">ID</label> <div class="col-sm-9"> <input type="text" readonly required class="form-control" id="id" name="id"> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">用户名</label> <div class="col-sm-9"> <input type="text" required class="form-control" id="username" name="username" placeholder="请输入用户名"> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">密码</label> <div class="col-sm-9"> <input type="text" required class="form-control" id="password" name="password" value="" placeholder="请输入密码"> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">姓名</label> <div class="col-sm-9"> <input type="text" required class="form-control" id="name" name="name" value="" placeholder="请输入姓名"> </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">性别</label> <div class="col-sm-9"> <input type="radio" checked value="男" class="gender" name="gender"> 男 <input type="radio" value="女" class="gender" name="gender"> 女 </div> </div> <div class="form-group"> <label for="user_id" class="col-sm-3 control-label">联系电话</label> <div class="col-sm-9"> <input type="text" required class="form-control" id="telephone" name="telephone" value="" placeholder=""> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button type="submit" class="btn btn-primary">提交</button> </div> </div> </div> </div> </form> <!-- 删除模态框示例(Modal) --> <form method="post" action="/dormitoryAdmin?method=delete" class="form-horizontal" style="margin-top: 0px" role="form" id="form_data" style="margin: 20px;"> <div class="modal fade" id="delUserModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">用户信息</h4> </div> <div class="modal-body"> <form class="form-horizontal" role="form"> <div class="form-group"> <div class="col-sm-9"> <h3 class="col-sm-18 control-label" id="deleteLabel">删除信息</h3> <input type="hidden" class="form-control" id="tab" name="tab" placeholder="" value="dor_admin"> <input type="hidden" class="form-control" id="id" name="id" placeholder=""> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button type="submit" class="btn btn-danger">删除</button> <span id="tip"> </span> </div> </div> </div> </div> </form> </div> </div> </div> </div> <script> $('#updateUserModal').on('show.bs.modal', function(event) { var button = $(event.relatedTarget) var id = button.data('id') var username = button.data('username') var password = button.data('password') var name = button.data('name') var gender = button.data('gender') var telephone = button.data('telephone') var modal = $(this) modal.find('.modal-title').text('修改宿管信息') modal.find('#id').val(id) modal.find('#username').val(username) modal.find('#password').val(password) modal.find('#name').val(name) var list = modal.find('.gender') for(var i=0;i<list.length;i++){ if(gender == $(list.get(i)).val()){ $(list.get(i)).prop('checked',true) } } modal.find('#telephone').val(telephone) }) $('#delUserModal').on('show.bs.modal', function(event) { var button = $(event.relatedTarget) var id = button.data('id') var modal = $(this) modal.find('.modal-title').text('删除宿管信息') modal.find('#deleteLabel').text('是否删除ID为 ' + id + ' 的信息') modal.find('#id').val(id) }) </script> </body> </html>
q:969060742 完整文档、代码、sql
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。