(with source code) Design and implementation of springboot college students' health reporting system

Table of contents

Summary

1 Introduction

1.1 Research background and significance

1.2 Development status and development trend

1.3 Features of system development technology

1.4 Paper structure and chapter arrangement

2 Systematic Analysis of College Students' Health Reporting System 

2.1 Feasibility analysis

2.2 System flow analysis

2.2.1 Data addition process

2.3.2 Data modification process

2.3.3 Data deletion process

2.3 System function analysis

2.3.1 Functional Analysis

2.3.2 Non-functional analysis

2.4 System use case analysis

2.5 Summary of this chapter

3 The overall design of the health reporting system for college students

3.1 System architecture design

3.2 System function module design

3.2.1 Overall functional module design

3.2.2 User module design

3.2.3 Comment management module design

3.3 Database design

3.3.1 Database conceptual structure design

3.3.2 Database logical structure design

3.4 Summary of this chapter

4 Detailed design and implementation of college students' health reporting system 

4.1 User Function Module

4.1.1 Front page interface

4.1.2 Student login interface

4.1.3 Student registration interface 21

4.1.4 Health News Interface

4.1.5 Notification announcement interface

4.1.6 Drug Information Details Interface

4. 2 Administrator function module

4.2.1 Student management interface

4.2.2 Drug information management interface 2 8

4.2.3 Notification announcement management interface 29

4.2.4 More management interface 30

5 System Test 32

5.1 Purpose of the test 32

5.2 Functional testing 32

5.3 Performance testing 33

Conclusion 34

References 35

thank you  

Summary

In the information society, there is a need for targeted information acquisition channels, but the expansion of channels is basically the direction that people are striving for. Due to the deviation in their perspective, people can often obtain different types of information, which is also the most difficult technology to overcome. topic. Aiming at the problems of the college students' health reporting system and other problems, the research and analysis of the college students' health reporting system is carried out, and then the college students' health reporting system is developed and designed to solve the problems.

The main functional modules of the college student health report system include user management, student management, medical staff management, health report, return to school report, killing situation, drug information, drug application, notification announcement, and comment list, adopting an object-oriented development model The development of software and the erection of hardware can well meet the needs of actual use, and the work of corresponding software erection and program coding has been improved. MySQL is used as the main storage unit of background data, and springboot framework, Java technology, and Ajax are adopted. Coding and development of the business system with advanced technology, realizing all the functions of the system. This report first analyzes the background, function and significance of the research, laying the foundation for the rationality of the research work. Analyze the various needs and technical problems of the college students' health report system, prove the necessity and technical feasibility of the system, and then make a basic introduction to the technical software and design ideas that need to be used in the design system, and finally realize the college students' health Submission systems and deployment runs use it.

Key words : springboot technology; MYSQL; college student health reporting system

Abstract

In the information society, there is a need for targeted information access, but the expansion of access is basically the direction of people's efforts. Due to the deviation of the perspective, people can often obtain different types of information, which is also the most difficult subject for technology to overcome. Aiming at the problems of College Students' health reporting system, this paper studies and analyzes the college students' health reporting system, and then develops and designs the college students' health reporting system to solve the problems.

The main functional modules of the college student health submission system include user management, student management, medical staff management, health submission, back to school reporting, killing situation, drug information, drug application, notice announcement and comment list. The object-oriented development mode is adopted for software development and hardware erection, which can well meet the needs of actual use and improve the corresponding software erection and program coding, MySQL is used as the main storage unit of background data, and springboot framework, Java technology and Ajax technology are used to code and develop the business system, which realizes all the functions of the system. This report first analyzes the background, function and significance of the research, which lays a foundation for the rationality of the research work. This paper analyzes the various needs and technical problems of the college students' health submission system, proves the necessity and technical feasibility of the system, and then makes a basic introduction to the technical software and design ideas needed to design the system. Finally, it realizes the college students' health submission system and deploys it.

Keywords: Springboot technology; MYSQL;College Students' health reporting system

1 Introduction

1.1 Research background and significance

With the development of society and the popularization of health knowledge, people have higher and higher requirements for the quality of life, and pay more and more attention to the health of the crowd and the crowd. system is very necessary. At present, the "Survey of Chinese Students' Physical Health" (hereinafter referred to as "China Sports Association"), which is commonly used in colleges and universities in our country, can reflect the school's physical education status, but it cannot accurately provide relevant information to teachers and students. "Physical Fitness Test Standards" (hereinafter referred to as "Physical Test Standards") makes up for this deficiency. The system measures the body shape, function and quality of college students, and publishes them on the Internet with a certain percentage of scores. According to the test results, scientific and reasonable physical exercise programs can be formulated for college students of different levels, ages and genders, so as to achieve the purpose of improving physical and mental health. However, due to various reasons, this function has not been effectively implemented. This topic is aimed at this situation, and designs and implements a college students' health report system based on the network environment. This article starts from the demand analysis, and discusses the key issues that the system needs to solve: data acquisition technology, data transmission technology, and database access technology. Part of the program code and the main interface are shown, so that it has better feasibility. In addition, it also discusses how to apply this software system to actual work, including specific implementation plans, such as data entry methods, data processing algorithms, and user management. Finally, the experiment proves that the program is feasible and effective, and can be used for further research. Promote apps.

1.2 Development status and development trend

