Design and implementation of ticket booking based on Java (with source code address)

Summary

With the improvement of residents' living standards, people are pursuing material and spiritual life more, and traveling has become a common leisure activity. As people travel all over the world, air travel has become a mainstream travel method. Since there are currently many types of flight information, an aviation booking system is designed to provide flight information to tourists. Users use the airline ticket booking system to filter, purchase, and cancel tickets.

The system is mainly developed using Java language and MySQL database. Its main functions are order customer management, air ticket management, flight information management, personnel user management, and aircraft model management. Administrators can control all flight information, including ticket information, aircraft type information, flight information, etc. Users can log in to the system, filter air tickets, select flights that suit them and purchase air tickets. Compared with other ticket booking systems, this design can meet tourists' ticket purchase needs more clearly and intuitively.

Keywords: Java; MySQL; air ticket booking; aviation system

1. Introduction

(1) Research background

With the rapid development of Internet technology, data analysis has greatly facilitated people's lives. In the field of flight booking, information on the number of passengers on a flight and the takeoff and landing times of the aircraft are the data that passengers are most concerned about. How to display various information related to the flight concisely, clearly and effectively is crucial for maintenance workers. . In recent years, due to the continuous advancement of flight digitalization and the full use of modern technology in flight-related fields, airlines have released a large amount of data such as flight information of various aircraft types to the outside world through data transmission. We can use the published data to By sorting and categorizing the data, we can then design an airline booking system that facilitates passengers to query various flight information.

The prospects for the national aviation industry have always been bright. Here are statistics on the overall development level of the aviation industry last year.

In 2021, the industry's total transportation turnover was 81.333 billion ton-kilometers, passenger turnover was 599.938 billion person-kilometers, and cargo and mail turnover was 3.0(1)2 billion ton-kilometers. In terms of passenger transport market, 321.7782 million passengers were transported. In terms of freight market, the cargo and mail transportation volume was 7.4461 million tons. Transport airlines across the industry completed 9.6522 million transport flight hours and 4.6509 million transport takeoffs[1].

As of the end of 2021, our country has 70 transport airlines, 4,003 transport aircraft, and 6,743 scheduled flight routes. In 2021, scheduled domestic flights will operate in 259 cities (or regions) (excluding Hong Kong, Macau, and Taiwan), and Chinese airlines’ international scheduled flights will operate in 201 cities in 90 countries. The industry-wide average daily utilization rate of registered transport aircraft is 7.03 hours, and the average scheduled passenger load factor is 80.19%. As of the end of 2021, there are 259 transportation airports in my country (excluding Hong Kong, Macau and Taiwan). In 2021, the industry will start or renew 204 airport projects throughout the year. The country's civil aviation transport airports completed a passenger throughput of 953.7 million passengers, a cargo and mail throughput of 15.9919 million tons, and a total of 10.0412 million takeoffs and landings.

(2) Research significance

The development of an aviation booking system allows airlines to easily check flight information for passengers during office hours, such as when the plane takes off and lands, which plane is delayed, and which flight is full of passengers. . This will make the maintenance staff work more efficiently. For passengers, the development of the aviation booking system allows passengers to log in to the airline website at home and query the flight information they want. This saves passengers the time of going to the airport front desk to seek services, so that passengers do not have to worry about booking tickets. Running back and forth. Therefore, the research and implementation of the aviation booking system is a very excellent system for both airlines and passengers.

2. Related technologies

(1) Java language

Java is an object-oriented programming language that can write cross-platform application software. It is the general name of Java programming language and Java platform. Java technology has excellent versatility, efficiency, platform portability and security. Its main technical features are as follows: Security: One of the main methods for Java to defend against malicious code is the storage allocation model. Therefore, many large-scale enterprise-level project developments will choose to use Java. Portability: Java does not depend on the platform, and programs written in Java can be applied to any operating system [2].

(2) MySQL database

MySQL database has strong compatibility, is a lightweight database, and is free, with no service to restore data. There are few MySQL management tools, and the installation of management tools sometimes requires the installation of additional packages (phpmyadmin, etc.), which is somewhat complex. Compared with other relational database management systems, MySQL storage files are secure [3].

(3) JSP technology

JSP is the abbreviation of Java Server Pages. It is essentially an embedded scripting language that embeds Java code in HTML code to implement functions that require dynamic operations in web pages. JSP is first executed on the server, and then forms a dedicated HTML file, which can be browsed and transmitted on the Internet [4].

