(Source code attached) SSM Smart Tourism System Computer Completion Design 040929

SSM smart tourism system

Summary

With the development of society, all walks of life in society are taking advantage of the information age. The advantages and popularity of computers have necessitated the development of various information systems.

Smart tourism system design, the main modules include viewing home page, site content (carousel map, bulletin board) system users (administrators, registered users, tour guides) public content (travel information, information classification) module management (regional management, attraction information , attraction ticket purchase, tour guide introduction, tour guide reservation) and other functions. Administrators in the system are mainly responsible for storing and managing various types of information safely and effectively. They can also manage, update and maintain the system, and have corresponding operating permissions for the backend.

In order to realize the various functions of the smart tourism system, we need the strong support of the background database. A large amount of data such as the administrator's verification of registration information, the collected user information, and the associated information derived from the analysis are all managed by the database management user consultation. In this article, the database server uses Mysql as the backend database, which closely connects the Web and the database. During the design process, the system code was fully guaranteed to have good readability, practicality, easy scalability, versatility, easy later maintenance, easy operation, and simple page.

The development of this system makes it more convenient and faster to obtain smart tourism system management information, and also makes smart tourism system management information more systematic and orderly. The system interface is friendly and easy to operate.

Keywords: smart tourism system; Java; Mysql

Smart tourism system

Abstract

With the development of society, all walks of life are making use of the advantages of the information age. The advantages and popularity of computers make it necessary to develop various information systems.

In the design of smart tourism system, the main modules include the functions of viewing the home page, site content (carousel map, bulletin board), system users (administrators, registered users, Guides), public content (tourism information, information classification), module management (regional management, scenic spot information, scenic spot ticket purchase, guide introduction, guide reservation), etc. The administrator in the system is mainly to store and manage all kinds of information safely and effectively, and can also manage, update and maintain the system, and has corresponding operation authority to the background.

In order to realize the functions of the intelligent tourism system, it needs the strong support of the background database. The administrator verifies the registration information, collects the user information, and obtains a large amount of data such as the related information from the analysis, which are all managed by the database management user. In this paper, the database server uses MySQL as the background database, which makes the web and database closely linked. In the design process, the good readability, practicability, extensibility, universality, convenience for later maintenance, easy operation and simple page of the system code are fully guaranteed.

The development of this system makes it more convenient to obtain the management information of the intelligent tourism system, and also makes the management information of the intelligent tourism system more systematic and orderly. The system interface is friendly and easy to operate.

Key words: smart tourism system; Java; Mysql

Table of contents

1System overview

1.1 Overview

1.2 Significance of the topic

1.3 Main content

2 system development environment

2.1 Development technology

2.2 Introduction to JAVA

2.3 Implementation method of accessing database

2.4 Two connection methods of the system to the MySQL database

2.5 MySql database

2.6 Introduction to SSM framework

2.7 Vue.js main functions

3Requirements analysis

3.1 Technical Feasibility: Technical Background

3.2 Economic feasibility

3.3 Operational feasibility: 

3.4 System design rules

3.5 System process and logic

4 System outline design

4.1 Overview

4.2 System structure

4.3 Database design

4.3.1 Database entities

4.4 Data sheet

Chapter 5 System Detailed Design

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 information data management module

5.6 Implementation of attraction ticket purchasing module

5.7 Implementation of attraction information module

5.8 Implementation of regional management module

6 system test

6.1 Purpose of system testing

6.2 System testing method

6.3 Test results

in conclusion

Acknowledgments

references

1System overview

1.1 Overview

With the rapid development of society, the impact of computers is comprehensive and profound. With the continuous improvement of people's living standards, people's requirements for tourism management in daily life are also constantly increasing, and the number of people who need to travel is constantly increasing, making the development of smart tourism systems a necessary and urgent matter. The smart tourism system mainly uses computers to manage the information required by the smart tourism system to increase user choices. It also facilitates timely query and modification of user information and timely understanding of user reservation information. The smart tourism system brings more convenience to users. The system cooperates with database management system software to meet user needs.

1.2 Significance of the topic

With the development of global informatization, people's life pace is getting faster and faster, and people pay more and more attention to the timeliness of information. The traditional tourism system based on traditional propaganda methods has long been unable to meet people's needs for information acquisition and convenience. Therefore, smart tourism systems have gradually become the focus of people's attention. First of all, with smart tourism systems, the real-time and convenient nature of obtaining information online is much higher than that of traditional models. Once the system is online, no matter where in the world the user is, as long as they can connect to the Internet, they can get the information they want as soon as possible.