With the progress of society, the development of science and technology and the improvement of people's living standards, people pay more and more attention to their own health. Colleges and universities are one of the important places to disseminate scientific and cultural knowledge and cultivate qualified professionals. They shoulder the important task of delivering high-quality talents for socialist modernization. However, due to various reasons, some unhealthy phenomena generally exist in colleges and universities in our country: on the one hand, students lack physical exercise in the process of learning; Both of these situations are not conducive to the improvement of the quality of talents cultivated by colleges and universities. Therefore, it is particularly important to strengthen the work of physical education in schools. In order to meet the requirements of teaching reform in colleges and universities in the new era, we must establish a complete health reporting system for college students as soon as possible. This article takes "College Students' Health Reporting System Development Status and Trends of College Students' Health Reporting System Development Status and Trends Liu Jinming (Jinan 266009, School of Information Management System, Shandong Agricultural University)" as the research content. The main purpose is to hope that through this system, teachers and students can timely Understand your physical health status and perform self-care, so as to enhance your physical fitness. This paper firstly introduces the research progress of domestic and foreign college students' physical fitness monitoring methods and indicators. Then, according to the goal of "strengthening youth's physique and promoting their physical and mental health" proposed in the "National Medium and Long-term Education Reform and Development Plan", combined with the actual situation of health education in domestic colleges and universities, a set of B/S-based models is designed. University student health management system under the campus network environment. Finally, each functional module of the system is described in detail.

1.3 Features of system development technology

(1) The backend of the web background management in the college student health reporting system no longer uses the ancient jsp+javabean+servlet technology, but uses the current mainstream springboot framework, which reduces java configuration codes and simplifies programming codes. Currently, springboot The framework is also one of the frameworks chosen by many companies.

(2) The front end of the web background management in the college student health reporting system uses a JavaScript framework, which can beautify the page design with ajax[8] and jquery[9].

(3) Mysql5.7 is used for the database in the college student health report system, which has high execution efficiency.

1.4 Paper Structure and Chapter Arrangement

The thesis will be arranged in layers, except for the abstract acknowledgments and references, the main text will also analyze the requirements of the website, explain the general design and implemented functions, and finally list some commissioning records. The main structure of the thesis is as follows:

Chapter 1: Introduction. The first chapter mainly introduces the background of the subject research, the status quo of system development and the development status, development trend and main work of this paper.

Chapter Two: System Requirements Analysis. The second chapter mainly conducts demand analysis from the aspects of system users and functions.

Chapter Three: System Design. The third chapter mainly carries on the function design to the system frame, the system function module, the database.

Chapter Four: System Realization. The fourth chapter mainly introduces the construction of the system framework and the realization of the system interface.

Chapter Five: System Testing. Chapter 5 mainly tests some interfaces of the system and tests the main functions

Chapter Six: Summary.

2 Analysis of College Students’ Health Reporting System

System analysis is a prerequisite for developing a project. Through system analysis, the basic needs of the main users of the system can be well understood, and this is also the reason for the development of the project. Further, feasibility analysis is carried out on system development, usually including technical feasibility, economic feasibility, etc. Feasibility analysis is also an analysis from the overall perspective of the project. Then it is to analyze the specific needs of the project, and the means of analysis are generally realized through the user's use case diagram. The following is a detailed introduction.

2.1 Feasibility analysis

(1) Economic feasibility:

Most of the tools used in the project are currently popular open source and free, so in the early stage of development, the funds used for the project will be greatly reduced, and the development of the software will not be affected by the funds during the project start-up period, so It is still economically feasible. Try to use the least cost to meet the needs of users. Save funds for labor costs and equipment costs. It will go further and further on the road of paperless and high efficiency.

So there is no question of economic viability.

(2) Operation feasibility:

The design of this project refers to several development cases of websites under this mode, analyzes their operation interface, combines many cases together, and highlights the people-oriented and simplified operation, so people with basic computer knowledge can operate this project.

Therefore, there is no problem with operability.

(3) Technical feasibility:

Technical feasibility refers to the feasibility of building a framework, and the acceptability of system technology upgrades when better technologies emerge, and the ratio of development time to cost.

The existing springboot technology can cater to the construction of all e-commerce systems. When developing this college student health reporting system, I used springboot+MYSQL to run the overall program.

In summary, there is no problem with the technical feasibility.

(4) Legal feasibility:

From the perspective of developers, springboot and MYSQL are open source and free online, and there will be no legal disputes in terms of intellectual property rights.

From the perspective of user use, as long as no contraband is sold on the system, a treaty agreement is made on the system, and illegal payments are eliminated.

In summary, there is no question of legal feasibility.

2.2 System flow analysis

The business process is to use some specific symbols and lines to demonstrate the user's process of using the system. When performing system analysis, the business process can help developers better understand the business, find errors, and improve the system.

2.2.1 Data addition process

After the user successfully logs in to the system , the operation of adding data can be realized. The number of adding data is specific and generated by the system, and the user cannot fill it in at will. Except for the number, the user can fill in other additional information by himself, and the filled information is verified by the system and verified to be legal. Passing shows that the data addition is successful. On the contrary, the addition is not successful. Figure 2-1 shows the process of adding data.

 

Figure 2-1 Flowchart of adding data

2.2.2 Data modification process

The process of data modification is similar to the process of data addition described above, as shown in Figure 2-2 .

 

