Graduation project based on springboot Xi'an cool running gym management system - with source code 345421

Design and Implementation of Xi'an Cool Pao Gym Management System

Summary

In the era of big data, data is growing explosively. In order to cater to the trend of the information age and the requirements of information security, it has become an irresistible trend to use the Internet to serve other industries and promote production. Under the requirements of gym management, develop a gym management system with an integral structure, and split the complex system to achieve rapid response to changes in demand, guarantee system stability, and ensure sustainable and large-scale development of the platform requirements.

This system adopts the object-oriented development mode for software development and hardware erection, which can well meet the needs of actual use, perfect the corresponding software erection and program coding work, and adopt MySQL as the main storage unit of background data , using the Spring boot framework, JSP technology, and Ajax technology to code and develop the business system, and realize all the functions of the system. Xi'an Cool Pao Gym Management System solves the waste of manpower, material resources and time brought about by traditional management methods and the limitation of communication depth, which makes the process of communication faster, more accurate and convenient, and at the same time completes the management system of Xi'an Cool Pao Gym Basic functions: user registration management, sports equipment management, locker rental management, fitness course management, private education course reservation cancellation management, group course reservation management.

Keywords: gym management; integral structure; Springboot framework; MySQL database

Design and implementation of Xi'an KUPAO gym management system

Abstract

In the era of big data, data is growing explosively. In order to meet the trend of the information age and the requirements of information security, using the Internet to serve other industries and promote production has become an irresistible trend. Under the requirements of gym management, a gym management system with integral structure is developed to split the complex system, which can realize rapid response to demand changes, guarantee system stability, and ensure the sustainable and large-scale development of the platform.

The system adopts the object-oriented development mode for software development and hardware erection, which can well meet the needs of actual use, improve the corresponding software erection and program coding, take MySQL as the main storage unit of background data, and use spring boot framework, JSP technology and Ajax technology for business system coding and development, All the functions of the system are realized. The gym management system solves the waste of human, material and time brought by the traditional management method and the limitation of communication depth, which makes the communication process faster, accurate and convenient. At the same time, it completes the basic functions of the gym management system: news data management, user registration management, message management, fitness course management, course reservation and group course reservation management.

Key words: gym management; Integral structure; Springboot framework; The MySQL database

Table of contents

Chapter 1 Introduction 1

1.1 Research background and significance 1

1.2 Development status 1

1.3 The structure of the thesis 2

Chapter 2 Introduction to Related Technologies 3

2.1 J2EE Technology 3

2.2 MySQL description 3

2.3 Spring boot framework 3

2.4 MVVM pattern 4

2.5 B/S structure 4

Chapter 3 System Analysis 5

3.1 Feasibility analysis 5

3.1.1 Economic feasibility5

3.1.2 Operational Feasibility 5

3.1.3 Demand Feasibility 6

3.2 Demand Analysis 6

3.3 System Business Process Analysis 10

3.4 System data flow analysis 10

Chapter 4 System Design 12

4.1 System Architecture Design 12

4.2 System function structure 13

4.3 Functional module design 13

4.4 Database Design 14

4.4.1 Conceptual model design 14

4.4.2 Logic structure design 15

4.4.3 Database Connection Design 17

Chapter 5 System Implementation 18

5.1 Implementation of login module 18

5.2 Implementation of User Subsystem Module 20

5.2.1 User Homepage Module 20

5.2.2 User registration module 22

5.2.4 Private education course selection module 29

5.3 Implementation of the supervisor subsystem module 31

5.3.1 Member user management module 31

5.3.2 Private education course management module 33

5.3.3 Personal education course reservation management module 34

5.3.4 Sports equipment management module 37

Chapter 6 System Testing 41

6.1 Test purpose 41

6.2 Test cases 41

6.2.1 Login test 41

6.2.2 Registration test 41

6.2.3 Message test 41

6.2.4 News and Information Management Test 42

6.2.5 Course Administration Test 42

6.2.6 Course Selection Test 42

6.3 Test results 42

Chapter 7 Summary and Outlook 44

Reference 45

Thanks 47

    • introduction

    • research background and meaning

