ssm travel website management system
Summary
In the information society, there is a need for targeted ways to obtain information, but the expansion of the ways is basically the direction that people strive for. Due to deviations in the perspective, people can often obtain different types of information, which is also the most difficult to overcome with technology. subject. In view of problems such as tourism websites, we conduct research and analysis on tourism websites, and then develop and design a tourism website management system to solve the problems.
The main functional modules of the tourism website management system include homepage, website management (carousel pictures, announcement information) personnel management (administrators, system users) content management (communication forum, forum classification, tourism culture, cultural classification) module management (attraction information, Ticket purchase information, travel routes, hotel information, type management, reservation information, customer service consultation), adopting an object-oriented development model for software development and hardware installation, which can well meet the needs of actual use and improve the corresponding For the software construction and program coding work, Mysql is used as the main storage unit of background data, and the SSM framework, Java technology, and Ajax technology are used to code and develop the business system, realizing all the functions of this system. This report first analyzes the background, role, and significance of the research, laying the foundation for the rationality of the research work. Analyzing the various needs and technical issues of the tourism website management system, proving the necessity and technical feasibility of the system, and then giving a basic introduction to the technical software and design ideas that need to be used in the design system, and finally realizing the tourism website management System and deployment operations use it.
Keywords: travel website; ssm framework; Mysql database
SSM Tourism Website Management System
Abstract
In the information society, there is a need for targeted information acquisition channels, but the expansion of channels is basically the direction of people's efforts. Due to the deviation in perspective, people often can obtain different types of information, which is also the most difficult topic for technology to overcome. Research and analyze tourism websites and other issues, and then develop and design a tourism website management system to solve the problem.
The main functional modules of the tourism website management system include homepage, website management (rotation map, announcement information), personnel management (administrator, system user), content management (exchange forum, forum classification, tourism culture, cultural classification), module management (scenic spot information, ticketing information, tourism routes, hotel information, type management, reservation information, and consulting customer service), Adopting an object-oriented development model for software development and hardware installation can effectively meet practical usage needs, improve the corresponding software installation and program coding work, adopt MySQL as the main storage unit for backend data, and use SSM framework, Java technology, and Ajax technology for business system coding and development, achieving all functions of this system. This report first analyzes the background, role, and significance of the research, laying the foundation for the rationality of the research work. Analyze the various requirements and technical issues of the tourism website management system, prove the necessity and technical feasibility of the system, and then provide a basic introduction to the technical software and design ideas required for designing the system. Finally, implement the tourism website management system and deploy it for operation.
Keywords: tourism websites; SSM framework; MySQL database
Table of contents
1.1 Research background and significance
Chapter 2 Introduction to Related Technologies
2.1 Development technical description
2.2 Java language and JDK development environment
2.3 Working principle of B/S system
2.4 Introduction to MVVM pattern
3.2 Functional requirements analysis
3.2.2 Backstage administrator function
3.3 Non-functional requirements analysis
3.4 Security requirements analysis
4.1 System architecture design
4.4.1 Data requirements analysis
4.4.2 Database conceptual design
Chapter 5 System Implementation
5.1 Implementation of database access layer
5.2 Implementation of registration module
5.3 Implementation of login module
5.4 Implementation of user data modification module
5.5 Implementation of announcement information management module
5.6 Implementation of hotel booking module
5.7 Implementation of attraction ticket purchase management module
The current amount of information in the tourism industry is very large, and the tourism system needs to process a large amount of information in normal operations. Therefore, it is necessary to manage tourism-related information, keep abreast of changes in various information, and make timely adjustments to changes to improve management efficiency and resource utilization. However, the existing tourist attraction service websites have poor timeliness, incomplete tourism-related information, and poor scalability.
Improve the timeliness and scalability of tourist attraction service websites and ensure that the system can operate in a long-term, safe, stable, reliable and efficient manner. Realize the standardization, systematization and automation of tourism information management work, improve the efficiency of management information, maximize resource utilization, maximize profits, and reduce the workload of tourism staff. Therefore, it is very necessary to develop a system with more complete functions and stronger capabilities.
With the improvement of economic level, domestic tourism has developed rapidly, but relatively speaking, the degree of development of domestic tourism cannot fully meet the needs of economic development and the improvement of people's living standards. Therefore, the status and role of domestic tourism in the national economy are of great importance.
However, the domestic tourism industry management lags behind, has a weak foundation, poor corporate efficiency, and low informatization. The management methods of the tourism administrative department are somewhat backward, lack of information management, and a series of problems such as unsmooth information communication channels. In the face of challenges and setbacks, the domestic tourism industry must change old concepts, be brave in innovation, break traditional concepts, and provide various resources. This will bring a new scene to the entire industry. At the same time, we must strengthen the construction of tourism informatization, continuously improve the management capabilities and work efficiency of management departments at all levels, simplify work procedures, reduce work costs, speed up the dissemination of information, do more publicity, and improve the authenticity of information; another On the one hand, the tourism industry is developed to meet the needs of tourists, improve the quality of tourism services, reduce costs, and transform the traditional business model of tourism enterprises. In doing so, it not only improves the quality of the entire tourism industry, but also enhances the informatization of the tourism industry and optimizes the structure of the industry. and resources. This will in turn drive the development of many industries, increase employment opportunities, and play a positive role in promoting economic development.
So far, tourists are the main customers of the domestic tourism industry. Some domestic tourism departments are still improving their informatization content and work. In this context, these departments will promote local customs and customs by establishing tourist attraction service websites. , Only in this way can we have certain competitiveness with other industries.
First, through engine search or relevant literature, we learned about the background of the system development and the significance of designing the system, and collected user demand information. Secondly, in terms of development tools, it was finally decided to use the Java platform to design and develop this system, with Mysql as the tool for designing the database. That is, Java language is used to implement the user interface and is connected with the database to achieve complete communication functions. After that, the general functional modules of the system are designed. It is mainly analyzed from the perspective of convenience for system users and system administrators to clarify the functions that the system should have. The final step is to test the system, discover existing problems and find solutions through use case testing. Utilize the existing development platform, combine the knowledge you have learned, and complete the design with the guidance of the teacher to ensure the usability and practicality of the system.
The front-end part of this system is developed based on the MVVM model, using B/S mode, and the back-end part is developed based on Java's ssm framework.
Front-end part: The front-end framework uses the popular progressive JavaScript framework Vue.js. Use Vue-Router and Vuex to realize dynamic routing and global state management, Ajax to realize front-end and back-end communication, Element UI component library to quickly prototype the page, and the project front-end to achieve responsiveness through grid layout, which can be adapted to PC, tablet, mobile phone, etc. Perfect layout display for different screen sizes.
Back-end part: Use ssm as the development framework, and integrate MyBatis, Redis and other related technologies.
Java is a programming language launched by Sun Corporation in the United States. It can be applied on multiple platforms and has good compatibility. In turn, it is widely used in data centers, personal PCs, technology supercomputers and other platforms with its own advantages. It has Currently the largest professional community of developers[3].
JDK is a brand new product launched by the American Sun Company for Java developers. Without JDK, the installed Java program will not be able to run [4].
The B/S architecture adopts the working mode of browser request and server response.
Users can access text, data, pictures, animations, video on demand, sounds and other information generated by Web servers on the Internet through a browser;
Each Web server can be connected to the database server in various ways, and a large amount of data is actually stored in the database server;
Download the program from the Web server to the local for execution. If you encounter instructions related to the database during the download process, the Web server will hand it over to the database server for interpretation and execution, and return it to the Web server, and the Web server will return it to the user. In this structure, many networks are connected together to form a huge network, that is, the global network. Each enterprise can build its own Internet based on this structure.
In the B/S mode, the user requests access through the browser to many servers distributed on the network. The browser's request is processed by the server, and the processing results and corresponding information are returned to the browser. Other data All processing and requests are completed by the Web Server. Through this framework structure and the browser embedded inside the operating system, this structure has become the mainstream structure pattern of today's software applications.
MVVM is the abbreviation of Model-View-ViewModel. It is essentially an improved version of MVC. MVVM abstracts the state and behavior of the View, allowing us to separate the view UI and business logic. Of course, ViewModel has already done these things for us. It can take out the data of the Model and help handle the business logic involved in the View due to the need to display content. Microsoft's WPF brings new technical experiences, such as Silverlight, audio , video , 3D , animation ..., which results in the software UI layer being more detailed and customizable. At the same time, at the technical level, WPF also brings new features such as Binding, Dependency Property, Routed Events, Command, DataTemplate, ControlTemplate and so on. The origin of the MVVM (Model-View-ViewModel) framework is a new architectural framework that evolved from the application method of combining the MVP (Model-View-Presenter) pattern with WPF . It is based on the original MVP framework and incorporates the new features of WPF to cope with increasingly complex changes in customer needs.
After many updates, Mysql has become very rich and complete in terms of functionality. It has undergone relatively large updates from version 4 to version 5, and has achieved good practical application results in actual commercial use. The latest version of Mysql supports information compression and encryption, which can better meet the needs for information security. At the same time, after multiple updates of the system, the mirroring function of the database itself has also been greatly enhanced, the smoothness of operation and ease of use have been greatly improved, and the use and creation of drivers have become more efficient and faster. The biggest change is the optimization of the display of spatial information, which makes it easier to label and calculate coordinates on application maps. The powerful backup function also ensures that users will feel more at ease during use. At the same time, the supported Office features also support users’ self-installation and use. The display form of information has also been greatly updated. Two very commonly used display areas have been added. One is the information area, where tables and texts have been classified, and the interface display is more refreshing and specific. The second is the information control of the instrument, which can display information in the instrument information area and compare multiple pieces of information at the same time, which brings great convenience to users' actual use [7][8].
In the actual implementation process of the tourism website management system designed in this article, the main reason for finally choosing the Mysql database is that there will be a large number of database operations during the application and development process of the enterprise's application system, and the security of the data The requirements are also very high. Based on these factors, Mysql, which has a relatively high security factor, was finally selected to store the background data of the travel website management system [9][10].
In terms of technology, the current mainstream SSM framework is used to build the main framework of the system. The popular progressive JavaScript framework Vue.js is used at the front desk to realize the design and aesthetic adjustment of the front desk page. The above technologies are all systematically studied by me, and all It has been practiced in course design and can make development more convenient and systematic. From a technical perspective, this system is completely achievable.
In terms of practicality, the main tasks of this design are the home page, website management (carousel images, announcement information), personnel management (administrators, system users), and content management (exchange forums, forum classifications, tourism culture, etc.) within the tourism website management system. Cultural classification) module management (attraction information, ticket purchase information, travel routes, hotel information, type management, reservation information, customer service consultation), etc., in line with the development of the current trend. From the user's perspective, we also consider system operating costs and human resources, and use convenient methods on the Internet to implement online business, making the business process more systematic, more user-friendly, and more practical.
In terms of economy, the main purpose of the tourism website management system designed in this project is to provide information query management and retrieval services more conveniently and quickly, that is, information software that can be directly put into use. The main cost of the system is mainly concentrated on the subsequent maintenance and management update of usage data. However, once the system is put into actual operation and use, it can greatly improve the efficiency of information query and retrieval. At the same time, it is also necessary to effectively ensure the security of the queryer's information. At the same time, the practical application brought by this tourism website management system The value of this aspect far exceeds the cost of developing and maintaining the actual system. Therefore, it is economically feasible to develop this software.
The functions of the tourism website management system are mainly divided into front-end users registering and logging in according to their own needs, browsing hotel information and making reservations for selected hotels. The administrator mainly handles registered users, announcement information, attraction details, hotel details, and hotel orders.
The system use case diagram is shown below.
Figure 3-1 System use case diagram
Front-end users can be divided into unregistered user needs and registered user needs.
The functions for unregistered users are as follows:
Register an account: The user fills in personal information and verifies the mobile phone number.
Browse announcement information: Users can browse the announcement information on the main page to learn about the latest announcement information of the system.
Browse attractions: Users can browse attraction information based on attraction type and select an attraction to view details, such as attraction name, attraction type, contact number, ticket price, address, star rating, opening hours, photos, etc.
Browse hotels: Users can browse hotel information according to hotel type, and select a hotel to view details, such as hotel name, pictures, address, contact number, room type, price, etc.
Browse review information: Select an attraction to view reviews from its users.
The functions for registered users are as follows:
Login: Log in based on your account and password.
Maintaining personal information: Users can modify their registration information at any time due to changes in personal information.
Comments: Users can comment on related attractions based on their own opinions.
Hotel reservation: Users select a hotel to make reservations based on their own needs.
Personal hotel booking history: Users can view their past booking data.
Administrator functions are as follows:
Change password: Administrators can change their login password to enter the system at any time to ensure system security.
Process the ticket purchase information of attractions: handle the review of ticket purchase orders, etc.
Manage ordinary administrators: Manage ordinary administrators. Ordinary administrators can be added or removed when transferring relevant staff.
Attraction information management: maintain attraction information, add, delete, and modify information.
Hotel information management: Maintain hotel information, add, delete, and modify information.
Process hotel reservation information: handle reservation review, etc.
Announcement information management: publish and delete relevant announcement information.
Comment information management: You can view user comments and learn about user-initiated suggestions in a timely manner.
First of all, the main consideration is whether the system functional software can better meet the basic functional needs of various users in the specific design process. If it cannot better meet the user needs, then the existence of this system is of no value. The non-functional analysis of software systems is carried out from seven aspects: one is performance analysis, which is aimed at the system; one is security analysis, which is aimed at the system; one is integrity analysis, which is aimed at the system; one is maintainability analysis, which is aimed at the system; One is scalability analysis, targeting the system, and the other is performance analysis to adapt to the business. After a comprehensive comparison and analysis of the seven aspects of performance, security, expansion, and integrity of the tourism website management system, it was found that corresponding non-functional requirements analysis is needed.
Security is very important for every system. A system with good security can protect corporate information and user information from being stolen. Improving system security is not only responsible for users, but also for enterprises. Especially for tourism website management systems, good security must be provided to protect the entire system.
The system has permission control for users, and restricts users' permissions based on different roles to ensure the security of the system.
The data in the database is input from the outside world. When the data is input, due to various reasons, the input data will be invalid or dirty data. Therefore, how to ensure that the input data complies with regulations has become the primary concern of database systems, especially multi-user relational database systems.
Therefore, when writing to the database, data integrity, correctness and consistency must be ensured.
After analyzing the data flow of the system, the users of the system are divided into two categories: general users and administrators. The system mainly handles interface information transmission, login information verification, registration information reception, and responses to various user operations.
The top-level data flow diagram of the system is shown in the figure below.
Figure 3-2 Top-level data flow diagram
To determine the identity of the user, it is judged based on the login data and then jumps to the corresponding functional interface. Users within the system can operate the data, and the database center can receive the effective data stream transmitted by the system to perform corresponding operations on the data SQL statements.
The underlying data flow diagram of the system is shown in the figure below.
Figure 3-3 Underlying data flow diagram
The system can be divided into two parts: the frontend and the backend. After each operation, the system returns the operation results. The data connection between the front-end and the back-end is mainly through the database, which means different operations are performed on the database respectively.
The architectural design of this tourism website management system is mainly divided into three layers, mainly including Web layer, business layer and Model layer. The web layer also includes the View layer and the Controller layer, and the Model layer includes the metadata extension layer and the data access layer.
The system architecture is shown in the figure below.
Figure 4-1 System architecture
The tourism website management system is generally divided into a front-end user module and a back-end administrator module.
The two modules appear to exist independently, but the database they access is the same. The functions of each module are compiled and produced based on previously completed demand analysis and review of relevant information.
To sum up, the system functional structure diagram is shown in the figure below.
Figure 4-2 System functional structure diagram
Login module: The login module is the entrance to the system. All users must log in before they can access the system. You need to enter your username and password to log in. If you try to log in multiple times, you need to enter a verification code. When logging in, you need to select the user's role, whether it is a general user or administrator login, etc. After successful login, the user's permissions will be obtained through the database and jumped to the user's home page.
Order module: The order module facilitates users to purchase products and view the details of a product.
Announcement information module: It can be divided into three modules: announcement information browsing, announcement information retrieval, and announcement information maintenance. The administrator has the authority to maintain announcement information, publish new announcement information, update existing announcement information, etc.
Attraction management module: Attraction management is divided into attraction addition, modification and attraction ticket purchase. Attraction information is modified, added, and deleted by administrators; attraction ticket purchase is performed by ordinary users.
Hotel management module: Hotel management is divided into hotel addition, modification and hotel reservation. Hotel information is modified, added, and deleted by administrators; hotel reservations are performed by ordinary users.
From the previous analysis, we can see that the most important things in the database are attraction information, user information, shopping information, and there are also hotel information and reservation information. The analysis can obtain the following data description:
Platform users: used to record various information of users, including user names, passwords, basic information, reputation, number of published information and other data items.
Administrator: Record the administrator’s login information. Including username, password, permissions and other data items.
Attractions: Content stored for attractions, including attraction name, attraction type, contact number, ticket price, address, star rating, opening hours, photos and other data items.
Hotel: Stores various hotel information. Including hotel name, pictures, address, contact number, room type, price and other data items.
Announcement information: stores announcement information content within the platform. Including title, announcement information content, time and other data items.
According to the previous data flow chart and combined with the functional module design of the system, each information entity that conforms to the system is designed.
The system ER diagram is shown below.
Figure 4-3 System ER diagram
The data tables owned by the tourism website management system are as follows: Since there are many data tables, only the main data tables of the system are displayed, as shown in the table below.
Table access_token (login access duration)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
token_id |
int |
10 |
0 |
N |
Y |
Temporary access badge ID |
|
2 |
token |
varchar |
64 |
0 |
Y |
N |
temporary access badge |
|
3 |
info |
text |
65535 |
0 |
Y |
N |
||
4 |
maxage |
int |
10 |
0 |
N |
N |
2 |
Maximum lifespan: Default 2 hours |
5 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
6 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
7 |
user_id |
int |
10 |
0 |
N |
N |
0 |
user ID: |
Table article (article: article for content management system)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
article_id |
mediumint |
8 |
0 |
N |
Y |
Article id: [0,8388607] |
|
2 |
title |
varchar |
125 |
0 |
N |
Y |
Title: [0,125] is used in the title tag of articles and html |
|
3 |
type |
varchar |
64 |
0 |
N |
N |
0 |
Article classification: [0,1000] is used to search for articles of the specified type |
4 |
hits |
int |
10 |
0 |
N |
N |
0 |
Number of clicks: [0,1000000000] Number of people who visited this article |
5 |
praise_len |
int |
10 |
0 |
N |
N |
0 |
Number of likes |
6 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
7 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
8 |
source |
varchar |
255 |
0 |
Y |
N |
Source: [0,255] Source of article |
|
9 |
url |
varchar |
255 |
0 |
Y |
N |
Source address: [0,255] used to jump to the website where the article was published |
|
10 |
tag |
varchar |
255 |
0 |
Y |
N |
Tag: [0,255] is used to mark the relevant content of the article. Multiple tags are separated by spaces. |
|
11 |
content |
longtext |
2147483647 |
0 |
Y |
N |
Text: the main content of the article |
|
12 |
img |
varchar |
255 |
0 |
Y |
N |
cover picture |
|
13 |
description |
text |
65535 |
0 |
Y |
N |
Article description |
Table article_type (article classification)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
type_id |
smallint |
5 |
0 |
N |
Y |
Category ID: [0,10000] |
|
2 |
display |
smallint |
5 |
0 |
N |
N |
100 |
Display order: [0,1000] determines the order in which categories are displayed. |
3 |
name |
varchar |
16 |
0 |
N |
N |
Category name: [2,16] |
|
4 |
father_id |
smallint |
5 |
0 |
N |
N |
0 |
Parent category ID: [0,32767] |
5 |
description |
varchar |
255 |
0 |
Y |
N |
Description: [0,255] describes the role of this classification |
|
6 |
icon |
text |
65535 |
0 |
Y |
N |
Category icon: |
|
7 |
url |
varchar |
255 |
0 |
Y |
N |
External link address: [0,255] If this category jumps to other websites, set it on the URL |
|
8 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
9 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
Table attraction_information (attraction information)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
attraction_information_id |
int |
10 |
0 |
N |
Y |
Attraction information ID |
|
2 |
attraction_name |
varchar |
64 |
0 |
Y |
N |
Attraction name |
|
3 |
ticket_price |
int |
10 |
0 |
Y |
N |
0 |
ticket price |
4 |
opening_hours |
varchar |
64 |
0 |
Y |
N |
Opening hours |
|
5 |
location_of_tourist_attractions |
varchar |
64 |
0 |
Y |
N |
Attraction location |
|
6 |
cover_photo |
varchar |
255 |
0 |
Y |
N |
cover image |
|
7 |
introduction_to_scenic_spots |
longtext |
2147483647 |
0 |
Y |
N |
Attractions |
|
8 |
hits |
int |
10 |
0 |
N |
N |
0 |
Clicks |
9 |
praise_len |
int |
10 |
0 |
N |
N |
0 |
Number of likes |
10 |
recommend |
int |
10 |
0 |
N |
N |
0 |
Intelligent Recommendation |
11 |
create_time |
datetime |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
creation time |
12 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time |
Table auth (user rights management)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
auth_id |
int |
10 |
0 |
N |
Y |
Authorization ID: |
|
2 |
user_group |
varchar |
64 |
0 |
Y |
N |
user group: |
|
3 |
mod_name |
varchar |
64 |
0 |
Y |
N |
Module name: |
|
4 |
table_name |
varchar |
64 |
0 |
Y |
N |
Table Name: |
|
5 |
page_title |
varchar |
255 |
0 |
Y |
N |
page title: |
|
6 |
path |
varchar |
255 |
0 |
Y |
N |
Routing path: |
|
7 |
position |
varchar |
32 |
0 |
Y |
N |
Location: |
|
8 |
mode |
varchar |
32 |
0 |
N |
N |
_blank |
Jump method: |
9 |
add |
tinyint |
3 |
0 |
N |
N |
1 |
Is it possible to add: |
10 |
of the |
tinyint |
3 |
0 |
N |
N |
1 |
Can it be deleted: |
11 |
set |
tinyint |
3 |
0 |
N |
N |
1 |
Whether it can be modified: |
12 |
get |
tinyint |
3 |
0 |
N |
N |
1 |
Is it possible to view: |
13 |
field_add |
text |
65535 |
0 |
Y |
N |
Add fields: |
|
14 |
field_set |
text |
65535 |
0 |
Y |
N |
Modify fields: |
|
15 |
field_get |
text |
65535 |
0 |
Y |
N |
Query fields: |
|
16 |
table_nav_name |
varchar |
500 |
0 |
Y |
N |
Cross-table navigation name: |
|
17 |
table_nav |
varchar |
500 |
0 |
Y |
N |
Cross-table navigation: |
|
18 |
option |
text |
65535 |
0 |
Y |
N |
Configuration: |
|
19 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
20 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
Table booking_information (booking information)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
booking_information_id |
int |
10 |
0 |
N |
Y |
Booking information ID |
|
2 |
hotel_name |
varchar |
64 |
0 |
Y |
N |
Hotel name |
|
3 |
room_type |
varchar |
64 |
0 |
Y |
N |
Room type |
|
4 |
room_price |
varchar |
64 |
0 |
Y |
N |
room price |
|
5 |
user_information |
int |
10 |
0 |
Y |
N |
0 |
User Info |
6 |
user_name |
varchar |
64 |
0 |
Y |
N |
username |
|
7 |
contact_number |
varchar |
64 |
0 |
Y |
N |
contact number |
|
8 |
booking_date |
date |
10 |
0 |
Y |
N |
Booking date |
|
9 |
booking_days |
int |
10 |
0 |
Y |
N |
0 |
Booking days |
10 |
total_booking_price |
varchar |
64 |
0 |
Y |
N |
Total booking price |
|
11 |
booking_remarks |
text |
65535 |
0 |
Y |
N |
Reservation notes |
|
12 |
examine_state |
varchar |
16 |
0 |
N |
N |
Not reviewed |
Approval Status |
13 |
examine_reply |
varchar |
16 |
0 |
Y |
N |
moderation reply |
|
14 |
pay_state |
varchar |
16 |
0 |
N |
N |
unpaid |
Payment status |
15 |
pay_type |
varchar |
16 |
0 |
Y |
N |
Payment type: WeChat, Alipay, online banking |
|
16 |
recommend |
int |
10 |
0 |
N |
N |
0 |
Intelligent Recommendation |
17 |
create_time |
datetime |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
creation time |
18 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time |
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
collect_id |
int |
10 |
0 |
N |
Y |
Collection ID: |
|
2 |
user_id |
int |
10 |
0 |
N |
N |
0 |
Collector ID: |
3 |
source_table |
varchar |
255 |
0 |
Y |
N |
Source table: |
|
4 |
source_field |
varchar |
255 |
0 |
Y |
N |
Source field: |
|
5 |
source_id |
int |
10 |
0 |
N |
N |
0 |
Source ID: |
6 |
title |
varchar |
255 |
0 |
Y |
N |
title: |
|
7 |
img |
varchar |
255 |
0 |
Y |
N |
Cover: |
|
8 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
9 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
comment_id |
int |
10 |
0 |
N |
Y |
Comment ID: |
|
2 |
user_id |
int |
10 |
0 |
N |
N |
0 |
Commenter ID: |
3 |
reply_to_id |
int |
10 |
0 |
N |
N |
0 |
Reply comment ID: empty is 0 |
4 |
content |
longtext |
2147483647 |
0 |
Y |
N |
content: |
|
5 |
nickname |
varchar |
255 |
0 |
Y |
N |
Nick name: |
|
6 |
avatar |
varchar |
255 |
0 |
Y |
N |
Avatar address: [0,255] |
|
7 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
8 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
9 |
source_table |
varchar |
255 |
0 |
Y |
N |
Source table: |
|
10 |
source_field |
varchar |
255 |
0 |
Y |
N |
Source field: |
|
11 |
source_id |
int |
10 |
0 |
N |
N |
0 |
Source ID: |
Table consulting_customer_service (consulting customer service)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
consulting_customer_service_id |
int |
10 |
0 |
N |
Y |
Consult customer service ID |
|
2 |
title_name |
varchar |
64 |
0 |
Y |
N |
title name |
|
3 |
user_information |
int |
10 |
0 |
Y |
N |
0 |
User Info |
4 |
user_name |
varchar |
64 |
0 |
Y |
N |
username |
|
5 |
consultation_date |
date |
10 |
0 |
Y |
N |
Consultation date |
|
6 |
consultation_content |
text |
65535 |
0 |
Y |
N |
Consultation content |
|
7 |
consultation_response |
text |
65535 |
0 |
Y |
N |
Consultation reply |
|
8 |
recommend |
int |
10 |
0 |
N |
N |
0 |
Intelligent Recommendation |
9 |
create_time |
datetime |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
creation time |
10 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time |
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
forum_id |
mediumint |
8 |
0 |
N |
Y |
Forum id |
|
2 |
display |
smallint |
5 |
0 |
N |
N |
100 |
sort |
3 |
user_id |
mediumint |
8 |
0 |
N |
N |
0 |
User ID |
4 |
nickname |
varchar |
16 |
0 |
Y |
N |
Nickname: [0,16] |
|
5 |
praise_len |
int |
10 |
0 |
Y |
N |
0 |
Number of likes |
6 |
hits |
int |
10 |
0 |
N |
N |
0 |
Number of visits |
7 |
title |
varchar |
125 |
0 |
N |
N |
title |
|
8 |
keywords |
varchar |
125 |
0 |
Y |
N |
Key words |
|
9 |
description |
varchar |
255 |
0 |
Y |
N |
describe |
|
10 |
url |
varchar |
255 |
0 |
Y |
N |
Source address |
|
11 |
tag |
varchar |
255 |
0 |
Y |
N |
Label |
|
12 |
img |
text |
65535 |
0 |
Y |
N |
cover picture |
|
13 |
content |
longtext |
2147483647 |
0 |
Y |
N |
text |
|
14 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
15 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
16 |
avatar |
varchar |
255 |
0 |
Y |
N |
Poster's avatar: |
|
17 |
type |
varchar |
64 |
0 |
N |
N |
0 |
Forum classification: [0,1000] is used to search for forum posts of specified types |
Table forum_type (forum classification)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
type_id |
smallint |
5 |
0 |
N |
Y |
Category ID: [0,10000] |
|
2 |
name |
varchar |
16 |
0 |
N |
N |
Category name: [2,16] |
|
3 |
description |
varchar |
255 |
0 |
Y |
N |
Description: [0,255] describes the role of this classification |
|
4 |
url |
varchar |
255 |
0 |
Y |
N |
External link address: [0,255] If this category jumps to other websites, set it on the URL |
|
5 |
father_id |
smallint |
5 |
0 |
N |
N |
0 |
Parent category ID: [0,32767] |
6 |
icon |
varchar |
255 |
0 |
Y |
N |
Category icon: |
|
7 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
8 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
hits_id |
int |
10 |
0 |
N |
Y |
Like ID: |
|
2 |
user_id |
int |
10 |
0 |
N |
N |
0 |
Liked by: |
3 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
4 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
5 |
source_table |
varchar |
255 |
0 |
Y |
N |
Source table: |
|
6 |
source_field |
varchar |
255 |
0 |
Y |
N |
Source field: |
|
7 |
source_id |
int |
10 |
0 |
N |
N |
0 |
Source ID: |
Table hotel_information (hotel information)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
hotel_information_id |
int |
10 |
0 |
N |
Y |
Hotel information ID |
|
2 |
hotel_name |
varchar |
64 |
0 |
Y |
N |
Hotel name |
|
3 |
comprehensive_rating |
varchar |
64 |
0 |
Y |
N |
Overall rating |
|
4 |
room_type |
varchar |
64 |
0 |
Y |
N |
Room type |
|
5 |
room_price |
int |
10 |
0 |
Y |
N |
0 |
room price |
6 |
hotels_address |
varchar |
64 |
0 |
Y |
N |
Hotel address |
|
7 |
hotel_cover |
varchar |
255 |
0 |
Y |
N |
hotel cover |
|
8 |
hotel_introduction |
longtext |
2147483647 |
0 |
Y |
N |
Hotel introduction |
|
9 |
room_introduction |
longtext |
2147483647 |
0 |
Y |
N |
Room introduction |
|
10 |
hits |
int |
10 |
0 |
N |
N |
0 |
Clicks |
11 |
praise_len |
int |
10 |
0 |
N |
N |
0 |
Number of likes |
12 |
recommend |
int |
10 |
0 |
N |
N |
0 |
Intelligent Recommendation |
13 |
create_time |
datetime |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
creation time |
14 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time |
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
notice_id |
mediumint |
8 |
0 |
N |
Y |
Announcement id: |
|
2 |
title |
varchar |
125 |
0 |
N |
N |
title: |
|
3 |
content |
longtext |
2147483647 |
0 |
Y |
N |
text: |
|
4 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
5 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
praise_id |
int |
10 |
0 |
N |
Y |
Like ID: |
|
2 |
user_id |
int |
10 |
0 |
N |
N |
0 |
Liked by: |
3 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
4 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
5 |
source_table |
varchar |
255 |
0 |
Y |
N |
Source table: |
|
6 |
source_field |
varchar |
255 |
0 |
Y |
N |
Source field: |
|
7 |
source_id |
int |
10 |
0 |
N |
N |
0 |
Source ID: |
8 |
status |
bit |
1 |
0 |
N |
N |
1 |
Like status: 1 is like, 0 is canceled |
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
slides_id |
int |
10 |
0 |
N |
Y |
Carousel image ID: |
|
2 |
title |
varchar |
64 |
0 |
Y |
N |
title: |
|
3 |
content |
varchar |
255 |
0 |
Y |
N |
content: |
|
4 |
url |
varchar |
255 |
0 |
Y |
N |
Link: |
|
5 |
img |
varchar |
255 |
0 |
Y |
N |
Carousel image: |
|
6 |
hits |
int |
10 |
0 |
N |
N |
0 |
Number of clicks: |
7 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Creation time: |
8 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
Update time: |
Table system_users (system users)
serial number |
name |
type of data |
length |
Decimal places |
Allow null values |
primary key |
default value |
illustrate |
1 |
system_users_id |
int |
10 |
0 |
N |
Y |
System user ID |
|
2 |
user_name |
varchar |
64 |
0 |
Y |
N |
username |
|
3 |
user_gender |
varchar |
64 |
0 |
Y |
N |
用户性别 |
|
4 |
examine_state |
varchar |
16 |
0 |
N |
N |
已通过 |
审核状态 |
5 |
recommend |
int |
10 |
0 |
N |
N |
0 |
智能推荐 |
6 |
user_id |
int |
10 |
0 |
N |
N |
0 |
用户ID |
7 |
create_time |
datetime |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
创建时间 |
8 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
更新时间 |
表ticket_purchase_information (购票信息)
编号 |
名称 |
数据类型 |
长度 |
小数位 |
允许空值 |
主键 |
默认值 |
说明 |
1 |
ticket_purchase_information_id |
int |
10 |
0 |
N |
Y |
购票信息ID |
|
2 |
attraction_name |
varchar |
64 |
0 |
Y |
N |
景点名称 |
|
3 |
ticket_price |
varchar |
64 |
0 |
Y |
N |
门票价格 |
|
4 |
user_information |
int |
10 |
0 |
Y |
N |
0 |
用户信息 |
5 |
user_name |
varchar |
64 |
0 |
Y |
N |
用户姓名 |
|
6 |
contact_number |
varchar |
64 |
0 |
Y |
N |
联系电话 |
|
7 |
number_of_tickets_purchased |
int |
10 |
0 |
Y |
N |
0 |
购票数量 |
8 |
total_ticket_price |
varchar |
64 |
0 |
Y |
N |
购票总价 |
|
9 |
ticket_purchase_remarks |
text |
65535 |
0 |
Y |
N |
购票备注 |
|
10 |
examine_state |
varchar |
16 |
0 |
N |
N |
未审核 |
审核状态 |
11 |
examine_reply |
varchar |
16 |
0 |
Y |
N |
审核回复 |
|
12 |
pay_state |
varchar |
16 |
0 |
N |
N |
未支付 |
支付状态 |
13 |
pay_type |
varchar |
16 |
0 |
Y |
N |
支付类型: 微信、支付宝、网银 |
|
14 |
recommend |
int |
10 |
0 |
N |
N |
0 |
智能推荐 |
15 |
create_time |
datetime |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
创建时间 |
16 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
更新时间 |
编号 |
名称 |
数据类型 |
长度 |
小数位 |
允许空值 |
主键 |
默认值 |
说明 |
1 |
tourist_routes_id |
int |
10 |
0 |
N |
Y |
旅游路线ID |
|
2 |
route_name |
varchar |
64 |
0 |
Y |
N |
路线名称 |
|
3 |
starting_location |
varchar |
64 |
0 |
Y |
N |
起始地点 |
|
4 |
destination_location |
varchar |
64 |
0 |
Y |
N |
目的地点 |
|
5 |
release_date |
date |
10 |
0 |
Y |
N |
发布日期 |
|
6 |
cover_photo |
varchar |
255 |
0 |
Y |
N |
封面图片 |
|
7 |
route_introduction |
longtext |
2147483647 |
0 |
Y |
N |
路线介绍 |
|
8 |
hits |
int |
10 |
0 |
N |
N |
0 |
点击数 |
9 |
praise_len |
int |
10 |
0 |
N |
N |
0 |
点赞数 |
10 |
recommend |
int |
10 |
0 |
N |
N |
0 |
智能推荐 |
11 |
create_time |
datetime |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
创建时间 |
12 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
更新时间 |
编号 |
名称 |
数据类型 |
长度 |
小数位 |
允许空值 |
主键 |
默认值 |
说明 |
1 |
type_management_id |
int |
10 |
0 |
N |
Y |
类型管理ID |
|
2 |
room_type |
varchar |
64 |
0 |
Y |
N |
房间类型 |
|
3 |
recommend |
int |
10 |
0 |
N |
N |
0 |
智能推荐 |
4 |
create_time |
datetime |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
创建时间 |
5 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
更新时间 |
编号 |
名称 |
数据类型 |
长度 |
小数位 |
允许空值 |
主键 |
默认值 |
说明 |
1 |
upload_id |
int |
10 |
0 |
N |
Y |
上传ID |
|
2 |
name |
varchar |
64 |
0 |
Y |
N |
文件名 |
|
3 |
path |
varchar |
255 |
0 |
Y |
N |
访问路径 |
|
4 |
file |
varchar |
255 |
0 |
Y |
N |
文件路径 |
|
5 |
display |
varchar |
255 |
0 |
Y |
N |
显示顺序 |
|
6 |
father_id |
int |
10 |
0 |
Y |
N |
0 |
父级ID |
7 |
dir |
varchar |
255 |
0 |
Y |
N |
文件夹 |
|
8 |
type |
varchar |
32 |
0 |
Y |
N |
文件类型 |
编号 |
名称 |
数据类型 |
长度 |
小数位 |
允许空值 |
主键 |
默认值 |
说明 |
1 |
user_id |
mediumint |
8 |
0 |
N |
Y |
用户ID:[0,8388607]用户获取其他与用户相关的数据 |
|
2 |
state |
smallint |
5 |
0 |
N |
N |
1 |
账户状态:[0,10](1可用|2异常|3已冻结|4已注销) |
3 |
user_group |
varchar |
32 |
0 |
Y |
N |
所在用户组:[0,32767]决定用户身份和权限 |
|
4 |
login_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
上次登录时间: |
5 |
phone |
varchar |
11 |
0 |
Y |
N |
手机号码:[0,11]用户的手机号码,用于找回密码时或登录时 |
|
6 |
phone_state |
smallint |
5 |
0 |
N |
N |
0 |
手机认证:[0,1](0未认证|1审核中|2已认证) |
7 |
username |
varchar |
16 |
0 |
N |
N |
用户名:[0,16]用户登录时所用的账户名称 |
|
8 |
nickname |
varchar |
16 |
0 |
Y |
N |
昵称:[0,16] |
|
9 |
password |
varchar |
64 |
0 |
N |
N |
密码:[0,32]用户登录所需的密码,由6-16位数字或英文组成 |
|
10 |
|
varchar |
64 |
0 |
Y |
N |
邮箱:[0,64]用户的邮箱,用于找回密码时或登录时 |
|
11 |
email_state |
smallint |
5 |
0 |
N |
N |
0 |
邮箱认证:[0,1](0未认证|1审核中|2已认证) |
12 |
avatar |
varchar |
255 |
0 |
Y |
N |
头像地址:[0,255] |
|
13 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
创建时间: |
编号 |
名称 |
数据类型 |
长度 |
小数位 |
允许空值 |
主键 |
默认值 |
说明 |
1 |
group_id |
mediumint |
8 |
0 |
N |
Y |
用户组ID:[0,8388607] |
|
2 |
display |
smallint |
5 |
0 |
N |
N |
100 |
显示顺序:[0,1000] |
3 |
name |
varchar |
16 |
0 |
N |
N |
名称:[0,16] |
|
4 |
description |
varchar |
255 |
0 |
Y |
N |
描述:[0,255]描述该用户组的特点或权限范围 |
|
5 |
source_table |
varchar |
255 |
0 |
Y |
N |
来源表: |
|
6 |
source_field |
varchar |
255 |
0 |
Y |
N |
来源字段: |
|
7 |
source_id |
int |
10 |
0 |
N |
N |
0 |
来源ID: |
8 |
register |
smallint |
5 |
0 |
Y |
N |
0 |
注册位置: |
9 |
create_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
创建时间: |
10 |
update_time |
timestamp |
19 |
0 |
N |
N |
CURRENT_TIMESTAMP |
更新时间: |
该系统是通过jdbc和Mysql达成连接的,新建一个jdbc.properties文件来填写与数据库连接所需要的驱动和参数。
第一个参数代表Mysql数据库的驱动,第二个参数代表要连接的数据库,第三个和第四个参数代表数据库连接名和密码。
后台与数据库访问主要是通过HQL语句来进行查询的,查询语句中的表名是表格的实体类名,在这种查询语句中*是不允许使用的,除非适合聚合函数一起使用才可以。
用户在填写数据的时候必须与注册页面上的验证相匹配否则会注册失败,注册页面的表单验证是通过JavaScript进行验证的,用户名的长度必须在6到18之间,邮箱必须带有@符号,密码和密码确认必须相同,你输入的密码,系统会根据你输入密码的强度给出指定的值,电话号码和身份证号码必须要求输入格式与生活相符合,当你前台验证通过的时候你点击注册,表单会将你输入的值通过name值传递给后台并保存到数据库中。
用户注册流程图如下图所示。
图5-1用户注册流程图
用户注册界面如下图所示。
图5-2用户注册界面
用户注册的关键代码如下。
* 注册
* @return
*/
@PostMapping("register")
public Map<String, Object> signUp(HttpServletRequest request) throws IOException {
// 查询用户
Map<String, String> query = new HashMap<>();
Map<String,Object> map = service.readBody(request.getReader());
query.put("username",String.valueOf(map.get("username")));
List list = service.selectBaseList(service.select(query, new HashMap<>()));
if (list.size()>0){
return error(30000, "用户已存在");
}
map.put("password",service.encryption(String.valueOf(map.get("password"))));
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){
E entity = JSON.parseObject(JSON.toJSONString(body),eClass);
baseMapper.insert(entity);
log.info("[{}] - 插入操作:{}",entity);
}
主要由两部分组成,登录前的登录界面以及登录后的用户功能界面。登录界面,要求用户输入用户名和密码,当用户名和密码其中一个输入为空时,给出提示“用户名,密码不能为空”。获取用户名和密码后到数据库中查找,如果用户名存在,以及对应的密码正确,则登录成功,否则登录失败。登录失败后给出提示,并把焦点停在文本框中。登录成功后将该次会话的全局变量username设置为用户名。登录成功后进入会员的功能模块,主要有会员基本信息修改,已经发布景点信息管理,发布信息,和退出功能。退出功能是清除全局变量username的值,并跳回到首页。
登录流程图如下图所示。
图5-4登录流程图
用户登录界面如下图所示。
图5-5用户登录界面
用户登录的关键代码如下。
* 登录
* @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;
QueryWrapper wrapper = new QueryWrapper<User>();
Map<String, String> map = new HashMap<>();
if(username != null && "".equals(username) == false){
map.put("username", username);
resultList = service.selectBaseList(service.select(map, new HashMap<>()));
}
else if(email != null && "".equals(email) == false){
map.put("email", email);
resultList = service.selectBaseList(service.select(map, new HashMap<>()));
}
else if(phone != null && "".equals(phone) == false){
map.put("phone", phone);
resultList = service.selectBaseList(service.select(map, new HashMap<>()));
}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.selectBaseList(userGroupService.select(groupMap, new HashMap<>()));
if (groupList.size()<1){
return error(30000,"用户组不存在");
}
UserGroup userGroup = (UserGroup) groupList.get(0);
//查询用户审核状态
if (!StringUtils.isEmpty(userGroup.getSourceTable())){
String res = service.selectExamineState(userGroup.getSourceTable(),byUsername.getUserId());
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, "账号或密码不正确");
}
}
public String 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 sql.toString();
}
public List selectBaseList(String select) {
List<Map<String,Object>> mapList = baseMapper.selectBaseList(select);
List<E> list = new ArrayList<>();
for (Map<String,Object> map:mapList) {
list.add(JSON.parseObject(JSON.toJSONString(map),eClass));
}
return list;
}
用户登录/注册成功之后可以修改自己的基本信息。修改页面的表单中每一个input的name值都要与实体类中的参数相匹配,在用户点击修改页面的时候,如果改后用户名与数据库里面重复了,页面会提示该用户名已经存在了,否则通过Id来查询用户,并将用户的信息修改为表单提交的数据。
-
- 公告信息管理模块的实现
如果公告信息的信息需要修改,管理员可以通过查询公告信息的基本信息来查询公告信息,查询公告信息是通过ajax技术来进行查询的,需要传递公告信息的标题、编号等参数然后在返回到该页面中,可以选中要修改或删除的那条信息,如果选中了超过一条数据,页面会挑一个窗口提醒只能选择一条数,如果没有选中数据会挑一个窗口题型必须选择一条数据。当选择确认修改的时候,后台会根据传过来的id到数据库查询,并将结果返回到修改页面中,可以在修改页面中修改刚刚选中的信息当点击确认的时候from表单会将修改的数据提交到后台并保存到数据库中,就是说如果提交的数据数据库中存在就修改,否则就保存。
公告信息展示界面如下图所示。
图5-6公告信息展示界面
公告信息管理界面如下图所示。
图5-7公告信息管理界面
公告信息发布的关键代码如下。
Map<String, Object> map = new HashMap<>();
map.put("error", new HashMap<String, Object>(4) { {
put("code", code);
put("message", message);
}});
return map;
}
预订酒店功能整体流程:用户浏览酒店信息时,同时会显示酒店的状态,系统会在其显示详细信息的页面时便会判断酒店的状态,若酒店状态为可预订,则会显示预订的链接按钮。在用户点击预订按钮时,会先通过拦截器判断用户是否登录,若未登录,会跳转至登录页面,提示用户先登录,若为登录用户就会跳转至填写预订信息的页面,填写好预订信息之后,点击提交按钮,预订成功之后返回提示信息,告知用户预订成功。
预订酒店流程图如下图所示。
图5-8预订酒店流程图
预订酒店界面如下图所示。
图5-8预订酒店界面
预订管理界面如下图所示。
图5-9预订管理界面
预订添加关键代码如下。
@RequestMapping("/get_obj")
public Map<String, Object> obj(HttpServletRequest request) {
List resultList = service.selectBaseList(service.select(service.readQuery(request), service.readConfig(request)));
if (resultList.size() > 0) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("obj",resultList.get(0));
return success(jsonObject);
} else {
return success(null);
}
}
-
- 景点购票管理模块的实现
此页面的关键是编写景点信息信息,包括景点购票编号,名称,详情等。单击提交按钮以完成信息的添加。如果未写入完整的景点购票信息,例如,如果未写入景点购票编号,系统将给出相应的错误提示,并且无法成功输入。数据以概念的形式以onsubmit =“return checkForm()”的形式写入以进行检查,checkForm()函数是一种用于写入数据的不同类型的校对方法,是不是为空也是经过form表单中的οnsubmit=”return checkForm()来检查。
管理员点击左侧菜单“景点购票信息管理”,页面跳转到景点购票信息管理外观,调用后台景点购票查询所有景点购票信息。并将信息密封到数据集合List,绑定到请求对象,然后页面跳转到相应的jsp,显示出景点购票信息,单击删除按钮完成景点购票信息的删除。
景点购票管理流程图如下图所示。
图5-10景点购票管理流程图
景点购票添加界面如下图所示。
图5-11景点购票添加界面
景点购票管理界面如下图所示。
图5-12景点购票管理界面
景点购票发布的关键代码如下。
@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);
}
%>
根据需求,需要对酒店进行添加、删除或修改详情信息。删除或修改酒店时,系统根据酒店的状态判定为可删除状态下,才会给出删除和修改链接,点击删除链接按钮时,请求到达后台,还会先查询酒店状态再次做出判定能否删除。点击修改链接按钮时,会跳转到修改信息的页面,重新填写好数据后,数据提交到后台会对数据库中相应的记录做出修改。
添加酒店时,会给出数据填写的页面,该页面根据填写好的酒店编号同样会事先发送Ajax请求查询编号是否已存在,数据填写好之后提交到后台,会调用相关服务在数据库中插入记录。
酒店管理流程图如下图所示。
图5-13酒店管理流程图
酒店添加页面设计效果如下图所示。
图5-14酒店添加界面
酒店管理页面效果如下图所示。
图5-15酒店管理界面
酒店发布的关键代码如下。
@RequestMapping(value = "/del")
@Transactional
public Map<String, Object> del(HttpServletRequest request) {
service.delete(service.readQuery(request), service.readConfig(request));
return success(1);
}
对任何系统而言,测试都是必不可少的环节,测试可以发现系统存在的很多问题,所有的软件上线之前,都应该进行充足的测试之后才能保证上线后不会Bug频发,或者是功能不满足需求等问题的发生。下面分别从单元测试,功能测试和用例测试来对系统进行测试以保证系统的稳定性和可靠性。
下表是景点管理功能的测试用例,检测了景点管理中对景点信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。
前置条件;用户登录系统。
表6-1 景点管理的测试用例
功能描述 |
用于景点管理 |
|
测试目的 |
检测景点管理时的各种操作的运行情况 |
|
测试数据以及操作 |
预期结果 |
实际结果 |
点击添加景点,必填项合法输入,点击保存 |
提示添加成功 |
与预期结果一致 |
点击添加景点,必填项输入不合法,点击保存 |
提示必填项不能为空 |
与预期结果一致 |
点击修改景点,必填项修改为空,点击保存 |
提示必填项不能为空 |
与预期结果一致 |
点击修改景点,必填项输入不合法,点击保存 |
提示必填项不能为空 |
与预期结果一致 |
点击删除景点,选择景点删除 |
提示删除成功 |
与预期结果一致 |
点击搜索景点,输入存在的景点名 |
查找出景点 |
与预期结果一致 |
点击搜索景点,输入不存在的景点名 |
不显示景点 |
与预期结果一致 |
下表是酒店管理功能的测试用例,检测了酒店管理中对酒店信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。
前置条件;用户登录系统。
表6-2 酒店管理的测试用例
功能描述 |
用于酒店管理 |
|
测试目的 |
检测酒店管理时的各种操作的运行情况 |
|
测试数据以及操作 |
预期结果 |
实际结果 |
点击添加酒店,必填项合法输入,点击保存 |
提示添加成功 |
与预期结果一致 |
点击添加酒店,必填项输入不合法,点击保存 |
提示必填项不能为空 |
与预期结果一致 |
点击修改酒店,必填项修改为空,点击保存 |
提示必填项不能为空 |
与预期结果一致 |
点击修改酒店,必填项输入不合法,点击保存 |
提示必填项不能为空 |
与预期结果一致 |
点击删除酒店,选择酒店删除 |
提示删除成功 |
与预期结果一致 |
点击搜索酒店,输入存在的酒店名 |
查找出酒店 |
与预期结果一致 |
点击搜索酒店,输入不存在的酒店名 |
不显示酒店 |
与预期结果一致 |
使用阿里云PTS(Performance Testing Service)性能测试服务对线上系统进行压力测试。线上服务器环境为:1核心CPU,1G内存,1Mbps公网带宽,Centos7.0操作系统。
压测过程中使用了2台并发机器,每台机器20个用户并发,对系统主页,登录,数据查询和数据维护等模块进行并发访问,测试结果是有40个用户并发时,数据管理相关页面的响应时间甚至达到了7s,通过查看服务器出网流量发现已经达到1381kb/s,可以看出服务器的带宽已经达到峰值,如果系统使用5Mbps的带宽,系统的响应时间和TPS将会大大增加。在整个测试的过程中,CPU的使用率占用仅8%,也提现出带宽瓶颈对系统的影响非常严重。
随着计算机互联网技术的迅猛发展,各行各业都已经实现采用计算机相关技术对日益放大的数据进行管理。该课题是旅游网站管理系统为核心展开的,主要是为了实现旅游信息化管理和用户在线预订酒店的需求。
旅游网站管理系统的开发是以Java编程语言作为基础,在Myeclipse平台上完成编码工作,系统整体为B/S架构,数据库系统使用Mysql。文中详细分析了旅游网站管理系统的研究背景、研究目的和意义、开发工具和相关技术以及系统需求、系统详细设计和系统测试等等一系列内容。系统实现了旅游网站管理系统所需的一些基本功能,并通过测试对这些实现的功能进行了完善,进而提高了系统整体的实用性。整个系统的开发过程中大量使用了Java相关的知识以及前端开发使用的html和javascript等,同时涉及到了很多开源框架和组件,例如后台系统中运用的MVVM模式、Freemarker模板引擎等,前端运用的UI框架等。
系统投入运行时,各功能均运行正常。系统的每个界面的操作符合常规逻辑,对使用者来说操作简单,界面友好。整个系统的各个功能设计合理,体现了人性化。
但是由于自己在系统开发过程中对一些用到的相关知识和技术掌握不够牢固,再加上自身开发经验欠缺,因此系统在有些方面的功能还不够完善,考虑的不够全面,因此整个系统还有待日后逐步完善。
参考文献
[1]赵静.基于SSM+VUE框架的企业合规管理系统[J].数字通信世界,2022(11):17-19.
[2]李乐.Java语言应用研究[J].智慧中国,2022(09):80-81.
[3]张晨.基于Java Web的反序列化信息安全漏洞挖掘研究[J].成都航空职业技术学院学报,2022,38(03):50-53.
[4]唐小玲.基于SSM框架的资质管理系统开发解析[J].科学技术创新,2022(26):80-83.
[5]彭莉芬.大数据视域下Java集合应用研究[J].福建电脑,2022,38(09):55-58.DOI:10.16707/j.cnki.fjpc.2022.09.012.
[6]仓业金.基于Java的软件保护技术研究[J].电脑知识与技术,2022,18(23):29-30+52.DOI:10.14004/j.cnki.ckt.2022.1597.
[7]宋旸.使用Java语言开发Web应用软件的知识探讨[J].中国设备工程,2022(14):121-123.
[8]杨迎.Java技术在嵌入式系统中的作用探讨[J].无线互联科技,2022,19(14):96-98.
[9]吴拓.Java编程语言在计算机软件开发中的应用[J].无线互联科技,2022,19(12):35-37.
[10]王南.Java编程在计算机应用软件中的应用特征与技术研究[J].信息记录材料,2022,23(04):130-132.DOI:10.16009/j.cnki.cn13-1295/tq.2022.04.057.
[11]杨迎.Java语言异常处理机制的分析[J].电子技术,2022,51(03):42-43.
[12]周金玉.乡村振兴背景下广州市乡村旅游电子商务创新发展研究[J].西部旅游,2022(02):20-22.
[13]张烈超,胡迎九.典型Java Web开发框架模型的研究[J].武汉交通职业学院学报,2021,23(04):122-127.
[14]许跃颖.基于敏捷开发的SSM Web应用开发措施[J].电子制作,2021(16):45-46+22.DOI:10.16589/j.cnki.cn11-3571/tn.2021.16.016.
[15]曹华山.SSM框架在Web应用开发中的设计与实现[J].无线互联科技,2021,18(11):108-109.
[16]Merle Didier,Landau Bernard. Review of the paleobiogeography of Eofavartia Merle, 2002 (Gastropoda: Muricidae) with the description of a new species from the Miocene of Java (Indonesia)[J]. Annales de Paléontologie,2020,106(prepublish).
[17]Yoshiki Higo,Shinpei Hayashi,Shinji Kusumoto. On tracking Java methods with Git mechanisms[J]. The Journal of Systems & Software,2020,165(prepublish).
[18] Pan Yuntian, Xiao Fei. Research on Chinese-English translation of official websites of domestic tourist attractions under the guidance of communicative translation theory - taking the English version of the official website of Nanjing Niushou Mountain as an example [J]. English Square, 2020(16):37-41 .DOI:10.16723/j.cnki.yygc.2020.16.010.
[19] Bai Jie. Comparison of transitivity in English tourist attraction introductions on Chinese and British websites [J]. Cultural and Educational Materials, 2019(18):221-223.
[20] Xing Jie, Zhang Qun, Zhuang Huihui. Comparative analysis of English-Chinese bilingual websites of tourist attractions in Guangdong, Hong Kong and Taiwan [J]. Journal of Guangdong University of Foreign Studies, 2017, 28(06): 57-64.
Acknowledgments
This design took 3 months. In this graduation project, it is inseparable from the guidance of the instructor to make things basically smooth. The instructors gave me great help both in the graduation project experience and in completing the thesis. On the other hand, I have benefited a lot from the teacher's serious and responsible work attitude, cautious teaching spirit and solid theoretical standards. His diligent and cautious teaching, educating and learning attitude also left a very deep impression on me. I learned a lot from my teachers. My skills have been greatly improved in theory and practice. Here, I would like to express my sincere gratitude to the teachers.
After all the research and development of this graduation project, my system research and development has experienced special progress from requirement analysis to implementation of detailed functions to final testing and maintenance. It gave me a deeper understanding of system research and development. Now my hands-on ability to solve doubts independently has also been greatly improved. This is the best gain from this graduation project.
Finally, during the entire system development process, my classmates and friends around me gave me a lot of opinions, so I quickly confirmed the business idea of the system. This time, I sincerely express my gratitude to them.
Please follow and like + privately message the blogger to receive the project source code for free