旅游定制服务|基于SSM实现旅游个性化定制网站平台

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: 这是一个旅游管理系统。系统主要有2个角色,分别是普通用户和管理员。普通用户可以进行登录注册,查看或修改个人信息,检索和浏览旅游产品信息,产品下单,订单详情查看、定制出行、咨询客服等操作,而网页端管理员可以进行用户管理,产品和产品-销售的增删查改,主题管理,订单管理、数据统计等操作

收藏点赞不迷路  关注作者有好处

文末获取源码

项目编号:BS-PT-071

一,项目简介

据公布的中国2019年旅游产业分析报告统计的信息: 2018年,中国旅游业发展迅猛,产业规模持续扩大,产品体系日益完善,市场秩序不断优化,中国2018年旅游业总收入达6.0万亿元,对中国GDP的综合贡献为9.9万亿元,占国内GDP总量的11.0%,逐渐成为国民经济新的增长点。

改革开放以来,我国的旅游业有了非常迅速的发展,但是比较而言,我国国内旅游业发展的广度深度都远远不能适应经济发展和人民生活水平提高的需要。随着市场经济的发展和人民收入水平的进一步提高,人民对旅游消费的需求将进一步上升,国内旅游业在国民经济中的地位和作用越来越重要。

但我国旅游产业仍然基础薄弱,管理手段滞后,信息化程度低,企业效益较差。旅游行政管理部门存在管理方式落后,缺乏信息化管理手段,信息沟通渠道不通畅等问题.,面对困难和挑战,我国旅游业必须转变观念,创新思维,以信息化建设为突破口和新手段,整合各种资源,从而实现整个行业的新跨越。

目前有许多综合性的旅游服务平台,像比较知名的携程、窝窝网、途牛网等。他们提供一个全方位的旅游信息服务平台,针对国内外的旅游景点提供相关的出行服务,但各地现在还是比较缺乏一个专业的各景点旅游信息化服务平台,主要存在的问题有:

1.这些平台提供的服务比较庞杂,不能针对相关景点的旅游信息提供比较全面的服务信息。

2.就一些地方性来讲,旅游资源相当丰富,很多有特的旅游景点和旅游线路没有得到开发,这些平台无法覆盖各地的完整信息。

3.外地人想去相关旅游景区旅游,想尝试一下本地比较有本地特色的旅游线路,这些平台都没有提供,他们只提供了一些比较知名的景点,像少林寺、龙门石窟等。

这是一个旅游管理系统。系统主要有2个角色,分别是普通用户和管理员。普通用户可以进行登录注册,查看或修改个人信息,检索和浏览旅游产品信息,产品下单,订单详情查看、定制出行、咨询客服等操作,而网页端管理员可以进行用户管理,产品和产品-销售的增删查改,主题管理,订单管理、数据统计等操作。

用户注册时,发送的验证码到邮箱需要配置代码中的邮箱号码和邮箱验证码

修改email.properties文件,替换下面的xxx为你真实信息,email_password是邮箱授权码

二,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

后台开发技术:SSM框架

前端开发技术:Bootstrap+Jquery+Ajax+Css

三,系统展示

前端首页

image.gif编辑

旅游产品搜索

image.gif编辑

个性旅游定制

image.gif编辑

旅游线路购买

image.gif编辑

个人中心

image.gif编辑

我的订单

image.gif编辑

我的定制

image.gif编辑

后台管理登陆

image.gif编辑

后台管理首页

image.gif编辑

旅游商品管理

image.gif编辑

image.gif编辑

旅游主题管理

image.gif编辑

用户信息管理

image.gif编辑

四,核心代码展示

package com.zzh.controller.backend;
import com.zzh.common.ServerResponse;
import com.zzh.entity.Product;
import com.zzh.entity.ProductDesc;
import com.zzh.entity.ThemeProduct;
import com.zzh.service.IProductDescService;
import com.zzh.service.IProductService;
import com.zzh.service.IThemeProductService;
import com.zzh.service.IThemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author znz
 * @since 2022-11-13
 */