Figure 2-2 Data modification flow chart

2.2.3 Data deletion process

If there are some useless data in the system , the relevant management personnel can also delete these data. Figure 2-3 is the flow chart of data deletion.

 

Figure 2-3 Data deletion flow chart

2.3 System function analysis

2.3.1 Functional Analysis

According to the role of the college students' health reporting system, I divided it into three parts: the student management module, the medical staff management module and the administrator management module.

Medic /Student User Module :

(1) Registration and login module: When medical staff /students want to enter the college student health reporting system to comment on information, communicate and operate drug information , they must log in to the system. If the new user does not have a college student For the account number of the health reporting system , click the "Register" button, and you will enter the new user registration interface. The user enters the corresponding account number (must be filled in) + password (must be filled in) + confirmation password (must be filled in, and must be with password) + nickname + email + mobile phone number + select user identity, etc., and then click "Register", the system will check whether the account exists in the user database, and whether the two passwords are the same. Register successfully, and then log in. If the user who has registered before has not used it for a long time and forgot the password, you can also click "Forgot Password" to retrieve it;

( 2 ) Bulletin Board: On the navigation bar of the home page, we will see the menu of " Bulletin Board ". After we click to enter, we will see the bulletin information released by all administrators in the background;

( 3 ) Health report : On the navigation bar of the home page, we will see the menu of " Health Report " . Like the health report , if you want to find this information faster next time, you can also bookmark and comment;

( 4 ) Drug information: On the navigation bar of the homepage, we will see the menu of " Drug Information". After we click to enter, we will see all the drug information released by the administrator in the background . We choose to know the name of the drug , View drug information, you can like + bookmark + comment ;

( 5 ) My Favorites: Under "My", you can view and manage the "My Favorites" information, you can view the favorites, and you can also delete the favorite information;

( 6 ) Students: This function is the function of the medical staff background, which can view the student information;

( 7 ) Disinfection status : Students can submit disinfection status information on the " Disinfection Status " interface in the background , and medical staff can check it on the " Disinfection Status " interface;

( 8 ) Drug application: Students can submit drug application information in the " Drug Application" interface in the background , and medical staff can view and review it in the " Drug Application" interface;

Administrator management module:

(1) Login: The account of the administrator is directly set and generated in the data table, and no registration is required;

( 2 ) User management: When you click on the "User Management" menu, three sub-menus will appear: administrator + student + medical staff , and you can add, delete, modify and query these three modules;

( 3 ) More management: When you click the "More" menu, there will be students + medical staff + health report + return to school report + killing situation + drug information + drug application + notice announcement + comment list . Nine sub-menus, which can add, delete, modify and check drug information, control the killing situation submitted by students and medical staff , and realize the review and management of drug applications submitted by medical staff and students +  report back to school ;

2.3.2 Non-functional analysis

The non-functional requirements of the college student health reporting system, such as the security, reliability, performance, and scalability of the college student health reporting system, etc. Specifically, it can be expressed in the following table 3-1:

Table 3- 1 Non-functional Requirements Table of College Students’ Health Reporting System

safety

It mainly refers to the installation of the database of the college student health reporting system, the use of the database and the setting of the password must comply with the regulations.

reliability

Reliability means that the college students' health report system can be operated according to the user's instructions. After testing, the reliability is more than 90%.

performance

Performance is a necessary condition for college students' health reporting system to occupy the market, so it is better to have good performance.

scalability

For example, the database reserves multiple attributes, such as the use of interfaces, to ensure the non-functional requirements of the system.

ease of use

Users only need to follow the page display content of the college student health reporting system to operate.

maintainability

The maintainability of the development of the college student health reporting system is very important. After testing, there is no problem with the maintainability

2.4 System use case analysis

Through the analysis of 2.3 functions, the use case diagram of the college student health reporting system is obtained:

Figure 2-3 shows an example of a student user role.

 

Figure 2-3 Use case diagram of student user roles in the college student health reporting system

The administrator on the web background management maintains all data information in the entire college student health reporting system. Figure 2-4 shows an example of an administrator role.

 

Figure 2-4 Use case diagram of medical staff user roles in the college student health reporting system

The administrator on the web background management maintains all data information in the entire college student health reporting system. Figure 2-5 shows an example of an administrator role.

 

figure 2-5 Use Case Diagram of Administrator Role in College Students’ Health Reporting System

2.5 Summary of this chapter

This chapter mainly determines the functions to be realized by the entire college student health reporting system through the feasibility analysis, process analysis, functional requirement analysis, and system use case analysis of the college student health reporting system. At the same time, it also provides a standard for the code implementation and testing of the college students' health reporting system.

3 Overall Design of College Students’ Health Reporting System

This chapter mainly discusses the functional module design and database system design of college students' health reporting system.

3.1 System architecture design

The college student health reporting system is divided into three layers in terms of architecture: presentation layer (UI), business logic layer (BLL) and data layer (DL).

                                

 

Figure 3-1 System Architecture Design Diagram of College Students’ Health Reporting System

Presentation layer (UI): also known as the UI layer, it mainly completes the UI interaction function of the college student health report system. A good UI can improve the user experience of users and enhance the user's comfort when using the college student health report system . The interface design of the UI should also adapt to different versions of the college student health reporting system and different size resolutions to achieve good compatibility. The requirements for UI interaction functions are reasonable, and users must obtain consistent interaction results when performing interactive operations, which requires a good connection between the presentation layer and the business logic layer.