If the gym management adopts a purely manual workflow, it will bring great inconvenience and unnecessary cost investment. If one of the steps goes wrong, it will cause a lot of trouble, thereby increasing the management cost. On the other hand, there are many fitness equipment and tools in the gym, which will consume a lot of manpower and material resources, resulting in a waste of resources, and the company's profits cannot be maximized. Without a complete management system, it is difficult to develop into a large gym. Thus, in view of the above situations, this system came into being. This system is designed for the business of the gym. Operators only need to input some simple Chinese characters and numbers to complete the operation and achieve their goals. It can realize the automation and intelligence of fitness, which is convenient and fast, saves time, greatly improves the efficiency of the gym, facilitates customers, and brings the maximum benefit to the enterprise. Therefore, the gym urgently needs such a management information system.

    • development status

After investigation, there are more than tens of thousands of gyms in my country, ranging from large to small. Relatively well-known gyms such as Zhongti Baili and Jade Bird have learned from foreign advanced gym management experience and advanced computer technology such as the use of the Internet. My own business has risen from a single platform for customers through the gym to customers who can enjoy professional news guidance and scientific fitness knowledge without leaving home, which is convenient for customers and has become a leader in the same industry. The success is not only due to scientific management but also to the convenience brought by the computer network. This is a model of using computer software and network technology to expand its business success, but how many domestic gyms use this mode of operation? In fact, there are not many. The management mode and business communication of most gyms are still in the traditional, low-efficiency employment management stage. The manual management mode has become increasingly unable to meet the needs of modern management. On the one hand, due to the large number of customers every day , the manual method will inevitably have loopholes in business and finance, which will bring unnecessary troubles to customers, and also bring various disadvantages to the operation of the gym; Headache”, as the scale of the gym continues to expand, the above problems will become more and more prominent, and will definitely become a stumbling block to the development of the gym. Regardless of the size, in order to survive and develop better, each gym must introduce advanced management software systems in the management mode, so as to improve and improve in member management, fitness information management, news management, course management, and event management. Effects and values ​​that cannot be achieved by manual methods.

The application of computer management in gym management is also a model in recent years as computers have been widely used in various industries. Gym management not only integrates the main parts of company development and management (members, projects, products, activities), but also represents advanced management ideas and management methods. As an important tool for modern gym management, it will gain more and more popularity in gyms in my country. Wide range of applications.

    • Thesis structure

Based on the information and data obtained from market research, combined with domestic and foreign frontier research, and using relevant system development and design methods, the management system of Xi'an Kupao Gym was finally designed.

There are seven chapters in this paper, as follows.

The first chapter summarizes the research purpose and significance of Xi'an Kupao Gym Management System; summarizes the research situation and future research trends in the field of warehousing at home and abroad, and finally gives the composition of the paper.

The second chapter gives a brief overview of the development techniques and tools used in this paper.

The third chapter briefly analyzes the needs and feasibility of each business process of the system.

The fourth chapter designs the management system of Xi'an Kupao Gym.

The fifth chapter implements the management system of Xi'an Cool Pao Gym, and posts screenshots of relevant pages, and describes the operation method of realizing specific functions in language.

The sixth chapter uses test cases to test some main functional modules of Xi'an Cool Pao Gym Management System, and finally draws the test results.

Chapter 7 summarizes the full text and makes an outlook on future research.

    • Related technology introduction

    • J2EE technology

People can master many foreign languages, but what a computer scientist is proficient in is mostly programming languages, which are not human natural languages, such as C language, Java, Perl and so on. Since the "middleware" developed by different companies is not standardized enough, Sun launched J2EE and used this standard to solve the ills. It provides a good mechanism, allowing each layer to allow the corresponding server and components to run, making the system stable and usable, efficient in development, and easy to maintain.

    • 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 [3].

MySQL is a very popular relational database management system, 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 of these powerful advantages. 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: In MySQL, users with different identities are set with different permissions 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 shows that MySQL can also support multiple data types.

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

    • 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.

    • MVVM pattern

The MVVM model is a commonly used development model, which is mainly divided into M layer, V layer and C layer in terms of code implementation.

View (View) represents the user interaction interface. A web application may have many interfaces. In the MVVM mode, the view only handles data collection, processing, and user requests, and does not include the processing of business processes and business processes. Handled by the Model.

Model (Model) is the processing of business processes/states and the formulation of business rules. The process of the model processing the business process cannot be seen by other layers. It is like a black box. After receiving the data requested by the view, it returns the final processing result. The main core of MVVM is the design of the business model. A typical application example is the popular EJB model. It further divides the model from the perspective of application technology implementation in order to make full use of existing components, but it cannot be used as a A framework for applying design models.

The controller (Controller) can be understood as receiving the user's request, and then the view and the model are matched together to complete the user's request together. It has a very obvious role in dividing the control layer, and can clearly tell you that it is a distributor, which model and view to choose, and what kind of request from the user can be completed. The control layer does not do all the data processing, for example: the user clicks a connection, after the control layer receives the request, it does not process the business information, it just transmits the user's information to the model, and tells the model what to do, and then chooses the one that meets the requirements The view is returned to the user.

    • B/S structure

B/S (Browser/Server) is a more convenient architecture than its predecessor architecture. It uses the Web server to complete the data transfer and exchange. You only need to download the browser as the client, then the work will achieve a "slimming" effect, and there is no need to consider the problem of non-stop installation of software.

    • system analysis

    • Feasibility Analysis

In the process of software development, systematic feasibility analysis is essential. Feasibility research is to evaluate whether the problem can be solved and to solve it with the least time and the least cost. The advantages and disadvantages of solutions to these problems must also be considered in order to achieve the above goals, as well as the economic benefits of developing these systems at scale. Here we can use technical feasibility, operational feasibility, and economic feasibility to conduct feasibility studies on our system. The feasibility analysis of Xi'an cool running gym management system is as follows:

    • economic feasibility

The Xi'an cool running gym management system runs in the environment of Springboot and MySQL, and the cost of the system is mainly distributed in the development and maintenance of the software. However, if the system is put into use, it will not only be convenient for people, but also save time and energy for users, and it will also greatly facilitate operators and reduce the workload of operators. The management system of Xi'an Cool Pao Gym is actually not too complicated. The economic expenditure is not large during development, and the time spent on developing the system is not much. The advantages of time and economic benefits far exceed maintenance and management. cost, so it is feasible and appropriate to develop this system.

    • operational feasibility

This system is a browser-based and server-based management system for Xi'an Coolpao Gym. After the system is developed, users only need to enter the correct URL address in the browser to access it. The front page of this system is simple and clear, and it can be operated without operation guidance. Whether it is a system administrator or an ordinary user, all operations on the page are completed in the browser, so as long as the computer is connected to the Internet Under the circumstances, it can be operated by opening the browser. Moreover, there is no need to perform relevant environment configuration before use, so the system is convenient, simple, and easy to use, so the system is easy and operable.

    • demand analysis

According to the user's demand for the system, the system is required to be simple to operate and able to manage information accurately and completely. After analyzing the requirements of the Xi'an Cool Pao Gym Management System, the whole system is mainly divided into two parts: administrators and ordinary users, and the branch functions under each module are different. Describe the function as follows:

Administrator module: user registration management, sports equipment management, private education course management, group buying course management, storage rental management.

User module: Fitness information browsing, locker rental, private education course reservation, team course reservation, course cancellation.

The user use case diagram is shown below.

Figure 3-1 User use case diagram

The administrator use case diagram is shown below.

Figure 3-2 Administrator use case diagram

According to the use case diagram, some important use cases are described.

The registration use cases are described in the table below.

Table 3-1 Registration use case description

use case name

register

participant

user

describe

The user fills in the relevant registration data to complete the registration and become a user of the system

Preconditions

none

postcondition

The user fills in the relevant registration data and the account to be registered does not exist in the system

event flow

  1. User clicks the register button

  1. User fills in relevant registration data

  1. User confirms and submits registration data

  1. The system prompts that the registration is successful

Supplementary Note

  1. The system detects that the registration data entered by the user does not meet the requirements, prompts and returns to the registration interface

  1. 系统检测用户所输账号不可用或已存在与系统中则提示并返回注册界面

登录用例描述如下表所示。

表3-1 登录用例描述

用例名称

登录

参与者

用户

描述

用户填写用户名和密码登录系统

前置条件

用户拥有账号和密码

后置条件

用户名和密码都正确

事件流

(1)用户在登录页面输入用户名和密码

(2)系统检测用户输入的用户名和密码是否正确

(3)用户名和密码正确的话,显示登录成功并返回主页面

补充说明

(a)系统检查除密码不正确,返回登录页面

个人信息管理用例描述如下表所示。

表3-1 个人信息管理用例描述

用例名称

管理和修改个人信息

参与者

用户

描述

用户查看、修改个人信息

前置条件

用户已登录到系统中

后置条件

事件流

(1)用户查看个人信息

(2)用户修改个人信息

补充说明

(a)用户可修改密码

(b)用户可修改个人资料,例如姓名,头像等

留言用例描述如下表所示。

表3-1 留言用例描述

用例名称

留言

参与者

用户

描述

用户发表留言

前置条件

用户已登录

后置条件

留言内容不违规

事件流

(1)在留言页输入留言数据,提交留言

(2)更新并显示留言板

补充说明

(a)留言内容不能为空

课程预约用例描述如下表所示。

表3-1 课程预约用例描述

用例名称

课程预约

参与者

用户

描述

用户执行课程预约操作

前置条件

用户已登录

后置条件

该课程存在,并且能被预约

事件流

(1)在课程页点击要预约的课程

(2)填写课程预约表单

补充说明

(a)课程预约表单数据不能为空

课程用例描述如下表所示。

表3-1 课程用例描述

用例名称

课程管理

参与者

用户

描述

用户提供新增、修改、删除、查阅等功能

前置条件

  1. 用户成功登录系统

  1. 用户只能对已存在的课程进行修改和删除

后置条件

事件流

(1)用户查看修改课程

(2)用户添加课程

(3)用户删除课程

补充说明

(a)新添加的课程不符合要求时会添加失败

(b)修改的课程不符合要求时会修改失败

    • 系统业务流程分析

西安酷跑健身房管理系统的业务流程如下图所示。

图3-3 系统业务流程图

管理员拥有最高权限,在对各项信息进行增加、删除、修改后会更新后台数据库的内容,用户在登录进行留言反馈、健身资讯浏览、课程预约、课程取消等指令动作同样会更新后台数据。

    • 系统数据流程分析

与强调控制逻辑的程序流程图不同,它更关心的是整个系统中数据的具体流动以及数据的加工处理的整个客观过程,是对数据规格的说明。也正因如此,系统数据流图作为系统结构化分析方法中极为重要的一种描述工具备受青睐。

瑜伽健身房管理系统的顶层数据流如下图所示。

图3-4系统顶层数据流图

系统顶层数据流:外部实体为用户,第一个流程为登录验证,用户信息表返回密码验证,是否正确,正确则登录系统,错误则反馈信息,登录系统后,根据不同用户的功能选择,来读写数据库。

系统底层数据流如下图所示。

图3-5系统底层数据流图

系统底层数据流:外部实体为管理员和普通用户,数据流分别有管理员和普通用户流向系统数据流程,数据表提供数据支持,来完成逻辑操作。

    • 系统设计

    • 系统架构设计

由于本系统在逻辑事务处理方面对数据库的操作比较频繁所以系统在底层连接数据库时并没有使用原生的JDBC,而是把JDBC进行了封装,封装之后相当于一个连接数据库的工具DB UTIL,这样使用起来会更加方便而且这样进行封装还可以降低系统中代码的冗余,当我们需要连接和使用数据库时只需要调用这个工具里面的一个方法就可以了。而且通过封装可以把对数据库的操作独立起来,当需要连接不同种类的数据库时只需要加以修改就可以达到目的。

系统架构如下图所示。

图4-1系统架构图

    • 系统功能结构

进入系统后首先要进行登录,验证你的身份,赋予你不同的权限。当你成功登录后,页面会有多个板块,分别是健身课程管理、用户注册管理、运动器材管理、课程预约管理、课程取消管理、寄存柜租赁管理。里面界面简单易懂,根据标示可以直接进行方便快捷的操作。

系统功能结构图如下所示。

图4-2系统功能结构图

    • 功能模块设计

管理员账户的基本信息管理。主要提供管理员账户的基本信息录入、删除、维护和查询等功能,包括:

管理员录入管理员账户基本信息;

管理员更新、增加及删除管理员账户基本信息;

用户根据管理员账户 ID 查询基本信息;

系统管理员更改个人密码;

留言的基本信息管理。主要提供留言的基本信息录入、修改和查询功能,包括:

用户录入留言基本信息;

管理员更新、增加及删除留言基本信息;

课程预约的基本信息管理。主要是提供课程预约的基本信息录入、维护和查询功能,包括:

用户录入课程预约基本信息;

用户更新、增加及删除课程预约基本信息;

用户根据课程预约 ID 查询课程预约基本信息;

课程的基本信息管理。主要提供课程的基本信息录入、删除、维护和查询功能,包括:

管理员录入课程信息;

管理员更新、增加课程基本信息;

管理员根据课程 ID 查询课程基本信息;

用户根据个人信息导航栏查询课程信息;

    • 数据库设计