3. Demand analysis

(1) Business needs analysis

The business of this system mainly includes: registration and login, flight query, ticket booking, and order filling.

(1) Login and registration: Each passenger can only register one account. After logging in to the account, he can purchase tickets and other services.

(2) Query flights: Passengers select the departure city and arrival city on the homepage, then select the departure time, and the system will filter out flight information suitable for the passenger.

(3) Air ticket booking: Passengers can purchase tickets after checking the flight information they need.

(4) Fill in the order: For the safety of passengers, passengers need to fill in their personal information when performing ticket booking services to facilitate information verification if any questions arise later. The business requirements analysis flow chart is shown in Figure 3-1.
Insert image description here

Figure 3-1 Business requirements analysis flow chart

(2) Functional requirements analysis

The main functions of this system include: order customer management, air ticket management, flight information management, personnel user management, and aircraft type management.

(1) Order customer management

The order customer management function is that the maintenance staff can view the ticket purchaser's account number, name, ID number and other detailed ticket purchaser information and order information in the order customer management interface. If the ticket purchaser wants to refund the ticket, the maintenance staff can delete the ticket purchaser from this interface to achieve the purpose of refunding the ticket.

(2) Air ticket management

Airline ticket management can conduct ticket booking review and refund review. If a passenger wants to book or refund a ticket, the booking and refund must be completed after approval by the cabin crew.

(3) Flight information management

Due to too many uncertainties, it is necessary to determine whether the flight can take off or whether to add new flights. Therefore, the function of flight information management is for cabin crew to add or delete flight information in a timely manner, so that passengers can book and refund tickets in a timely manner and minimize the time wasted by passengers.

(4) Personnel user management

The main function of personnel user management is to manage the information of maintenance personnel. The name, gender, ID number, mobile phone number, email address and other information of the maintenance staff can be seen in the personnel user management interface. If there are newly employed maintenance personnel, their information can be added to the personnel user management page for timely search. If the maintenance personnel have resigned and retired, they can be deleted from the personnel management interface.

(5) Model management

In the aircraft model management interface, you can view the aircraft model, and you can check and modify the number of remaining first-class and business-class seats for that aircraft model.

The functional requirements analysis flow chart is shown in Figure 3-2.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-uDanRv8i-1686035517281) (RackMultipart20230606-1-k3zu4_html_a4ea0193850064eb.png)]

Figure 3-2 Functional requirements analysis flow chart

4. System design

(1) Overall structure design of the system

According to the demand analysis of the aviation booking system, in order to fully realize the functions of the system, the main modules of the system should include: login module, order customer management module, air ticket management module, flight information management module, personnel user management module, aircraft model management module. The overall structure diagram of the system design is shown in Figure 4-1.

Insert image description here

Figure 4-1 Overall system structure diagram

(2) Database design

Through the above system design, the database also needs to meet the needs of order customer management, air ticket management, flight information management, personnel user management, and aircraft type management. The database E-R diagram is shown in Figure 4-2.

Insert image description here

Figure 4-2 Database E-R diagram

On the basis of database analysis and conceptual structure design, the conceptual model of the database is transformed into a logical structure, that is, the structure of the database is designed. The structure design of the MySQL data table in this system is as follows.

1.Customer information form

The fields it includes are: empid is the customer ID, varchar type, and can store up to 9 characters. Password is the customer account password, varchar type, with a maximum of 12 characters. realname is the customer's real name, varchar type, which can store up to 10 characters. Sex is the customer's gender, char type, and can store up to one character. Birthdate is a date type, the customer's birthday. phone is the customer's phone number, char type, length 11. qq is customer QQ, varchar type, length 17. idcard is the customer's ID number, char type, length 18. The customer information table is shown in Table 4-1.

Table 4-1 Customer information table

Field name type of data length Is it a primary foreign key? Can it be empty
empis varchar 9 no no
password varchar 12 no no
realname varchar 10 no no
sex char 1 no no
birthdate date 20 no no
phoneqqidcard charvarcharchar 111018 No no no no No no no no

2. Flight information form

