Java campus notification system based on WeChat applet, with front-end and back-end codes, tutorials

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✌

1 Introduction

The system is mainly to realize the integration and processing of unified campus information such as the release of various notification messages on campus, check-in feedback, and homework release and review.

The main functional modules of the system include: event management, data extraction, and system management.

The users of the campus notification applet system based on the WeChat applet are the most fundamental users of the system. According to the needs, the system includes three types of users: students, teachers, and administrators. The requirements of these three types of users on the system are briefly as follows.

2 technology stack

illustrate technology stack Remark
Backstage Java
front end Applets
database MYSql
architecture B/S structure

Chapter Three System Analysis

3.1 Preliminary demand analysis

3.1.1 System Background Description

The system is mainly to realize the integration and processing of unified campus information such as the release of various notification messages on campus, check-in feedback, and homework release and review.

The main functional modules of the system include: event management, data extraction, and system management.

The users of the campus notification applet system based on the WeChat applet are the most fundamental users of the system. According to the needs, the system includes three types of users: students, teachers, and administrators. The requirements of these three types of users on the system are briefly as follows.

3.2 System use case analysis

3.2.1 Announcement Management Use Case Analysis

The administrator user logs in to the system, manages the announcement, selects the relevant announcement name, and uploads the announcement information, and the administrator user views the announcement. The use case analysis diagram is shown in Figure 3.1:

img

Figure 3.1 Analysis Diagram of Announcement Information Management Use Case

The announcement information management use case specification is shown in Table 3.1.

Table 3.1 Announcement Management Use Case Specification

project Announcement management of campus notification applet system based on WeChat applet
A brief description Collect announcement information, revise and delete announcement information, and manage other related basic content.
Preconditions Successfully run the campus notification applet system based on the WeChat applet, and obtain login authorization.
postcondition Store the information in the database and successfully generate a list of announcement information.
process flow 1. There are three ways to collect announcement information. First, import announcement information into the document. Second, import announcement information from other related systems into this database through the interface. Finally, enter through the interface and save the announcement information to the database. 2. For the deletion of announcement information, if there is an error in the entry or historical announcements, it is necessary to perform regular deletion operations and verify whether the deletion is successful. 3. The modification of the announcement information is to modify the announcement information in case of input errors or changes in the basic information of the announcement. Verify that the database records are synchronized after modification. 4. Query the announcement information, on the list page, retrieve all the announcement information in the database and load them into the list. Query bulletin information by specific conditions. 5. If an exception occurs, prompt the cause of the exception, or return to the main page to contact the piping system administrator for processing.

3.2.2 System Management Use Case Analysis

System management refers to functions such as system user login, system logout, and password modification. The use case analysis diagram of system management is shown in Figure 3.2:

img

Figure 3.3 System Management Use Case Analysis Diagram

Among them, the administrator login use case specification is as follows.

​ Table 3.2 Administrator login use case specification

project Campus notification applet system user login based on WeChat applet
A brief description Verify user permissions.
Preconditions Successfully run the campus notification applet system based on the WeChat applet.
postcondition If the login is successful, a list of user operation permissions is generated.
process flow 1. Verify whether the user name information is empty, whether it complies with the specification, and whether the length is legal. 2. Verify whether the password information is standardized, and filter keywords such as select and delete to prevent SQL injection. 3. Query whether the information entered by the user exists in the database, query the user's permission information, and generate a permission list. 4. If an exception occurs, prompt the cause of the exception, or return to the main page to contact the piping system administrator for processing.

3.2.3 Student Information Use Case Analysis

User information includes administrator information, student and teacher information. The use case analysis diagram of student information management is shown in Figure 3.3:

img

Figure 3.4 Student information management use case analysis diagram

The use case specification for student information management is shown in Table 3.3.