@Controller
@RequestMapping("/manager/product")
public class ProductManagerController {
    @Autowired
    private IProductService productService;
    @Autowired
    private IProductDescService productDescService;
    @Autowired
    private IThemeService themeService;
    @Autowired
    private IThemeProductService themeProductService;
    /**
     * 新增
     * @return
     */
    @RequestMapping("/save")
    @ResponseBody
    public ServerResponse save(Product product, ProductDesc productDesc, String[] themeName){
        System.out.println(product.getPrice());
        ThemeProduct[] themeProducts=new ThemeProduct[themeName.length];
        for (int i=0;i<themeName.length;i++){
            String themeId=themeService.selectIdByName(themeName[i]);
            if (null==themeId){
                return ServerResponse.createByErrorMessage("不存在该主题");
            }
            themeProducts[i]=new ThemeProduct();
            themeProducts[i].setThemeId(themeId);
            themeProducts[i].setThemeName(themeName[i]);
        }
        try {
            productService.create(product,productDesc,themeProducts);
        } catch (Exception e) {
            return ServerResponse.createByError();
        }
        return ServerResponse.createBySuccess();
    }
    @RequestMapping("/update/{pid}")
    @ResponseBody
    public ServerResponse update(@PathVariable String pid,Product product, ProductDesc productDesc, String[] themeName){
        product.setPid(pid);
        ThemeProduct[] themeProducts=new ThemeProduct[themeName.length];
        for (int i=0;i<themeName.length;i++){
            String themeId=themeService.selectIdByName(themeName[i]);
            if (null==themeId){
                return ServerResponse.createByErrorMessage("不存在该主题");
            }
            themeProducts[i]=new ThemeProduct();
            themeProducts[i].setThemeId(themeId);
            themeProducts[i].setThemeName(themeName[i]);
        }
        try {
            productService.update(product,productDesc,themeProducts);
        } catch (Exception e) {
            return ServerResponse.createByError();
        }
        return ServerResponse.createBySuccess();
    }
    /**
     * 下架
     * @param pid
     * @return
     */
    @ResponseBody
    @RequestMapping("/shelf/{pid}")
    public ServerResponse shelf(@PathVariable  String pid){
        Product product=new Product();
        product.setPid(pid);
        product.setStatus(2);//下架
        return ServerResponse.createByResult(product.updateById());
    }
    /**
     * 删除
     * @param pid
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/delete/{pid}")
    public ServerResponse delete(@PathVariable  String pid){
        productService.cascadeDeleteById(pid);
        return ServerResponse.createBySuccess();
    }
    /**
     * 批量删除
     * @param pids
     * @return
     */
    @ResponseBody
    @RequestMapping("/deleteBatchIds")
    public ServerResponse deleteBatchIds(String[] pids){
        if (pids.length>60){
            return ServerResponse.createByErrorMessage("超出一次删除的记录");
        }
        productService.deleteBatchIds(pids);
        return ServerResponse.createBySuccess();
    }
    private boolean setThemeProduct(String[] themeName,ThemeProduct[] themeProducts){
        themeProducts=new ThemeProduct[themeName.length];
        for (int i=0;i<themeName.length;i++){
            String themeId=themeService.selectIdByName(themeName[i]);
            if (null==themeId){
                return false;
            }
            themeProducts[i]=new ThemeProduct();
            themeProducts[i].setThemeId(themeId);
            themeProducts[i].setThemeName(themeName[i]);
        }
        return true;
    }
    @RequestMapping("/addView")
    public String addView(Model model){
        model.addAttribute("theme",themeService.selectList(null));
        return "backend/product_add";
    }
    @RequestMapping("/listView")
    public String listView(){
        return "backend/product_list";
    }
    @RequestMapping("/updateView/{pid}")
    public String updateView(@PathVariable String pid, Model model){
        Product product=productService.selectById(pid);
        ProductDesc productDesc=productDescService.selectById(pid);
        model.addAttribute("product",product);
        model.addAttribute("productDesc",productDesc);
        model.addAttribute("theme",themeService.selectList(null));
        model.addAttribute("tp",themeProductService.selectByPid(pid));
//        model.addAttribute("themeProduct",themeProductService.selectByPid(product.getPid()));
        //复选框的值先缺着
        return "backend/product_update";
    }
    /**
     * 检查日期输入合法性
     * @return
     */
    private boolean checkDateInputIllegal(Date stratDate,Date endDate){
        //计算天数
        int  days = (int)(stratDate.getTime()-endDate.getTime())/ (1000*3600*24);
        if (days<0||days>60){
            return false;
        }
        return true;
    }
}

image.gif

