(with source code) design and implementation of springboot-based campus sports venues and equipment rental system based on WeChat applet 131052

Campus sports venues and equipment rental system

summary 

With the rapid development of my country's economy, people's demand for mobile phones is increasing, and various mobile phone software are also being widely used. However, for mobile phone data information management, various software for mobile phones are also popular among users. Campus The sports venue and equipment rental system is widely used by users. In order to facilitate users to manage the data information of the campus sports venue and equipment rental system at any time, a campus sports venue and equipment rental system is specially developed.

The design of the campus sports venue and equipment rental system is mainly to consider the functions to be realized by the system in detail, and design the interface after determining the functions to be realized. In the process, it is also necessary to consider how to better integrate the functions and pages. A good combination is convenient for users to find the information they need easily and clearly, as well as the operability of the system platform in the later stage, and technology development can be carried out through a detailed understanding of the information content.

The development of the campus sports venue and equipment rental system uses the existing mature technology reference, uses the source code as a template, analyzes the function adjustment and combines the actual needs of the campus sports venue and equipment rental system, and discusses the system based on campus sports. Use of venue and equipment rental system. 

Key words: campus sports venues and equipment rental system; Java language;

Campus sports venues and equipment rental system

Abstract

With the rapid development of China's economy, people's demand for mobile phones is increasing, and various mobile phone software are also widely used. However, data information management for mobile phones and various software for mobile phones are also loved by users. Campus sports venues and equipment rental systems are widely used by users, In order to facilitate users to manage the data information of campus sports venues and equipment rental system at any time, a system based on campus sports venues and equipment rental system is developed.

The design of campus sports venues and equipment rental system is mainly to consider in detail the functions to be realized by the system, and design the interface after determining the functions to be realized. In the middle, we should also consider how to better combine the functions and pages, so that users can easily and clearly find the information they need, There is also the operability of the system platform in the later stage, and the technical development is carried out through the detailed understanding of the information content.

The development of campus sports venues and equipment rental system makes use of the existing mature technology reference, takes the source code as the template, analyzes the combination of function adjustment and the actual needs of campus sports venues and equipment rental system, and discusses the use of campus sports venues and equipment rental system.

Key words: Campus sports venues and equipment rental system; Java language;

Table of contents

Chapter 1 Introduction

1.1  Research Background

1.2 Research content

Chapter 2 Introduction to Related Technologies

2.1 WeChat Developer Tools

2.2 Mini Program Framework and Directory Structure Introduction

2.3 Myeclipse Description

2.4  Mysql Description

2.5 Tomcat Description

2.6 Introduction to springboot framework 5

Chapter 3 System Analysis 6

3.1  Demand Analysis 6

3.2  Feasibility Analysis 6

3.1.1  Technical Feasibility Analysis 6

3.1.2  Economic feasibility analysis 6

3.1.3  Operation Feasibility Analysis 7

3. 3 Performance Analysis 7

3.4 System operation process

3.4.1 User login process

3.4.2 Information adding process 8

3.4.3 Information deletion process 9

Chapter 4 System Design 10

4.1  System Architecture Design 10

4.2 Development Process Design 10

4.3 Database design

4. .3.1 Entity ER Diagram

4.3.2 Data Sheet

Chapter 5 System Implementation

5.1 User front-end function module (front-end)

5. 2 Administrator background function module (backend)

Chapter 6 System Testing

6.1  Test purpose

6.2  Testing process

6.3  Test results 37

Chapter 7 Summary and Outlook 38

Reference 39

Thanks 41

  1. introduction

1.1 Research Background

For schools of all levels and types, physical education teaching has become an indispensable and important part of school education, and more and more attention has been paid to it. The leasing system puts forward new and higher requirements. Although schools at all levels and types of schools in my country have achieved certain results in the development and utilization of sports venues and equipment rental systems, there are still some problems that cannot be ignored, especially from the current overall situation of some campus sports venues and equipment rental systems in our country. Look, there are still a series of outstanding problems such as low quality and waste of resources, which have restricted the teaching work of physical education and the in-depth development of "Sunshine Sports" to a large extent, and need to be highly valued. Under the historical condition that our country vigorously implements the strategy of "strengthening the country with talents", we must attach great importance to the development and utilization of campus sports venues and equipment resources, actively explore new development and utilization models, and make more effective use of the campus sports venues and equipment rental system.

1.2 Research content

The development and implementation of campus sports venues and equipment rental system, the required work content:

