Mini Program Tourism | Smart Travel System Based on WeChat Mini Program and SSM

Author Homepage: Programming Compass

About the author: High-quality creator in the Java field, CSDN blog expert, invited author of Nuggets, many years of architect design experience, resident lecturer in Tencent Classroom

Main content: Java project, graduation design, resume template, learning materials, interview question bank, technical mutual assistance

Favorites, likes, don't get lost, it's good to follow the author

Get the source code at the end of the article 

Item number: BS-XCX-009

Foreword:

With the advent of the Internet trend, all walks of life are considering using the Internet to promote their information. The best way is to establish their own platform information and manage it. The application travel service software in the mobile phone is also being used continuously. This paper first analyzes the demand of the travel service software application program, and designs the system from the aspects of system development environment, system goal, design process and function design. Developed this travel service software, which mainly realizes the administrator backend; home page, personal center, travel guide management, travel information management, scenic spot information management, ticket reservation management, user management, hotel information management, hotel reservation management, recommended route management , forum management, system management, user front-end; home page, scenic spot information, hotel information, forum center, mine, etc. The overall design mainly includes the system function design, the full comprehensive application of Mysql database, JAVA and other related knowledge in the system. The composition of the web interface is easy to understand and convenient. In the design process, first, the production of static pages requires application language and app art, and good results have been obtained in these aspects. Second, hard study and a lot of practice for dynamic programming and database technology such as HBuilder X, and applied to the construction of APP.

1. Environmental introduction

Locale: Java: jdk1.8

Database: Mysql: mysql5.7

Application server: Tomcat: tomcat8.5.31

Development tools: IDEA or eclipse

2. Project introduction

Through demand analysis and design of travel service software, realize home page, personal center, travel strategy management, travel information management, scenic spot information management, ticket reservation management, user management, hotel information management, hotel reservation management, recommended route management, forum management , system management and other functions, providing users with a complete tourism service software resource platform. System testing of travel service software.

Administrators and users can open the system through the HBuilder X system mobile phone, after registration and login;

Administrator; home page, personal center, travel strategy management, travel information management, scenic spot information management, ticket reservation management, user management, hotel information management, hotel reservation management, recommended route management, forum management, system management, etc.

The use of this system is mainly to provide users with a convenient platform for querying travel service software, to meet the needs of users for mobile phone query travel service software, and to promote the development of travel service software.

The overall distribution is shown in Figure 3.1:

 

Figure 3.1 Overall Functional Requirements Diagram

The user use case diagram shows:

Functional structure diagram:

 

 System Development Flowchart

The database concept model aims to abstract the information in the real world and realize the modeling of the information world. Therefore, the conceptual model is an important tool for database design. In conceptual model design, the method of ER model is the most commonly used design method.

According to the division of system function modules, most of the entities in the system are analyzed. The main physical diagram of the system is as follows:

1. The property map of the hotel information entity is shown in Figure 4.4

 

Figure 4.4 Hotel Information Entity Attribute Diagram

2. The user information entity attribute diagram is shown in Figure 4.5

 

Figure 4.5 User Information Entity Attribute Diagram

3. The entity attribute map of scenic spot information is shown in Figure 4.5

Figure 4.6 Attraction Information Entity Attribute Map

 

Three, system display

5.1 Administrator login module

The administrator enters the user name, password, and role to log in through the page, as shown in Figure 5-1.

Figure 5-1 Administrator login interface diagram

5.2 Administrator backend function module

The administrator performs login operations through the page. After logging in to the system, you can view the home page, personal center, travel guide management, travel information management, scenic spot information management, ticket reservation management, user management, hotel information management, hotel reservation management, recommended route management, Modules such as forum management and system management can be used to view, edit and modify operations; as shown in Figure 5-2.

Figure 5-2 Administrator function interface diagram

Tourism information management: Through the content list, you can obtain information such as information title, cover image, and release time, and perform operations such as viewing details, modifying, and deleting, as shown in Figure 5-3;

Figure 5-3 Interface of tourism information management