package com.zzh.controller.backend;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.zzh.common.ResponseCode;
import com.zzh.common.ServerResponse;
import com.zzh.entity.ProductSell;
import com.zzh.service.IProductSellService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author znz
 * @since 2022-11-13
 */
@Controller
@RequestMapping("/manager/productSell")
public class ProductSellManageController {
    @Autowired
    private IProductSellService productSellService;
    /**
     * 列表
     * @param current
     * @param size
     * @return
     */
    @RequestMapping("/list")
    @ResponseBody
    public ServerResponse list(@RequestParam(value="current",defaultValue="1") int current, @RequestParam(value="size",defaultValue="10") int size){
        if (current<0||size<0){
            return ServerResponse.createByErrorCodeMessage(ResponseCode.ILLEGAL_ARGUMENT.getCode(),ResponseCode.ILLEGAL_ARGUMENT.getDesc());
        }
        return ServerResponse.createBySuccess(productSellService.selectPage(new Page(current,size))) ;
    }
    /**
     * 列表
     * @param current
     * @param size
     * @return
     */
    @RequestMapping("/list/{pid}")
    @ResponseBody
    public ServerResponse listBypid(@PathVariable String pid,@RequestParam(value="current",defaultValue="1") int current, @RequestParam(value="size",defaultValue="10") int size){
        if (current<0||size<0){
            return ServerResponse.createByErrorCodeMessage(ResponseCode.ILLEGAL_ARGUMENT.getCode(),ResponseCode.ILLEGAL_ARGUMENT.getDesc());
        }
        EntityWrapper<ProductSell> entityWrapper=new EntityWrapper();
        entityWrapper.eq("pid",pid);
        entityWrapper.orderBy("start_date",true);
        return ServerResponse.createBySuccess(productSellService.selectPage(new Page(current,size),entityWrapper)) ;
    }
    /**
     * 新增
     * @param productSell
     * @return
     */
    @RequestMapping("/save")
    @ResponseBody
    public ServerResponse create(ProductSell productSell){
        productSell.setCreateTime(new Date());
        return ServerResponse.createBySuccess(productSell.insert());
    }
    /**
     *修改
     * @param id
     * @param productSell
     * @return
     */
    @ResponseBody
    @RequestMapping("/update/{id}")
    public ServerResponse update(@PathVariable  String id, ProductSell productSell){
        productSell.setId(id);
        productSell.setUpdateTime(new Date());
        return ServerResponse.createByResult(productSell.updateById());
    }
    /**
     * 删除
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/delete/{id}")
    public  ServerResponse delete(@PathVariable String id){
        ProductSell productSell=new ProductSell();
        productSell.setId(id);
        return ServerResponse.createByResult(productSell.deleteById());
    }
    /**
     * 批量删除
     * @param ids
     * @return
     */
    @ResponseBody
    @RequestMapping("/delete")
    public  ServerResponse delete(String[] ids){
        return ServerResponse.createByResult(productSellService.deleteBatchIds(Arrays.asList(ids)));
    }
    /**
     * 批量新增
     * @param productSells
     * @return
     */
    @RequestMapping("/insertBatch")
    @ResponseBody
    public ServerResponse insertBatch(ProductSell productSells,int days){
        if (days>30){
            return ServerResponse.createByErrorMessage("不能连续设置超过30天的产品销售");
        }
        ArrayList<ProductSell> productSellArrayList=new ArrayList<>();
        for (int i=1;i<=days;i++){
            ProductSell productSell=new ProductSell(productSells);
            Calendar c = Calendar.getInstance();
            c.setTime(productSell.getStartDate());
            c.add(Calendar.DAY_OF_MONTH, i);// +i天
            productSell.setStartDate(c.getTime());
            productSell.setCreateTime(new Date());
            productSellArrayList.add(productSell);
        }
        return ServerResponse.createByResult(productSellService.insertBatch(productSellArrayList));
    }
    @RequestMapping("/addView")
    public String addView(String pid, String title,Double price, Model model) throws UnsupportedEncodingException {
        String param = new String(title.getBytes("ISO8859-1"), "UTF-8");//解决get乱码
        model.addAttribute("pid",pid);
        model.addAttribute("title",param);
        model.addAttribute("price",price);
        return "backend/productSell_add";
    }
    @RequestMapping("/listView/{pid}")
    public String listView(@PathVariable String pid,Model model){
        model.addAttribute("pid",pid);
        return "backend/productSell_list";
    }
    @RequestMapping("/updateView/{id}")
    public String updateView(@PathVariable String id,Model model){
        model.addAttribute("productSell", productSellService.selectById(id));
        return "backend/productSell_update";
    }
}

