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

旅游定制订单管理

旅游订单管理

作者主页:编程千纸鹤

作者简介:Java、前端、Pythone开发多年,做过高程,项目经理,架构师

主要内容:Java项目开发、毕业设计开发、面试技术整理、最新技术分享

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

项目编号: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

三,系统展示

前端首页

旅游产品搜索

 个性旅游定制

旅游线路购买

 

个人中心

 

 

 我的订单

我的定制

后台管理登陆

后台管理首页

 

旅游商品管理

旅游主题管理

用户信息管理

四,核心代码展示

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;
    }

}

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";
    }
}

五,项目总结

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

  1. 前端UI

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

2)后台:

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

3)数据库设计:

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

  • 4
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

编程千纸鹤

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值