A free library management system based on springboot, very beautiful

Hello everyone, I'm Brother Feng. I saw a good library management system based on springboot developed. Let me share it** (the download address is at the end of the article)**.

Technology Introduction

Based on: java8 + SpringBoot + thymeleaf + MySQL8.0.17 + mybatis-plus + maven + Xadmin to realize the library management system

Instructions before use

sql is stored in src/main/resources/the directory

The application context deployed by tomcat is/

application context

The encoding of this idea project is utf8, please change the relevant configuration by yourself

Idea配置:File–>Settings–>File Encodings–>Project Encoding

The default under Windows is GBK, tomcat configuration interface: add virtual machine startup parameters: -Dfile.encoding=UTF-8

The console is garbled
. Modify the vm parameters in the idea
. Add a piece of configuration information: -Dfile.encoding=UTF-8

Tomcat is all set to utf8

1. Requirements

The system shall implement the following basic management functions:

(1) Users are divided into two categories: administrators and general users.

(2) Provide user registration and user login verification functions; one of the login user information includes: login user name, login password.

(3) The administrator can realize the management of registered users (query, delete, password modification), the determination of the user's application for borrowing books and the operation of returning books, and the creation, query, modification and deletion of books and other related operations

(4) Ordinary users can only query books and borrow books (apply for borrowing books). Each user can borrow up to 8 books. After the book is finished, you can borrow it again.

Design a global interceptor

Open to all: 1-4

reader,admin:5-7

reader only: 8-9

admin only: 10-28

serial number path illustrate Where page 1 On page 2 On page 3 accessible
1 /toIndex Automatically log in, jump to the home page if you are not logged in /index.jsp everyone
2 /RegisterReader Jump registration /register.jsp everyone
3 /Login Log in /login.jsp everyone
4 SpringBoot has built-in Jump to error page * everyone
5 /UpdateReader Implementation of user information modification, administrator edits user information /reader/edit.jsp /admin/editReader.jsp admin,reader
6 /toEditReader Jump to the user modification page, the administrator edits the user /reader/edit /admin/readerList.jsp admin,reader
7 /Logout sign out /reader/index.jsp /admin/index.jsp admin,reader
8 /reader/toBookshelf Jump to the user to display the book, and the user finds the details of a book /reader/index.jsp /reader/borrowList.jsp reader
9 /reader/toReaderBorrow Jump to the user's borrowing record /reader/index.jsp reader
10 /admin/toAddReader Admin add user /admin/readerList.jsp admin
11 /admin/toBorrowList Admin query borrowing information /admin/readerList.jsp /admin/index.jsp /admin/bookList.jsp admin
12 /admin/DeleteReader delete users /admin/readerList.jsp admin
13 /admin/toEditAdmin Jump to the administrator edit page, administrator personal information modification /admin/index.jsp /admin/adminList.jsp admin
14 /admin/toAdminList to display the admin list /admin/index.jsp admin
15 /admin/toReaderList To display the user list and borrower information /admin/index.jsp /admin/borrowList.jsp admin
16 /admin/toBookList to display the book list /admin/index.jsp /admin/borrowList.jsp admin
17 /admin/UpdateBook Administrator edits book information /admin/editBook.jsp admin
18 /admin/UpdateAdmin Admin Edit Admin Information /admin/editAdmin.jsp admin
19 /admin/toAddBorrow Administrator to add borrowing information /admin/borrowList.jsp admin
20 /admin/toReturnBook Jump to book return application /admin/borrowList.jsp admin
21 /admin/toAddBook Admin to add books /admin/bookList.jsp admin
22 /admin/toEditBook Admin to edit books /admin/bookList.jsp admin
23 /admin/DeleteBook delete book /admin/bookList.jsp admin
24 /admin/toAddAdmin Jump to add administrator page /admin/adminList.jsp admin
25 /admin/DeleteAdmin Delete administrator information /admin/adminList.jsp admin
26 /admin/AddBorrow Admin Borrowing Books /admin/addBorrow.jsp admin
27 /admin/AddBook Admin add book /admin/addBook.jsp admin
28 /admin/RegisterAdmin administrator registration administrator /admin/addAdmin.jsp admin

2. Overall design

2.1 Division of system function modules