(1) First of all, determine the topic, determine the system to be built, and conduct a preliminary systematic confirmation of the background of the system and some problems currently facing it.

(2) After the system confirmation is completed, confirm the technology used for system development in combination with the needs of system development. The development of campus sports venues and equipment rental system uses JAVA technology, and the database is used to build and develop the platform, and the technology used is confirmed. Technical analysis, whether the technology used can complete the realization of campus sports venues and equipment rental system.

(3) Determine the technology used by the system, confirm the user roles divided by the system online, and determine the functional modules to be designed according to the division of user roles. For the design of campus sports venues and equipment rental systems, the main divisions are administrators The role of users and the functional modules used are also different, but the content of the database of the system is interactive, and users can access course information according to their own needs at any time. Processing and operation, the administrator obtains the detailed data information of all users, and processes and solves it as soon as possible according to the needs.

(4) Design the program and interface after the functional modules of the system are confirmed. The test method finds out the loopholes in the program, and solves the loopholes in the program online. If there is no problem in the test system, the system can be uploaded for formal operation.

  1. Related technology introduction
    1. WeChat Developer Tools

The WeChat developer tool has now been developed and run by the small program development team. At present, the WeChat developer tool is still being continuously improved, and it is often updated when developing a small program. You can use the WeChat code to log in to the developer tool, and the developer tool will use the information of this WeChat account to develop and debug the applet.

Model selection: The applet uses the screen size of the smartphone as the design standard to cut pictures.

Preview interface: After writing the view layout, click compile to refresh the view interface.

Console: It is convenient to debug and print out information.

Upload code: upload to the Tencent server, and submit for review. You can fill in the version number and remarks when uploading the code.

Resource file: Generally, you can perform breakpoint debugging of the file directory of the corresponding project in the resource file.

Display remote debugging: The joint debugging of mobile phone and PC development tools is very practical for users.

Local data storage: Displays the data stored locally.

View debugging: The standard components are presented in a child-parent hierarchical structure, which is convenient for debugging.

WeChat is limited to a code volume within 2M; the legal domain name information is generally not verified during development; the server domain name needs to be configured in the background of the applet.

The above are the functions commonly used by WeChat developer tools during the development process, and the WeChat developer tools are also constantly being improved.

    1. Small program framework and directory structure introduction

The entire applet framework system is divided into two parts: logic layer and view layer . The goal of the mini program development framework is to allow developers to develop services with native mini program experience in WeChat in the simplest and most efficient way possible. The applet provides a data transmission and event system between the view layer and the logic layer, and provides its own view layer and logic layer framework, allowing developers to focus on data and logic. At the heart of the framework is a reactive data binding system that makes keeping data and views in sync very simple. Data modification at the logical layer will be updated accordingly at the view layer. The framework provides a set of basic components. These components come with WeChat-style styles and special logic. Developers can create powerful WeChat applets by combining basic components.

2.3 Myeclipse description

The software we usually use when we use Java to develop the system is Myeclipse, which is used to design the collection of Eclipse plug-ins for Java and JavaEE. Most of Myeclipse can realize the research and development of Mysql database and Javaee. Using Myeclipse greatly facilitates developers, and the progress of system development will also be improved.

2.4 Mysql Description

Now the Mysql database can support many users on the network, and it can also adapt to the deployment or configuration of customer service machines and servers. Our server and client machines here are actually a software concept, and the computer hardware we use is also There is no one-to-one correspondence with them.

Mysql is a very popular relational database, and its appearance has always been a leader. It is not only very powerful, but also very convenient to use, and Mysql's cross-platform capabilities are also very good. Software developers like it very much. Strong advantage. Different from other relational databases, it has its own set of solutions for database management, and manages the database by setting corresponding permissions and roles for users. It can be seen that Mysql is a database management software suitable for high throughput, high reliability and high efficiency [4].

Advantage 1: Mysql sets different permissions for users with different identities to complete different business logics, which makes Mysql far exceed other relational databases in terms of security and integrity.

Advantage 2: Mysql can also support the data types of animation, graphics and sound, which means that multiple data types can also be supported by Mysql.

Advantage 3: Mysql can also be developed on multiple platforms, and various programming languages ​​for software development can realize the operation of Mysql database.

2.5 Tomcat Description

