parent
b70a430f5f
commit
32e9c936d6
@ -0,0 +1,112 @@
|
||||
package cn.ppdxzz.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Description:访客实体类
|
||||
*
|
||||
* @Date: 2020/2/18 16:29
|
||||
* @Author: PeiChen
|
||||
*/
|
||||
public class Visitor implements Serializable {
|
||||
private String id;//uuid 全球唯一id
|
||||
private String name;//访客姓名
|
||||
private String sno;//访客学号
|
||||
private String phone;//联系方式
|
||||
private String place;//访问地址
|
||||
private String begin_date;//来访时间
|
||||
private String end_date;//离开时间
|
||||
private String visit_result;//到访原因
|
||||
|
||||
public Visitor() {
|
||||
}
|
||||
|
||||
public Visitor(String id, String name, String sno, String phone, String place, String begin_date, String end_date, String visit_result) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.sno = sno;
|
||||
this.phone = phone;
|
||||
this.place = place;
|
||||
this.begin_date = begin_date;
|
||||
this.end_date = end_date;
|
||||
this.visit_result = visit_result;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getSno() {
|
||||
return sno;
|
||||
}
|
||||
|
||||
public void setSno(String sno) {
|
||||
this.sno = sno;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPlace() {
|
||||
return place;
|
||||
}
|
||||
|
||||
public void setPlace(String place) {
|
||||
this.place = place;
|
||||
}
|
||||
|
||||
public String getBegin_date() {
|
||||
return begin_date;
|
||||
}
|
||||
|
||||
public void setBegin_date(String begin_date) {
|
||||
this.begin_date = begin_date;
|
||||
}
|
||||
|
||||
public String getEnd_date() {
|
||||
return end_date;
|
||||
}
|
||||
|
||||
public void setEnd_date(String end_date) {
|
||||
this.end_date = end_date;
|
||||
}
|
||||
|
||||
public String getVisit_result() {
|
||||
return visit_result;
|
||||
}
|
||||
|
||||
public void setVisit_result(String visit_result) {
|
||||
this.visit_result = visit_result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Visitor{" +
|
||||
"id='" + id + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", sno='" + sno + '\'' +
|
||||
", phone='" + phone + '\'' +
|
||||
", place='" + place + '\'' +
|
||||
", begin_date='" + begin_date + '\'' +
|
||||
", end_date='" + end_date + '\'' +
|
||||
", visit_result='" + visit_result + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.ppdxzz.service;
|
||||
|
||||
import cn.ppdxzz.domain.Visitor;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
*
|
||||
* @Date: 2020/2/18 18:27
|
||||
* @Author: PeiChen
|
||||
*/
|
||||
public interface VisitorService {
|
||||
|
||||
void add(Visitor visitor) throws Exception;
|
||||
|
||||
List<Visitor> findAll(int page,int size) throws Exception;
|
||||
|
||||
List<Visitor> search(int page,int size,String keyword) throws Exception;
|
||||
|
||||
void logout(String id,String end_date) throws Exception;
|
||||
|
||||
InputStream getInputStream() throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: user
|
||||
Date: 2020/2/18
|
||||
Time: 15:49
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,214 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: user
|
||||
Date: 2020/2/18
|
||||
Time: 15:56
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<html class="x-admin-sm">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
|
||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
|
||||
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
|
||||
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
|
||||
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script>
|
||||
function changePageSize() {
|
||||
//获取下拉框的值
|
||||
var pageSize = $("#changePageSize").val();
|
||||
//向服务器发送请求,改变每页显示条数
|
||||
location.href = "${pageContext.request.contextPath}/visitor/findAll?page=1&size="+ pageSize;
|
||||
}
|
||||
$("#serarch_btn").click(function () {
|
||||
var keyword = $("#keyword").val();
|
||||
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4&keyword="+keyword;
|
||||
});
|
||||
$("#refresh").click(function () {
|
||||
$("#myform").reset();
|
||||
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4";
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<%--<div class="x-nav">
|
||||
<span class="layui-breadcrumb">
|
||||
<a href="">首页</a>
|
||||
<a href="">演示</a>
|
||||
<a>
|
||||
<cite>导航元素</cite></a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
|
||||
<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
|
||||
</div>--%>
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body ">
|
||||
<form id="myform" class="layui-form layui-col-space5">
|
||||
<div class="layui-inline layui-show-xs-block">
|
||||
<input class="layui-input" type="text" autocomplete="off" placeholder="请输入关键字" name="keyword" id="keyword" value="${param.keyword}">
|
||||
</div>
|
||||
<div class="layui-inline layui-show-xs-block">
|
||||
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
</div>
|
||||
<div class="layui-inline layui-show-xs-block x-right">
|
||||
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4"><i class="layui-icon"></i></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<xblock>
|
||||
<c:if test="${sessionScope.adminInfo.power > 2 }">
|
||||
<a onclick="exportInfo()" class="layui-btn layui-btn-warm" href="javascript:;"><i class="layui-icon"></i>导出</a>
|
||||
</c:if>
|
||||
<span class="x-right" style="line-height:40px">共有数据:${pageInfo.total} 条</span>
|
||||
</xblock>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table layui-form">
|
||||
<thead>
|
||||
<tr style="text-align: center">
|
||||
<c:if test="${sessionScope.adminInfo.power > 3 }">
|
||||
<th style="text-align: center">ID</th>
|
||||
</c:if>
|
||||
<th style="text-align: center">姓名</th>
|
||||
<th style="text-align: center">学号</th>
|
||||
<th style="text-align: center">联系方式</th>
|
||||
<th style="text-align: center">访问地址</th>
|
||||
<th style="text-align: center">来访时间</th>
|
||||
<th style="text-align: center">离开时间</th>
|
||||
<th style="text-align: center">到访原因</th>
|
||||
<c:if test="${sessionScope.adminInfo.power > 2}">
|
||||
<th style="text-align: center">操作</th>
|
||||
</c:if>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${pageInfo.list}" var="visitor">
|
||||
<tr id="light" style="text-align: center">
|
||||
<c:if test="${sessionScope.adminInfo.power > 3 }">
|
||||
<td>${visitor.id}</td>
|
||||
</c:if>
|
||||
<td>${visitor.name}</td>
|
||||
<td>${visitor.sno}</td>
|
||||
<td>${visitor.phone}</td>
|
||||
<td>${visitor.place}</td>
|
||||
<td>${visitor.begin_date}</td>
|
||||
<c:if test="${visitor.end_date == null || visitor.end_date == ''}">
|
||||
<td>尚未离开</td>
|
||||
</c:if>
|
||||
<c:if test="${visitor.end_date != ''}">
|
||||
<td>${visitor.end_date}</td>
|
||||
</c:if>
|
||||
<td>${visitor.visit_result}</td>
|
||||
<c:if test="${sessionScope.adminInfo.power > 2}">
|
||||
<td class="td-manage">
|
||||
<a title="注销访客" onclick="update(this,${visitor.id})">
|
||||
<i class="layui-icon"></i>
|
||||
</a>
|
||||
</td>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<div class="form-group form-inline">
|
||||
共 ${pageInfo.pages} 页 当前页:${pageInfo.pageNum} / ${pageInfo.pages}  每页
|
||||
<select class="form-control" id="changePageSize" onchange="changePageSize()">
|
||||
<option value="1">${pageInfo.size}</option>
|
||||
<option value="2">2</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="15">15</option>
|
||||
<option value="20">20</option>
|
||||
</select> 条
|
||||
</div>
|
||||
</div>
|
||||
<c:choose>
|
||||
<c:when test="${pageInfo.pages < 5}">
|
||||
<c:set var="begin" value="1">
|
||||
</c:set>
|
||||
<c:set var="end" value="${pageInfo.pages}">
|
||||
</c:set>
|
||||
</c:when>
|
||||
<c:when test="${pageInfo.pageNum <= 3}">
|
||||
<c:set var="begin" value="1">
|
||||
</c:set>
|
||||
<c:set var="end" value="5">
|
||||
</c:set>
|
||||
</c:when>
|
||||
<c:when test="${pageInfo.pageNum > 3 and pageInfo.pageNum <= pageInfo.pages-2}">
|
||||
<c:set var="begin" value="${pageInfo.pageNum - 2}">
|
||||
</c:set>
|
||||
<c:set var="end" value="${pageInfo.pageNum + 2}">
|
||||
</c:set>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:set var="begin" value="${pageInfo.pages - 4}">
|
||||
</c:set>
|
||||
<c:set var="end" value="${pageInfo.pages}">
|
||||
</c:set>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<div class="layui-card-body x-right" style="height: min-content">
|
||||
<div class="page">
|
||||
<div>
|
||||
<a class="next" href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=${pageInfo.pageSize}&keyword=${param.keyword}">首页</a>
|
||||
<c:if test="${pageInfo.pageNum > 1}">
|
||||
<a class="prev" href="${pageContext.request.contextPath}/visitor/findAll?page=${pageInfo.pageNum-1}&size=${pageInfo.pageSize}&keyword=${param.keyword}">上一页</a>
|
||||
</c:if>
|
||||
<c:forEach var="i" begin="${begin}" end="${end}" step="1">
|
||||
<c:if test="${pageInfo.pageNum == i}">
|
||||
<span class="current">${i}</span>
|
||||
</c:if>
|
||||
<c:if test="${pageInfo.pageNum != i}">
|
||||
<a class="num" href="${pageContext.request.contextPath}/visitor/findAll?page=${i}&size=${pageInfo.pageSize}&keyword=${param.keyword}">${i}</a>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<c:if test="${pageInfo.pageNum < pageInfo.pages}">
|
||||
<a class="next" href="${pageContext.request.contextPath}/visitor/findAll?page=${pageInfo.pageNum+1}&size=${pageInfo.pageSize}&keyword=${param.keyword}">下一页</a>
|
||||
</c:if>
|
||||
<a class="next" href="${pageContext.request.contextPath}/visitor/findAll?page=${pageInfo.pages}&size=${pageInfo.pageSize}&keyword=${param.keyword}">尾页</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function update(obj,id) {
|
||||
$.get("${pageContext.request.contextPath}/visitor/updateStatus",{"id":id},function (data) {
|
||||
if (data) {
|
||||
layer.msg('注销成功');
|
||||
}else {
|
||||
layer.msg('系统繁忙,请联系系统管理员');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
//导出Excel操作
|
||||
function exportInfo() {
|
||||
layer.confirm('确定导出所有访客数据吗?',function (index) {
|
||||
location.href="${pageContext.request.contextPath}/visitor/export";
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,19 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: user
|
||||
Date: 2020/2/18
|
||||
Time: 20:07
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3>恭喜您,来访登记成功!</h3>
|
||||
<br>
|
||||
<a href="${pageContext.request.contextPath}/visitor/logout?id=${id}">注销登记</a>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue