Design and Implementation of Book Management System Based on JavaSSM+MySQL

Background and significance of topic selection:

With the rapid development of information technology, libraries, as the center of information resources, are also expanding in size and complexity. The traditional library management mode often consumes a lot of manpower, material resources and time, and is prone to errors and loopholes in the library management process, which makes library management inefficient and unable to meet the needs of readers. Therefore, designing and implementing a library management system based on JavaSSM+MySQL has important practical significance for improving library management efficiency and service quality.

This article aims to design and implement a book management system based on JavaSSM+MySQL, and realize various functions of book management, including book information management and reader information, by using technologies such as Java language, Spring framework, SpringMVC framework, MyBatis framework and MySQL database. Management, Borrowing Management, etc. At the same time, this system will fully consider the scalability and maintainability of the system, so that the system has good adaptability and can meet the needs of different libraries.

In addition, this paper will also conduct performance test and security test on the system to ensure the stability and security of the system. Finally, we will verify the feasibility and effectiveness of the system through experiments, and provide more efficient and convenient services for library book management.

Through the research of this paper, we hope to make some contribution to the development of the library management field, and provide a more advanced and efficient library management solution for the library.
demand analysis:

Functional requirements: This system should realize functions such as book information management, reader information management, and borrowing management. Book information management includes operations such as adding, modifying, querying, and deleting books; reader information management includes operations such as adding, modifying, querying, and deleting readers; borrowing management includes operations such as borrowing books, returning books, and querying borrowing records.
Performance requirements: The system should have good stability and security to ensure the normal operation of the system under high load and prevent hacker attacks and data leakage. At the same time, the system should have good scalability and maintainability to facilitate subsequent function upgrades and optimizations.
Other requirements: The system should have a user-friendly interface, simple and convenient operation, and easy to use. In addition, the system should have a good user rights management function to ensure that different users can only operate the functional modules under their corresponding rights.
Based on the above requirement analysis, we can further design and implement a library management system based on JavaSSM+MySQL to improve the efficiency of library management and service quality.

<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<title>图书馆首页</title>
<link rel="stylesheet" href="../css/bootstrap.min.css">
<script src="../js/jquery-3.2.1.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/js.cookie.js"></script>
<style>
#myCarousel {
    
    
	margin-left: 2%;
	width: 60%;
	height: 70%;
	float: left;
	z-index: 999;
	display: inline;
}

#login {
    
    
	float: left;
	height: 50%;
	width: 23%;
	margin-left: 6%;
	margin-top: 6%;
	display: inline;
	z-index: 999;
}

* {
    
    
	padding: 0;
	margin: 0;
}
</style>
<script>
	$(function() {
    
    
		$('#myCarousel').carousel({
    
    
			interval : 2000
		})
	});
</script>
</head>
<body>
	<c:if test="${!empty error}">
		<script>
			alert("${error}");
			window.location.href = "login.html";
		</script>
	</c:if>
	<h2
		style="text-align: center; font-family: 'Adobe 楷体 Std R'; color: palevioletred">
		书 馆</h2>
	<div style="float: right;" id="github_iframe"></div>
	<!-- <script type="text/javascript" src="../js/canvas-nest.js"></script> -->
	<div id="myCarousel" class="carousel slide">
		<ol class="carousel-indicators">
			<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
			<li data-target="#myCarousel" data-slide-to="1"></li>
			<li data-target="#myCarousel" data-slide-to="2"></li>
		</ol>
		<div class="carousel-inner">
			<div class="item active">
				<img src="../images/82839-106.jpg" alt="第一张">
			</div>
			<div class="item">
				<img src="../images/105905-106.jpg" alt="第二张">
			</div>
			<div class="item">
				<img src="../images/296494-106.jpg" alt="第三张">
			</div>
		</div>

		<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;
		</a> <a class="carousel-control right" href="#myCarousel"
			data-slide="next">&rsaquo; </a>
	</div>

	<div class="panel panel-default" id="login">
		<div class="panel-heading" style="background-color: #fff">
			<h3 class="panel-title">请登录</h3>
		</div>
		<div class="panel-body">
			<div class="form-group">
				<label for="id">用户名</label> <input type="text" class="form-control"
					id="id" placeholder="请输入用户名">
			</div>
			<div class="form-group">
				<label for="passwd">密码</label> <input type="password"
					class="form-control" id="passwd" placeholder="请输入密码">
			</div>
			<div class="form-group">
				<label for="passwd">用户类型</label>
				<!-- 以下是bootstrap的单选框的写法 -->
				<div class="btn-group" id="type" data-toggle="buttons">
					<label class="radio-inline"> <input type="radio"
						name="optionsRadiosinline" value="0" checked> 管理员
					</label> <label class="radio-inline"> <input type="radio"
						name="optionsRadiosinline" value="1"> 用户
					</label>
				</div>
			</div>
			<div class="checkbox text-left">
				<label> <input type="checkbox" id="remember">记住密码
				</label> <a style="margin-left: 100px" href="#">忘记密码?</a>
			</div>

			<p style="text-align: right; color: red; position: absolute"
				id="info"></p>
			<br />
			<button id="loginButton" class="btn btn-primary  btn-block">
				登陆</button>
		</div>
	</div>

	<script>
		$("#id").keyup(function() {
    
    
			if (isNaN($("#id").val())) {
    
    
				$("#info").text("提示:账号只能为数字");
			} else {
    
    
				$("#info").text("");
			}
		})
		// 记住登录信息
		function rememberLogin(username, password, checked) {
    
    
			Cookies.set('loginStatus', {
    
    
				username : username,
				password : password,
				remember : checked
			}, {
    
    
				expires : 30,
				path : ''
			})
		}

		// 若选择记住登录信息,则进入页面时设置登录信息
		function setLoginStatus() {
    
    
			var loginStatusText = Cookies.get('loginStatus')
			if (loginStatusText) {
    
    
				var loginStatus
				try {
    
    
					loginStatus = JSON.parse(loginStatusText);
					$('#id').val(loginStatus.username);
					$('#passwd').val(loginStatus.password);
					$("#remember").prop('checked', true);
				} catch (__) {
    
    
				}
			}
		}

		// 设置登录信息
		setLoginStatus();

		$("#loginButton").click(function() {
    
    
			var id = $("#id").val();
			var passwd = $("#passwd").val();
			var type = $('#type input:radio:checked').val();
	
			var remember = $("#remember").prop('checked');

			if (id == '' && passwd == '') {
    
    
				alter("000")
				$("#info").text("提示:账号和密码不能为空");
			} else if (id == '') {
    
    
				alter("111")
				$("#info").text("提示:账号不能为空");
			} else if (passwd == '') {
    
    
				alter("222")
				$("#info").text("提示:密码不能为空");
			} else if (isNaN(id)) {
    
    
				alter("333")
				$("#info").text("提示:账号必须为数字");
			} else {
    
    
				var data = "id=" + id + "&passwd=" + passwd;
				if (type == "0") {
    
    
					/*type为0就是管理员登陆 */
					$.ajax({
    
    
						"type" : "POST",
						"url" : "../admin/login.do",
						"data" : data,
						"dataType" : "json",
						"success" : function(json) {
    
    
							if (json.state == 200) {
    
    
								location.href = "admin_main.jsp";
							} else if (json.state == 402) {
    
    
								alert("登录失败,用户名不存在");
							} else if (json.state == 403) {
    
    
								alert("密码错误");
							}
						}
					});

				} else {
    
    
					/*type为1就是用户登录*/
					$.ajax({
    
    
						"type" : "POST",
						"url" : "../user/login.do",
						"data" : data,
						"dataType" : "json",
						"success" : function(json) {
    
    
							if (json.state == 200) {
    
    
								location.href = "reader_main.jsp";
							} else if (json.state == 402) {
    
    
								alert("登录失败,用户名不存在");
							} else if (json.state == 403) {
    
    
								alert("密码错误");
							}
						}
					});
				}
			}
		})
	</script>
</body>
</html>

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/newlw/article/details/131357353