Tomcat is a free server. The usage scenario is more suitable for situations where the number of visits is relatively small. It means that when Tomcat is installed on the computer, the access request of the front-end HTML page can be parsed through it. In fact, Tomcat is an extension of Apache, but it works relatively independently of Apache, so it can be seen that it runs relatively independently of Apache.

Tomcat was originally developed and applied by Davidson of Sun Company. After his efforts, he has continuously turned it into an open source server. It was also handed over to the Apache Software Foundation by the sun company. The ever-evolving tomcat server has undergone a lot of refactoring and combing in a recent version to make it more convenient to use. The Tomcat-based load balancing algorithm is an open source software implementation. There is no need to add additional hardware investment, and it is very convenient to implement, especially suitable for the expansion of general small business website servers at present and in the future. Judging from the current practice, it can be used as a reference for similar applications.

2.6 Introduction to spring boot framework

The Spring framework is an open source application framework on the Java platform that provides a container with inversion of control features. Although the Spring framework itself has no restrictions on the programming model, its frequent use in Java applications made it so popular that it was later used as a supplement or even a substitute for the EJB (EnterpriseJavaBeans) model. The Spring framework provides a series of solutions for development, such as using the core features of inversion of control, and implementing inversion of control through dependency injection to realize the containerization of the management object life cycle, using aspect-oriented programming for declarative transaction management, and integrating A variety of persistence technologies manage data access, provide a large number of excellent web frameworks to facilitate development, and so on. The Spring framework has the feature of inversion of control (IOC). IOC is designed to facilitate project maintenance and testing. It provides a method for unified configuration and management of Java objects through the Java reflection mechanism. The Spring framework uses the container to manage the life cycle of objects. The container can configure objects by scanning XML files or specific Java annotations on classes. Developers can obtain objects through dependency lookup or dependency injection. Aspect Oriented Programming(AOP) framework, the Spring AOP framework is based on the proxy mode, and can be configured at runtime; the AOP framework is mainly modularized for the cross concerns between modules. The AOP framework of the Spring framework only provides basic AOP features. Although it cannot be compared with the AspectJ framework, it can also meet the basic needs through integration with AspectJ. Functions such as transaction management and remote access under the Spring framework can be realized by using Spring AOP technology. Spring's transaction management framework brings an abstraction mechanism to the Java platform that enables local and global transactions, as well as nested transactions, to work with savepoints and in almost any environment on the Java platform. Spring integrates multiple transaction templates. The system can configure transactions through transaction templates, XML or Java annotations, and the transaction framework integrates functions such as messaging and caching. Spring's data access framework addresses common difficulties developers encounter when using databases in their applications. It not only provides support for all popular data access frameworks such as Java: JDBC, iBATS/MyBATIs, Hibernate, Java Data Objects (JDO), ApacheOJB and Apache Cayne, but also can be used with Spring's transaction management to provide data access Flexible abstraction. The Spring framework initially did not intend to build its own Web MVC framework . During the development process, its developers believed that the separation between the presentation layer and the request processing layer of the existing Struts Web framework and between the request processing layer and the model was not enough, so they created Spring MVC.

  1. system analysis

3.1 Demand Analysis

Before any project is developed and researched, it is necessary to make a careful analysis of the needs of the R&D system itself. Market research cannot be ignored. Determine the functional requirements of the users from the actual scene, so as to clarify the goals and develop the entire system. There is a more accurate positioning. In this chapter, the performance analysis, business process analysis, and data analysis of the system are required. The overall interface of the campus sports venue and equipment rental system is simple and the functions are complete.

The feasibility of requirements is to analyze and discuss what kind of requirements the developed system can meet. Whether the developed system platform meets the previous requirements. Only in the development of a pre-assessment system can the requirements be completed before the system is developed and implemented. If it is not feasible for you to develop a system that does not function properly, then it is development failure. Whether the development system is useful or not can fulfill the requirements discussed before. The following analyzes the actual requirements of the campus sports venue and equipment rental system.

System design needs to start with the actual needs of users and administrators to understand what functions they need to implement and what administrative work they can include.

Considering the design characteristics of campus sports venues and equipment rental system, several requirements should be met:

(1) It can carry out the information management of campus sports venues and equipment rental system through the network, and promote the information management of campus sports venues and equipment rental system.

(2) Learning methods become more diverse and management is more standardized;

(3) It provides a free channel to ensure real-time and effective communication of data.

3.2 Feasibility analysis

This design is based on the B/S mode, and the Java technology is used to implement the MySQL database and Myeclipse. The overall feasibility is divided into the following three aspects.