image.gif

五,项目总结

本课题是基于Java语言的Spring框架整合springmvc和mybatis作为后台进行设计,页面采用JSP,前端使用的是JS、CSS、JQUEY、BootStrap来实现并设计页面;数据库采用目前比较流行的MYSQL数据库进行信息存储,应用服务器采用Tomcat8.5。

    1. 前端UI:

    作为一个旅游网站,前台界面起到了对客户浏览信息进行导航的作用,前台设计的简洁、易上手十分重要。前端用户可以登陆进行旅游线路的购买、个人信息的修改、订单查看和支付的操作,以及网站各模块信息查询功能。

    (2)后台:

    后台为系统的核心,提供了对整个前台信息进行管理操作的主要作用。后台管理员可以对前端的信息进行添加、修改、发布、删除、查看等操作。主要包括旅游线路管理、景点信息管理、订单管理、留言评论管理、酒店管理、管理员登录退出模块。

    (3)数据库设计:

    数据库做为整个网站的信息存储的重要组成部分。网站信息全部存储在MYSQL数据库中,MYSQL作为一款免费的数据库软件应用比较广泛,无论性能还是安全性都是得到开发者一致的认可。

    相关实践学习
    基于CentOS快速搭建LAMP环境
    本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
    全面了解阿里云能为你做什么
    阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
    相关文章
    |
    8天前
    |
    JavaScript Java 测试技术
    基于ssm+vue.js+uniapp小程序的跑腿平台附带文章和源代码部署视频讲解等
    基于ssm+vue.js+uniapp小程序的跑腿平台附带文章和源代码部署视频讲解等
    26 10
    |
    8天前
    |
    JavaScript Java 测试技术
    基于ssm+vue.js+uniapp小程序的洛川县苹果销售管理平台附带文章和源代码部署视频讲解等
    基于ssm+vue.js+uniapp小程序的洛川县苹果销售管理平台附带文章和源代码部署视频讲解等
    18 5
    |
    8天前
    |
    JavaScript Java 测试技术
    基于ssm+vue.js+uniapp小程序的求职招聘平台附带文章和源代码部署视频讲解等
    基于ssm+vue.js+uniapp小程序的求职招聘平台附带文章和源代码部署视频讲解等
    18 3
    |
    8天前
    |
    JavaScript Java 测试技术
    基于ssm+vue.js+uniapp小程序的编程语言在线学习平台附带文章和源代码部署视频讲解等
    基于ssm+vue.js+uniapp小程序的编程语言在线学习平台附带文章和源代码部署视频讲解等
    15 4
    |
    2天前
    |
    搜索推荐 JavaScript Java
    计算机Java项目|基于SSM的个性化商铺系统
    计算机Java项目|基于SSM的个性化商铺系统
    |
    4天前
    |
    Java 测试技术 数据库连接
    基于SSM框架实现的快递配送平台
    基于SSM框架实现的快递配送平台
    |
    8天前
    |
    JavaScript Java 测试技术
    基于ssm+vue.js+uniapp小程序的白优校园社团网站附带文章和源代码部署视频讲解等
    基于ssm+vue.js+uniapp小程序的白优校园社团网站附带文章和源代码部署视频讲解等
    9 0
    |
    8天前
    |
    JavaScript Java 测试技术
    基于ssm+vue.js+uniapp小程序的畅游游戏销售平台附带文章和源代码部署视频讲解等
    基于ssm+vue.js+uniapp小程序的畅游游戏销售平台附带文章和源代码部署视频讲解等
    9 0
    |
    8天前
    |
    JavaScript Java 测试技术
    基于ssm+vue.js+uniapp小程序的大学生校园兼职附带文章和源代码部署视频讲解等
    基于ssm+vue.js+uniapp小程序的大学生校园兼职附带文章和源代码部署视频讲解等
    30 8
    |
    8天前
    |
    JavaScript Java 测试技术
    基于ssm+vue.js+uniapp小程序的停车场微信小程序附带文章和源代码部署视频讲解等
    基于ssm+vue.js+uniapp小程序的停车场微信小程序附带文章和源代码部署视频讲解等
    20 6