project Student management of campus notification applet system based on WeChat applet
A brief description Collect student information, revise and delete student information, and manage other related basic content.
Preconditions Successfully run the campus notification applet system based on the WeChat applet, and obtain login authorization.
postcondition Store information to the database and successfully generate a list of student information.
process flow 1. Enter through the interface and save the student's information to the database. 2. For the deletion of student information, if there is a mistake in the entry or a historical student, it is necessary to perform the deletion operation regularly and verify whether the deletion is successful. 3. The modification of student information is to modify the student information in case of input errors or changes in the basic information of students. Verify that the database records are synchronized after modification. 4. Inquiry of student information, on the list page, retrieve all student information in the database and load them into the list. Query student information through specific conditions. 5. If an exception occurs, prompt the cause of the exception, or return to the main page to contact the piping system administrator for processing.

3.2.4 Use case analysis of event management

The teacher user logs in to the system and enters the items, including the item name, notification time, student number, name, content and other information. After the user logs in, the information can be modified.

After the mini program students log in, they can check the items, check in the items involved, and notify the recycling management.

The use case analysis diagram of item management is shown in Figure 3.6:

img

Figure 3.6 Use Case Analysis Diagram of Item Information Management

The item management use case specification is shown in 3.4:

Table 3.4 Item Management Use Case Specification

project Campus notification applet system event management based on WeChat applet
A brief description Collect item information, revise and delete item information, and manage other related basic content.
Preconditions Successfully run the campus notification applet system based on the WeChat applet, and obtain login authorization.
postcondition Store information to the database and successfully generate a list of item information.
process flow 1. Enter through the interface and save the item information to the database. 2. For the deletion of item information, if there is a mistake in the entry or historical items, it is necessary to perform regular deletion operations and verify whether the deletion is successful. 3. The modification of item information is to modify the item information in case of input errors, or when the basic information of the item changes. Verify that the database records are synchronized after modification. 4. Query item information, on the list page, retrieve all item information in the database and load them into the list. Query item information by specific conditions. 5. If an exception occurs, prompt the cause of the exception, or return to the main page to contact the piping system administrator for processing.

Chapter 4 System Design

4.1 System function design

The users of the campus notification applet system are the most fundamental users of the system. According to the needs, the analysis system includes users: students, teachers, and administrators.

管理员通过后台的登录页面,选择管理员权限后进行登录,管理员的权限包括学生信息管理、老师信息管理和文章公告管理。通知公告管理,添加通知公告信息,给学生发布一些学校的公告内容,为学习提前做准备,管理员管理后点击退出,注销登录信息。

学生用户只要实现了前台信息的查看,打开首页,查看网站介绍、事项信息、信息公告等,学生用户通过账户账号登录,登录后查看事项、事项打卡,事项回收操作。

用户功能结构图如4.1所示:

img

图4.1:用户功能结构图

该系统主要是实现校园内各种通知消息的发布打卡反馈以及作业发布批阅等统一校园内消息的整合处理。

系统主要功能模块包括:事项管理、数据抽取、系统管理

事项管理:主要包括事项创建、对事项优先级排列、事项打卡(定位/文件附件上传)、事项的二次推送。

数据抽取:主要包括数据抽取请求审核、数据合并、数据分析事项完成度(比例图展现)。

系统管理:主要对用户、角色、权限和系统公示的管理功能。

4.2 系统总体设计

4.2.1 系统流程图

基于微信小程序的校园通知小程序系统包括学生、老师和管理员。登录后维护个人信息,在线查看通知信息。管理员管理用户信息、管理通知信息。其中系统流程图如图4.2所示。

img

图4.2 系统流程图

4.2.2 数据流图

基于微信小程序的校园通知小程序系统数据流程图描述系统数据流程,它将数据独立抽象出来,展现信息的来龙去脉。其中基于微信小程序的校园通知小程序系统的数据流程图如4.3所示:

img

图4.3系统数据流图

4.4 数据库设计

4.4.1 ER图设计

本基于微信小程序的校园通知小程序系统实体清晰,所以这里只绘制系统整体E-R图,其它的略去E—R图的绘制。