3.2.1 Technical Feasibility Analysis

The so-called technical feasibility refers to whether the functions planned in the early stage can be satisfied within a limited time. Whether there will be problems that cannot be solved in the development and design. Whether the completed project can be well applied, if there are shortcomings, whether there is great difficulty in later maintenance. After evaluating the system, it was determined that existing technology could achieve the goals. Using Java technology to realize dynamic pages, embedding low-dependency design patterns, flexible databases, and stable servers, the operating efficiency of the entire system is greatly improved. It can be seen that achieving the goal at the technical level is not a nonsense.

3.2.2 Economic Feasibility Analysis

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.

3.2.3 Operation Feasibility Analysis

The operation of this system to realize the functions is very simple. The common configuration of ordinary mobile phones can run this software, and as long as you have a rough understanding of the basic common sense of computer use, you can use this software smoothly. The mobile phone has the ability to connect to the Internet and can access the system normally. It does not require the operator to have any superb ability. It only needs to understand the business process and operate correctly according to professional knowledge. Therefore, the campus sports venue and equipment rental system It is operationally feasible.

 3.3 Performance Analysis

For performance analysis, compared with the traditional management method, the traditional management method uses manual statistics and management of data information with paper and pen, and this method is more troublesome for storing and finding certain data information. With the advent of computer networks, this traditional method is difficult to adapt to the development of the current society. It not only reduces people's work efficiency, but also requires a lot of manpower and material resources, which is relatively high in terms of time and cost. To reduce costs, improve users' work efficiency, and develop a campus sports venue and equipment rental system based on computer and network technology.

The development and design of the campus sports venue and equipment rental system is an independent system. The previous database is used for data storage and development, mainly to realize the user roles and corresponding functional modules of the campus sports venue and equipment rental system. Let the management of the campus sports venues and equipment rental system not have management differences and low efficiency, but just the opposite of traditional management information. The realization of the campus sports venues and equipment rental system can save resources, and for business The processing speed is also improved, with high speed, high efficiency and powerful functions.

3.4 System operation process

3.4.1 User login process

The first hurdle for system security is that users who want to enter the system must enter their own login information through the login window before they can log in. Only after the information entered by the user is accurate can they enter the operating system interface and perform function modules. The corresponding operation, if the information entered by the user is incorrect, a prompt box will appear in the window, and the user fails to log in. Return to the first step to re-enter, as shown in Figure 3-1.

                                                                           Figure 3-1 User use case diagram

 

3.4.2 Information adding process

For the campus sports venue and equipment rental system, it is necessary to add the required meal data information at any time. For the user to add information, it is necessary to fill in the meal data information to be added according to the addition interface and the content of the check box, and judge after the information input is completed. If the data information meets the requirements, the addition is completed if the requirements are met. If the information added by the user does not meet the requirements, you need to return to the first step, re-enter the data information, and then perform the judgment operation, as shown in Figure 3-2.

                                          

 

                                             Figure 3-2 Information adding flow chart

3.4.3 Information deletion process

No matter which user role enters the unreasonable system operation interface, it can perform different information content operation functions. For the deletion of system data information, once the user deletes the information, the deleted data information will not be restored. Therefore, the user When deleting data, it is necessary to judge whether the content to be deleted is determined to be deleted. After confirming that it is correct, choose to confirm the deletion operation, as shown in Figure 3-3.

                                                  

 

  Figure 3-3 Information deletion flow chart

  1. system design

4.1 System architecture design

An overview design analysis of the campus sports venue and equipment rental system project, the main content is the specific analysis of the campus sports venue and equipment rental system, the database is designed, the data uses mysql database, and the design of the system adopts more humane The operation design is optimized, and the error information in the system can be processed and fed back in time.

Based on the design of campus sports venues and equipment rental system based on existing mobile phones, it can realize detailed understanding and statistical analysis of administrators, home pages, user management, venue information, equipment rental, rental information, venue reservations, etc. The module relationship diagram established according to the system functional requirements is as follows:

The system architecture diagram is shown in the figure below.

 

                    Figure 4-1 Administrator function module diagram   

4.2 Development Process Design

The development of campus sports venues and equipment rental system analyzes the management module and the database used by the system, writes generation development, planning and operation are the necessary three steps to build information management applications, which determines whether the system can truly achieve the expected function and whether it can be implemented after a successful design. In the development process, each stage must be developed in strict accordance with the linear sequence, and each work generated in the corresponding stage can be verified and checked by technology. Make sure that it is correct after the completion of one stage, and will not cause drag and drop phenomenon in the next stage, so that the system can be guaranteed after the design function is completed.