Business Logic Layer (BLL): It mainly completes the data processing function of the college students' health reporting system. The data transmitted by the user from the presentation layer is processed and delivered to the data layer through the business logic layer, and the data read by the system from the data layer is processed and delivered to the presentation layer through the business logic layer.

Data layer (DL): Since the data of the college student health reporting system is placed in the mysql database on the server side, the part that belongs to the service layer can be directly integrated into the business logic layer, so there is only a database in the data layer, which mainly completes The data storage and management function of the college student health reporting system.

3.2 System function module design

3.2.1 Overall functional module design

In the last chapter, the functional requirements and non-functional requirements of the system are mainly analyzed, and the use cases in the college student health reporting system are analyzed according to the requirements. Then the next step is to start the design of the architecture, main functions and database of the college students' health reporting system. The college student health report system is obtained based on the requirements analysis in the previous chapters, and its overall design module diagram is shown in Figure 3-2.

Figure 3-2 Functional module diagram of college students’ health reporting system

 

3.2.2 User module design

The background manager can add, delete, modify and check the users registered in the front desk. The structure diagram of the user module is as follows:

 

Figure 3-3 User module structure diagram

3.2.3 Comment management module design

The college student health reporting system is an open platform for communication. Users and administrators can comment on the information on the platform to increase the interaction between users. But at the same time, in order to better regulate the content of comments and give administrators the function of deleting inappropriate comments, a comment management module needs to be specially designed. The specific structure diagram is as follows:

 

Figure 3-4 Comment module structure diagram

3.3 Database design

Database design generally includes three major processes: requirements analysis, conceptual model design, and database table establishment. Requirements analysis has been explained in the previous chapters, and conceptual model design has two parts: conceptual model and logical structure design.

3.3.1 Conceptual structure design of database

The following is the ER entity relationship diagram of the main database tables in the entire college student health reporting system.

Figure 3-6 Overall ER relationship diagram of college students’ health reporting system

 

According to the general ER relationship diagram of the database of the college student health reporting system, it can be concluded that the college student health reporting system requires many ER diagrams. Here are some main database ER model diagrams.

 

Figure 3-7 ER relationship diagram for medical staff

 

Figure 3-8 ER relationship diagram of disinfecting situation

 

Figure 3-9 Drug information ER relationship diagram

 

Figure 3-10 Health reporting ER relationship diagram

3.3.2 Database logical structure design

According to the ER relationship diagram of the Central University Student Health Reporting System in the previous section, it can be concluded that a lot of data tables need to be created. Here I mainly list several major database table structure designs.

report_back_to_school table:

name

type

length

not null

primary key

note

report_back_to_school_id

int

11

yes

yes

Return to school reporting ID

full_name

int

11

no

no

Name

health_code

varchar

255

no

no

health code

travel_code

varchar

255

no

no

trip code

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

medical_staff table:

name

type

length

not null

primary key

note

medical_staff_id

int

11

yes

yes

Medic ID

full_name

varchar

64

no

no

Name

id

varchar

255

no

no

ID card

gender

varchar

64

no

no

gender

examine_state

varchar

16

yes

no

Approval Status

recommend

int

11

yes

no

Intelligent Recommendation

user_id

int

11

yes

no

User ID

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

killing_situation table:

name

type

length

not null

primary key

note

killing_situation_id

int

11

yes

yes

disinfecting Situation ID

killing_position

varchar

64

no

no

disinfecting position

killing_situation

varchar

64

no

no

disinfecting situation

person_in_charge

int

11

no

no

principal

kill_details

text

0

no

no

disinfect details

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

health_submission table:

name

type

length

not null

primary key

note

health_submission_id

int

11

yes

yes

Health filing ID

full_name

int

11

no

no

Name

id

varchar

255

no

no

ID card

native_place

varchar

64

no

no

native place

student_number

varchar

64

no

no

student ID

grade

varchar

64

no

no

grade

dormitory_no

varchar

64

no

no

dormitory number

temperature

int

11

no

no

body temperature

health_status

varchar

64

no

no

health status

submission_date

date

0

no

no

filing date

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

drug_information table:

name

type

length

not null

primary key

note

drug_information_id

int

11

yes

yes

Drug Information ID

drug_name

varchar

64

no

no

Drug Name

drug_number

varchar

64

no

no

drug number

drug_picture

varchar

255

no

no

drug picture

stock

int

11

no

no

库存

price

int

11

价格

drug_details

text

0

药品详情

hits

int

11

点击数

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

drug_application表:

名称

类型

长度

不是null

主键

注释

drug_application_id

int

11

药品申请ID

drug_name

varchar

64

药品名称

drug_number

varchar

64

药品编号

number

int

11

数量

dormitory_no

varchar

64

宿舍号

contact_information

varchar

64

联系方式

applying_students

int

11

申请学生

reason_for_application

text

0

申请原因

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

comment表:

名称

类型

长度

不是null

主键

注释

comment_id

int

11

评论ID

user_id

int

11

评论人ID

reply_to_id

int

11

回复评论ID

content

longtext

0

内容

nickname

varchar

255

昵称

avatar

varchar

255

头像地址

create_time

timestamp

0

创建时间

update_time

timestamp

0

更新时间

source_table

varchar

255

来源表

source_field

varchar