The fields it includes include com_code airline name, varchar type, and can store up to 12 characters. air_code aircraft model, varchar type, can store up to 10 characters. fli_no flight number, varchar type, can store up to 15 characters. fli_baddress departure place name, varchar type can store up to 14 characters. fli_aaddress destination name, varchar type can store up to 14 characters. fl_btime departure time, date type, can store up to 20 characters. fli_atime landing time, date type, can store up to 20 characters. The flight information table is shown in Table 4-2. fli_fnumber accommodates the number of people, char type, and can store up to 5 characters. berth cabin type, varchar type, can store up to 5 characters.

Table 4-2 Flight information table

Field name type of data length Is it a primary foreign key? Can it be empty
com_code varchar 12 no no
air_code varchar 10 no no
fli_no varchar 15 no no
fli_baddress varchar 14 no no
fli_add varchar 14 no no
fli_btime time 20 no no
fli_atime time 20 no no
fli_fnumber char 5 no no
berth char 5 no no

3. Administrator information form

The fields it includes are: empid is the administrator ID, varchar type, and can store up to 9 characters. password is the administrator account password, varchar type, can store up to 12 characters. realname is the real name of the administrator. It is of varchar type and can store up to 10 characters. Birthdate is a date type, the administrator’s birthday. phone is the administrator’s phone number, char type, length 11. qq is the administrator QQ, varchar type, length 17. idcard is the administrator's ID number, char type, length 18. The administrator information table is shown in Table 4-3.

Table 4-3 Administrator information table

Field name type of data length Is it a primary foreign key? Can it be empty
empis varchar 9 no no
password varchar 12 no no
realname varchar 10 no no
sex char 1 no no
birthdate date 20 no no
phoneqqidcard charvarcharchar 111018 No no no no No no no no

5. System implementation

(1) Login module implementation

When users enter the air ticket booking system, they first register a personal account, then enter the registered account password and fill in a random verification code.

The renderings of the registration and login interface are shown in Figure 5-1 and Figure 5-2.

Insert image description here

Figure 5-1 Registration renderings

Insert image description here

Figure 5-2 Login renderings

(2) Ticket purchase realization

Passengers click on the origin to select the place where they will take the flight, click on the destination to select the place where they will get off the plane, click on the time box, select the time they want to travel, and the flight information that satisfies the passenger will appear on the page.

The rendering of the ticket purchase page is shown in Figure 5-3.

Insert image description here

Figure 5-3 Ticket purchase effect diagram

(3) Order query implementation

After users purchase tickets, they can view their historical ticket purchase records, as shown in Figure 5-4.

Insert image description here

Figure 5-4 Order query implementation renderings

(4) User message implementation

After taking the flight, the user can evaluate the flight attendant service based on the overall flight experience. The user can enter the nickname and leave a message, and then click to submit the comment to successfully leave the message. User messages are shown in Figure 5-5.

Insert image description here

Figure 5-5 User message renderings

(5) Implementation of personal information management

Users can manage their account information and modify their name, ID number, city, mobile phone number, email, QQ number and other information. Personal information management is shown in Figure 5-6.

Insert image description here

Figure 5-6 Personal information management renderings

(6) Implementation of aviation information management

Administrators can control aviation information, and administrators can add aviation information. Adding aviation information is shown in Figure 5-7.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-rnLK1FAr-1686035517284) (RackMultipart20230606-1-k3zu4_html_1b03f1c240f41721.png)]

Figure 5-7 Effect diagram of adding aviation information

Administrators can also view aviation information, as shown in Figure 5-8.

Insert image description here

Figure 5-8 View aviation information

(7) Order information management

The administrator clicks on order information management and can see the user's order record, including user name, flight number, passenger, date of flight, position, document number, contact person, and contact number. Order information management is shown in Figure 5-9.

Insert image description here

Figure 5-9 Order information management

(8) User information management

Administrators can view and delete user information, so that they can manage users who have not used their accounts for a long time and avoid wasting account resources. As shown in Figure 5-10.

Insert image description here

Figure 5-10 User information management

6. System test

(1) Login module test

If you want the system to be used normally, you must first ensure that the login function of the system is used normally, because only when the login is correct can the next operation be carried out [9]. The main purpose of this test is to test how the system will react when entering the administrator account and entering the correct password and incorrect password; when entering the user account, how will the system react if the correct password and incorrect password are entered. Test whether one account can correspond to one password. The login module test case table is shown in Table 5-1.

Table 5-1 Login test case table