(1)管理员信息实体E-R图:

img

图4.3管理员E-R图

(2)公告信息实体E-R图

img

图4.4公告信息实体E-R图

(3)教师信息实体E-R图

img

图4.5教师信息E-R图

(4)学生信息实体E-R图

img

图4.6 学生信息实体E-R图

(5) 事项信息E-R图

img

图4.7 事项信息实体E-R图

(6)事项打卡信息E-R图

img

图4.8 事项打卡信息实体E-R图

4.4.2 数据库表设计

基于微信小程序的校园通知小程序系统包括多个数据库表,下面对数据表进行详细的介绍,每个数据库表包括这个名称,对于类型是否逐渐、是否与空字段的备注信息等。

表: config信息表

编号 数据字段名称 对应类型 主键 允许空 字段的备注信息
No1 C_id bigint(8) PK No 主键
No2 C_name nvarchar(200) NO No 配置参数名称
No3 C_value nvarchar(200) NO Null 配置参数值

表: shixiangxinxi信息表

编号 数据字段名称 对应类型 主键 允许空 字段的备注信息
No1 C_id bigint(8) PK No 主键
No2 C_addtime timestamp(8) NO No 创建时间
No3 C_shixiangmingcheng nvarchar(400) NO Null 事项名称
No4 C_suoshubanji nvarchar(400) NO Null 所属班级
No5 C_youxianji nvarchar(400) NO Null 优先级
No6 C_shixiangneirong text(16) NO Null 事项内容
No7 C_shixiangtupian nvarchar(400) NO Null 事项图片
No8 C_fabushijian datetime(8) NO Null 发布时间
No9 C_jiezhishijian datetime(8) NO Null 截止时间
No10 C_jiaoshibianhao nvarchar(400) NO Null 教师编号
No11 C_jiaoshixingming nvarchar(400) NO Null 教师姓名
No12 C_userid bigint(8) NO Null 用户id

表: news信息表

编号 数据字段名称 对应类型 主键 允许空 字段的备注信息
No1 C_id bigint(8) PK No 主键
No2 C_addtime timestamp(8) NO No 创建时间
No3 C_title nvarchar(400) NO No 标题
No4 C_introduction text(16) NO Null 简介
No5 C_picture nvarchar(400) NO No 图片
No6 C_content text(16) NO Null 内容

表: users信息表

编号 数据字段名称 对应类型 主键 允许空 字段的备注信息
No1 C_id bigint(8) PK No 主键
No2 C_username nvarchar(200) NO No 用户名
No3 C_password nvarchar(200) NO No 密码
No4 C_role nvarchar(200) NO Null 角色
No5 C_addtime timestamp(8) NO No 新增时间

表: tongzhihuishou信息表

编号 数据字段名称 对应类型 主键 允许空 字段的备注信息
No1 C_id bigint(8) PK No 主键
No2 C_addtime timestamp(8) NO No 创建时间
No3 C_shixiangmingcheng nvarchar(400) NO Null 事项名称
No4 C_tongzhineirong text(16) NO Null 通知内容
No5 C_tongzhishijian datetime(8) NO Null 通知时间
No6 C_tongzhitupian nvarchar(400) NO Null 通知图片
No7 C_jiaoshibianhao nvarchar(400) NO Null 教师编号
No8 C_xuehao nvarchar(400) NO Null 学号
No9 C_xingming nvarchar(400) NO Null 姓名
No10 C_sfsh nvarchar(400) NO Null 是否审核
No11 C_shhf text(16) NO Null 审核回复
No12 C_userid bigint(8) NO Null 用户id

表: storeup信息表

编号 数据字段名称 对应类型 主键 允许空 字段的备注信息
No1 C_id bigint(8) PK No 主键
No2 C_addtime timestamp(8) NO No 创建时间
No3 C_userid bigint(8) NO No 用户id
No4 C_refid bigint(8) NO Null 收藏id
No5 C_tablename nvarchar(400) NO Null 表名
No6 C_name nvarchar(400) NO No 收藏名称
No7 C_picture nvarchar(400) NO No 收藏图片
No8 C_type nvarchar(400) NO Null 类型(1:收藏,21:赞,22:踩)
No9 C_inteltype nvarchar(400) NO Null 推荐类型