The general modules of the system are as follows:

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-fotdZLxk-1678002919400)(https://gitee.com/ifwlzs/img/raw/master/img/% E5%9B%BE%E4%B9%A6%E9%A6%86-%E7%B3%BB%E7%BB%9F%E6%A8%A1%E5%9D%97.png)]

Error page jumping module: When a user accesses a page that does not exist, it will jump to the default 404 page of this system. When performing an error operation that causes a 500 error on the server, it will also jump to the matching 500 page of this system.

Rights management: using interceptors to achieve the purpose of users not being able to access pages and send requests beyond their rights

Login verification module: match with the existing users in the database, if not, return an error message. After successful login, it will jump to the corresponding home page

Administrator module: modification of personal information; addition, deletion, modification and inquiry of readers; addition, deletion, modification and inquiry of books; addition, deletion, modification and inquiry of administrators, book borrowing and book return operations.

Reader module: Personal information modification, library inventory query, personal borrowing record query.

2.2 ER model

The ER model is shown in the figure:

[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-oznredeh-1678002919401) (https://gitee.com/ifwlzs/img/raw/master/img/% E5%9B%BE%E4%B9%A6%E9%A6%86-ER.png)]

2.3 Database design

The database design is shown in the figure:

Database Design

3. Detailed design

3.1 Front Design

3.1.1 Login interface

登录包括注册和登录部分。当用户未输入时,只能点击前往注册,点击登录会弹窗提示“未输入必填项以及未完成滑块认证”。

login interface

点击前往注册。可以看到注册页面。再注册界面中,加入了空值、用户ID、邮箱、电话等关键值的判断。保证用户输入的字符,符合注册要求后在向后端发送注册请求。

registration page

登录后,系统会根据用户ID自动判别用户类别,如果是r开头的,为读者登录,如果是m开头的则为管理员。若登录出错会返回错误信息

login error

3.1.2 读者模块

读者模块分为三小块。右边为导航栏,包括两个功能,分别是查询馆藏书籍和查询自己的借阅记录。右边为刷新,登出和编辑个人信息功能。

Reader Module Home

3.1.2.1 编辑个人信息

该页面做了密码验证功能,如果密码输入错误将无法修改。

edit personal information

3.1.2.2 查询馆藏书籍

该页面会显示书籍的基本信息。也可以根据书名进行模糊查询。但是进行特别处理。不满足借阅条件的将无法显示“去借阅”按钮。

Collection Catalog

如果当前用户借书量达到8本了,将会提示“每个用户最多可借阅8本书籍,请尽快前往图书馆归还!”

3.1.2.3 查询个人借阅记录

查询中,可以根据全部记录和未归还记录作为条件进行查询。

Query personal borrowing records

表格中也可以根据书籍ID查询书籍详情。

Query book details

点击“归还”按钮会提示图书馆开放时间。

3.2 后台设计

管理员后台功能颇多。除了个人信息更改,还包括用户管理,书籍管理,借阅管理三大模块。

3.2.1 用户管理

用户管理分为管理员和读者模块。管理员包括增删改和模糊查询操作。

administrator management

reader management

读者管理包括增删改模糊查询外还包括查询未归还记录和查询全部记录,下面展示查询未归还记录

Query unreturned records

3.2.2 书籍管理

书籍管理大致包括书籍的增删改,以及查询某本书的借阅记录和未归还记录

book management

编辑界面中,对库存总量进行了安全安全判断,使得库存永远大于等于借出数量。并且说定了借出数量,让还书操作在借阅管理中进行。

edit books

3.2.3 借阅记录管理

借阅记录中可以进行借阅者,书籍详情,未归还书籍的查询;书籍归还操作以及添加借阅信息。归还操作中,满足书籍库存大于等于借出量以及借出量不为0的条件下,即可归还成功。

Borrowing record management

When adding borrowing information. If the selected reader has reached the maximum borrowing capacity, it will prompt that the borrowing is unsuccessful.

Failed to borrow books

3.3 Security design

In terms of security, the access of different roles is mainly restricted.

Users who are not logged in can only access the login and registration pages. If they access pages with other roles, they will be redirected to the login homepage.

Administrators cannot access methods and pages under the reader directory. After accessing, you will be automatically redirected to the administrator's homepage.

Readers cannot access methods and pages under the admin directory. After visiting, you will be automatically redirected to the reader's home page.

When entering a page that does not exist, and when an error occurs on the server, the page will jump to the corresponding error page.

404 page

Server Error

4. Source code download

1 point download: https://download.csdn.net/download/caofeng891102/87528418

5. Popular recommendation

Free OA automation office system based on springboot, very beautiful

Share a human resource management system of SpringBoot + Vue + ElementUI for free

Share a SpringBoot flower mall management system for free

I wrote a set of SpringBoot+SpringSecurity+Vue permission system practical courses

I wrote a set of SpringBoot WeChat applet e-commerce full-stack employment practical courses

springboot+vue front-end and back-end music network system, very beautiful_Simple music playback front-end and back-end

Share a springboot+vue campus dormitory management system for free, very beautiful

Share a SSM mall management system for free, very beautiful

Guess you like

Origin blog.csdn.net/caoli201314/article/details/129347066