The application of computer technology in modern management has made computers an important tool for people to apply modern technology. It can effectively solve the problem of convenient and comprehensive acquisition of information and improve efficiency.

1.3 Main content

The development and implementation of smart tourism system requires the following work contents:

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

(2) After the system is confirmed, the technology used in system development is confirmed based on the needs of system development. The development of this smart tourism system uses JAVA technology and the database is used to build and develop the platform. The technology used is confirmed for technical analysis. Whether the technology used can complete the implementation of the smart tourism system .

(3) Determine the technology used in the system, confirm online the student roles divided by the system, and determine the functional modules to be designed based on the user role division. The design of the smart tourism system is mainly divided into three categories: administrator, user , and tour guide. The roles and functional modules used are also different, but the content implemented by the system's database is interactive. Students and teachers can view travel information at any time according to their own needs. The administrator obtains the detailed data information of all users and based on Needs will be dealt with immediately.

(4) After the functional modules of the system are confirmed, the program and interface are designed. After the design is completed, tests are conducted to determine whether the program is perfect. For system testing, different students are required to edit and submit different content, and use different The testing method finds out the loopholes in the program and solves the loopholes in the program online. If there are no problems with the test system, the system can be uploaded for formal operation.

2 system development environment

2.1  Development technology

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.

2.2 Introduction to JAVA

Java mainly uses CORBA technology and security model to protect data in Internet applications. It also provides full support for EJB (Enterprise JavaBeans), java servlet API, SSM, and XML technologies. Java is a computer programming language with three main features: encapsulation, inheritance, and polymorphism. It is widely used in enterprise web application development and mobile application development. The difference between the Java language and general compilers and literal translation is that Java first converts the source code into bytecode and then converts it into an executable file for the JVM, which can run on a variety of different JVMs. Therefore, its cross-platform nature is achieved. While this made Java very slow in its early days, it has improved as Java has developed.

2.3 Implementation method of accessing database

(1) First, introduce the basic steps of web database search on the network:

Step 1: Check the user’s data,

Step 2: You must establish a connection to the database;

Step 3: Search the database;

Step 4: Structure of data;

Step 5: The user's results are shown.

(2) System until my MYSQL5.0 PHP integrated development environment, such as using WAMP server is turned on, and it is easier to access the database report development environment:

A connection to the MySQL database server Mysql_connect-;

Syntax: resource mysql_connect (host, student name, password);

Please select the database: mysql_select_db (the name of the database link identifier);

Close the database: mysql_close();

2.4 Two connection methods of the system to the MySQL database

Active MySQL/MySQL library, or using the ODBC interface, the MySQL database is a two-way link. Permanent and non-permanent connections.

(1) Permanent connection: The biggest advantage of a more permanent connection request is that it can be very effective for the client to stand in close contact, even better when connecting to the MySQL server. The page is drafted every time a child is connected in the process, not just at any time, only during the lifetime of the connection request to the MySQL server, once connected. This sub-process is to establish a separate connection to the server which can be permanent.

(2) Non-permanent connection: it is a short circuit. The submission goes down to the web server, the server handles the request and sends the requested page to the browser you want to send to the client, and then the connection drops. For most websites it is often efficient in relation to the connections used but in most cases it is a full time to avoid any problems and to increase the capacity the server is hosting.

2.5 MySql database

The language of Mysql is unstructured and users can work on the data. Because Mysql's language and structure are relatively simple, but its functions and amount of stored information are powerful, its speed, reliability and adaptability have attracted much attention and have been widely used. The role of Mysql database in the programming process is very extensive, bringing convenience to students for data query. The application characteristics of Mysql database: strong flexibility, powerful functions, and the language is relatively simple. 

Data process analysis is primarily a repository of data storage, which is performed on a computer rather than a real-life repository. Database management mainly includes data storage, modification and addition, and the establishment of data tables. The establishment of the data table can adjust the data in the data table, recombine and reconstruct the data to ensure the security of the data. Due to the powerful functions of the database, the development of this system mainly uses Mysql for data management.

2.6 Introduction to SSM framework

The SSM (Spring+SpringMVC+MyBatis) framework set is integrated by the two open source frameworks Spring and MyBatis (SpringMVC is part of Spring). It is often used as a framework for web projects with relatively simple data sources.