表: shixiangdaka信息表

编号 数据字段名称 对应类型 主键 允许空 字段的备注信息
No1 C_id bigint(8) PK No 主键
No2 C_addtime timestamp(8) NO No 创建时间
No3 C_shixiangmingcheng nvarchar(400) NO Null 事项名称
No4 C_suoshubanji nvarchar(400) NO Null 所属班级
No5 C_dakashijian datetime(8) NO Null 打卡时间
No6 C_wanchengjindu nvarchar(400) NO Null 完成进度
No7 C_wanchengneirong text(16) NO Null 完成内容
No8 C_wanchengtupian nvarchar(400) NO Null 完成图片
No9 C_jiaoshibianhao nvarchar(400) NO Null 教师编号
No10 C_xuehao nvarchar(400) NO Null 学号
No11 C_xingming nvarchar(400) NO Null 姓名
No12 C_sfsh nvarchar(400) NO Null 是否审核
No13 C_shhf text(16) NO Null 审核回复
No14 C_userid bigint(8) NO Null 用户id
No15 C_longitude money(8) NO Null 经度
No16 C_latitude money(8) NO Null 纬度
No17 C_fulladdress nvarchar(400) NO Null 地址

表: jiaoshi信息表

编号 数据字段名称 对应类型 主键 允许空 字段的备注信息
No1 C_id bigint(8) PK No 主键
No2 C_addtime timestamp(8) NO No 创建时间
No3 C_jiaoshibianhao nvarchar(400) NO No 教师编号
No4 C_mima nvarchar(400) NO No 密码
No5 C_jiaoshixingming nvarchar(400) NO No 教师姓名
No6 C_xingbie nvarchar(400) NO Null 性别
No7 C_shouji nvarchar(400) NO Null 手机
No8 C_touxiang nvarchar(400) NO Null 头像

表: xuesheng信息表

编号 数据字段名称 对应类型 主键 允许空 字段的备注信息
No1 C_id bigint(8) PK No 主键
No2 C_addtime timestamp(8) NO No 创建时间
No3 C_xuehao nvarchar(400) NO No 学号
No4 C_mima nvarchar(400) NO No 密码
No5 C_xingming nvarchar(400) NO No 姓名
No6 C_xingbie nvarchar(400) NO Null 性别
No7 C_zhuanye nvarchar(400) NO Null 专业
No8 C_banji nvarchar(400) NO Null 班级
No9 C_touxiang nvarchar(400) NO Null 头像

第五章 系统实现

5.1小程序功能的实现

5.1.1 学生注册界面

点击导航菜单中的注册即可打开注册页面,注册页面是由文本框、选择框、和注册按钮组成,在文本框中输入需要填写的基本注册信息,点击注册进行信息提交。

如下图所示:

img

图5-1学生注册界面

首先验证填写的信息是否为空,如果通过验证,才把信息构造为插入语句,调用数据库保存操作,插入信息到数据库,返回保存成功的信息到界面,进行登陆,或者返回到首页。

5.1.2 首页界面

搭建微信小程序环境后,进入到系统首页,首页包括头部的logo,导航条,中间为文章公告信息。

小程序首页如下图所示:

img

图5-2 首页

首页是在index页面中,该页面包括头部文件header、文章公告读取数据库中最新的信息,显示图片和对应的链接。在首页中先引入相关的JS和CSS样式。在对应模块中调用数据库操作方法,把读取的结果赋赋给RS数据集合对象,通过循环显示信息。

5.1.3 公告列表界面

用户打开本系统后,可以查看公告列表信息。如下图所示:

img

图5-4公告界面