255

来源字段

source_id

int

10

来源ID

3.4本章小结

整个大学生健康报送系统的需求分析主要对系统总体架构以及功能模块的设计,通过建立E-R模型和数据库逻辑系统设计完成了数据库系统设计。

4 大学生健康报送系统 详细设计与实现

大学生健康报送系统 的详细设计与实现主要是根据前面的大学生健康报送系统 的需求分析和大学生健康报送系统 的总体设计来设计页面并实现业务逻辑。主要从大学生健康报送系统 界面实现、业务逻辑实现这两部分进行介绍。

4.1用户功能模块

4.1.1 前台首页界面

当进入大学生健康报送系统的时候,首先映入眼帘的是系统的导航栏,下面是轮播图以及系统内容,其主界面展示如下图4-1所示。

 

图4-1 前台首页界面图

4.1.2学生登录界面

大学生健康报送系统中的前台上注册后的学生是可以通过自己的账户名和密码进行登录的,当学生输入完整的自己的账户名和密码信息并点击“登录”按钮后,将会首先验证输入的有没有空数据,再次验证输入的账户名+密码和数据库中当前保存的学生信息是否一致,只有在一致后将会登录成功并自动跳转到大学生健康报送系统的首页中;否则将会提示相应错误信息,学生登录界面如下图4-2所示。

 

图4-2学生登录界面图

登录关键代码如下所示。

/**

     * 登录

     * @param data

     * @param httpServletRequest

     * @return

     */

    @PostMapping("login")

    public Map<String, Object> login(@RequestBody Map<String, String> data, HttpServletRequest httpServletRequest) {

        log.info("[执行登录接口]");

        String username = data.get("username");

        String email = data.get("email");

        String phone = data.get("phone");

        String password = data.get("password");

        List resultList = null;

        Map<String, String> map = new HashMap<>();

        if(username != null && "".equals(username) == false){

            map.put("username", username);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }

        else if(email != null && "".equals(email) == false){

            map.put("email", email);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }

        else if(phone != null && "".equals(phone) == false){

            map.put("phone", phone);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }else{

            return error(30000, "账号或密码不能为空");

        }

        if (resultList == null || password == null) {

            return error(30000, "账号或密码不能为空");

        }

        //判断是否有这个用户

        if (resultList.size()<=0){

            return error(30000,"用户不存在");

        }

        User byUsername = (User) resultList.get(0);

        Map<String, String> groupMap = new HashMap<>();

        groupMap.put("name",byUsername.getUserGroup());

        List groupList = userGroupService.select(groupMap, new HashMap<>()).getResultList();

        if (groupList.size()<1){

            return error(30000,"用户组不存在");

        }

        UserGroup userGroup = (UserGroup) groupList.get(0);

        //查询用户审核状态

        if (!StringUtils.isEmpty(userGroup.getSourceTable())){

            String sql = "select examine_state from "+ userGroup.getSourceTable() +" WHERE user_id = " + byUsername.getUserId();

            String res = String.valueOf(service.runCountSql(sql).getSingleResult());

            if (res==null){

                return error(30000,"用户不存在");

            }

            if (!res.equals("已通过")){

                return error(30000,"该用户审核未通过");

            }

        }

        //查询用户状态

        if (byUsername.getState()!=1){

            return error(30000,"用户非可用状态,不能登录");

        }

        String md5password = service.encryption(password);

        if (byUsername.getPassword().equals(md5password)) {

            // 存储Token到数据库

            AccessToken accessToken = new AccessToken();

            accessToken.setToken(UUID.randomUUID().toString().replaceAll("-", ""));

            accessToken.setUser_id(byUsername.getUserId());

            tokenService.save(accessToken);

            // 返回用户信息

            JSONObject user = JSONObject.parseObject(JSONObject.toJSONString(byUsername));

            user.put("token", accessToken.getToken());

            JSONObject ret = new JSONObject();

            ret.put("obj",user);

            return success(ret);

        } else {

            return error(30000, "账号或密码不正确");

        }

}

4.1.3学生注册界面

不是大学生健康报送系统中正式用户的是可以在线进行注册的,如果你没有本大学生健康报送系统的账号的话,添加“注册”,当填写上自己的账号+密码+确认密码+昵称+邮箱+手机号等后再点击“注册”按钮后将会先验证输入的有没有空数据,再次验证密码和确认密码是否是一样的,最后验证输入的账户名和数据库表中已经注册的账户名是否重复,只有都验证没问题后即可学生注册成功。其用学生注册界面展示如下图4-3所示。

 

图4-2学生注册界面图

注册关键代码如下所示。

/**

     * 注册

     * @param user

     * @return

     */

    @PostMapping("register")

    public Map<String, Object> signUp(@RequestBody User user) {

        // 查询用户

        Map<String, String> query = new HashMap<>();

        query.put("username",user.getUsername());

        List list = service.select(query, new HashMap<>()).getResultList();

        if (list.size()>0){

            return error(30000, "用户已存在");

        }

        user.setUserId(null);

        user.setPassword(service.encryption(user.getPassword()));

        service.save(user);

        return success(1);

}