Judging from the successful development experience of the campus sports venue and equipment rental system, the above method has the most obvious effect and reduces the complexity of system development to the greatest extent. As shown in Figure 4-2.

 

         Figure 4-2 Flow chart of the development system

4.3 Database design

Database is the foundation and core of information system. The quality of database design directly affects the success or failure of information system development. Creating a database table first determines the attributes of entities and the relationships between entities. Create a data table based on the relationship.

4.3.1 Entity ER Diagram

The database is the most important step in the entire software programming. For the database problem, it is mainly to determine the number of databases and the creation of structural formulas. The display system uses Mysql to manage the database to ensure data security and stability.

Conceptual models are designed to abstract real-world information and model the information world. It is a powerful tool for database design. Database conceptual model design can describe the conceptual model of the real world through ER diagrams. An ER diagram of a system shows the links between entities in the system. Moreover, the Mysql database is a database with relatively strong self-protection capabilities. The following figure is mainly an ER diagram of database entities:

(1) ER diagram of site information management, as shown in Figure 4-3:

                                       

 

                                                     Figure 4-3 Site Information Management Entity Attribute Map

 (2) The lease information management ER diagram is shown in Figure 4-4:

                                 

 

                                                 Figure 4-4 Leasing Information Management Entity Diagram

These functions can fully meet the needs of campus sports venues and equipment rental system. The function of this system is relatively comprehensive, as shown in Figure 4-5 below the system function structure.

                                                       Figure 4-5 System function structure diagram

 

 

4.3.2 Data Sheet

According to the detailed analysis requirements of the data structure, we can analyze according to the requirements of the input and output data volume, determine what table, the relationship between the structure, we can verify, adjust and improve, query and browse the process, can realize the database, In order to make users have more requirements for data and functions.

Based on the characteristics of the database used by the system, the conceptual model of the database is converted and constructed. However, this system only needs to fully consider the functions of the campus sports venue and equipment rental system, and the organization is relatively clear.

site_information table :

name

type

length

not null

primary key

note

site_information_id

int

11

yes

yes

venue information ID

site_name

varchar

64

no

no

venue name

venue_cover

varchar

255

no

no

venue cover

site_type

varchar

64

no

no

venue type

hourly_rent

varchar

64

no

no

hourly rental price

site_details

varchar

64

no

no

Venue Details

site_conditions

varchar

64

no

no

site condition

hits

int

11

yes

no

hits

praise_len

int

11

yes

no

Likes

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

venue_reservation表:

name

type

length

not null

primary key

note

venue_reservation_id

int

11

yes

yes

Venue Booking ID

site_name

varchar

64

no

no

venue name

site_type

varchar

64

no

no

venue type

hourly_rent

varchar

64

no

no

hourly rental price

appointment_date

date

0

no

no

appointment date

time_of_appointment

varchar

64

no

no

Appointment

lease_duration

varchar

64

no

no

Rental duration

total_lease_price

varchar

64

no

no

total rental price

reservation_user

int

11

no

no

Subscriber

merchant_reply

text

0

no

no

Merchant reply

pay_state

varchar

16

yes

no

Payment status

pay_type

varchar

16

no

no

Payment Types

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

site_information table:

name

type

length

not null

primary key

note

site_information_id

int

11

yes

yes

venue information ID

site_name

varchar

64

no

no

venue name

venue_cover

varchar

255

no

no

venue cover

site_type

varchar

64

no

no

venue type

hourly_rent

varchar

64

no

no

hourly rental price

site_details

varchar

64

no

no

Venue Details

site_conditions

varchar

64

no

no

site condition

hits

int

11

yes

no

hits

praise_len

int

11

yes

no

Likes

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

lease_information表:

name

type

length

not null

primary key

note

lease_information_id

int

11

yes

yes

Rental Information ID

equipment_name

varchar

64

no

no

equipment name

equipment_type

varchar

64

no

no

equipment type

hourly_rent

varchar

64

no

no

hourly rental price

lease_date

date

0

no

no

lease date

lease_time

varchar

64

no

no

lease time

lease_duration

varchar

64

no

no

Rental duration

total_lease_price

varchar

64

no

no

total rental price

leasing_user

int

11

no

no

rental user

merchant_reply

text