Attraction information management: Through the content list, you can obtain the name, level, picture of the scenic spot, ticket price, opening time, service phone number, etc. for details, modification, and deletion, as shown in Figure 5-4;

Figure 5-4 Scenic spot information management interface

User management: User account, password, user name, avatar, mobile phone number, ID card and other information can be obtained through the content list, and can be viewed, modified, and deleted, as shown in Figure 5-5;

Figure 5-5 User management interface interface

Hotel information management: Through the content list, you can obtain information such as hotel name, category, star rating, hotel picture, hotel address, room type, one-night price, contact number, etc., and perform operations such as viewing, modifying, and deleting, as shown in Figure 5-6 ;

Figure 5-6 Hotel information management interface interface

Front-end function display:

front page

After logging in to the home page, the user can view the home page, scenic spot information, hotel information, forum center, mine, etc., as shown in Figure 5.13 .

Figure 5.13 Home page function interface diagram

 

mine

On my page, you can view travel guides, scenic spot information, ticket reservations, hotel information, hotel reservations, recommended routes, and I want to post information, as shown in Figure 5.14 .

Figure 5.14 My interface diagram

 

User Info

On the user information page, you can view the user account, password, user name and avatar, mobile phone number and other information, and save them as needed, as shown in Figure 5.15 .

Figure 5.15 User Information Interface Diagram

travelling guideline

In the travel guide, you can view the guide title, release time, pictures, user account, guide content and other information, and submit the travel guide as needed, as shown in Figure 5.16 .

                        5.16 Interface map of travel strategy 

Attraction information

On the scenic spot information page, you can check the scenic spot name, level, scenic spot picture, ticket price, opening time, service phone number, detailed address and other information, and you can book tickets for the scenic spot information as needed, as shown in Figure 5.17 .

Figure 5.17 Attraction Information Interface Diagram

hotel info

On the hotel information page, you can view the hotel name, category, star rating, hotel picture, hotel address, room type, one-night price, contact number, etc., and make hotel reservations as needed, as shown in Figure 5.18 .

Figure 5.18 Hotel Information Interface Diagram

Ticket reservation

On the ticket booking page, you can check the scenic spot name, level, detailed address, ticket price, purchase quantity, total price, etc., and make payment as needed, as shown in Figure 5.19 .

Figure 5.19 Ticket booking interface

Fourth, the core code display

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.JingdianxinxiEntity;
import com.entity.view.JingdianxinxiView;

import com.service.JingdianxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 景点信息
 * 后端接口
 * @author 
 * @email 
 * @date 2020-12-29 11:11:16
 */
