Blogger introduction: ✌Programmer brother Xu, 7 years of experience as a programmer in a big factory. 30W+ fans on the whole network, csdn blog expert, high-quality author on Nuggets/Huawei Cloud/Ali Cloud/InfoQ and other platforms, focusing on Java technology field and graduation project practice✌
Article directory
1 Introduction
Java self-study room reservation system based on WeChat applet
The self-study room reservation system of Xinxiang University based on the WeChat applet developed in this paper combines the specific reality of the university, and uses the programming foundation and database to realize the information management of educational affairs. Make full use of the existing resources of the campus, upgrade the current backward management status to the information management mode, reduce the management workload of the self-study room, and help standardize the teaching work. The self-study room reservation system of Xinxiang University based on the WeChat mini-program helps teachers effectively manage the information of the self-study room, and students understand the use and changes of the self-study room through the system. Reduce the time spent walking to the study room to check the status, and view various announcements and teaching announcement information through the system. In the communication module, you can also communicate with other students or teachers online. Obtain problems and solutions in campus life, effectively improve the utilization of school time and improve learning efficiency
2 technology stack
illustrate | technology stack | Remark |
---|---|---|
Backstage | Java | |
front end | Applets | |
database | MYSql | |
architecture | B/S structure |
3 Demand Analysis
3.1 User needs analysis
The users of the self-study room reservation system of Xinxiang University based on the WeChat applet are the most fundamental users of the system. According to the needs, the system includes two types of users: students and administrators. The requirements of these two types of users on the system are briefly as follows.
3.1.1 Student User
As long as the student user has realized the viewing of the front desk information, open the homepage, view the website introduction, self-study room information, online messages, carousel information announcements, etc., and jump to the corresponding function page menu by clicking the menu on the homepage, including the website homepage, self-study Room information, registration and login, personal center, background login.
The student user logs in through the account number, and has all the operation rights after logging in. If he does not log in, he cannot make an appointment online. Student users logging out of the system will log out their personal login information.
3.1.3 Administrator user
The administrator selects the administrator authority to log in through the login page in the background. The authority of the administrator includes carousel announcement management, teacher and student information management, and information audit management. After the administrator manages, click Exit to log out the login information.
The administrator user has the management of online communication, self-study room information management, and self-study room reservation management.
Online communication is to manage the message content of the front desk users, delete the message, and check the message. Study room type management, add a certain study room type information. College self-study room management, the user adds college self-study room information, including the name of the college self-study room, the maximum capacity, the location of the college self-study room, the status of the college self-study room, and the picture of the corresponding college self-study room. information carried out. Exit the system after operation.
4 Database design
4.4.1 ER diagram design
The self-study room reservation system of Xinxiang University based on the WeChat applet has a clear entity, so only the ER diagram of the system as a whole is drawn here, and the drawing of the E-R diagram is omitted for the others.
(1) ER diagram of administrator information entity:
Figure 4.3 Administrator ER Diagram
(2) Announcement information entity ER diagram
Figure 4.4 Announcement Information Entity ER Diagram
(3) Type information entity ER diagram
Figure 4.5 ER Diagram of Study Room Type Information
(4) Student information entity ER diagram
Figure 4.6 Student Information Entity ER Diagram
(5) ER Diagram of University Self-study Room Information
Figure 4.7 ER Diagram of Information Entities in Self-study Rooms in Colleges and Universities
(6) Message exchange information ER diagram
Figure 4.8 Message Exchange Information Entity ER Diagram
4.4.2 Database table design
The self-study room reservation system of Xinxiang University based on the WeChat applet includes multiple database tables. The following is a detailed introduction to the data tables. Each database table includes the name, whether the type is gradual, and whether it is an empty field.
Form: Study Room Information Form
serial number | data field name | corresponding type | primary key | allow empty | Remarks for the field |
---|---|---|---|---|---|
No1 | C_id | bigint(8) | PK | No | primary key |
No2 | C_addtime | timestamp(8) | NO | No | creation time |
No3 | C_bianhao | nvarchar(400) | NO | Null | serial number |
No. 4 | C_jifanghao | nvarchar(400) | NO | Null | study room type |
No. 5 | C_tupian | nvarchar(400) | NO | Null | picture |
No. 6 | C_riqi | nvarchar(400) | NO | Null | date |
No7 | C_shiduan | nvarchar(400) | NO | Null | period of time |
No8 | C_kongxianzuowei | text(16) | NO | Null | building |
No9 | C_xiangqing | text(16) | NO | Null | details |
No10 | C_zhuangtai | nvarchar(400) | NO | Null | state |
Table: config information table
serial number | data field name | corresponding type | primary key | allow empty | Remarks for the field |
---|---|---|---|---|---|
No1 | C_id | bigint(8) | PK | No | primary key |
No2 | C_name | nvarchar(200) | NO | No | Configuration parameter name |
No3 | C_value | nvarchar(200) | NO | Null | Configuration parameter value |
Form: quxiaoyuyue Information Form
serial number | data field name | corresponding type | primary key | allow empty | Remarks for the field |
---|---|---|---|---|---|
No1 | C_id | bigint(8) | PK | No | primary key |
No2 | C_addtime | timestamp(8) | NO | No | creation time |
No3 | C_bianhao | nvarchar(400) | NO | Null | serial number |
No. 4 | C_jifanghao | nvarchar(400) | NO | Null | study room type |
No. 5 | C_riqi | nvarchar(400) | NO | Null | date |
No. 6 | C_shiduan | nvarchar(400) | NO | Null | period of time |
No7 | C_zuoweihao | nvarchar(400) | NO | Null | seat number |
No8 | C_quxiaoliyou | text(16) | NO | Null | Cancellation reason |
No9 | C_xuehao | nvarchar(400) | NO | Null | student ID |
No10 | C_xingming | nvarchar(400) | NO | Null | Name |
No11 | C_shenfenzheng | nvarchar(400) | NO | Null | ID card |
No12 | C_sfsh | nvarchar(400) | NO | Null | Whether to review |
No13 | C_shhf | text(16) | NO | Null | review reply |
Table: users information table
serial number | data field name | corresponding type | primary key | allow empty | Remarks for the field |
---|---|---|---|---|---|
No1 | C_id | bigint(8) | PK | No | primary key |
No2 | C_username | nvarchar(200) | NO | No | username |
No3 | C_password | nvarchar(200) | NO | No | password |
No. 4 | C_role | nvarchar(200) | NO | Null | Role |
No. 5 | C_addtime | timestamp(8) | NO | No | add time |
Form: shenqingyuyue information form
serial number | data field name | corresponding type | primary key | allow empty | Remarks for the field |
---|---|---|---|---|---|
No1 | C_id | bigint(8) | PK | No | primary key |
No2 | C_addtime | timestamp(8) | NO | No | creation time |
No3 | C_bianhao | nvarchar(400) | NO | Null | serial number |
No. 4 | C_jifanghao | nvarchar(400) | NO | Null | study room type |
No. 5 | C_riqi | datetime(8) | NO | Null | date |
No. 6 | C_shiduan | nvarchar(400) | NO | Null | period of time |
No7 | C_zuoweihao | nvarchar(400) | NO | Null | seat number |
No8 | C_shenqingneirong | nvarchar(400) | NO | Null | application content |
No9 | C_xuehao | nvarchar(400) | NO | Null | student ID |
No10 | C_xingming | nvarchar(400) | NO | Null | Name |
No11 | C_shenfenzheng | nvarchar(400) | NO | Null | ID card |
No12 | C_sfsh | nvarchar(400) | NO | Null | Whether to review |
No13 | C_shhf | text(16) | NO | Null | review reply |
Form: forum information form
serial number | data field name | corresponding type | primary key | allow empty | Remarks for the field |
---|---|---|---|---|---|
No1 | C_id | bigint(8) | PK | No | primary key |
No2 | C_addtime | timestamp(8) | NO | No | creation time |
No3 | C_title | nvarchar(400) | NO | Null | post title |
No. 4 | C_content | text(16) | NO | Null | post content |
No. 5 | C_parentid | bigint(8) | NO | Null | parent node id |
No. 6 | C_userid | bigint(8) | NO | No | user id |
No7 | C_username | nvarchar(400) | NO | Null | username |
No8 | C_isdone | nvarchar(400) | NO | Null | state |
Table: messages information table
serial number | data field name | corresponding type | primary key | allow empty | Remarks for the field |
---|---|---|---|---|---|
No1 | C_id | bigint(8) | PK | No | primary key |
No2 | C_addtime | timestamp(8) | NO | No | creation time |
No3 | C_userid | bigint(8) | NO | No | message id |
No. 4 | C_username | nvarchar(400) | NO | Null | username |
No. 5 | C_content | text(16) | NO | Null | Message content |
No. 6 | C_reply | text(16) | NO | Null | reply content |
Form: xuesheng information form
serial number | data field name | corresponding type | primary key | allow empty | Remarks for the field |
---|---|---|---|---|---|
No1 | C_id | bigint(8) | PK | No | primary key |
No2 | C_addtime | timestamp(8) | NO | No | creation time |
No3 | C_xuehao | nvarchar(400) | NO | No | student ID |
No. 4 | C_mima | nvarchar(400) | NO | No | password |
No. 5 | C_xingming | nvarchar(400) | NO | No | Name |
No. 6 | C_xingbie | nvarchar(400) | NO | Null | gender |
No7 | C_touxiang | nvarchar(400) | NO | Null | avatar |
No8 | C_zhuanye | nvarchar(400) | NO | Null | major |
No9 | C_shoujihao | nvarchar(400) | NO | Null | Phone number |
No10 | C_shenfenzheng | nvarchar(400) | NO | Null | ID card |
Chapter 5 System Implementation
5.1 Realization of Mini Program Functions
5.1.1 Student registration interface
Click Register in the navigation menu to open the registration page. The registration page is composed of a text box, a selection box, and a registration button. Enter the basic registration information to be filled in the text box, and click Register to submit the information.
As shown below:
Figure 5-1 Student registration interface
First, verify whether the filled information is empty. If it passes the verification, construct the information as an insert statement, call the database save operation, insert the information into the database, return the successfully saved information to the interface, log in, or return to the home page.
5.1.2 Home page interface
After setting up the WeChat Mini Program environment, enter the homepage of the system. The homepage includes the logo on the head, the navigation bar, and the article announcement information in the middle.
The homepage of the applet is shown in the figure below:
Figure 5-2 Home page
首页是在index页面中,该页面包括头部文件header、文章公告读取数据库中最新的信息,显示图片和对应的链接。在首页中先引入相关的JS和CSS样式。在对应模块中调用数据库操作方法,把读取的结果赋赋给RS数据集合对象,通过循环显示信息。
5.1.3 自习室列表界面
用户打开本系统后,可以查看自习室列表信息。如下图所示:
图5-4自习室界面
点击自习室,先打开自习室的列表界面,在列表界面读取信息,详细表达所有相关自习室信息,通过JAVA的数据库操作,把列表绑定到result数据集合中,使用while循环,把所有的信息显示到自习室界面。点击自习室,通过该条信息的ID值传递到自习室的详情页面,在详情页面根据当前的ID值查询对应的具体信息。包括标题名称和内容。
5.1.4 高校自习室预约界面
用户打开本系统后,可以查看高校自习室信息,并进行预约。如下图所示:
图5-5高校自习室预约界面
输入预约信息后,添加预约记录到数据库中,在个人中心可以查看预约记录,管理员对预约记录进行审核。
5.1.5 在线交流界面
用户登录本系统后,可以发表在线交流信息。如下图所示:
图5-6在线交流界面
在线交流包括评论信息的提交和查询显示,在线交流前需要先进行登录,如果没有登。录界面提示登录后才能进行评论,登陆后的信息是通过session进行判断。如果session存在登录信息,就说明已经登录,在评论中输入评论的内容,点击提交,把评论信息保存到数据库中,评论结束之后进行查询。查询通过当前信息的ID进行条件查询,查询的结果保存在数据集合中,对数据集合进行循环显示。
5.2管理员模块的实现
5.2.1 留言管理
在系统主界面中的导航菜单中,有留言按钮,点击按钮,就可以在留言界面进行信息添加和管理。
其中,留言管理界面为5.7所示:
图5.7:留言管理页面
5.2.2 学生信息管理
在系统主界面中的导航菜单中,有学生信息按钮,点击按钮,就可以在学生信息界面进行信息添加和管理。
其中,学生信息管理界面为5.8所示:
图5.8:学生信息管理页面
在学生页面加载学生的信息列表,当执行该页面初始化的时候,调用业务逻辑层的学生查询方法。该方法先定义学生实体类,然后调用数据库中的学生查询方法,把查询结果绑定在list集合中。循环集合,把数据逐条绑定在学生实体对象,最终返回到界面。将得到的学生集合循环绑定到界面控件,根据字段名和数据结果进行映射,最终显示。
5.2.3 公告管理
管理员查看公告信息。其中,公告信息管理界面为5.9所示:
图5.9:公告页面
在公告页面加载公告的信息列表,当执行该页面初始化的时候,调用业务逻辑层的公告查询方法。该方法先定义公告实体类,然后调用数据库中的公告查询方法,把查询结果绑定在list集合中。循环集合,把数据逐条绑定在公告实体对象,最终返回到界面。将得到的公告集合循环绑定到界面控件,根据字段名和数据结果进行映射,最终显示。
5.2.4 高校自习室信息管理
在系统主界面中的导航菜单中,有高校自习室管理按钮,点击按钮,就可以在高校自习室管理界面进行高校自习室信息添加和管理。其中高校自习室添加的界面如下:
图5.6:高校自习室添加页面
首先对高校自习室页面进行布局,完成界面设计。在高校自习室页,输入高校自习室的内容,点击保存,执行保存事件,在该事件中进行数据保存操作。该事件方法先获取用户输入的高校自习室内容,把这些数据绑定到高校自习室实体方法中,对高校自习室的信息进行验证,包括是否为空,是否符合规范数据格式等。通过验证后,调用高校自习室的业务逻辑方法,业务逻辑层先执行高校自习室的唯一性验证,通过验证后,调用数据库操作方法。将在线保修的数据使用插入语句,提交到数据库中。数据库操作方法返回操作成功的信息到业务逻辑层,业务逻辑层再把结果返回到在线保修页面,完成插入操作。
5.2.5 自习室预约审核管理
在系统主界面中的导航菜单中,有自习室预约管理按钮,点击按钮,就可以在自习室预约管理界面进行信息审核和管理。
其中,自习室预约管理界面为5.7所示:
图5.7:自习室预约管理页面
Load the study room reservation information list on the self-study room reservation page, and call the self-study room reservation query method of the business logic layer when the page is initialized. This method first defines the self-study room reservation entity class, then calls the self-study room reservation query method in the database, and binds the query results to the list collection. Loop the collection, bind the data one by one to the reservation entity object in the study room, and finally return to the interface. Bind the obtained self-study room reservation collection to the interface control in a loop, map it according to the field name and data result, and finally display it.
Click Review of Study Room Reservation Information. On the Study Room Reservation Information page, first query the corresponding study room reservation information through the ID value, and save the study room reservation information in the temporary object. Bind the variable value to the self-study room reservation information column on the page, then load the page, edit the information that needs to be reviewed and click Save, and the data will be verified. If the verification is passed, the verification operation will be performed. If the verification fails, a specific notification will be prompted wrong information. Execute the audit statement, call the business logic method of audit, and judge whether there is a reservation for the study room in the audit method. If there is no reservation for the study room, call the database operation layer to perform the audit operation, and return after the audit is successful.
Click to delete the reservation information of the study room, and check whether the reservation information of the study room has a foreign key association through the ID value. First delete the data associated with the foreign key, and then call the deleted database method. After the deletion is successful, return to the study room reservation information list interface.