Spring is like a big factory that assembles beans in the entire project. In the configuration file, you can specify the use of specific parameters to call the constructor method of the entity class to instantiate the object. It can also be called the glue in the project.

The core idea of ​​Spring is IoC (Inversion of Control), which means that programmers no longer need to explicitly `new` an object, but let the Spring framework do it all for you.

1.6.2 SpringMVC

SpringMVC intercepts user requests in the project. Its core Servlet, DispatcherServlet, assumes the responsibility of intermediary or front desk, and matches user requests through HandlerMapping to the Controller. The Controller is the specific operation performed in response to the request. SpringMVC is equivalent to struts in the SSH framework.

1.6.3 Mybot

Mybatis is an encapsulation of jdbc, which makes the underlying operations of the database transparent. The operations of mybatis are centered around a sqlSessionFactory instance. Mybatis is associated to the Mapper file of each entity class through the configuration file. The Mapper file is configured with the SQL statement mapping required for each class to the database. Every time you interact with the database, get a sqlSession through sqlSessionFactory, and then execute the sql command.

The page sends a request to the controller, the controller calls the business layer processing logic, the logic layer sends a request to the persistence layer, the persistence layer interacts with the database, and then returns the result to the business layer, the business layer sends the processing logic to the controller, and the controller then Call the view to display the data.

 2.7 Vue.js main functions

Vue.js is a progressive framework for building user interfaces. Unlike other heavyweight frameworks, Vue adopts a bottom-up incremental development design. Vue's core library only focuses on the view layer, and is very easy to learn and integrate with other libraries or existing projects. Vue, on the other hand, is fully capable of driving complex single-page applications developed using single-file components and libraries supported by the Vue ecosystem.

The goal of Vue.js is to implement responsive data binding and composed view components through the simplest possible API.

Vue.js itself is not a full-featured framework - it only focuses on the view layer. Therefore it is very easy to learn and very easy to integrate with other libraries or existing projects. On the other hand, Vue.js can also power complex single-page applications when used with related tools and supporting libraries.

3Requirements analysis

3.1 Technical Feasibility: Technical Background

The tourism system is developed and used in the Windows operating system, and the current performance of PCs can already be used as web servers for ordinary websites. The technology used in system development is also owned by itself, and it is also one of the widely used technologies today.

The development environment and configuration of the system can be installed by yourself. The system uses Java development tools and the relatively mature Mysql database to interact with the system's front-end and back-end data. The database is modified and maintained according to the technical language and combined with the needs, which can make the website The operation is more stable and secure, thereby completing the development of the website.

Hardware feasibility analysis; the design of attraction information management analysis has no rigid requirements for the computer used. As long as the computer can be used normally for code writing and page design, it is feasible. The main requirements are for the server and the completion of the platform construction. There are certain requirements for the upload server. The server must be chosen with relatively high security. Then, opening the website must be smooth and cannot be paused for too long. It must be cost-effective and secure.

Therefore, we conducted a feasibility study and could see that there were no problems in developing the system.

3.2 Economic feasibility

There is no charge for the market research conducted before the development of the smart tourism system and other related management systems. All investigations and research are done by the developers themselves, and all work is done by themselves. When encountering problems that are difficult to solve by themselves, most of them solve related problems with the help of their instructors and classmates. Therefore, the development of smart tourism systems is completely economically feasible without any expenses.

Using relatively mature technology, the system is developed based on Java and uses Mysql database. Therefore, the system does not require high development manpower and financial resources and is economically feasible.

3.3 Operational feasibility: 

Operability is mainly about the user experience after the smart tourism system is completed, and the administrator can manage relevant data information at any time through the system, and the three roles of administrator, user, and tour guide can be entered simply and clearly Go to your own system interface, and you can operate function modules simply and clearly through the interface navigation menu, which facilitates user information operation needs and administrators to manage data information. For the operation of the system, no professional is required to directly operate and manage the functional modules, so the operability of the smart tourism system is completely acceptable. The operation of this system also uses the interface window to log in, so as long as the operator knows simple computer operations, it is completely fine.

3.4 System design rules

This smart tourism system uses Java technology and Mysql database development to fully ensure system stability and integrity.

The design ideas for the design and implementation of the tourism system are as follows:

The operation is simple and convenient, and the system interface is safe and good: the simple and clear page layout makes it easy to query relevant information about smart tourism system management.

2. Instant visibility: The information processed by the smart tourism system will be immediately available for query at the corresponding location, thereby realizing the system function of “instant release and immediate effect”.