/**

     * 用户ID:[0,8388607]用户获取其他与用户相关的数据

     */

    @Id

    @GeneratedValue(strategy = GenerationType.IDENTITY)

    @Column(name = "user_id")

    private Integer userId;

    /**

     * 账户状态:[0,10](1可用|2异常|3已冻结|4已注销)

     */

    @Basic

    @Column(name = "state")

    private Integer state;

    /**

     * 所在用户组:[0,32767]决定用户身份和权限

     */

    @Basic

    @Column(name = "user_group")

    private String userGroup;

    /**

     * 上次登录时间:

     */

    @Basic

    @Column(name = "login_time")

    private Timestamp loginTime;

    /**

     * 手机号码:[0,11]用户的手机号码,用于找回密码时或登录时

     */

    @Basic

    @Column(name = "phone")

    private String phone;

    /**

     * 手机认证:[0,1](0未认证|1审核中|2已认证)

     */

    @Basic

    @Column(name = "phone_state")

    private Integer phoneState;

    /**

     * 用户名:[0,16]用户登录时所用的账户名称

     */

    @Basic

    @Column(name = "username")

    private String username;

    /**

     * 昵称:[0,16]

     */

    @Basic

    @Column(name = "nickname")

    private String nickname;

    /**

     * 密码:[0,32]用户登录所需的密码,由6-16位数字或英文组成

     */

    @Basic

    @Column(name = "password")

    private String password;

    /**

     * 邮箱:[0,64]用户的邮箱,用于找回密码时或登录时

     */

    @Basic

    @Column(name = "email")

    private String email;

    /**

     * 邮箱认证:[0,1](0未认证|1审核中|2已认证)

     */

    @Basic

    @Column(name = "email_state")

    private Integer emailState;

    /**

     * 头像地址:[0,255]

     */

    @Basic

    @Column(name = "avatar")

    private String avatar;

    /**

     * 创建时间:

     */

    @Basic

    @Column(name = "create_time")

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    private Timestamp createTime;

    @Basic

    @Transient

    private String code;

}

4.1.4健康新闻界面

当访客点击大学生健康报送系统中导航栏上的“健康新闻”后将会进入到该“健康新闻”列表的界面,然后选择想要看的新闻,点击进入到新闻详细界面,在健康新闻详细界面可以发布内容+收藏+评论等操作,健康新闻界面如下图4-3所示。

 

图4-3健康新闻界面图

4.1.5通知公告界面

当点击后台的“公告”的时候,就会进入对应的界面查看公告信息,公告界面如下图4-4所示。

 

图4-4通知公告界面图

4.1.6药品信息详情界面

当访客点击了任意药品信息后将会进入药品信息的详情界面,可以了解到该药品的药品名称、价格、药品详情、库存等,同时可以对该药品信息进行收藏+点赞+评论,药品信息详情展示页面如图4-5所示。

 

图4-5药品信息详情界面图

4.3管理员功能模块

4.3.1 学生管理界面

大学生健康报送系统中的管理人员是可以对前台注册的学生用户进行管理的,也可以对管理员进行管控。界面如下图4-6所示。

 

图4-6学生管理界面图

学生管理关键代码如下所示。

public String encryption(String plainText) {

        String re_md5 = new String();

        try {

            MessageDigest md = MessageDigest.getInstance("MD5");

            md.update(plainText.getBytes());

            byte b[] = md.digest();

            int i;

            StringBuffer buf = new StringBuffer("");

            for (int offset = 0; offset < b.length; offset++) {

                i = b[offset];

                if (i < 0)

                    i += 256;

                if (i < 16)

                    buf.append("0");

                buf.append(Integer.toHexString(i));

            }

            re_md5 = buf.toString();

        } catch (Exception e) {

            e.printStackTrace();

        }

        return re_md5;

    }

4.3.2药品信息管理界面

此功能为管理员的功能,管理员点击“更多管理”菜单后能够对药品信息进行管控,包括了添加+编辑+删除+查询+申请,同时可以对前台用户对药品信息提交的申请进行管控;其界面展示如下图4-7所示。

 

图4-7药品信息管理界面图

4.3.3通知公告管理界面

在大学生健康报送系统中的管理人员是可以对前台用户发布的公告进行管控的,界面如下图4-8所示。

 

图4-8通知公告管理界面图

通知公告管理关键代码如下所示。

  @PostMapping("/add")

    @Transactional

    public Map<String, Object> add(HttpServletRequest request) throws IOException {

        service.insert(service.readBody(request.getReader()));

        return success(1);

    }

    @Transactional

    public Map<String, Object> addMap(Map<String,Object> map){

        service.insert(map);

        return success(1);

}

    public Map<String,Object> readBody(BufferedReader reader){

        BufferedReader br = null;

        StringBuilder sb = new StringBuilder("");

        try{

            br = reader;

            String str;

            while ((str = br.readLine()) != null){

                sb.append(str);

            }

            br.close();

            String json = sb.toString();

            return JSONObject.parseObject(json, Map.class);

        }catch (IOException e){

            e.printStackTrace();

        }finally{

            if (null != br){

                try{

                    br.close();

                }catch (IOException e){

                    e.printStackTrace();

                }

            }

        }

        return null;

}

    public void insert(Map<String,Object> body){

        StringBuffer sql = new StringBuffer("INSERT INTO ");

        sql.append("`").append(table).append("`").append(" (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            sql.append("`"+humpToLine(entry.getKey())+"`").append(",");

        }

        sql.deleteCharAt(sql.length()-1);

        sql.append(") VALUES (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            Object value = entry.getValue();

            if (value instanceof String){

                sql.append("'").append(entry.getValue()).append("'").append(",");

            }else {

                sql.append(entry.getValue()).append(",");

            }

        }

        sql.deleteCharAt(sql.length() - 1);

        sql.append(")");

        log.info("[{}] - 插入操作:{}",table,sql);

        Query query = runCountSql(sql.toString());

        query.executeUpdate();

    }