一个好的系统它的后台数据库一定要考虑的全面,这和我们建造房子一个概念,房子不是随心所欲建起来的,一切都是在合理设计的基础是实现的,地基打牢固了房子才能建的更高。数据库如果设计的很合理,而且每个方面都能考虑到了那么这个系统才能不会出现大的问题。

    • 概念模型设计

本系统在数据库中存放了多张表,分别是用户表、课程预约表、留言表、课程取消表、寄存柜租赁表、器材出借表。

系统的主要实体间关系E-R图如下图所示。

图4-7系统E-R图

    • 逻辑结构设计

此环节把概念转变成数据。由于整个数据库所处理的信息过多,就只展示几个表。

group表:

名称

类型

长度

不是null

主键

注释

group_id

mediumint

8

用户组ID

display

smallint

4

显示顺序

name

varchar

16

名称

description

varchar

255

描述

source_table

varchar

255

来源表:

source_field

varchar

255

来源字段:

source_id

int

10

来源ID:

register

smallint

1

注册位置:

create_time

timestamp

0

创建时间:

update_time

timestamp

0

更新时间:

membership_card表:

名称

类型

长度

不是null

主键

注释

membership_card_id

int

11

会员卡ID

membership_card_number

varchar

64

会员卡编号

member_name

varchar

64

会员姓名

card_charging_time

date

0

充卡时间

term_of_validity

varchar

64

有效期

member_account

int

11

会员账号

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

sports_equipment表:

名称

类型

长度

不是null

主键

注释

sports_equipment_id

int

11

运动器材ID

number

varchar

64

编号

equipment_name

varchar

64

器材名称

purchase_time

date

0

购买时间

condition

varchar

64

成色

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

private_education_courses表:

名称

类型

长度

不是null

主键

注释

private_education_courses_id

int

11

私教课程ID

course_number

varchar

64

课程编号

title

varchar

64

标题

content

text

0

内容

cover

varchar

255

封面

coach_job_number

int

11

教练工号

remarks

varchar

64

备注

hits

int

11

点击数

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

private_course_reservation表:

名称

类型

长度

不是null

主键

注释

private_course_reservation_id

int

11

私教课程预约ID

course_number

varchar

64

课程编号

coach_job_number

int

11

教练工号

time_of_appointment

datetime

0

预约时间

title

varchar

64

标题

appointment_person

int

11

预约人

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

locker_rental表:

名称

类型

长度

不是null

主键

注释

locker_rental_id

int

11

寄存柜租赁ID

cabinet_number

varchar

64

柜号

position

varchar

64

位置

lease_time

datetime

0

租赁时间

member_account

int

11

会员账号

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

cancellation_of_private_education_courses表:

名称

类型

长度

不是null

主键

注释

cancellation_of_private_education_courses_id

int

11

私教课程取消ID

course_number

varchar

64

课程编号

title

varchar

64

标题

coach_job_number

int

11

教练工号

cancellation_reason

text

0

取消原因

canceller

int

11

取消人

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

    • 系统实现

    • 登录模块的实现

该登录模块利用js进行设计,JavaScript函数CheckSubmit()对输入框是否为空进行验证,使用js的技术结合MySQL 2012数据库的查询语句进行登录信息的验证。首先从文本框中分别获得账号user_name和密码user_pw,使用Sql语句“select * from t_user where user_name=‘”+user_name+“’ and user_pw=‘”+user_pw+“’”将查询结果赋给rs结果集,若rs.next()返回值为空,表示数据库找不到该用户数据,若rs.next()返回值不为空,则显示登录成功,进入主界面。

用户登录流程图如下所示。

图5-1用户登录流程

用户登录流程:用户只有输入正确的用户名和密码才会成功进入系统,用户输入用户名密码后点击登录按钮,系统会进行校验该用户名是否存在,如果用户名与密码不匹配或者用户名不存在,则返回主界面。

系统登录界面如下图所示。

图5-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,"用户不存在");

}

    • 用户子系统模块的实现

    • 用户首页模块

在浏览器的地址栏里输入http://localhost:8080/index.jsp 地址,就可以跳转到瑜伽健身房管理系统的首页,首页是由4个页面组成的,包括top、left、down和center等页面,这里也是浏览者访问系统的入口,通过@ include引入。

首页载入流程图如下所示。

图5-3首页载入流程