3. Functional perfection: can manage homepage, site content (carousel, bulletin board) system users (administrators, registered users, tour guides) public content (travel information, information classification) module management (regional management, attraction information, Modification and maintenance operations of modules such as attraction ticket purchase, tour guide introduction, and tour guide reservation).

3.5 System process and logic

System business flow chart, as shown in the figure:

Figure 3-1 Login flow chart

Figure 3-2 Add information flow chart

Figure 3-3 Registration information flow chart

4 System outline design

4.1 Overview

The smart tourism system is based on the Web service model and is a model structure suitable for the Internet environment. As long as users can connect to the Internet, they can use this system without being restricted by time or location. The working principle diagram of the smart tourism system   is shown in Figure 4-1:

Figure 4-1 System working principle diagram

4.2 System structure

This system architecture website system, the specific functions of this system are as follows:

Figure 4-2 System functional structure diagram

Administrator function structure diagram, as shown in Figure 4-3:

Figure 4-3 Administrator function structure diagram

User structure diagram, as shown in Figure 4-4:

Figure 4-4 User function structure diagram

4.3 Database design

4.3.1 Database entities

Administrator information structure diagram, as shown in Figure 4-5:

 Figure 4-5 Administrator information entity structure diagram

User management entity attribute diagram, as shown in Figure 4-6:

Figure 4-6 User entity attribute diagram

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, as shown in Figure 4-7.

Figure 4-7 System ER diagram

4. 4 Data sheet

Convert ER diagram of database conceptual design into relational database. In a relational database, data relationships are composed of data tables, but the structure of the table is represented by the fields of the table.

guide

Field Name

type

length

not null

primary key

Field description

guide_id

int

11

no

primary key

Tour guide ID

guide_number

varchar

64

no

Tour guide number

name_of_tour_guide

varchar

64

yes

Tour guide name

examine_state

varchar

16

no

Approval Status

recommend

int

11

no

Intelligent Recommendation

user_id

int

11

no

User ID

create_time

datetime

0

no

creation time

update_time

timestamp

0

no

Update time

regional_management

Field Name

type

length

not null

primary key

Field description

regional_management_id

int

11

no

primary key

Region management ID

region

varchar

64

yes

area

recommend

int

11

no

Intelligent Recommendation

create_time

datetime

0

no

creation time

update_time

timestamp

0

no

Update time

registered_user

Field Name

type

length

not null

primary key

Field description

registered_user_id

int

11

no

primary key

Register user ID

user_number

varchar

64

no

user ID

full_name

varchar

64

yes

Name

examine_state

varchar

16

no

Approval Status

recommend

int

11

no

Intelligent Recommendation

user_id

int

11

no

User ID

create_time

datetime

0

no

creation time

update_time

timestamp

0

no

Update time

tour_guide_introduction

Field Name

type

length

not null

primary key

Field description

tour_guide_introduction_id

int

11

no

primary key

Tour guide introduction ID

guide_number

int

11

yes

Tour guide number

name_of_tour_guide

varchar

64

yes

Tour guide name

region

varchar

64

yes

area

photo

varchar

255

yes

photo

entire_period_of_actual_operation

varchar

64

yes

Working years

charging_standard

text

0

yes

Charges

provision_of_services

text

0

yes

Provide services

self_introduction

text

0

自我介绍

details

longtext

0

详情

hits

int

11

点击数

praise_len

int

11

点赞数

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

tour_guide_reservation

字段名称

类型

长度

不是null

主键

字段说明

tour_guide_reservation_id

int

11

主键

导游预约ID

order_number

varchar

64

订单号

guide_number

int

11

导游编号

name_of_tour_guide

varchar

64

导游姓名

region

varchar

64

地区

user

int

11

用户

full_name

varchar

64

姓名

contact_number

varchar

64

联系电话

appointment_date

date

0

预约日期

form_a_plan

text

0

行程规划

examine_state

varchar

16

审核状态

examine_reply

varchar

16

审核回复

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

5章系统详细设计

5.1数据库访问层的实现

该系统是通过jdbc和Mysql达成连接的,新建一个jdbc.properties文件来填写与数据库连接所需要的驱动和参数。

 @PostMapping("/set")

@Transactional

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

        service.update(service.readQuery(request), service.readConfig(request), service.readBody(request.getReader()));

        return success(1);

}

第一个参数代表Mysql数据库的驱动,第二个参数代表要连接的数据库,第三个和第四个参数代表数据库连接名和密码。