4.3.4更多管理界面

大学生健康报送系统中的管理人员在“更多管理”这一菜单下是可以对大学生健康报送系统内的医务员、健康报送、返校上报、消杀情况、药品申请、评论列表进行管控的,其管理界面如下图4-9所示。

 

图4-9更多管理界面图

更多管理关键代码如下所示。

@RequestMapping(value = "/del")

    @Transactional

    public Map<String, Object> del(HttpServletRequest request) {

        service.delete(service.readQuery(request), service.readConfig(request));

        return success(1);

}

    @Transactional

    public void delete(Map<String,String> query,Map<String,String> config){

        StringBuffer sql = new StringBuffer("DELETE FROM ").append("`").append(table).append("`").append(" ");

        sql.append(toWhereSql(query, "0".equals(config.get(FindConfig.GROUP_BY))));

        log.info("[{}] - 删除操作:{}",table,sql);

        Query query1 = runCountSql(sql.toString());

        query1.executeUpdate();

    }

5系统测试

5.1测试目的

对任何系统而言,测试都是必不可少的环节,测试可以发现系统存在的很多问题,所有的软件上线之前,都应该进行充足的测试之后才能保证上线后不会Bug频发,或者是功能不满足需求等问题的发生。下面分别从单元测试,功能测试和用例测试来对系统进行测试以保证系统的稳定性和可靠性。

5.2功能测试

下表是药品信息管理功能的测试用例,检测了药品信息管理中对药品信息信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表5-1 药品信息管理的测试用例

功能描述

用于药品信息管理

测试目的

检测药品信息管理时的各种操作的运行情况

测试数据以及操作

预期结果

实际结果

点击添加药品信息,必填项合法输入,点击保存

提示添加成功

与预期结果一致

点击添加药品信息,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击修改药品信息,必填项修改为空,点击保存

提示必填项不能为空

与预期结果一致

点击修改药品信息,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击删除药品信息,选择药品信息删除

提示删除成功

与预期结果一致

点击搜索药品信息,输入存在的药品信息名

查找出药品信息

与预期结果一致

点击搜索药品信息,输入不存在的药品信息名

不显示药品信息

与预期结果一致

下表是返校上报管理功能的测试用例,检测了返校上报管理中对返校上报信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表5-2 返校上报管理的测试用例

功能描述

用于返校上报管理

测试目的

检测返校上报管理时的各种操作的运行情况

测试数据以及操作

预期结果

实际结果

点击添加返校上报,必填项合法输入,点击保存

提示添加成功

与预期结果一致

点击添加返校上报,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击修改返校上报,必填项修改为空,点击保存

提示必填项不能为空

与预期结果一致

点击修改返校上报,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击删除返校上报,选择返校上报删除

提示删除成功

与预期结果一致

点击搜索返校上报,输入存在的返校上报名

查找出返校上报

与预期结果一致

点击搜索返校上报,输入不存在的返校上报名

不显示返校上报

与预期结果一致

下表是健康报送管理功能的测试用例,检测了健康报送管理中分类列表的操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表5-3 健康报送管理的测试用例

功能描述

用于健康报送管理

测试目的

检测健康报送管理时各种操作的情况

测试数据以及操作

预期结果

实际结果

未选择分类,点击提交

提示请选择分类

与预期结果一致

未选择列表,点击提交

提示请选择列表

与预期结果一致

5.3性能测试

使用阿里云PTS(Performance Testing Service)性能测试服务对线上系统进行压力测试。线上服务器环境为:1核心CPU,1G内存,1Mbps公网带宽,Centos7.0操作系统。

压测过程中使用了2台并发机器,每台机器20个用户并发,对系统主页,登录,数据查询和数据维护等模块进行并发访问,测试结果是有40个用户并发时,数据管理相关页面的响应时间甚至达到了7s,通过查看服务器出网流量发现已经达到1381kb/s,可以看出服务器的带宽已经达到峰值,如果系统使用5Mbps的带宽,系统的响应时间和TPS将会大大增加。在整个测试的过程中,CPU的使用率占用仅8%,也提现出带宽瓶颈对系统的影响非常严重。

结论

至此,大学生健康报送系统已经结束,在开发前做了许多的准备,在本系统的设计和开发过程中阅览和学习了许多文献资料,从中我也收获了很多宝贵的方法和设计思路,对系统的开发也起到了很重要的作用,系统的开发技术选用的都是自己比较熟悉的,比如Web、springboot技术、MYSQL,这些技术都是在以前的学习中学到了,其中许多的设计思路和方法都是在以前不断地学习中摸索出来的经验,其实对于我们来说工作量还是比较大的,但是正是由于之前的积累与准备,才能顺利的完成这个项目,由此看来,积累经验跟做好准备是十分重要的事情。

当然在该系统的设计与实现的过程中也离不开老师以及同学们的帮助,正是因为他们的指导与帮助,我才能够成功的在预期内完成了这个系统。同时在这个过程当中我也收获了很多东西,此系统也有需要改进的地方,但是由于专业知识的浅薄,并不能做到十分完美,希望以后有机会可以让其真正的投入到使用之中。