@RestController
@RequestMapping("/jingdianxinxi")
public class JingdianxinxiController {
    @Autowired
    private JingdianxinxiService jingdianxinxiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,JingdianxinxiEntity jingdianxinxi, HttpServletRequest request){

        EntityWrapper<JingdianxinxiEntity> ew = new EntityWrapper<JingdianxinxiEntity>();
		PageUtils page = jingdianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jingdianxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,JingdianxinxiEntity jingdianxinxi, HttpServletRequest request){
        EntityWrapper<JingdianxinxiEntity> ew = new EntityWrapper<JingdianxinxiEntity>();
		PageUtils page = jingdianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jingdianxinxi), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( JingdianxinxiEntity jingdianxinxi){
       	EntityWrapper<JingdianxinxiEntity> ew = new EntityWrapper<JingdianxinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( jingdianxinxi, "jingdianxinxi")); 
        return R.ok().put("data", jingdianxinxiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(JingdianxinxiEntity jingdianxinxi){
        EntityWrapper< JingdianxinxiEntity> ew = new EntityWrapper< JingdianxinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( jingdianxinxi, "jingdianxinxi")); 
		JingdianxinxiView jingdianxinxiView =  jingdianxinxiService.selectView(ew);
		return R.ok("查询景点信息成功").put("data", jingdianxinxiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        JingdianxinxiEntity jingdianxinxi = jingdianxinxiService.selectById(id);
        return R.ok().put("data", jingdianxinxi);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") String id){
        JingdianxinxiEntity jingdianxinxi = jingdianxinxiService.selectById(id);
        return R.ok().put("data", jingdianxinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody JingdianxinxiEntity jingdianxinxi, HttpServletRequest request){
    	jingdianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(jingdianxinxi);

        jingdianxinxiService.insert(jingdianxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody JingdianxinxiEntity jingdianxinxi, HttpServletRequest request){
    	jingdianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(jingdianxinxi);

        jingdianxinxiService.insert(jingdianxinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody JingdianxinxiEntity jingdianxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(jingdianxinxi);
        jingdianxinxiService.updateById(jingdianxinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        jingdianxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<JingdianxinxiEntity> wrapper = new EntityWrapper<JingdianxinxiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = jingdianxinxiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.JiudianxinxiEntity;
import com.entity.view.JiudianxinxiView;

import com.service.JiudianxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 酒店信息
 * 后端接口
 * @author 
 * @email 
 * @date 2020-12-29 11:11:16
 */
@RestController
@RequestMapping("/jiudianxinxi")
public class JiudianxinxiController {
    @Autowired
    private JiudianxinxiService jiudianxinxiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,JiudianxinxiEntity jiudianxinxi, HttpServletRequest request){

        EntityWrapper<JiudianxinxiEntity> ew = new EntityWrapper<JiudianxinxiEntity>();
		PageUtils page = jiudianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiudianxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,JiudianxinxiEntity jiudianxinxi, HttpServletRequest request){
        EntityWrapper<JiudianxinxiEntity> ew = new EntityWrapper<JiudianxinxiEntity>();
		PageUtils page = jiudianxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiudianxinxi), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( JiudianxinxiEntity jiudianxinxi){
       	EntityWrapper<JiudianxinxiEntity> ew = new EntityWrapper<JiudianxinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( jiudianxinxi, "jiudianxinxi")); 
        return R.ok().put("data", jiudianxinxiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(JiudianxinxiEntity jiudianxinxi){
        EntityWrapper< JiudianxinxiEntity> ew = new EntityWrapper< JiudianxinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( jiudianxinxi, "jiudianxinxi")); 
		JiudianxinxiView jiudianxinxiView =  jiudianxinxiService.selectView(ew);
		return R.ok("查询酒店信息成功").put("data", jiudianxinxiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        JiudianxinxiEntity jiudianxinxi = jiudianxinxiService.selectById(id);
        return R.ok().put("data", jiudianxinxi);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") String id){
        JiudianxinxiEntity jiudianxinxi = jiudianxinxiService.selectById(id);
        return R.ok().put("data", jiudianxinxi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody JiudianxinxiEntity jiudianxinxi, HttpServletRequest request){
    	jiudianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(jiudianxinxi);

        jiudianxinxiService.insert(jiudianxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody JiudianxinxiEntity jiudianxinxi, HttpServletRequest request){
    	jiudianxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(jiudianxinxi);

        jiudianxinxiService.insert(jiudianxinxi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody JiudianxinxiEntity jiudianxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(jiudianxinxi);
        jiudianxinxiService.updateById(jiudianxinxi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        jiudianxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<JiudianxinxiEntity> wrapper = new EntityWrapper<JiudianxinxiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = jiudianxinxiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

V. Project Summary

Unregistered users can enter the registration interface and fill in the user information. If the user name exists, the prompt returns to fill in the user name. If the user name does not exist, fill in the password and mobile phone number. If the phone number is valid, the user information will be added to the database. registration success. The flow chart of user registration is shown in Figure 3.2.

 

Figure 3.2 System registration flow chart

In order to ensure the security of the system, you must first log in to the system to use the system. The user enters the user name and password on the login interface, clicks Login to enter the system, and the login flow chart is shown in Figure 3.3.

 

Figure 3.3 System login flow chart

Guess you like

Origin blog.csdn.net/whirlwind526/article/details/129961711