首页载入流程:系统先连接数据库,显示界面参数初始化,读取数据库的数据表,读取html显示模板,对数据按添加时间排序,按照模板设计位置显示数据,刷新显示界面,断开数据库连接。

首页如下图所示。

图5-4首页界面

其中载入首页的主要代码如下。

@RequestMapping("/get_obj")

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

Query select = service.select(service.readQuery(request), service.readConfig(request));

List resultList = select.getResultList();

if (resultList.size() > 0) {

JSONObject jsonObject = new JSONObject();

jsonObject.put("obj",resultList.get(0));

return success(jsonObject);

} else {

return success(null);

}

}

public Query select(Map<String,String> query,Map<String,String> config){

StringBuffer sql = new StringBuffer("select ");

sql.append(config.get(FindConfig.FIELD) == null || "".equals(config.get(FindConfig.FIELD)) ? "*" : config.get(FindConfig.FIELD)).append(" ");

sql.append("from ").append("`").append(table).append("`").append(toWhereSql(query, "0".equals(config.get(FindConfig.LIKE))));

if (config.get(FindConfig.GROUP_BY) != null && !"".equals(config.get(FindConfig.GROUP_BY))){

sql.append("group by ").append(config.get(FindConfig.GROUP_BY)).append(" ");

}

if (config.get(FindConfig.ORDER_BY) != null && !"".equals(config.get(FindConfig.ORDER_BY))){

sql.append("order by ").append(config.get(FindConfig.ORDER_BY)).append(" ");

}

if (config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE))){

int page = config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE)) ? Integer.parseInt(config.get(FindConfig.PAGE)) : 1;

int limit = config.get(FindConfig.SIZE) != null && !"".equals(config.get(FindConfig.SIZE)) ? Integer.parseInt(config.get(FindConfig.SIZE)) : 10;

sql.append(" limit ").append( (page-1)*limit ).append(" , ").append(limit);

}

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

return runEntitySql(sql.toString());

}

    • 用户注册模块

系统的用户通过自行注册生成,在系统首页点击用户注册菜单,系统跳转到对应的注册页面。点击重置按钮,清空所填数据,点击注册按钮完成注册。

用户注册流程图如下所示。

图5-5用户注册流程

注册个人信息实现流程为:填写个人信息,系统使用JQuery选择器获取在网页中输入的注册信息,再对联系方式、登录密码等信息进行验证,验证通过后用Ajax异步请求方式向服务器发送请求并把数据传送到后台,然后验证用户名是否已存在,如果已存在则注册失败提示“用户名已存在”;如果用户表中没有该用户名则把用户信息加入数据库,把操作状态以json字符串方式返回到前台。Ajax请求成功接收到返回的数据时会触发成功回调函数,然后解析返回的json字符串,系统根据返回信息弹出提示框,注册成功后返回登录页。

用户注册界面如下图所示。

图5-6用户注册界面

用户注册页面的逻辑代码如下。

/**

* 注册

* @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传参,找到该课程,在add.jsp提交私教课表单,生成私教课记录。

私教课程选课流程如下图所示。

图5-7私教课程选课流程

私教课程选课界面如下图所示。

图5-8私教课程选课界面

私教课程选课的主要逻辑代码:

@RequestMapping(value = {"/avg_group", "/avg"})

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

Query count = service.avg(service.readQuery(request), service.readConfig(request));

return success(count.getResultList());

}

    • 管理员子系统模块的实现

    • 会员用户管理模块

管理员对会员用户的管理,在yhzhgl.jsp实现管理员用户的管理,包括录入、删除、修改,修改密码通过SESSION获取会员用户名,然后输入新密码,提交到mod.jsp中,使用sql命令更新密码。

会员用户管理的界面如下图所示。

图5-9会员用户管理界面

    • 私教课程管理模块

用户在系统前台后,数据库的私教课程表生成私教课记录信息,管理员在xuankejilu_list.jsp录入,进行管理。

选课管理如下图所示。

图5-10私教课程管理界面

私教课程主要逻辑代码如下所示。

@RestController

@RequestMapping("auth")

public class AuthController extends BaseController<Auth, AuthService> {

/**

* 服务对象

*/

@Autowired

public AuthController(AuthService service) {

setService(service);

}

}

    • 私教课程预约管理模块

管理员在kechengxinxi_add.jsp发布私教课程,跳转至私教课程添加表单,提交私教课程预约,包括课程编号、课程名称、预约时间、标题、等,课程提交后,数据库的私教课程信息表刷新数据,系统将预约的私教课程信息展示出来。