参考文献

[1]曾劲涛,斯恩昊,龙满生,付青.基于Spring Boot框架的井冈蜜柚管理系统设计与实现[J].井冈山大学学报(自然科学版),2022,43(02):82-87+102.

[2]曹小华,张雯,王娜,杜洁,林钧昌,赵民.突发公共卫生事件下山东省大学生健康知识现状及影响因素分析[J].中国卫生事业管理,2022,39(03):231-234.

[3]Pfledderer Christopher D.,Bai Yang,Brusseau Timothy A.,Burns Ryan D.,King Jensen Jessica L.. Changes in college students’ health behaviors and substance use after a brief wellness intervention during COVID-19[J]. Preventive Medicine Reports,2022,26.

[4]孙培培,王世强,盛祥梅,肖刚,罗钟.大学生健康素养和体力活动水平的相关性分析研究[J].安徽体育科技,2022,43(01):78-82.

[5]李峰.疫情防控下大学生健康档案管理与服务探研[J].档案管理,2022(01):79-80.DOI:10.15950/j.cnki.1005-9458.2022.01.008.

[6]陈青杨,汪宏莉,卢恒,韦海华.中国大学生健康素养现状及其影响因素[J].科技资讯,2021,19(36):159-162+184.DOI:10.16661/j.cnki.1672-3791.2110-5042-2480.

[7]李磊.探究大学生健康教育存在的问题与对策[J].中国继续医学教育,2021,13(34):124-127.

[8]姜峰,张佳彤,乔金鸽,臧卫东.新时期在校大学生健康素养现状调查及影响因素分析——以河南某综合性大学为例[J].保健医学研究与实践,2021,18(06):1-7.

[9]魏来,黄艳. 9周“1+1”运动模式对江苏科技大学肥胖女大学生健康体适能效果的研究[C]//.第三届“全民健身 科学运动”学术交流大会论文集.,2021:191.DOI:10.26914/c.cnkihy.2021.048706.

[10]尚鹏. 一种基于Spring boot框架的数据处理方法及装置[P]. 北京市:CN113641700A,2021-11-12.

[11]和大同, 红十字会 “2018怒江·大学生健康故乡行”慰问志愿服务活动. 杨国志 主编,兰坪年鉴,云南民族出版社,2019,238,年鉴.DOI:10.40612/y.cnki.ylpnn.2021.001104.

[12]He Xinbin,Bai Yongbin,Yue Lisen,Wang Haixiao,Liu Yi. Design and Implementation of Information System Based on Java Technology Platform[J]. Journal of Physics: Conference Series,2021,2033(1).

[13]黄瑞泉.基于Spring Boot框架的地图监管系统[J].计算机系统应用,2021,30(08):89-95.DOI:10.15888/j.cnki.csa.008020.

[14]佟佳春. 立德树人视域下大学生健康人格培育研究[D].辽宁工业大学,2021.

[15]杨超智. 基于Spring boot框架的预警监测平台[C]//.中国移动5G天线产业技术研讨会论文集.,2020:90-92.DOI:10.26914/c.cnkihy.2020.065469.

[16]Lei Yu,Cheng Li,Lei Wei,Hu WenYa. Marine biological monitoring and managing system based on Java technology[J]. MIPPR 2019: REMOTE SENSING IMAGE PROCESSING, GEOGRAPHIC INFORMATION SYSTEMS, AND OTHER APPLICATIONS,2020,11432.

[17]Xuchun Chen. Design and Implementation of University Art Education Management System Based on JAVA Technology[J]. International Journal of Emerging Technologies in Learning (iJET),2018,13(10).

致  谢

逝者如斯夫,不舍昼夜。转眼间,大用户用户活便已经接近尾声,人面对着离别与结束,总是充满着不舍与茫然,我亦如此,仍记得那年秋天,我迫不及待的提前一天到了学校,面对学校巍峨的大门,我心里充满了期待:这里,就是我新生活的起点吗?那天,阳光明媚,学校的欢迎仪式很热烈,我面对着一个个对着我微笑的同学,仿佛一缕缕阳光透过胸口照进了我心里,同时,在那天我认识可爱的室友,我们携手共同度过了这难忘的两年。如今,我望着这篇论文的致谢,不禁又要问自己:现在,我们就要说再见了吗?

感慨莫名,不知所言。遥想当初刚来学校的时候,心里总是想着工科学校会过于板正,会缺乏一些柔情,当时心里甚至有一点点排斥,但是随着我对学校的慢慢认识与了解,我才认识到了她的美丽,她的柔情,并且慢慢的喜欢上了这个校园,但是时间太快了,快到我还没有好好体会她的美丽便要离开了,但是她带给我的回忆,永远不会离开我,也许真正离开那天我的眼里会满含泪水,我不是因为难过,我只是想将她的样子映在我的泪水里,刻在我的心里。最后,感谢我的老师们,是你们教授了我们知识与做人的道理;感谢我的室友们,是你们陪伴了我如此之久;感谢每位关心与支持我的人。

少年,追风赶月莫停留,平荒尽处是春山。

请关注点赞+私信博主,免费领取项目源码

Guess you like

Origin blog.csdn.net/ID3461074420/article/details/131223009