0

no

no

Merchant reply

pay_state

varchar

16

yes

no

Payment status

pay_type

varchar

16

no

no

Payment Types

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

equipment_leasing表:

name

type

length

not null

primary key

note

equipment_leasing_id

int

11

yes

yes

Equipment Rental ID

equipment_name

varchar

64

no

no

equipment name

equipment_cover

varchar

255

no

no

equipment cover

equipment_type

varchar

64

no

no

equipment type

hourly_rent

varchar

64

no

no

hourly rental price

equipment_details

varchar

64

no

no

Equipment Details

equipment_status

varchar

64

no

no

equipment condition

hits

int

11

yes

no

hits

praise_len

int

11

yes

no

Likes

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

upload table:

name

type

length

not null

primary key

note

upload_id

int

11

yes

yes

Upload ID

name

varchar

64

no

no

file name

path

varchar

255

no

no

access path

file

varchar

255

no

no

file path

display

varchar

255

no

no

display order

father_id

int

11

no

no

Parent ID

dir

varchar

255

no

no

folder

type

varchar

32

no

no

file type

  1. System implementation
    1. User front-end function module (front-end)

On the login interface of the campus sports venue and equipment rental system, you can log in by filling in the account number, password, and other information, as shown in Figure 5-1.

 

图5-1登录界面图

登录关键代码如下。