serial number Test Data expected result actual effect test status
1 Enter the administrator account "admit" and the correct password 12345678 Able to log in to the account normally Able to log in to the account normally Same as expected result
2 Enter the administrator account "admit" and error secret 888888 Unable to log in to the account normally Unable to log in to the account normally Same as expected result
3 Enter the user account "user" and the correct password 987654321 Able to log in to the account normally Able to log in to the account normally Same as expected result
4 Enter user account "user" and wrong password 1234653 Unable to log in to the account normally Unable to log in to the account normally Same as expected result

(2) Order management module test

This test is to ensure that the cabin crew has absolute control over the ticket order. If the passenger wants to refund the ticket, the cabin crew can refund the ticket normally; if the cabin crew needs to check the order information, they can check the ticket order information normally. The order customer management use case table is shown in Table 5-2.

Table 5-2 Order customer management test case table

serial number Test Data expected result actual effect test status
1 Click to view on the page Able to view booking information Able to view booking information Same as expected result
2 Click Delete on the page
Ability to delete passenger orders Ability to delete order information Same as expected result

(3) Flight information management module test

This test is to accurately verify the flight information management function of the maintenance staff to ensure that the control is in place. The significance of this test is huge because the function of flight information management is extremely important and cannot be ignored. Flight information management is also the most difficult function in this system, because this function must take into account many take-off factors such as weather and wind speed, so it is necessary to accurately determine whether the maintenance staff can edit and delete flight information [11]. The use case for air ticket management is shown in Table 5-3.

Table 5-3 Flight information management test case table

serial number Test Data expected result actual effect test status
1 A new flight from Chengdu to Beijing has been added, flight number is 8888767 Able to add successfully Able to add successfully Same as expected result
2 A new flight from Shanghai to Chengdu has been added, flight number is 787667 Able to add successfully Able to add successfully Same as expected result
3 Increase the number of economy class seats on Chengdu to Shanghai flight number 234677 by 10 can increase success can increase success Same as expected result
4 Delete the flight number 233114 from Harbin to Beijing Can be deleted successfully Can be deleted successfully Same as expected result
5 Increase the first-class price of flight number 1231223 from Urumqi to Harbin by 500 yuan Can be modified successfully Can be modified successfully Same as expected result

(4) User management module test

The function of the personnel user management module is to modify the information of maintenance staff. Therefore, it is necessary to go through multiple tests to ensure that the information of maintenance personnel can be accurately managed, that personnel can be deleted accurately when personnel need to be deleted, and personnel information can be modified normally when personnel information needs to be edited [12]. The use case table for personnel user management is shown in Table 5-5.

Table 5-5 Personnel user management test case table

serial number Test Data expected result actual effect test status
1 Added information about the maintenance staff named zhangzhuyi Able to add successfully Able to add successfully Same as expected result
2 Added information about the maintenance staff named zhuyi Able to add successfully Able to add successfully Same as expected result
3 Delete the information of the maintenance staff named Tianxi Can be deleted successfully Can be deleted successfully Same as expected result
4 Change the ID number named caoxue to 231024200102312211 Can be modified successfully Can be modified successfully Same as expected result
5 Change the gender of 100086 to female Can be modified successfully Can be modified successfully Same as expected result

in conclusion

The Java language used in this system is often encountered in life. The Java language has been popular for decades, and the technology is close to perfection. I also studied Java seriously for three years in college, so I think I am familiar with this system. The mastery of Java is quite comprehensive. But in addition to Java technology, other development technologies are also used, which I have never touched before, so I have almost zero foundation in technologies that I have not been exposed to such as framework technology. I can only rely on online courses and other methods to learn and apply them now. The system will have many flaws. But I also tried my best to carry out this system development without any spare effort. Although the development of this system was successfully completed, many problems such as data loss, database connection failure, and code anomalies occurred during the development process. What troubles me the most is the unsightly appearance of the front-end page. I have never been exposed to front-end page development technology in my previous studies, so I can only roughly design the front-end interface and will not make the interface beautiful. Therefore, in the next process of technical learning, I will focus on learning my weaknesses, focusing on learning front-end technology, and training my development technology to perfection.

Source code network disk link address
Link: https://pan.baidu.com/s/1ODBPhsKw87dLb2tPLBPQCw?pwd=1m3m
Extraction code: 1m3m

JAVA completion help, guidance, source code sharing, debugging and deployment

Guess you like

Origin blog.csdn.net/a1g45/article/details/131068406