私教课程预约的界面如所示。

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

}

    • 运动器材管理模块

运动器材管理包括新增运动器材、删除运动器材、运动器材查询新闻等,以运动器材新增为例,在视图层请求器材新增,反馈后,调用业务逻辑层,通过业务逻辑层的接口调用底层的数据逻辑层完成数据库联动操作。

运动器材管理的流程如所示。

图5-12运动器材管理流程

运动器材添加的界面如所示。

图5-13新闻添加界面

运动器材管理的界面如所示。

图5-14运动器材管理界面

运动器材添加的逻辑代码如下。

@RequestMapping("/get_list")

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

Map<String, Object> map = service.selectToPage(service.readQuery(request), service.readConfig(request));

return success(map);

}

    • 系统测试

    • 测试目的

在这个产品被投入使用前,首先需要进行试用,这是重要的环节。考虑到某个部分的开发没有缺陷情况下,把各种模块拼接,也有一定概率就存在矛盾。这就好比每个人都很独特,但聚在一起就显得杂乱无章,需要保证有默契的配合。对于测试,要看它的各项内容是否契合的原则。若与最初定下的标准有一定程度上的出入,那么就需要做出一些调整,让最终的大方向朝着目标前进。

    • 测试用例

    • 登录测试

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

表6-1登录测试用例

输入

输出

用户名

密码

用户名或密码不能为空

蔡徐坤

123

用户名不能为汉字,请重新输入

789

789

用户名或密码错误

678

123456

登录成功

    • 注册测试

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

表6-2注册测试用例

输入

输出

用户名

密码

确认密码

邮箱

请输入完整

001

001

001

[email protected]

注册成功

002

002

003

[email protected]

注册失败,两次密码不一致

003

003

003

003.com

注册失败,邮箱格式不正确

    • 留言测试

留言测试用例如下表所示。

表6-3留言测试用例

功能

测试数据

预期结果

测试结果

留言反馈

留言内容:鸡你太美

在留言列表中显示留言内容,留言显示为未回复

和预期一致

回复留言

留言回复内容:鸡你太美啊

留言列表中的留言“鸡你太美”显示已回复

和预期一致

删除留言

删除留言“鸡你太美”

留言成功删除

和预期一致

    • 健身资讯管理测试

健身资讯测试用例如下表所示。

表6-4添加健身资讯测试用例

输入

输出

标题

类别

内容

备注

添加失败

健身资讯1

A

1

添加成功

A

1

添加失败,标题不能为空

健身资讯2

1

添加失败,请选择类别

    • 课程管理测试

课程测试用例如下表所示。

表6-4添加课程测试用例

输入

输出

名称

类别

价格

备注

添加失败

课程1

A

100

添加成功

A

100

添加失败,名称不能为空

课程2

100

添加失败,请选择类别

    • 课程预约测试

课程预约测试用例如下表所示。

表6-5课程预约测试用例

输入

输出

名称

类别

价格

选课人

添加失败

课程1

A

100

001

添加成功

A

100

001

添加失败,名称不能为空

课程2

100

001

添加失败,请选择类别

    • 测试结果

经过测试,得到测试结果如下表所示。

表6-6测试结果

测试项目

内容和目的

测试结果

用户登录

输入正确用户名与密码

可以登录

输入错误用户名与密码

提示错误的信息

课程管理(添加,修改,删除)

输入正确信息

成功完成

输入错误信息

操作失败

修改登录密码

修改新的密码

成功完成

用户管理(添加,修改,删除)

输入正确信息

成功完成

输入错误信息

操作失败

评论管理(添加,修改,删除)

输入正确信息

成功完成

输入错误信息

操作失败

留言管理(添加,修改,删除)

输入正确信息

成功完成

输入错误信息

操作失败

选课管理(添加,修改,删除)

输入正确信息

成功完成

输入错误信息

操作失败

    • 总结与展望

本次毕业论文的主要是开发一个安全可靠,操作简易,同时具备业务可扩展的西安酷跑健身房管理系统。本文详细的论述了健身房管理系统的设计和开发,本系统的所有事务逻辑都是按照系统的需求分析进行设计的,系统有普通用户和系统管理员两种角色,系统大大增加了客户的体验程度,由于是对局部进行操作那么就减少了一些繁琐而又不必要的操作,减轻了服务器对页面解析的负担。

与其他系统相比,本系统有自身的优点,

