Book Management System 2.0——mysql database

1. Brief introduction

1. Using technology

Native java+swing+jdbc driver+mysql without any framework

2. Brief function

insert image description here

3. Source code

https://gitee.com/wang-yongyan188/bms.git

2. Requirements document

1. Login

After the code runs, a login window will pop up

  • Enter the user name (the user name is unique), the account password and the password is not visible
  • If the input is correct, it will judge whether it is an administrator or a user, and enter a different page menu
  • If you make a mistake, there will be a red prompt
  • If you do not have an account password, you can click Register

insert image description here

2. Registration

  • In the login window, click Register to pop up the registration window
  • Enter the user name (the required name has not been registered), password, click to register if it is empty or does not meet the requirements, there will be a corresponding prompt
  • The registration is successful, the registration window disappears, a successful prompt pops up, click OK, and the pop-up window disappears
  • Registered users default to normal users

insert image description here

insert image description here

3. User menu

  • After successful login, enter the menu
  • Displays current user name, current credits, and system notifications at the top of the menu. If the book is about to expire or has not been returned after the due date, it will be displayed in the system notification
  • Users can click menu options to enter different function windows

insert image description here

3.1 Borrowing books

  • Click to borrow, and the borrow window will pop up. If the points are negative, you cannot click and give a reminder
  • In the window, fill in the title of the book, and select the number of months and days to be borrowed. The total borrowing period does not exceed 3 months
  • If you click Borrow, if the title of the book is empty, or it does not exist in the system, there will be a pop-up prompt, and the filled content will be cleared at the same time; if it is successful, the return time will be prompted, and the borrowing window will disappear
  • A user can only borrow one book of the same book before returning it
  • Click Cancel, and the borrowing window disappears. Only menu page left

insert image description here
insert image description here

3.1 Returning Books

  • Click the Return button on the menu bar, a return window will pop up, enter the name of the book to be returned in the window
  • If the user returns the book without borrowing or the input is empty, a pop-up window will prompt
  • If the return is successful, a prompt will pop up, and a one-click jump to the evaluation window button will be added
  • Successful return once on time, plus 1 point; if it is overtime, the overtime period will be calculated, and one point will be deducted for every day that exceeds, and less than one day will be counted as one day. This information will end up in my messages

insert image description here

3.2 Personal center

3.2.1 View all borrowing records

  • Clicking will display the books that the user has borrowed in the system in a tabular form, including borrowing completed and borrowing
  • insert image description here

3.2.2 View the books in borrowing

  • Clicking will display all unreturned books of the user in a tabular form
    insert image description here

3.2.3 Sign in to collect points

  • Click to pop up the sign-in page, each user can sign in once a day, and one point can be added for one sign-in and c
  • If you have already signed, you will be prompted
    insert image description here

3.2.4 My message

  • All check-in records, return records, borrowing records, and evaluation records are here
  • Click Clear to clear the database records
  • If there is no message, a pop-up window will prompt
    insert image description here

3.2.5 Change password

  • A pop-up window, the user enters the new password and the old password, the password does not display the clear text
  • If the old password is wrong, a prompt will be given, and the new password requires at least 4 digits
  • The modification is successful, the pop-up window disappears and returns to the menu. Valid for next login

insert image description here

3.2.6 Logout

  • Click to log out, the current user will be empty, the menu page will disappear, and the initial login page will pop up, log in again

insert image description here

3.3 Renewing Books

  • Each borrowing can only be renewed once
  • Renewal time up to 30 days
  • Renewal request borrowing without timeout
  • Enter the title of the book to determine whether it meets the renewal conditions (whether the book is being borrowed)
    insert image description here

3.4 Review Books

  • Book evaluation can be returned after successful return, or click from the menu bar
  • Each user can only evaluate once for each borrowing
  • Only after the return is successful, can it be evaluated
  • Enter the title of the book to determine whether you have borrowed the book and evaluated it
  • The evaluation can choose the score (select the column method, it cannot be empty), or enter the evaluation content (the content can be empty)

insert image description here

3.5 Message Square

  • Every time the administrator makes changes to the book, it will be automatically published in the message square, which can be seen by all users and other administrators
  • The message has a specific time and event
  • The messages inside can only be viewed and cannot be deleted
    insert image description here

4. Administrator menu

  • User login will automatically determine the identity and go to different menu pages
    insert image description here

4.1 Manage Books

4.1.1 Add Book

  • In the pop-up window, enter the book name, select the corresponding type, enter the quantity, and finally add
  • If the book already exists, a prompt will pop up
  • Book title, quantity (greater than 0) detection cannot be empty, and a prompt will be given

insert image description here

4.1.2 Editing Books

  • First pop up a window, enter the title of the book to be modified, if it exists, it will enter the modification page; if it does not exist, it will give a prompt
  • The original information will be automatically filled into the form
  • Modify the part to be modified, and after checking whether the modification is legal, a pop-up window prompts success, and the modification page disappears

insert image description here

4.1.3 Removal of books

  • Enter the title of the book on the pop-up off-shelf page
  • If the book title does not exist, a prompt will be given
  • If it is still borrowed at this time, it cannot be removed from the shelf
  • Any operation gives a prompt

insert image description here

4.2 Message Square

  • Same as the user page, showing the administrator's operations on the book
  • specific time, event
  • insert image description here

4.3 View book data

4.3.1 Query from less to more according to inventory

  • Displays a list of all books in tabular form and sorts them from least to most in stock

insert image description here

4.3.2 Query according to the score from high to low

  • Display a list of all books in table form and display them in order of rating from high to low
  • insert image description here

4.3.3 Query according to borrowing frequency from high to low


  • Display a list of all books in table form and display them in descending order of borrowing frequency-insert image description here

4.4 Safe Exit

  • Click to exit the system directly

3. System design

1. Library table design

tbl_book

insert image description here

tbl_order

insert image description here
insert image description here

tbl_user

insert image description here

tbl_msg_square

insert image description here

overall design

insert image description here

2. Core class diagram

2.1 Login

insert image description here

2.2 Menu

overview:
insert image description here

2.3 Directory structure

insert image description here

4. This improvement point

1、将所有业务代码,数据库操作、图形化界面分离  可直接自己编写网页配合控制器去对应业务,从而去掉GUI
2、增加 消息模块、归还提醒、积分模块、安全校验 增加可玩性
3、优化操作体验,使得操作更连贯、每个操作成功或失败都有对应提醒
4、将容易变化部分进行抽取,方便修改
5、修改上一个版本反馈的所有的bug、并增加功能、美化页面


It took 4 days and the creation was not easy. If you think it's good, please give it a thumbs up ! Any bugs are welcome to private message feedback, and we will update again when we have time!

Guess you like

Origin blog.csdn.net/m0_52889702/article/details/127230912