/**

     * 登录

     * @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, "账号或密码不正确");

        }

}

用户注册,通过填写账号、密码、昵称、手机、邮箱、身份等信息,输入完成后选择提交即可注册成功,如图5-2所示。 

                                 

 

图5-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;

}

首页,可以进行首页、运动论坛、运动新闻、我的等功能模块的查看与操作,如图5-3所示。

        

 

图5-3系统首页界面图

场地预定,在场地预定页面可以查看场地名称、场地类型、小时租价、预约日期、租赁时长、租赁总价、预约用户、商家回复等信息,如图5-4所示。

                

 

图5-4场地预定界面

我的,在我的页面可以查看基本信息、收藏、租赁信息、场地预定等信息,如图5-5所示。

                     

 

图5-5我的界面图

租赁信息页面可以搜索器材名称、器材类型、小时租价、租赁日期、租赁时间、租赁时长、租赁总价、租赁用户、商家回复等详情信息等操作。如图5-6所示。

        

 

图5-6租赁信息界面

    1. 管理员功能模块的实现(后端

管理员首页,在进入管理员首页可看到首页、站点内容(轮播图、公告栏)、用户管理(管理员、普通用户)、内容管理(论坛列表、论坛分类列表、新闻列表、新闻分类列表)更多管理(场地信息、器材租赁、租赁信息、场地预定)等查询、添加、删除操作,如图5-8所示

 

图5-8管理员首页界面

管理员首页关键代码如下所示。

@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-9所示

 

图5-9普通用户管理界面

普通用户管理关键代码如下所示。

@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();

    }

场地信息展示,管理员通过输入场地名称、场地封面、场地类型、小时租价、场地详情、场地状况等编辑、查询添加、删除操作,如图5-10所示

 

图5-10场地信息管理界面

 

场地信息管理关键代码如下所示。

@PostMapping("/upload")

    public Map<String, Object> upload(@RequestParam("file") MultipartFile file) {

        log.info("进入方法");

        if (file.isEmpty()) {

            return error(30000, "没有选择文件");

        }

        try {

            //判断有没路径,没有则创建

            String filePath = System.getProperty("user.dir") + "\\target\\classes\\static\\upload\\";

            File targetDir = new File(filePath);

            if (!targetDir.exists() && !targetDir.isDirectory()) {

                if (targetDir.mkdirs()) {

                    log.info("创建目录成功");

                } else {

                    log.error("创建目录失败");

                }

            }

            String fileName = file.getOriginalFilename();

            File dest = new File(filePath + fileName);

            log.info("文件路径:{}", dest.getPath());

            log.info("文件名:{}", dest.getName());

            file.transferTo(dest);

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("url", "/api/upload/" + fileName);

            return success(jsonObject);

        } catch (IOException e) {

            log.info("上传失败:{}", e.getMessage());

        }

        return error(30000, "上传失败");

}

器材租赁展示,管理员通过输入器材名称、器材封面、器材类型、小时租价、器材详情、器材状况等编辑查询、添加删除操作,如图5-11所示

 

图5-11器材租赁界面图

器材租赁关键代码如下所示。

@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();

    }

  1. 测试

6.1测试目的

在对该系统进行完详细设计和编码之后,就要对平衡膳食程序进行测试,检测程序是否运行无误,反复进行测试和修改,使之最后成为完整的软件,满足用户的需求,实现预期的功能。

6.2测试过程

在软件的测试过程中,通常测试人员需要针对不同的功能模块设计多种测试用例。通过测试用例能够及时发现代码业务逻辑上是否与真实的业务逻辑相对应,及时发现代码上或逻辑上的缺陷,以此来来完善系统,提高软件产品的质量,使软件具有良好的用户体验。

注册测试用例表如下所示。

表6-1注册测试用例

测试性能

新用户注册

用例目的

测试系统新用户个人信息注册功能的功能和安全性

前提条件

进入注册页面填写个人信息

输入条件

预期输出

实际情况

各项基本信息输入不完整

不允许注册,无法点击注册按钮

一致

填写已存在的用户名

系统显示出提示信息,要求重新填写

一致

两次密码输入不一致

系统显示出提示信息,要求重新填写

一致

填写的各项信息没有符合提示的长度和字符要求

系统显示出提示信息,要求重新填写

一致

胡乱填写电话号码

收不到验证码

一致

填写验证码与收到的不一致

系统显示提示信息告知用户验证码错误,不予注册

一致

登录测试用例表如下所示。

表6-2登录测试用例

测试性能

用户或操作员登录系统

用例目的

测试用户或操作员登录系统时功能是否正常

前提条件

进入用户登录页面或操作员登录页面

输入条件

预期输出

实际情况

各项信息不予填写,直接点击登陆按钮

不允许登录,提示填写账号相关信息

一致

填写错误的登录名或密码后点击登录系统

提示用户名或密码错误,要求重新填写进行登录

一致

填写与验证码信息不一致的信息

系统显示出提示信息,表明验证码错误,要求重新填写

一致

 场地信息测试用例表如下所示。

表6-3 场地信息测试用例

测试性能

用户进行场地信息的操作

用例目的

测试用户进行 场地信息操作时,该功能是否正常

前提条件

用户进入场地信息详情页,该律师能够被受理

输入条件

预期输出

实际情况

对着某场地点击“受理”按钮

界面跳转至受理界面

一致

在受理界面,输入必填项,点击“提交”按钮

提示“受理成功”,并返回上一级界面

一致

在受理界面,填写受理表单的时候未输入完整,点击“提交”按钮

提示“受理失败”

一致

器材租赁测试用例表如下所示。

表6-4器材租赁测试用例

测试性能

事故相关信息管理功能

用例目的

测试系统操作者对器材租赁相关信息进行管理的功能是否正常

前提条件

登录系统进入相关管理页面

输入条件

预期输出

实际情况

进入器材租赁界面,点击“录入”按钮,填写所有必填项,点击提交

提示“录入成功”,并返回查询界面

一致

进入器材租赁界面,点击“录入”按钮,未填写一个或者多个必填项,点击提交

提示“录入失败”,请填写必填项

一致

进入器材租赁界面,选择要修改的一条数据,点击该条数据后面的“修改”按钮 

节目跳转至修改界面

一致

在修改界面,修改可修改项后,点击“提交”按钮

提示“修改成功”,并返回查询界面

一致

进入器材租赁界面,点击某条数据后面的删除按钮

提示“是否要删除该数据”,如果用户点击“确定”按钮,则成功删除该条数据,并提示“删除成功”,之后返回查询界面

一致

6.3测试结果

经过对此系统的测试,得出该系统足以满足用户日常需求,在功能项目和操作等方面也能满足操作员对于其他用户的管理。但是,还有很多功能有待添加,这个系统仅能满足大部分的需求,还需要对此系统的功能更进一步的完善,这样使用起来才能更加的完美。

第7章 总结与展望

通过校园体育运动场地及器材租凭系统的开发,本人巩固了之前学过的知识,如今将平时所学到的知识融合在设计中,在设计过程中,做了很多的准备,首先,在数据库系统的设计过程中,尤其是在数据库的工作原理、工作特点,对其深刻的讨论,与此同时,对于小型站点来说,最好服务器的选择,其次,利用所学的知识点分析所做的系统,并在此基础上设计。

目前本系统已经上线,正在试运行阶段,用户反馈良好,基本完成用户所需,试运行过程中没有出现阻断性问题,有一些不足和小问题也及时予以修正,系统上线后,为了保证数据的安全性,对系统进行了备份操作,系统备份是每两个月备份一次,数据库备份为每周备份一次,系统部署在校园体育运动场地及器材租凭系统  系统的云平台服务器中。

本次系统上线成功后,得到了用户的高度认可,但是在功能上和性能上还需做进一步的研究处理,使其有更高的性能和更好的用户体验。

系统在以后的升级过程中,需要解决一系列用户所提出的问题,例如打印过程中如何避免浏览器的兼容性问题,大量用户访问时,如何保持较高的响应速度,在系统今后的升级过程中将着重解决这些安全性问题。

参考文献

[1]王齐.基于中老年群体数字融入行为的银发经济蓝海探究——以微信小程序“小年糕+”为例[J].视听,2022(03):153-155.

[2]郭建梅.微信小程序让车辆登记不再“烦心”[J].班组天地,2022(02):55-56.

[3]李晓艳,蔺宝军.基于人机交互的语言训练中微信小程序开发设计[J].微型电脑应用,2022,38(02):123-126.

[4]陈信达,叶孟琦,刘祚先,林达华,吴舒怡,肖彬.基于微信小程序的医务随访系统开发[J].电脑编程技巧与维护,2022(02):53-55.

[5]刘在英,杨磊. 一种基于SpringBoot框架的企业进存销系统的设计方法[P]. 山东省:CN114003204A,2022-02-01.

[6]熊柏祥.基于Springboot和Vue框架的考试资源服务平台的设计与实现[J].信息与电脑(理论版),2022,34(01):97-99+103.

[7]霍福华,韩慧.基于SpringBoot微服务架构下前后端分离的MVVM模型[J].电子技术与软件工程,2022(01):73-76.

[8]曹明昊. 基于SpringBoot和Vue框架的邯郸市现代农业园区信息管理系统的研发[D].河北工程大学,2021.

[9]单树倩,任佳勋.基于SpringBoot和Vue框架的数据库原理网站设计与实现[J].电脑知识与技术,2021,17(30):40-41+50.

[10]苏文强,刘紫阳,苗玉恒.基于SpringBoot的缺陷管理系统设计与实现[J].大众科技,2021,23(10):4-6+10.

[11]王萍.SpringBoot项目中EhCache缓存技术的实现[J].电脑知识与技术,2021,17(29):79-81.

[12]周常志,甘恒.基于SpringBoot的智慧就业服务平台的设计与实现[J].电脑知识与技术,2021,17(28):182-184+187.

[13]齐善鲁,马徳俊,梁雪.基于SpringBoot的开放式软件开发案例教学平台设计[J].电脑知识与技术,2021,17(28):71-73.

[14]詹梦军,彭蕾,何杰,朱效,刘灵辉. Design and Implementation of the Platform of Helping Farmers to Buy Freely Based on WeChat Applet[J]. 计算机科学与应用,2021,11(07).

[15]Fuyuan Cheng. Talent Recruitment Management System for Small and Micro Enterprises Based on Springboot Framework[J]. Advances in Educational Technology and Psychology,2021,5(2).

[16]刘欣,李亮亮,牛聪. 基于Vue和SpringBoot框架的流域监管平台的研究和应用[C]//.第十一届防汛抗旱信息化论坛论文集.,2021:118-122.

[17]危炜. 基于SpringBoot和Vue框架的刹车片工厂流程再造系统的设计与实现[D].浙江理工大学,2021.

[18]Guanhong Chen,Jiangming Xu. Design and implementation of efficient Learning platform based on SpringBoot Framework[J]. Journal of Electronics and Information Science,2020,6(1).

thank you

With the completion of the design, the college career is coming to an end. The time in college is the time I cherish the most. I have learned a lot and grown a lot during the time in college. Every memory during this time is engraved in my mind. Thanks to the students who studied and grew up together, and the teachers who taught me during the growth process, I am very grateful for your company.

First of all, I would like to thank my instructor. The completion of the design is inseparable from a series of guidance from the teacher. During the completion of the graduation project, the teacher gave many pertinent suggestions. It is precisely because of the teacher's meticulous work attitude that my design can be successfully completed.

Finally, I would like to thank every teacher who taught me during my college career. You have taught me a wealth of knowledge and taught me how to deal with and solve problems when I encounter them. Thank you for your help and support.

Please pay attention to like + private message blogger, get the source code of the project for free

Guess you like

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