点击公告,先打开公告的列表界面,在列表界面读取信息,详细表达所有相关公告信息,通过JAVA的数据库操作,把列表绑定到result数据集合中,使用while循环,把所有的信息显示到公告界面。点击公告,通过该条信息的ID值传递到公告的详情页面,在详情页面根据当前的ID值查询对应的具体信息。包括标题名称和内容。

5.1.4 事项界面

用户打开本系统后,可以查看事项信息,通过关键字查询对应的事项信息,并进行打卡。如下图所示:

img

图5-5事项信息界面

点击事项,先打开事项的列表界面,在列表界面读取信息,详细表达所有相关事项信息,通过JAVA的数据库操作,把列表绑定到result数据集合中,使用while循环,把所有的信息显示到事项界面。点击事项,通过该条信息的ID值传递到事项的详情页面,在详情页面根据当前的ID值查询对应的具体信息。包括标题名称和内容。

5.1.5 事项打卡界面

用户登录本系统后,可以进行事项打卡操作。如下图所示:

img

图5-6事项打卡界面

事项打卡包括事项打卡信息的提交和查询显示,事项打卡前需要先进行登录,如果没有登。录界面提示登录后才能进行上传事项打卡,登陆后的信息是通过session进行判断。如果session存在登录信息,就说明已经登录,在事项打卡中输入事项打卡的内容,点击提交,把事项打卡信息保存到数据库中,事项打卡结束之后进行查询。查询通过当前信息的ID进行条件查询,查询的结果保存在数据集合中,对数据集合进行循环显示。

5.2后台模块的实现

5.2.1 老师管理

在系统主界面中的导航菜单中,有老师按钮,点击按钮,就可以在老师界面进行信息添加和管理。

其中,老师管理界面为5.7所示:

img

图5.7:老师管理页面

5.2.2 学生信息管理

在系统主界面中的导航菜单中,有学生信息按钮,点击按钮,就可以在学生信息界面进行信息添加和管理。

其中,学生信息管理界面为5.8所示:

img

图5.8:学生信息管理页面

Load the student information list on the student page, and call the student query method of the business logic layer when the page is initialized. This method first defines the student entity class, then calls the student query method in the database, and binds the query results to the list collection. Loop the collection, bind the data to the student entity object one by one, and finally return to the interface. Bind the obtained student collection to the interface control in a loop, map according to the field name and data result, and finally display.

5.2.3 Announcement Management

The administrator checks the bulletin information. Among them, the announcement information management interface is shown in 5.9:

img

Figure 5.9: Announcement page

Load the announcement information list on the announcement page, and call the announcement query method of the business logic layer when the page is initialized. This method first defines the announcement entity class, then calls the announcement query method in the database, and binds the query results to the list collection. Loop the collection, bind the data to the announcement entity object one by one, and finally return to the interface. Bind the obtained announcement collection to the interface control in a loop, map it according to the field name and data result, and finally display it.

5.2.4 Event information management

In the navigation menu of the main interface of the system, there is an item management button. Click the button to add and manage item information on the item management interface. The interface for adding items is as follows:

img

Figure 5.6: Item Add Page

First, layout the item page and complete the interface design. On the item page, enter the content of the item, click Save, execute the save event, and perform the data save operation in this event. The event method first obtains the content of the item entered by the user, binds the data to the item entity method, and verifies the information of the item, including whether it is empty, whether it conforms to the standard data format, etc. After passing the verification, call the business logic method of the item, and the business logic layer first performs the uniqueness verification of the item, and after passing the verification, call the database operation method. Use the insert statement to submit the online warranty data to the database. The database operation method returns the successful operation information to the business logic layer, and the business logic layer returns the result to the online warranty page to complete the insertion operation.

5.2.5 Item check-in review management

In the navigation menu of the main interface of the system, there is an item check-in management button. Click the button to conduct information review and management on the item check-in management interface.

Among them, the item check-in management interface is shown in 5.7:

img

Guess you like

Origin blog.csdn.net/JasonXu94/article/details/132472694