后台与数据库访问主要是通过HQL语句来进行查询的,查询语句中的表名是表格的实体类名,在这种查询语句中*是不允许使用的,除非适合聚合函数一起使用才可以。

5.2注册模块的实现

用户在填写数据的时候必须与注册页面上的验证相匹配否则会注册失败,注册页面的表单验证是通过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);

}

5.3登录模块的实现

主要由两部分组成,登录前的登录界面以及登录后的用户功能界面。登录界面,要求用户输入用户名和密码,当用户名和密码其中一个输入为空时,给出提示“用户名,密码不能为空”。获取用户名和密码后到数据库中查找,如果用户名存在,以及对应的密码正确,则登录成功,否则登录失败。登录失败后给出提示,并把焦点停在文本框中。登录成功后将该次会话的全局变量username设置为用户名。登录成功后进入会员的功能模块,主要有会员基本信息修改,已经发布景点信息管理,发布信息,和退出功能。退出功能是清除全局变量username的值,并跳回到首页。

登录流程图如下图所示。

图5-3登录流程图

用户登录界面如下图所示。

图5-4用户登录界面

用户登录的关键代码如下。

  /**

     * 登录

     * @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;

}

5.4用户资料修改模块的实现

用户登录/注册成功之后可以修改自己的基本信息。修改页面的表单中每一个input的name值都要与实体类中的参数相匹配,在用户点击修改页面的时候,如果改后用户名与数据库里面重复了,页面会提示该用户名已经存在了,否则通过Id来查询用户,并将用户的信息修改为表单提交的数据。

5.5资讯数据管理模块的实现

如果资讯数据的信息需要修改,管理员可以通过查询资讯数据的基本信息来查询资讯数据,查询资讯数据是通过ajax技术来进行查询的,需要传递资讯数据的标题、编号等参数然后在返回到该页面中,可以选中要修改或删除的那条信息,如果选中了超过一条数据,页面会挑一个窗口提醒只能选择一条数,如果没有选中数据会挑一个窗口题型必须选择一条数据。当选择确认修改的时候,后台会根据传过来的id到数据库查询,并将结果返回到修改页面中,可以在修改页面中修改刚刚选中的信息当点击确认的时候from表单会将修改的数据提交到后台并保存到数据库中,就是说如果提交的数据数据库中存在就修改,否则就保存。

资讯数据展示界面如下图所示。

图5-5资讯数据展示界面

资讯数据管理界面如下图所示。

图5-6资讯数据管理界面

资讯数据发布的关键代码如下。

<mapper namespace="com.project.demo.dao.base.BaseMapper">

    <select id="selectBaseList" resultType="java.util.LinkedHashMap">

        ${select}

    </select>

    <select id="selectBaseCount" resultType="Integer">

        ${count}

    </select>

    <select id="selectBaseOne" resultType="Object">

        ${select}

    </select>

    <update id="updateBaseSql">

        ${sql}

    </update>

    <delete id="deleteBaseSql">

        ${sql}

    </delete>

</mapper>

5.6景点购票模块的实现

景点购票功能需要考虑高并发,防止出现景点重复购票、景点状态显示出错等情况,特对景点这一共享数据增加锁机制。在乐观锁、悲观锁以及线程锁中,综合考虑性能效率和错误的可接受性选择了乐观锁机制。乐观锁的实现方式是使用版本标识来确定读到的数据与提交时的数据是否一致,提交后修改版本标识,不一致时可以采取丢弃和再次尝试的策略。在数据库景点表(对应景点实体)设计中增加了version字段,每次数据提交时(更改景点状态)会判断version是否匹配,若不匹配停止本次提交,若匹配则提交成功并增加version的值。

景点购票功能整体流程:用户浏览景点信息时,同时会显示景点的状态,系统会在其显示详细信息的页面时便会判断景点的状态,若景点状态为可购票,则会显示购票的链接按钮。在用户点击购票按钮时,会先通过拦截器判断用户是否登录,若未登录,会跳转至登录页面,提示用户先登录,若为登录用户就会跳转至填写购票信息的页面,填写好购票信息之后,点击提交按钮,购票成功之后返回提示信息,告知用户购票成功。

景点购票流程图如下图所示。

图5-7景点购票流程图

景点购票界面如下图所示。

图5-8景点购票界面

购票管理界面如下图所示。

图5-9购票管理界面

景点购票关键代码如下。

  public String encryption(String plainText) {

        String re_md5 = new String();

        try {

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

            md.update(plainText.getBytes());

            byte b[] = md.digest();

            int i;

            StringBuffer buf = new StringBuffer("");

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

                i = b[offset];

                if (i < 0)

                    i += 256;

                if (i < 16)

                    buf.append("0");

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

            }

            re_md5 = buf.toString();

        } catch (Exception e) {

            e.printStackTrace();

        }

        return re_md5;

}

5.7景点信息模块的实现

此页面的关键是编写景点信息,包括景点编号,名称,详情等。单击提交按钮以完成信息的添加。如果未写入完整的景点信息,例如,如果未写入景点编号,系统将给出相应的错误提示,并且无法成功输入。数据以概念的形式以onsubmit =“return checkForm()”的形式写入以进行检查,checkForm()函数是一种用于写入数据的不同类型的校对方法,是不是为空也是经过form表单中的οnsubmit=”return checkForm()来检查。

管理员点击左侧菜单“景点信息管理”,页面跳转到景点信息管理外观,调用后台景点查询所有景点信息。并将信息密封到数据集合List,绑定到请求对象,然后页面跳转到相应的jsp,显示出景点信息,单击删除按钮完成景点信息的删除。

景点管理流程图如下图所示。

图5-10景点管理流程图

景点添加界面如下图所示。

图5-11景点添加界面

景点信息管理界面如下图所示。

图5-12景点管理界面

景点信息管理的关键代码如下。

  @PostMapping("/upload")

    public Map<String, Object> upload(@RequestParam(value = "file",required=false) MultipartFile file,HttpServletRequest request) {

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

        if (file.isEmpty()) {

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

        }

        try {

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

            String filePath = request.getSession().getServletContext().getRealPath("\\") +"upload\\";

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

            File targetDir = new File(filePath);

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

                if (targetDir.mkdirs()) {

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

                } else {

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

                }

            }

//            String path = ResourceUtils.getURL("classpath:").getPath() + "static/upload/";

//            String filePath = path.replace('/', '\\').substring(1, path.length());

            String fileName = file.getOriginalFilename();

            int lastIndexOf = fileName.lastIndexOf(".");

            //获取文件的后缀名 .jpg

            String suffix = fileName.substring(lastIndexOf);

            fileName = IdWorker.getId()+suffix;

            File dest = new File(filePath + fileName);

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

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

            file.transferTo(dest);

            JSONObject jsonObject = new JSONObject();

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

            return success(jsonObject);

        } catch (IOException e) {

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

        }

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

}

5.8地区管理模块的实现

根据需求,需要对地区进行添加、删除或修改详情信息。删除或修改地区时,系统根据地区的状态判定为可删除状态下,才会给出删除和修改链接,点击删除链接按钮时,请求到达后台,还会先查询地区状态再次做出判定能否删除。点击修改链接按钮时,会跳转到修改信息的页面,重新填写好数据后,数据提交到后台会对数据库中相应的记录做出修改。

添加地区时,会给出数据填写的页面,该页面根据填写好的地区编号同样会事先发送Ajax请求查询编号是否已存在,数据填写好之后提交到后台,会调用相关服务在数据库中插入记录。

地区管理流程图如下图所示。

图5-13地区管理流程图

地区添加页面设计效果如下图所示。

图5-14地区添加界面

地区管理页面效果如下图所示。

图5-15地区管理界面

地区管理的关键代码如下。

  @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系统测试

6.1系统测试的目的 

程序设计不能保证没有错误,这是一个开发过程,在错误或错误的过程中都是难以避免的。虽然这是不可避免的,但我们不能使这些错误始终存在于系统中,错误可能会造成无法估量的后果,如系统崩溃,安全信息泄露,系统无法正常启动等,为了避免这些问题我们需要测试程序,在测试过程中发现问题并纠正它们,从而使系统更长时间稳定成熟。

本章的作用是发现这些问题,并对其进行修改,虽然耗时费力,但对于长期使用而言是非常重要和必要系统的开发。 

软件在设计后必须进行测试,调试过程中使用的方法是软件测试方法。在开发新软件时,系统测试是检查软件是否合格的关键步骤,以及是否符合设计目标的参考。测试主要是查看软件中数据的准确性,正确的操作与否,以及操作的结果,还有哪些方面需要改进。 

旅游系统的实现,对于系统中功能模块的实现及操作都必须通过测试进行来评判系统是否可以准确的实现。在旅游系统正式上传使用之前必须做的一步就是系统测试,对于测试发现的错误及时修改处理,保证系统准确无误的供给用户使用。

6.2系统测试方法 

在对旅游系统进行测试的时候在找到问题的情况下必须在第一时间找到解决问题的办法,不要存在侥幸的心理,这样才能让旅游系统开发的质量可以过关,并且开发的周期会大大缩短,还有就是在测试时,不要出现重复性的错误,遇到一个错误问题,要将整个旅游系统开发所牵扯的该问题都必须一一解决,提高旅游系统管理平台的安全性、稳定性。 

白盒测试与黑盒测试是测试中比较常用的两种方法。 

①结构测试俗称白盒测试:这种测试是在对程序的处理过程与结构都有详尽谅解的前提下,顺从程序内部的逻辑而完成的系统测试,以确定系统中所有的通路都能够遵照设计要求正常工作,不出现任何偏差。 

②功能测试又成黑盒测试:主要是针对程序功能能够按照设计正常实现的一种检测,在程序接口处进行,检测程序手法数据是否正常,与外部信息的交换是否完整。 

6.3 测试结果

经过对一系列测试结果的有效分析,本平台开发系统符合用户的要求和需求。所有的基本功能相对齐全,操作起来简单方便,测试系统性能良好,作为大众化系统使用是比较值得推广宣传的。


结论

本系统通过对java和Mysql数据库的简介,从硬件和软件两反面说明了旅游系统的可行性,本文结论及研究成果如下:实现了java与Mysql相结合构建的智慧旅游系统,网站可以响应式展示。通过本次智慧旅游系统的研究与实现,我感到学海无涯,学习是没有终点的,而且实践出真知,只有多动手才能尽快掌握它,经验对系统的开发非常重要,经验不足,就难免会有许多考虑不周之处。比如要有美观的界面,更完善的功能,才能吸引更多的用户 。

Since I had no in-depth understanding of Java knowledge before, I encountered many difficulties from the beginning, such as the page display at the beginning was not standardized, there were problems with the database connection, and parameters could not be passed, etc. However, by searching for relevant information on the Internet, And with the help of my classmates, I finally solved it. In the process, I not only learned a lot of knowledge, but also improved my ability to solve problems, especially how to filter out the required and useful information from a large amount of information. I have a deeper understanding that although most of the knowledge in books is valuable and correct, in fact everyone's programming ideas and data processing methods and thoughts are different, which requires us to pass It takes practice to find solutions to problems. In this graduation project activity, I continued to improve myself and gained valuable experience, which I believe will be of great help to my future development.

Through the development of this smart tourism system, I referred to many examples of related systems, learned from each other's strengths, absorbed the strengths of other systems, and gradually improved the system. However, the system still has many shortcomings and needs further study in the future. .

Practice has proved that the smart tourism system has very good development prospects. After testing and operation, the system's functions are perfect, the interface is beautiful, easy to use, easy to operate, and it is mature in technology and theory.

Acknowledgments

The end of graduation project also means that four years of college life are coming to an end. A lot of effort was put into the completion of the tourism system and how to achieve better results during the operation of the system. This time will be unforgettable for a lifetime. 

During the period of graduation project, it is inseparable from the careful guidance of the instructor and the enthusiastic help of the students. Sometimes several students discuss together how to implement a certain functional module in the system, how to implement it better, or If the problem is not effectively solved, we will have no intention to do other things, which makes us full of motivation for learning.

As the graduation project is coming to an end, I would like to first thank my instructor for your guidance in my graduation project and thesis. Under your careful guidance, I can quickly master the relevant functions of the system. With your strong help, I can combine the knowledge in the textbook with my own projects and truly apply what I have learned. Thank you for often sacrificing your own time to guide me with your rich teaching and project experience. In class, you taught us how to study and taught us new knowledge. After class, you were as kind as a friend. You taught me a lot of truths and made me realize that I should be a person first and do things later. I would like to thank all the teachers who have taught me and devoted a lot of effort to me. It is your sincere teaching and rigorous teaching that enabled me to successfully complete my studies. I would like to express my deep gratitude to you. Thank you to every teacher who taught me in college, and I sincerely wish you all the best.

I would also like to thank my comrades, that is, my classmates for their strong support and help. It is precisely because of your constant help and encouragement, staying up all night, constantly debugging and testing the program, that gave me great motivation to finally complete the operation of the website. The time we spend communicating and talking together will be our precious treasure on the road to the future. I want to thank you deeply!

Graduation is around the corner. In my future work and life, I will remember the teachings of my teachers and the help of my classmates, and continue to work tirelessly and pursue my goals to repay everyone who has supported and helped me!

Finally, I would like to express my deep gratitude to all the teachers who sacrificed their rest time to review, comment and participate in the thesis defense of this article. Here, thank you from the bottom of my heart!


references

[1] Zhen Xinyu, Jing Qinqin. Teaching practice of Java language programming [J]. Integrated Circuit Applications, 2022, 39(02): 256-257.DOI: 10.19339/j.issn.1674-2583.2022.02.111 .

[2] Long Yao, Huang Ping, Zhang Chao, Huan Xiaolan. Research on the vulnerability of tourism economic system under the influence of public health emergencies [J]. Contemporary Tourism, 2022, 20(03): 104-108+113.

[3] Chen Juncheng, Bai Hua. Contribute tourism to write a new chapter in the development of ethnic areas [N]. China Tourism News, 2022-01-20(004).DOI:10.28109/n.cnki.nclyb.2022.000154.

[4] Guo Yang, Chang Yingxian. A brief discussion on the application of Java language in computer software development [J]. Digital Communications World, 2022(01):88-90+94.

[5] Liu Xueyu. Application of JAVA programming language in computer software development [J]. Electronic Technology and Software Engineering, 2022(01):57-60.

[6] Zhang Liechao, Hu Yingjiu. Research on typical Java Web development framework model [J]. Journal of Wuhan Communications Vocational College, 2021, 23(04): 122-127.

[7] Wu Youjin. Research on the collaborative governance mechanism of multiple stakeholders in the rural tourism system [J]. Agricultural Economy, 2021(12):58-59.

[8] Wang Tao, Zhang Longtang, Niu Ying, Yang Junjie, Yang Xiaoyu, Li Jinzhi, Wang Sichao, Ren Li, Zhou Chen, Huang Gaoyuan, Fan Chaohui. Firm belief and forge ahead to promote high-quality development of culture and tourism [N]. China Tourism News, 2021 -12-07(001).DOI:10.28109/n.cnki.nclyb.2021.003450.

[9] Wang Yu, Xia Lili, He Yinggang. Design and implementation of college graduation thesis management system based on SSM framework [J]. Electronic Technology and Software Engineering, 2021(22):26-29.

[10] Wu Di. Application of Java programming language in computer software development [J]. Information and Computers (Theoretical Edition), 2021, 33(20): 29-31.

[11] Liu Xiying, Zhang Yanhong. Design and implementation of online education system based on SSM [J]. Computer Programming Skills and Maintenance, 2021(10):45-46+59.DOI:10.16184/j.cnki.comprg.2021.10. 017.

[12] Meng Xiaoyang. Indoor positioning and navigation system based on SSM framework [J]. Railway Communication and Signal Engineering Technology, 2021, 18(09): 38-42.

[13] Lei Yiwei, Qi Sheng. Implementation technology of communication station dynamic environment monitoring system based on C#.NET and SSM framework [J]. Automation Technology and Application, 2021, 40(08): 75-80.

[14]Xu Yueying. SSM Web application development measures based on agile development[J]. Electronic Production, 2021(16):45-46+22.DOI:10.16589/j.cnki.cn11-3571/tn.2021.16.016.

[15] Cao Huashan. Design and implementation of SSM framework in Web application development [J]. Wireless Internet Technology, 2021, 18(11): 108-109.

[16]Siyi Liu. Explore Java Language and Android Mobile Software Development[J]. International Journal of Frontiers in Engineering Technology,2021,3.0(2.0):

[17]Kevin Kline. The Java Language Extension for SQL Server Is Now Open Source[J]. Database Trends and Applications,2020,34(4):

[18] Yang Xue. Analysis of tourism management informatization [J]. Tourism Overview (Second Half of the Month), 2020(08):60-61.

[19]Hu Xin,Yan Chaobing. Development and application of JAVA language development test evaluation system software[J]. Journal of Computational Methods in Sciences and Engineering,2020,20(4):

[20] Xia Ping, Qiu Xing. Research and design of "Internet + Tourism"-oriented customized platform for college students' poor travel [J]. Wireless Internet Technology, 2018, 15(10): 46-47+60.

Please follow and like + privately message the blogger to receive the project source code for free
 

Guess you like

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