例如:

(1)创新性强;

(2)业务逻辑性强,安全性高,在一些重要的功能模块需要通过审查之后才可使用;

(3)移植性高,在所有Window平台都可使用。

当然也还有很多需要进一步改进的地方:

(1)系统大多数页面都是全局刷新,缺乏局部刷新,这将增加服务器的压力,如果有大量用户在同一时间段操作同一个功能模块,可能会导致查询缓慢;

(2)页面没有经过专业的UI设计,美观程度不及其他市场其他网站系统,有待改善。

参考文献

[1]贾先文,李周.北美五大湖JSP管理模式及对我国河湖流域管理的启示[J].环境保护,2020,48(10):70-74.

[1]时艺玮,赵琪,周爱平.物联网在健身房应用的案例分析[J].电子技术,2021,50(01):72-73.

[2]葛丽萍. 基于移动互联网的健身房综合管理系统的研究与实现[D].南京邮电大学,2020.DOI:10.27251/d.cnki.gnjdc.2020.000903.

[3]张海威,田力天.互联网思维下的健身行业发展策略研究[J].当代体育科技,2020,10(33):198-200.DOI:10.16655/j.cnki.2095-2813.2002-5797-7474.

[4]白志刚. “互联网+”背景下坚蛋运动智能健身房的发展战略研究[D].天津大学,2020.

[5]郑丽鑫,赵菀琳,钟汇丰,黄子聪,彭志豪.大数据背景下基于VR技术的共享健身模式体系构建[J].电子元器件与信息技术,2020,4(01):83-84.DOI:10.19772/j.cnki.2096-4455.2020.1.035.

[6]甄莉. “互联网+”时代智能健身房商业模式研究[D].北京体育大学,2019.DOI:10.26961/d.cnki.gbjtu.2019.000012.

[7]Doo Han Kim. Management Strategy in Prediction of Quality Change based on Performance-Oriented Content for Taekwondo Gym[J]. Innovative Surgical Sciences,2019,37(1):

[8]罗超.基于java的健身房管理系统关键技术研究[J].信息记录材料,2019,20(08):159-160.DOI:10.16009/j.cnki.cn13-1295/tq.2019.08.105.

[9]刘小豫,朱亚兵,聂维.健身房管理系统平台的开发[J].内蒙古科技与经济,2019(11):71+73.

[10]马村. 服务设计视域下健身房系统设计研究[D].中南林业科技大学,2019.

[11]郑宇轩. 健身房服务流程体验设计[D].山东建筑大学,2019.

[12]熊雷.健身房管理系统的分析与设计[J].信息与电脑(理论版),2019(01):113-114.

[13]孙海君,许家铭,赵凯.互联网时代下智能共享健身房的新型模式思考与探析[J].现代营销(创富信息版),2018(12):76.

[14]马英瑞,刘真,李娟.基于JavaWeb的健身管理系统设计与实现[J].福建电脑,2018,34(09):39-40+44.DOI:10.16707/j.cnki.fjpc.2018.09.018.

[15] Approach Generates $1.5 Million for Complete Gym Management System[J]. Wireless News,2021:

致谢

经过几个月时间的努力终于完成了这篇文章,在文章的写作与研究的过程中遇到了很多困难,都在同学和老师的帮助下解决了。尤其非常感谢我最敬爱的老师,他对我进行了无私的指导和帮助,不厌其烦的帮助进行文章的修改。老师严谨的治学态度、渊博的学术知识、诲人不倦的敬业精神以及宽容的待人风范使我获益颇丰。此外,在校图书馆查找资料的时候,图书馆的老师也给我提供了很多方面的支持与帮助。在此,向帮助和指导过我的老师表示最衷心的感谢!感谢这篇文章所涉及到的各位学者。本文引用了数位学者的文献,如果没有各位学者的研究成果的帮助和启发,我将很难完成本篇文章的写作。感谢我的同学、朋友以及所在单位的同事,在我写文章的过程中给与了我很多素材和帮助,还在文章的撰写和排版过程中提供热情的帮助。同时,感谢我的室友对我的热心指导和帮助,经常有不懂之处都是大家在帮助我,才使得我比较顺利的完成了这篇文章。由于我水平有限,所写文章难免有不足之处,恳请各位老师和学友批评和指正!

点赞+收藏+关注 → 私信领取本源代码、数据库

Guess you like

Origin blog.csdn.net/DZBS2000/article/details/128870487