Merge pull request !1 from you/ming
pull/1/head
you 5 years ago committed by Gitee
commit 4f173a691e

@ -0,0 +1,71 @@
# 一、项目介绍
使用jsp、layui、mysql完成的图书馆系统包含用户图书借阅、图书管理员、系统管理员界面功能齐全。在·
开发工具为eclipse
# 二、部署
需要修改以下两个数据库连接相关属性,并将**sql文件导入mysql数据库**
**用户账号密码1805010219 1234**
**图书管理员账号密码root 1234**
**系统管理员账号密码admin admin**
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/image-20201117122227215.png)
# 项目演示
## 用户
**图书查询**
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/image-20201117124235584.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605588101413.png)
其他省略
## 图书管理员
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605588522320.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/image-20201117124314632.png)
## 系统管理员
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586686520.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605588740472.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605588792283.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586708802.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586720887.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586727919.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586733759.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586739400.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605588836223.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586754111.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605588810178.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586772278.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586779311.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586784032.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586790655.png)
![](https://ming-edu.oss-cn-beijing.aliyuncs.com/1605586794872.png)

@ -59,7 +59,7 @@
<option value="id">ID</option> <option value="id">ID</option>
<option value="name">书名</option> <option value="name">书名</option>
<option value="author">作者</option> <option value="author">作者</option>
<option value="library">图书馆</option> <option value="library_id">图书馆</option>
<option value="position">位置</option> <option value="position">位置</option>
<option value="status">状态</option> <option value="status">状态</option>
<option value="description">描述</option> <option value="description">描述</option>
@ -79,7 +79,7 @@
</table> </table>
<!-- 行操作 --> <!-- 行操作 -->
<script type="text/html" id="barDemo"> <script type="text/html" id="operateBar">
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="bookBorrowList">查看借阅</a> <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="bookBorrowList">查看借阅</a>
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
@ -108,12 +108,10 @@
var tableIns = table.render({ var tableIns = table.render({
elem: '#demo' elem: '#demo'
,height: 600 ,height: 600
//,url: './data.json'
,url: './bookList' ,url: './bookList'
,title: '数据表单' ,title: '数据表单'
,toolbar: '#search' ,toolbar: '#search'
,page: true ,page: true
//,size: 'lg'
,cols: [[ ,cols: [[
{type: 'numbers', width:50, fixed:'left'} {type: 'numbers', width:50, fixed:'left'}
,{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'} ,{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
@ -130,10 +128,8 @@
,{field: 'position', title: '位置', width: 110, sort: true} ,{field: 'position', title: '位置', width: 110, sort: true}
,{field: 'status', title: '状态', width: 60, templet:'#statusTpl'} ,{field: 'status', title: '状态', width: 60, templet:'#statusTpl'}
,{field: 'description', title: '描述', width: 340} ,{field: 'description', title: '描述', width: 340}
//,{field: 'operate', title: '操作', width: 200, templet: 'titleTpl'} ,{fixed: 'right', title:'操作', width: 200, align:'center', toolbar: '#operateBar'} //这里的toolbar值是模板元素的选择器
,{fixed: 'right', title:'操作', width: 200, align:'center', toolbar: '#barDemo'} //这里的toolbar值是模板元素的选择器
]] ]]
,id: 'idTest'
}); });
// 直接编辑 // 直接编辑

@ -59,23 +59,23 @@
<% <%
System.out.println(Util.getCurrentTimeString()); System.out.println(Util.getCurrentTimeString());
%> %>
<% while(resultSet.next()){ %> <% while(resultSet.next()){ %>
<%-- 图书超期 --%> <%-- 图书超期 --%>
<%if(Util.getFormatDateTime(resultSet.getString("end_date")).compareTo(Util.getCurrentTimeString()) < 0 && resultSet.getString("return_date") == null){ %> <%if(Util.getFormatDateTime(resultSet.getString("end_date")).compareTo(Util.getCurrentTimeString()) < 0 && resultSet.getString("return_date") == null){ %>
<tr style="color:#FF5722;"> <tr style="color:#FF5722;">
<%} else{ %> <%} else{ %>
<tr> <tr>
<%} %> <%} %>
<td><%=resultSet.getString("card_id") %></td> <td><%=resultSet.getString("card_id") %></td>
<td><%=resultSet.getString("id") %></td> <td><%=resultSet.getString("book_id") %></td>
<td><%=resultSet.getString("books.name") %></td> <td><%=resultSet.getString("books.name") %></td>
<td><%=Util.getFormatDateTime(resultSet.getString("borrow_date")) %></td> <td><%=Util.getFormatDateTime(resultSet.getString("borrow_date")) %></td>
<td><%=Util.getFormatDateTime(resultSet.getString("end_date"))%></td> <td><%=Util.getFormatDateTime(resultSet.getString("end_date"))%></td>
<td><%=resultSet.getString("return_date")!=null?Util.getFormatDateTime(resultSet.getString("return_date")) : "未归还" %></td> <td><%=resultSet.getString("return_date")!=null?Util.getFormatDateTime(resultSet.getString("return_date")) : "未归还" %></td>
<td><%=resultSet.getString("illegal")!=null?resultSet.getString("illegal"):""%></td> <td><%=resultSet.getString("illegal")!=null?resultSet.getString("illegal"):""%></td>
<td><%=resultSet.getString("manager_id")!=null?resultSet.getString("manager_id"):"" %></td> <td><%=resultSet.getString("manager_id")!=null?resultSet.getString("manager_id"):"" %></td>
</tr> </tr>
<%} %> <%} %>
</tbody> </tbody>
</table> </table>
</div> </div>

@ -70,25 +70,25 @@
</div> </div>
</div> </div>
<!-- 借阅规则 --> <!-- 借阅规则 -->
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">规则</label> <label class="layui-form-label">规则</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select name="rule_id" lay-filter="rule_id" lay-verify="required"> <select name="rule_id" lay-filter="rule_id" lay-verify="required">
<% while(ruleSet.next()){ %> <% while(ruleSet.next()){ %>
<option value=<%=ruleSet.getString("id") %> <%if(ruleSet.getString("id").equals(infoSet.getString("rule_id"))) out.print("selected"); %>><%=ruleSet.getString("id") %></option> <option value=<%=ruleSet.getString("id") %> <%if(ruleSet.getString("id").equals(infoSet.getString("rule_id"))) out.print("selected"); %>><%=ruleSet.getString("id") %></option>
<%} %> <%} %>
</select> </select>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">状态</label> <label class="layui-form-label">状态</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="radio" name="status" value="1" title="可用" <%if(infoSet.getString("status").equals("1")) out.print("checked"); %>> <input type="radio" name="status" value="1" title="可用" <%if(infoSet.getString("status").equals("1")) out.print("checked"); %>>
<input type="radio" name="status" value="0" title="挂失" <%if(infoSet.getString("status").equals("0")) out.print("checked"); %>> <input type="radio" name="status" value="0" title="挂失" <%if(infoSet.getString("status").equals("0")) out.print("checked"); %>>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block"> <div class="layui-input-block">
@ -118,25 +118,12 @@ layui.use(['form', 'jquery'], function(){
anim: 5, anim: 5,
time: 500, time: 500,
}); });
setTimeout(function(){ setTimeout(function(){
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
parent.layer.close(index); //再执行关闭 parent.layer.close(index); //再执行关闭
}, 500) }, 500)
/*
parent.layer.open({
title: '注册账号为',
content: data.data['id'],
end: function(){
parent.location.reload();
}
});
*/
/*setTimeout(function(){
parent.location.reload();
}, 500);*/
}else{ }else{
leyer.msg("添加失败"); leyer.msg("修改失败");
} }
}, },
error: function(){ error: function(){

@ -145,7 +145,6 @@
icon: 6, icon: 6,
time: 1500 time: 1500
}) })
//obj.del();
// 还是本页数据 // 还是本页数据
$(".layui-laypage-btn").click(); $(".layui-laypage-btn").click();
}else{ }else{

@ -32,36 +32,36 @@
</div> </div>
<script src="./public/js/layer/layer.js"></script> <script src="./public/js/layer/layer.js"></script>
<script> <script>
$(function(){ $(function(){
//登录 //登录
$("input[type=submit]").click(function(){ $("input[type=submit]").click(function(){
$.ajax({ $.ajax({
url: "./adminLogin", url: "./adminLogin",
type: "post", type: "post",
data: $("form").serialize(), data: $("form").serialize(),
dataType: "json", dataType: "json",
success: function( data ){ success: function( data ){
if(data.code == 0){ if(data.code == 0){
layer.msg("登录成功", { layer.msg("登录成功", {
icon: 6, icon: 6,
time: 1000 time: 1000
}, function(){ }, function(){
location.href = data.url; location.href = data.url;
}) })
}else{ }else{
layer.open({ layer.open({
title: "登录失败", title: "登录失败",
content: data.msg, content: data.msg,
icon: 5, icon: 5,
anim: 6 anim: 6
}) })
}
} }
} })
return false;
}) })
return false;
}) })
})
</script> </script>
</body> </body>
</html> </html>

@ -27,7 +27,7 @@
</div> </div>
</div> </div>
<div style="position:fixed; bottom:0; right:0;"> <div style="position:fixed; bottom:0; right:0;">
<a href="loginReader.html" target="_blank"><img src="public/image/reader.png" width="50px" height="50px"></a><br> <a href="reader/04readerFrame.jsp" target="_blank"><img src="public/image/reader.png" width="50px" height="50px"></a><br>
<a href="adminLogin.html" target="_blank"><img src="public/image/admin.png" width="50px" height="50px"></a> <a href="adminLogin.html" target="_blank"><img src="public/image/admin.png" width="50px" height="50px"></a>
</div> </div>
<script src="./public/js/layer/layer.js"></script> <script src="./public/js/layer/layer.js"></script>

@ -70,7 +70,7 @@
<div class="layui-footer"> <div class="layui-footer">
<!-- 底部固定区域 --> <!-- 底部固定区域 -->
© layui.com - 底部固定区域 © 图书管理系统
</div> </div>
</div> </div>
<script src="../src/layui.js"></script> <script src="../src/layui.js"></script>

@ -71,7 +71,6 @@
case 'search': case 'search':
var conditionValue = $('#conditionValue'); var conditionValue = $('#conditionValue');
var condition = $('#condition'); var condition = $('#condition');
layer.msg(condition.val());
// 进行搜索,重新渲染 // 进行搜索,重新渲染
tableIns.reload({ tableIns.reload({
where: { //设定异步数据接口的额外参数,任意设 where: { //设定异步数据接口的额外参数,任意设

@ -65,7 +65,6 @@
case 'search': case 'search':
var conditionValue = $('#conditionValue'); var conditionValue = $('#conditionValue');
var condition = $('#condition'); var condition = $('#condition');
layer.msg(condition.val());
// 进行搜索,重新渲染 // 进行搜索,重新渲染
tableIns.reload({ tableIns.reload({
where: { //设定异步数据接口的额外参数,任意设 where: { //设定异步数据接口的额外参数,任意设

@ -83,7 +83,6 @@
dataType: 'json', dataType: 'json',
timeout: 3000, timeout: 3000,
success: function(data){ success: function(data){
layer.msg("???");
if(data.code == 0){ if(data.code == 0){
layer.msg(data.msg,{ layer.msg(data.msg,{
icon: 6, icon: 6,

@ -42,7 +42,6 @@
<div class="layui-inline"> <div class="layui-inline">
<select id="condition" name="condition" lay-verify="required"> <select id="condition" name="condition" lay-verify="required">
<option value=""></option> <option value=""></option>
<option value="card_id">借阅证号</option>
<option value="book_id">图书编号</option> <option value="book_id">图书编号</option>
<option value="borrow_date">借阅日期</option> <option value="borrow_date">借阅日期</option>
<option value="end_date">截止日期</option> <option value="end_date">截止日期</option>

Binary file not shown.

@ -0,0 +1,269 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Version : 50505
Source Host : localhost:3306
Source Database : library
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2020-06-13 20:31:37
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `admin`
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`username` varchar(20) NOT NULL,
`password` varchar(50) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of admin
-- ----------------------------
INSERT INTO `admin` VALUES ('admin', 'e7ef63bc4c950228aa049fc02d2ec291');
INSERT INTO `admin` VALUES ('root', 'e7ef63bc4c950228aa049fc02d2ec291');
-- ----------------------------
-- Table structure for `announcement`
-- ----------------------------
DROP TABLE IF EXISTS `announcement`;
CREATE TABLE `announcement` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(50) DEFAULT NULL COMMENT '告示标题',
`detail` varchar(2000) DEFAULT NULL COMMENT '告示内容',
`publish_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of announcement
-- ----------------------------
INSERT INTO `announcement` VALUES ('1', '图书系统开始建设', '图书系统开始建设', '2020-06-02 22:28:31');
INSERT INTO `announcement` VALUES ('2', '图书系统正在建设', '图书系统正在建设,冲鸭', '2020-06-02 08:29:40');
INSERT INTO `announcement` VALUES ('3', '图书管理系统基本建成', '庆祝图书管理系统基本建成', '2020-06-09 16:43:18');
-- ----------------------------
-- Table structure for `books`
-- ----------------------------
DROP TABLE IF EXISTS `books`;
CREATE TABLE `books` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`name` varchar(30) DEFAULT NULL,
`author` varchar(50) DEFAULT NULL,
`library_id` int(20) DEFAULT NULL,
`sort_id` int(30) DEFAULT NULL,
`position` varchar(50) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`description` varchar(2000) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of books
-- ----------------------------
INSERT INTO `books` VALUES ('1', '夏洛特烦恼', '夏洛', '1', '1', '4asdfa23', '1', '<p>我也特烦恼!!!!<br></p>');
INSERT INTO `books` VALUES ('2', '植发的价格', '江湖老中医', '2', '2', '5sdfs1', '0', '详细介绍每植一根发多少钱?');
INSERT INTO `books` VALUES ('3', '代码的力量', '明月复苏', '2', '3', '234as', '1', '<p>神不知鬼不觉的拔掉你的头发<br></p>');
INSERT INTO `books` VALUES ('4', 'java从入门到入土', '明月复苏', '2', '3', 'sdfs33', '1', '无简介');
INSERT INTO `books` VALUES ('5', '图书馆章程', '明月复苏', '1', '5', '234sdfs', '1', '图书馆章程');
INSERT INTO `books` VALUES ('6', '图书馆建设', '吸尘羊', '1', '5', '23dgdff', '0', '图书馆建设!');
INSERT INTO `books` VALUES ('7', '学习如何跑路', '明月复苏', '1', '7', '2sdsa', '1', '<p>学习如何跑路</p>');
INSERT INTO `books` VALUES ('8', '美好课设', '匿名', '1', '8', '23432s', '1', '做梦');
INSERT INTO `books` VALUES ('9', '中国童话', '刘丽朵', '1', '9', '6sdf11', '1', '这是一本给孩子的中国童话故事集。以“非教训的无意思、空灵的幻想、快活的嬉笑、纯净的诗意、悠远的生命体味”为选篇标准从《搜神记》《太平广记》《聊斋志异》《酉阳杂俎》等近30本经典作品中精心挑选45篇符合现代审美、适合孩子阅读的故事故事蕴涵着丰富的想象力与趣味性用简美的现代语言全新讲述中国童话故事搭配符合故事主题的原创古风插画带孩子进入奇幻浪漫的童话世界。');
INSERT INTO `books` VALUES ('10', '人生删除事务所', '本多孝好', '1', '7', '22sdf1', '1', '你想好死后如何处理自己的手机、电脑、社交账号了吗?「死后,你不想示人的数据由我们来删除。」——人生删除事务所');
INSERT INTO `books` VALUES ('11', '飞鸟集', '拉宾德拉纳特·泰戈尔', '1', '10', '23sdf12', '1', '《飞鸟集》是泰戈尔的代表作之一,也是世界上最杰出的诗集之一。白昼和黑夜、溪流和海洋、自由和背叛,都在泰戈尔的笔下合而为一,短小的语句道出了深刻的人生哲理,引领世人探寻真理和智慧的源泉。初读这些诗篇,如同在暴风雨过后的初夏清晨,推开卧室的窗户,看到一个淡泊清透的世界,一切都是那样清新、亮丽,可是其中的韵味却很厚实,耐人寻味。');
INSERT INTO `books` VALUES ('12', '声音中的另一种语言', '伊夫·博纳富瓦', '1', '10', '23sdf2', '1', '在本书中我们会读到这位诗人翻译家从自己的写作和翻译经验出发对诗及诗的翻译的特殊性与重要性的阐述对某些诗歌译作的批评对译者处境与任务的思考以及对不同语言的诗歌的独特见解……总而言之在博纳富瓦看来我们在声音中触及的另一种语言是存在僭越概念性日常言语书写生命真实“在场”的语言诗的语言不同于世上其他一切语言它斟酌词语倾听节奏“一首诗歌poème的诗poésie以一种声音voix的方式走向读者”。诗的翻译是可能的但不同于其他任何翻译只能以独特的方式进行“诗歌唯一需要忠实的是在场译者要保留诗意便要倾听词语的音乐重新经历诗人用声音勾起的关于“在场”的记忆用自己的语言和存在经验去重构、去分享原诗的“在场”。诗的翻译应当受到重视通过诗的翻译处于两种语言间隙的译者和另一种语言的读者能够对虚幻的概念性言语提出质疑在进一步自我批评的同时重新思考与异的关系从而探寻真实的生活与场所与自己真实的信念相遇。');
INSERT INTO `books` VALUES ('13', '诗经', '孔丘', '1', '10', '23sdf3', '1', '这本《诗经》收录全部305篇每篇诗歌都配有相应的解释及译文使读者更容易理解');
INSERT INTO `books` VALUES ('14', '海子的诗', '海子', '1', '10', '23sdf4', '1', '本书收录了已故诗人海子的诗作精华,其诗以独特的风格深受读者的喜爱,从这些诗中反映出诗人那对于一切美好事物的眷恋之情,对于生命的世俗和崇高的激动和关怀。');
INSERT INTO `books` VALUES ('15', '剧变', '[美] 贾雷德·戴蒙德 ', '2', '11', '2342sdf', '1', '<p>&nbsp; 《剧变》探讨了一个当前人类社会面临的重大问题:当危机来临时,我们该如何应对?从个人视角而言,危机可以改变一个人的成长轨迹,如处理不当,终其一生会生活在负面情绪中。对于整个人类社会而言,危机可使一种文明没落、一个国家解体、一个时代终结。因此,如何分辨危机、应对危机,避免危机,化危机为机遇,实现个人和整个人类社会的剧变,是人类当下面临的主课题。普利策奖得主、《枪炮、病菌与钢铁》作者戴蒙德再一次发挥其历史叙事的顶级水准,带我们巡礼了各国在历史中的危机应对,并从社会学、心理学、经济学、生物进化等跨学科视角展现了人类自古以来何以应对危机的历史沿革,并谏言国家、企业及整个人类社会如何从个人应对危机的进化逻辑和生理变化中得到启示,以更加多维度的、宽视角地看待危机应对这一关乎人类未来的命题。</p>');
INSERT INTO `books` VALUES ('16', '七个疯子', '罗伯特·阿尔特 ', '2', '12', '234sae', '1', '<p><span class=\"all hidden\"></span></p><div class=\"intro\">\n <p>◎ “是我想太多,还是这世界太疯狂?”</p> <p>◎ 毒丽场域疯子们的“蛮荒故事”,纳粹等现代性之殇的神奇预言</p> <p>◎ “阿根廷的陀思妥耶夫斯基”,拉美现代小说之父,罗伯特·阿尔特代表作</p> <p>◎ 马尔克斯、博尔赫斯之先驱,胡里奥·科塔萨尔、罗伯特·波拉尼奥、胡安·卡洛斯·奥内蒂盛赞的伟大作家</p> <p>——————————</p> <p>本书是阿根廷著名作家罗伯特·阿尔特的长篇小说代表作描述男主人公在社会底层挣扎并逐渐走向崩溃的过程。故事集中在三天时间各色人物纷纷登场从一件绑架案折射出20世纪20年代阿根廷乃至拉美的社会现实生活。作家以精湛的文笔对主人公进行了大量的心理描摹并通过主人公的眼睛变形地透视了身边的现实和种种人物其混乱怪诞之感正应了魔幻现实主义的画风。有续集《喷火器》。</p> <p>——————————</p> <p>阿尔特无疑是一位伟大的作家……他是拉美第一位真正的都市小说家……这就是激发文学创作的力量。——《卫报》</p> <p>他的视野与布宜诺斯艾利斯那一帮家伙昏暗而偏缘的视野从不可同日而语。——胡里奥·科塔萨尔</p> <p>阿尔特是阿根廷现代小说之父,他是最重要、最伟大的阿根廷小说家。——里卡多·皮格利亚</p> <p>如果这些海岸上有人能被称为文学天才的话,那一定是罗伯特·阿尔特……我在谈论一个将在时间长河中留下名字的小说家……难以置信,他还不为当今大众所熟知。——胡安·卡洛斯·奥内蒂</p> <p>——————————</p> <p>美洲西班牙语文学的另一重要特征即是它永恒的见证:暴力与不公平的见证,集体与个体的见证,现实与虚构的见证,往昔与现今的见证。在美洲,写作总是兼有诗意与政治的功能,写作从来不是一种无谓的游戏,即便在表面看来最形式化的表达中,它也从不逃遁于幻觉中。</p> <p>——《理想藏书》</p></div><p></p>');
INSERT INTO `books` VALUES ('17', '走出唯一真理观', '陈嘉映', '1', '13', '234sdfd', '1', '<div class=\"intro\">\n <p>★陈嘉映2007—2018自选文集。</p> <p>★《何为良好生活》后新作,认真思考,认真表述这些思考,召唤爱思考的人来一道思考。</p> <p>★在危机与纷争爆发的时代,哲学如何协助我们反思生活。“我们与其说需要共识,不如说需要学会,没有共识的人应该如何一起生存。”</p> <p>本书是陈嘉映先生选编自己于2007—2018年间所作演讲、访谈与评论结集。</p> <p>有不同的道,从前有不同的道,现在有不同的道,将来还有不同的道。重要的问题不是找到唯一的道,而是这些不同的道之间怎样呼应,怎样交流,怎样斗争。你要是坚持说,哲学要的就是唯一的真理体系,那我不得不说,哲学已经死了。</p> <p>哲学,尤其今天的哲学,不是宣教式的,不是上智向下愚宣教。我们之所求,首先不是让别人明白,而是求自己明白。</p> <p>“我个人想要的是,认真思考,认真表述这些思考,召唤爱思考的人来一道思考。”</p></div>');
INSERT INTO `books` VALUES ('18', '人类灭绝之后', '杜格尔·狄克逊', '1', '14', '234s', '1', '<p><span class=\"all hidden\"></span></p><p>《人类灭绝之后——未来世界动物图鉴》描绘了人类灭绝5000万年之后的动物世界。</p> <p>本书分为十一个章节前两章回顾了从生命进化之初到人类出现之后的物种进化历程中间八章则根据狄克逊天马行空又有理有据的想象推演出在人类灭绝之后的5000万年地球上从热带到寒带、从雨林到苔原的动物进化可能带领读者穿越时空共同欣赏这颗星球上生命进化的壮观景象最终章则畅想了在更遥远的未来生命终将归往何处。</p><p></p>');
INSERT INTO `books` VALUES ('19', '孩子们的诗', '果麦', '1', '10', 'sd2342', '1', '<p><span class=\"all hidden\"><div class=\"intro\">\n <p>书中有灵气的诗句包括但不限于以下:</p> <p>*我的眼睛/很小很小/有时遇到心事/就连两行泪/也装不下——陈科全, 八岁</p> <p>*灯把黑夜/烫了一个洞——姜二嫚,七岁</p> <p>*春天来了/我去小溪边砸冰/把春天砸得头破血流/直淌眼泪——铁头,八岁</p> <p>*要是笑过了头/你就会飞到天上去/要想回到地面/你必须做一件伤心事——朵朵,五岁</p> <p>*纸币在飘的时候,我们知道风在算钱。——王子乔,六岁</p> <p>*你问我出生前在做什么/我答 我在天上挑妈妈——朱尔,八岁</p> <p>*母亲提水桶/父亲提电脑/我想起/往日他们提着我在街上乱跑——王芗远,十二岁</p> <p>*树枝想去撕裂天空,但却只戳了几个微小的窟窿,它透出天外的光亮,人们把它叫做月亮和星星。——顾城,十二岁</p> <p>《孩子们的诗》精选了七十多首等313岁小朋友写的诗。小诗人们来自北京、上海、广东、江苏、山东、广西、福建、内蒙古、新疆等全国各个地方。</p> <p>从上万首诗作中脱颖而出,它们首先是好诗,其次才是孩子的诗。</p> <p>本书还邀请了Starry阿星、飞行猴CF、九个妖、木可子、黄雷蕾Linali、苏寒、Lett Yice等二十多位国内知名插画家为书中每一首诗歌创作了兼具美感与奇趣的插画。</p></div></span></p>');
INSERT INTO `books` VALUES ('20', '万物静默如谜', '维斯拉瓦•辛波斯卡', '1', '10', '5楼1室234', '1', '<div class=\"intro\">\n <p>《辛波斯卡诗选万物静默如谜》收录辛波斯卡各阶段名作75首包括激发知名绘本作家幾米创作出《向左走向右走》的《一见钟情》收录高中语文教材的《底片》网上广为流传的《在一颗小星星下》《种种可能》等曾获得《洛杉矶时报》年度最佳图书。</p> <p>辛波斯卡的诗取材于日常生活的事物和经验,甲虫、海参、石头、沙粒、天空;安眠药、履历表、衣服;电影、画作、剧场、梦境等等,在她的笔下无不焕发出新的诗意,让人们重新认识生活中常见的事物。</p></div>');
INSERT INTO `books` VALUES ('21', 'Python编程', '埃里克·马瑟斯', '1', '3', '4楼1室234', '1', '<p>本书是一本针对所有层次的Python 读者而作的Python 入门书。全书分两部分第一部分介绍用Python \n编程所必须了解的基本概念包括matplotlib、NumPy 和Pygal 等强大的Python 库和工具介绍以及列表、字典、if \n语句、类、文件与异常、代码测试等内容第二部分将理论付诸实践讲解如何开发三个项目包括简单的Python 2D \n游戏开发如何利用数据生成交互式的信息图以及创建和定制简单的Web 应用,并帮读者解决常见编程问题和困惑。</p>');
INSERT INTO `books` VALUES ('24', '战斗', '战斗', '2', '1', '五楼234', '1', '<p>战斗</p>');
INSERT INTO `books` VALUES ('26', '124', '1243', '1', '2', '撒旦法', '1', '撒旦法');
-- ----------------------------
-- Table structure for `book_sort`
-- ----------------------------
DROP TABLE IF EXISTS `book_sort`;
CREATE TABLE `book_sort` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT '' COMMENT '书籍类型名',
`description` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of book_sort
-- ----------------------------
INSERT INTO `book_sort` VALUES ('1', '未分类', '不可删除');
INSERT INTO `book_sort` VALUES ('2', '护理', '护理护理');
INSERT INTO `book_sort` VALUES ('3', '编程', '编程编程');
INSERT INTO `book_sort` VALUES ('4', '艺术', '');
INSERT INTO `book_sort` VALUES ('5', '管理', null);
INSERT INTO `book_sort` VALUES ('6', '法律', null);
INSERT INTO `book_sort` VALUES ('7', '生活', null);
INSERT INTO `book_sort` VALUES ('8', '励志', '');
INSERT INTO `book_sort` VALUES ('9', '故事', null);
INSERT INTO `book_sort` VALUES ('10', '诗歌', null);
INSERT INTO `book_sort` VALUES ('11', '社会学', null);
INSERT INTO `book_sort` VALUES ('12', '文学', null);
INSERT INTO `book_sort` VALUES ('13', '哲学', null);
INSERT INTO `book_sort` VALUES ('14', '科学', null);
INSERT INTO `book_sort` VALUES ('16', '幽默', '');
-- ----------------------------
-- Table structure for `borrow_books`
-- ----------------------------
DROP TABLE IF EXISTS `borrow_books`;
CREATE TABLE `borrow_books` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`card_id` int(20) DEFAULT NULL,
`book_id` int(20) DEFAULT NULL,
`borrow_date` datetime DEFAULT NULL,
`end_date` datetime DEFAULT NULL,
`return_date` datetime DEFAULT NULL,
`illegal` varchar(200) DEFAULT NULL,
`manager_id` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of borrow_books
-- ----------------------------
INSERT INTO `borrow_books` VALUES ('20', '1805010202', '1', '2020-06-11 09:37:10', '2020-06-12 09:37:18', '2020-06-11 09:48:07', '', 'chen');
INSERT INTO `borrow_books` VALUES ('21', '1805010206', '5', '2020-04-08 09:37:40', '2020-06-08 09:38:14', '2020-06-11 10:50:07', '已逾期3天', 'chen');
INSERT INTO `borrow_books` VALUES ('22', '1805010207', '1', '2020-06-11 09:47:44', '2020-08-10 09:47:52', '2020-06-11 09:50:07', '', 'chen');
INSERT INTO `borrow_books` VALUES ('24', '1805010202', '1', '2020-06-02 09:55:04', '2020-06-03 09:55:16', '2020-06-11 09:56:02', '已逾期8天', 'chen');
INSERT INTO `borrow_books` VALUES ('25', '1805010204', '2', '2020-06-11 09:59:42', '2020-08-10 09:59:47', '2020-06-11 10:00:17', '', 'chen');
INSERT INTO `borrow_books` VALUES ('26', '1805010202', '1', '2020-06-09 10:01:13', '2020-06-10 10:01:48', '2020-06-11 10:07:29', '超期一天', 'chen');
INSERT INTO `borrow_books` VALUES ('27', '1805010202', '5', '2020-06-08 10:12:18', '2020-06-09 10:12:27', '2020-06-11 10:13:36', '已逾期2天', 'chen');
INSERT INTO `borrow_books` VALUES ('28', '1805010204', '2', '2020-04-07 10:12:28', '2020-06-06 10:12:41', null, null, null);
INSERT INTO `borrow_books` VALUES ('29', '1805010202', '6', '2020-06-11 08:19:56', '2020-06-12 08:20:07', null, null, null);
-- ----------------------------
-- Table structure for `borrow_card`
-- ----------------------------
DROP TABLE IF EXISTS `borrow_card`;
CREATE TABLE `borrow_card` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`password` varchar(20) DEFAULT NULL,
`reader` varchar(20) DEFAULT NULL,
`rule_id` int(11) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL COMMENT '0注销1正常',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1805010220 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of borrow_card
-- ----------------------------
INSERT INTO `borrow_card` VALUES ('1805010202', 'root', '老王', '7', '1');
INSERT INTO `borrow_card` VALUES ('1805010203', 'root', '黄白白', '2', '0');
INSERT INTO `borrow_card` VALUES ('1805010204', 'root', '黄土', '1', '1');
INSERT INTO `borrow_card` VALUES ('1805010205', '1234', '白云', '1', '1');
INSERT INTO `borrow_card` VALUES ('1805010206', '111', '', '6', '1');
INSERT INTO `borrow_card` VALUES ('1805010207', 'admin', '明月', '1', '1');
INSERT INTO `borrow_card` VALUES ('1805010208', 'admin', '明月复苏', '1', '1');
INSERT INTO `borrow_card` VALUES ('1805010210', 'yue', '张沙', '1', '1');
INSERT INTO `borrow_card` VALUES ('1805010211', 'mingming', '星星', '1', '1');
INSERT INTO `borrow_card` VALUES ('1805010212', 'admin', '明月', '1', '1');
INSERT INTO `borrow_card` VALUES ('1805010213', 'chen', '', '1', '1');
INSERT INTO `borrow_card` VALUES ('1805010214', '1234', '小红', '1', '1');
INSERT INTO `borrow_card` VALUES ('1805010217', '赵雪', '赵雪', '2', '1');
INSERT INTO `borrow_card` VALUES ('1805010219', '1234', '测试', '1', '0');
-- ----------------------------
-- Table structure for `library`
-- ----------------------------
DROP TABLE IF EXISTS `library`;
CREATE TABLE `library` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`description` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of library
-- ----------------------------
INSERT INTO `library` VALUES ('1', '南图', null);
INSERT INTO `library` VALUES ('2', '北图', null);
INSERT INTO `library` VALUES ('3', '教师之家', null);
-- ----------------------------
-- Table structure for `manager`
-- ----------------------------
DROP TABLE IF EXISTS `manager`;
CREATE TABLE `manager` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`account` varchar(20) DEFAULT NULL,
`password` varchar(30) DEFAULT NULL,
`email` varchar(30) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of manager
-- ----------------------------
INSERT INTO `manager` VALUES ('1', '', 'chen', 'chen', '232222@qq.com');
INSERT INTO `manager` VALUES ('2', '', 'ming', 'ming', '234234@qq.com');
INSERT INTO `manager` VALUES ('3', '明月', 'root', 'root', '284908631@qq.com');
INSERT INTO `manager` VALUES ('11', 'root', '1234', 'root', '123456@qq.com');
INSERT INTO `manager` VALUES ('12', '测试员', 'test', 'test', 'test@qq.com');
INSERT INTO `manager` VALUES ('13', '明月', '1', 'root', '1');
-- ----------------------------
-- Table structure for `message`
-- ----------------------------
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`card_id` int(20) DEFAULT NULL,
`detail` varchar(1000) DEFAULT NULL,
`public_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of message
-- ----------------------------
INSERT INTO `message` VALUES ('1', '1805010201', '冲鸭,一起来看书', '2020-06-01 23:11:59');
INSERT INTO `message` VALUES ('2', '1805010202', '我爱学习', '2020-05-29 23:12:03');
INSERT INTO `message` VALUES ('3', '1805010202', '图书馆的书质量很好,图书管理员态度非常好,系统管理员也非常热心,太棒了', '2020-06-04 23:12:24');
INSERT INTO `message` VALUES ('6', '1805010202', '咋回事', '2020-06-12 08:34:18');
-- ----------------------------
-- Table structure for `rules`
-- ----------------------------
DROP TABLE IF EXISTS `rules`;
CREATE TABLE `rules` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`borrow_num` int(10) DEFAULT NULL COMMENT '限制本数',
`limit_day` int(10) DEFAULT NULL COMMENT '限制天数',
`borrow_library` varchar(20) DEFAULT NULL,
`overtime_fee` float(10,3) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of rules
-- ----------------------------
INSERT INTO `rules` VALUES ('1', '10', '60', '1、2、3', '0.100');
INSERT INTO `rules` VALUES ('2', '1', '10', '2、3', '1.000');
INSERT INTO `rules` VALUES ('3', '20', '120', '1、2、3', '1.000');
INSERT INTO `rules` VALUES ('4', '20', '180', '1、2、3', '0.100');
INSERT INTO `rules` VALUES ('5', '1', '100', '1', '0.100');
INSERT INTO `rules` VALUES ('6', '15', '60', '1、2、3', '0.100');
INSERT INTO `rules` VALUES ('7', '1', '1', '1、3', '1.000');

@ -20,6 +20,10 @@ import javax.servlet.http.HttpSession;
*/ */
public class AdminFilter implements Filter { public class AdminFilter implements Filter {
public void init(FilterConfig filterConfig) throws ServletException {
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request; HttpServletRequest req = (HttpServletRequest) request;
HttpSession session = req.getSession(); HttpSession session = req.getSession();
@ -31,9 +35,4 @@ public class AdminFilter implements Filter {
} }
chain.doFilter(request, response); chain.doFilter(request, response);
} }
public void init(FilterConfig fConfig) throws ServletException {
}
} }

@ -45,7 +45,7 @@ public class Admin {
return "发生未知错误"; return "发生未知错误";
}finally { }finally {
if(Base.closeResource(connection, pstmt, resultSet) == false) { if(Base.closeResource(connection, pstmt, resultSet) == false) {
System.out.println("关闭失败"); return "关闭失败";
} }
} }

@ -27,54 +27,52 @@ public class BookList extends HttpServlet {
@Override @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("application/json; charset=utf8"); resp.setContentType("application/json; charset=utf8");
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
String result = null; String result = null;
Map<String, Object> map = null; Map<String, Object> map = null;
int code = 1; int code = 1;
String msg = ""; String msg = "";
String data = ""; String data = "";
String page = (String) req.getParameter("page"); String page = (String) req.getParameter("page");
String limit = (String) req.getParameter("limit"); String limit = (String) req.getParameter("limit");
String condition = (String) req.getParameter("condition"); String condition = (String) req.getParameter("condition");
String conditionValue = (String) req.getParameter("conditionValue"); String conditionValue = (String) req.getParameter("conditionValue");
Map where = new HashMap<String, String>(); Map where = new HashMap<String, String>();
//System.out.println(condition +"" +conditionValue); // 传输数据过滤
// 传输数据过滤 if(page == null) {
if(page == null) { page = "1";
page = "1"; }
} if(limit == null) {
if(limit == null) { limit = "10";
limit = "10"; }
} if(condition == null || conditionValue == null || condition.isEmpty() || conditionValue.isEmpty()) {
if(condition == null || conditionValue == null || condition.isEmpty() || conditionValue.isEmpty()) { condition = null;
condition = null; conditionValue = null;
conditionValue = null; }else {
}else { where.put("condition", condition);
where.put("condition", condition); where.put("conditionValue", conditionValue);
where.put("conditionValue", conditionValue); }
} Admin admin = new Admin();
Admin admin = new Admin(); try {
try {
map = admin.getBookList(page, limit, where); map = admin.getBookList(page, limit, where);
result = (String) map.get("data"); result = (String) map.get("data");
} catch (ClassNotFoundException | SQLException e) { } catch (ClassNotFoundException | SQLException e) {
msg = "数据库获取信息失败"; msg = "数据库获取信息失败";
} }
if(result == null || result.isEmpty() || result.equals("1")) { if(result == null || result.isEmpty() || result.equals("1")) {
json.put("code", 1); json.put("code", 1);
json.put("msg", "数据为空"); json.put("msg", "数据为空");
} else { } else {
json.put("code", 0); json.put("code", 0);
json.put("msg", "success"); json.put("msg", "success");
json.put("count", map.get("count")); json.put("count", map.get("count"));
result = "[" +result +"]"; result = "[" +result +"]";
json.put("data", result); json.put("data", result);
} }
PrintWriter out = resp.getWriter(); PrintWriter out = resp.getWriter();
out.print(json.toString()); out.print(json.toString());
//out.print("{\"code\":0,\"msg\":\"\",\"count\":10,\"data\":[{\"id\":10000,\"name\":\"夏洛特的烦恼\",\"library_name\":\"南图\",\"sort_id\":\"言情\",\"position_id\":\"sdf\",\"state\":\"借出\",\"descript\":\"好看\",\"operate\":\"234\"},{\"id\":10000,\"name\":\"夏洛特的烦恼\",\"library_name\":\"南图\",\"sort_id\":\"言情\",\"position_id\":\"sdf\",\"state\":\"借出\",\"descript\":\"好看\",\"operate\":\"234\"},{\"id\":10000,\"name\":\"夏洛特的烦恼\",\"library_name\":\"南图\",\"sort_id\":\"言情\",\"position_id\":\"sdf\",\"state\":\"借出\",\"descript\":\"好看\",\"operate\":\"234\"},{\"id\":10010,\"name\":\"夏洛特的烦恼\",\"library_name\":\"南图\",\"sort_id\":\"言情\",\"position_id\":\"sdf\",\"state\":\"借出\",\"descript\":\"好看\",\"operate\":\"234\"}]}");
} }
@Override @Override

@ -68,8 +68,8 @@ public class BorrowList extends HttpServlet {
where = " where return_date is null and curtime()>end_date "; where = " where return_date is null and curtime()>end_date ";
sql +=where; sql +=where;
} }
sql += " limit ?,?";//1 10 (1-1)*10; sql += " limit ?,?";
pstmt = connection.prepareStatement(sql); pstmt = connection.prepareStatement(sql);
pstmt.setInt(1, (Integer.parseInt(page)-1) * Integer.parseInt(limit)); pstmt.setInt(1, (Integer.parseInt(page)-1) * Integer.parseInt(limit));
pstmt.setInt(2, Integer.parseInt(limit)); pstmt.setInt(2, Integer.parseInt(limit));
resultSet = pstmt.executeQuery(); resultSet = pstmt.executeQuery();

@ -49,7 +49,7 @@ public class SortDel extends HttpServlet {
pstmt.setString(1, defaultId); pstmt.setString(1, defaultId);
pstmt.setString(2, id); pstmt.setString(2, id);
result = pstmt.executeUpdate(); result = pstmt.executeUpdate();
// 进行删除 // 进行删除
sql = "delete from book_sort where id=?"; sql = "delete from book_sort where id=?";
pstmt = connection.prepareStatement(sql); pstmt = connection.prepareStatement(sql);

Loading…
Cancel
Save