基于javaweb+springboot的旅游网站管理系统设计和实现(java+springboot+jsp+mysql+spring)

news/2024/5/9 13:25:27/文章来源:https://blog.csdn.net/m0_67990629/article/details/123724775

基于javaweb+springboot的旅游网站管理系统设计和实现(java+springboot+jsp+mysql+spring)
运行环境: java jdk 1.8
IDE环境: IDEA
tomcat环境: Tomcat 7.x,8.x,9.x版本均可
主要功能说明:
管理员角色包含以下功能:管理员登录,用户管理,旅游路线管理,旅游景点管理,酒店管理,旅游攻略管理,车票管理,订单管理,数据分析等功能。
用户角色包含以下功能:用户注册,用户登录,旅游路线预定,旅游景区预定,餐饮住宿,车票预定,旅游保险预定,旅游攻略,我的订单查看,个人资料管理等功能。
用了技术框架: HTML+CSS+JavaScript+jsp+mysql+Spring+Springboot+mybatis+maven+layui
所用的数据库: Mysql数据库
主要功能截图:

用户端:
注册和登录
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

		hotel.setCommentCount(commentCount);hotel.setStar(avgStar);Integer hotel1 = hotelService.updateStar(hotel);hotel_ordersService.updateStarStatus(orderId);if(hotel1==null){return new Result(false,StatusCode.ERROR,"评分更新失败!");}return new Result(true,StatusCode.OK,"评价成功!");}/*** 景点评分* @param scenic* @return*/@ResponseBody@PostMapping("/travelOrderStar")public Result travelOrderStar(Scenic scenic,@RequestParam("orderId")Long orderId){Long id = scenic.getId();Scenic newScenic = scenicService.findById(id);if(newScenic==null){return new Result(false,StatusCode.ERROR,"未找到该景点!");}Integer totalStar = newScenic.getStart();Integer currentStar = scenic.getStart();
			return new Result(false,StatusCode.ERROR,"该酒店信息不存在");}if(StringUtils.isEmpty(hotel.getName())){return new Result(false,StatusCode.ERROR,"请填写酒店名称");}BeanUtils.copyProperties(hotel,hotelById,"id","img","miaoshu","day","startdate","addr","commentCount");if(hotelService.update(hotelById)==null){return new Result(false,StatusCode.ERROR,"酒店编辑失败");}return new Result(true,StatusCode.OK,"修改成功");}/*** 删除* @param id*/@ResponseBody@RequestMapping(value="/{id}",method= RequestMethod.DELETE)public Result delete(@PathVariable String id ){hotelService.deleteById(id);
	private HotelService hotelService;@Autowiredprivate ScenicService scenicService;/*** 查询全部酒店信息* @return*/@ResponseBody@RequestMapping(value = "/list",method= RequestMethod.GET)public Result findAll(){List<Hotel> all = hotelService.findAll();return new Result(true, StatusCode.OK,"查询成功",all,all.size());}
		}return new Result(true,StatusCode.OK,"修改成功");}/*** 删除* @param id*/@ResponseBody@RequestMapping(value="/{id}",method= RequestMethod.DELETE)public Result delete(@PathVariable String id ){hotelService.deleteById(id);return new Result(true,StatusCode.OK,"删除成功");}/*** 酒店列表跳转路径* @return*/
                    return 1;}return -1;}});if (hotels.size()>=4){List newList=hotels.subList(0,3);model.addAttribute("scenics",newList);System.out.println("个数:"+newList.size());}else {model.addAttribute("scenics",hotels);System.out.println("个数2:"+hotels.size());}return "page/product::table_refresh";}
}
订单控制层:
/*** 控制器层* @author yy**/
@Controller
	/*** 分页+多条件查询* @param searchMap 查询条件封装* @param page 页码* @param size 页大小* @return 分页结果*/@ResponseBody@RequestMapping(value="/search/{page}/{size}",method=RequestMethod.POST)public Result findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){Page<Hotel> pageList = hotelService.findSearch(searchMap, page, size);return  new Result(true,StatusCode.OK,"查询成功",  new PageResult<Hotel>(pageList.getTotalElements(), pageList.getContent()) );}/*** 根据条件查询* @param searchMap* @return*/@ResponseBody@RequestMapping(value="/search",method = RequestMethod.POST)public Result findSearch( @RequestBody Map searchMap){return new Result(true,StatusCode.OK,"查询成功",hotelService.findSearch(searchMap));}
	 * @return*/@ResponseBody@RequestMapping(value="/{id}",method= RequestMethod.GET)public Result findById(@PathVariable Long id){return new Result(true,StatusCode.OK,"查询成功",ordersService.findById(id));}/*** 分页+多条件查询* @param searchMap 查询条件封装* @param page 页码* @param size 页大小* @return 分页结果*/@ResponseBody@RequestMapping(value="/search/{page}/{size}",method=RequestMethod.POST)public Result findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){Page<Orders> pageList = ordersService.findSearch(searchMap, page, size);return  new Result(true,StatusCode.OK,"查询成功",  new PageResult<Orders>(pageList.getTotalElements(), pageList.getContent()) );}/*** 根据条件查询* @param searchMap
     * 查询单个景点* @param model* @param id* @return*/@RequestMapping("/oneAttr")public String One_attr(Model model,Long id){Scenic scenic=scenicService.findById(id);model.addAttribute("oneAttr",scenic);return "page/product";}/**
            scenic.setStart(valuestar);scenicDao.save(scenic);System.out.println("数据不为空!");return new Result(true,1,"","");}else {System.out.println("数据为空!");return new Result(false,0,"","");}}/***查询星级* @return*/@ResponseBody@RequestMapping(value = "/hotel",method = RequestMethod.POST)public Result judgeHotelStar(Long id,String start){Hotel scenic = hotelService.findById(id);
	public String findAllOrders(HttpSession session, Model model) throws ParseException {User user= (User) session.getAttribute("user");model.addAttribute("orders",ordersService.findOrders(user.getId().toString()));return "index_header::table_refresh";}/*** 查询全部订单* @return*/@ResponseBody@RequestMapping(value = "/allorder",method = RequestMethod.POST)public List<Orders> findAllOrder(HttpSession session) throws ParseException {User user= (User) session.getAttribute("user");return ordersService.findOrders(user.getId().toString());}/*** 查询全部订单
	 */@ResponseBody@RequestMapping(value = "/list",method= RequestMethod.GET)public Result findAll(){List<Orders> all = ordersService.findAll();return new Result(true, StatusCode.OK,"查询成功",all,all.size());}/*** 查询全部订单* @return*/@ResponseBody@RequestMapping(value = "/allorders",method = RequestMethod.POST)public String findAllOrders(HttpSession session, Model model) throws ParseException {User user= (User) session.getAttribute("user");model.addAttribute("orders",ordersService.findOrders(user.getId().toString()));return "index_header::table_refresh";}/*** 查询全部订单* @return*/@ResponseBody@RequestMapping(value = "/allorder",method = RequestMethod.POST)
		return hotel_orders;}/*** 根据ID查询* @param id ID* @return*/@ResponseBody@RequestMapping(value="/{id}",method= RequestMethod.GET)public Result findById(@PathVariable Long id){return new Result(true,StatusCode.OK,"查询成功",ordersService.findById(id));}/*** 分页+多条件查询* @param searchMap 查询条件封装* @param page 页码* @param size 页大小* @return 分页结果
			return new Result(false,StatusCode.ERROR,"请填写酒店名称");}BeanUtils.copyProperties(hotel,hotelById,"id","img","miaoshu","day","startdate","addr","commentCount");if(hotelService.update(hotelById)==null){return new Result(false,StatusCode.ERROR,"酒店编辑失败");}return new Result(true,StatusCode.OK,"修改成功");}/**
	 * 查询全部酒店信息* @return*/@ResponseBody@RequestMapping(value = "/list",method= RequestMethod.GET)public Result findAll(){List<Hotel> all = hotelService.findAll();return new Result(true, StatusCode.OK,"查询成功",all,all.size());}/*** 根据ID查询* @param id ID* @return*/@ResponseBody@RequestMapping(value="/{id}",method= RequestMethod.GET)public Result findById(@PathVariable Long id){return new Result(true,StatusCode.OK,"查询成功",hotelService.findById(id));}/**
		Long id = hotel.getId();Hotel newHotel = hotelService.findById(id);if(newHotel==null){return new Result(false,StatusCode.ERROR,"未找到该酒店!");}Integer currentStar = hotel.getStar();Integer totalStar = newHotel.getStar();if(currentStar<0){return new Result(false,StatusCode.ERROR,"请选择评分!");}Integer commentCount = newHotel.getCommentCount();commentCount=commentCount+1;totalStar=currentStar+totalStar;int avgStar = totalStar / commentCount;
	 * @return*/@RequestMapping(value = "/hotelList")public String hotelList(){return "admin/hotelmanage/hotelList";}@RequestMapping(value = "/hotelAdd")public String hotelAdd(){return "admin/hotelmanage/hotelAdd";}/*** 查询单个酒店* @param model* @param id* @return*/@RequestMapping("/oneAttr")public String One_attr(Model model, Long id){Hotel scenic=hotelService.findById(id);model.addAttribute("oneAttr",scenic);
	@RequestMapping(value="/search/{page}/{size}",method=RequestMethod.POST)public Result findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){Page<Orders> pageList = ordersService.findSearch(searchMap, page, size);return  new Result(true,StatusCode.OK,"查询成功",  new PageResult<Orders>(pageList.getTotalElements(), pageList.getContent()) );}/*** 根据条件查询* @param searchMap* @return*/@ResponseBody@RequestMapping(value="/search",method = RequestMethod.POST)public Result findSearch( @RequestBody Map searchMap){return new Result(true,StatusCode.OK,"查询成功",ordersService.findSearch(searchMap));}/*** 订单添加操作
@RequestMapping("/hotel")
public class HotelController {@Autowiredprivate HotelService hotelService;@Autowiredprivate ScenicService scenicService;/*** 查询全部酒店信息* @return*/@ResponseBody@RequestMapping(value = "/list",method= RequestMethod.GET)public Result findAll(){List<Hotel> all = hotelService.findAll();return new Result(true, StatusCode.OK,"查询成功",all,all.size());}/**
    public Result judgeStar(String id,String start){System.out.println(id+"===="+start);Optional<Scenic> s = scenicDao.findById(id);if (s.isPresent()){Scenic scenic = s.get();int valuestar = (Integer.valueOf(start)+Integer.valueOf(scenic.getStart()))/2;scenic.setStart(valuestar);scenicDao.save(scenic);System.out.println("数据不为空!");return new Result(true,1,"","");}else {System.out.println("数据为空!");return new Result(false,0,"","");}}/***查询星级* @return
		if(StringUtils.isEmpty(hotel.getMiaoshu())){return new Result(false,StatusCode.ERROR,"请填写酒店描述");}hotel.setCommentCount(0);hotel.setStar(0);if(hotelService.add(hotel)==null){return new Result(false,StatusCode.ERROR,"酒店添加失败");}return new Result(true,StatusCode.OK,"添加成功");}/*** 分页+多条件查询* @param searchMap 查询条件封装* @param page 页码* @param size 页大小* @return 分页结果*/@ResponseBody@RequestMapping(value="/search/{page}/{size}",method=RequestMethod.POST)
	 * @param hotel*/@ResponseBody@RequestMapping(value="/edit",method= RequestMethod.PUT)public Result update(Hotel hotel){Hotel hotelById = hotelService.findById(hotel.getId());if(hotelById==null){return new Result(false,StatusCode.ERROR,"该酒店信息不存在");}if(StringUtils.isEmpty(hotel.getName())){return new Result(false,StatusCode.ERROR,"请填写酒店名称");}
	@RequestMapping(value = "/ordersList")public String ordersList(){return "admin/ordersmanage/orderslist";}/*** 酒店评分* @param hotel* @return*/@ResponseBody@PostMapping("/hotelOrderStar")public Result hotelOrderStar(Hotel hotel,@RequestParam("orderId")Long orderId){Long id = hotel.getId();Hotel newHotel = hotelService.findById(id);if(newHotel==null){return new Result(false,StatusCode.ERROR,"未找到该酒店!");}Integer currentStar = hotel.getStar();Integer totalStar = newHotel.getStar();if(currentStar<0){return new Result(false,StatusCode.ERROR,"请选择评分!");}Integer commentCount = newHotel.getCommentCount();commentCount=commentCount+1;
			return new Result(false,StatusCode.ERROR,"未找到该酒店!");}Integer currentStar = hotel.getStar();Integer totalStar = newHotel.getStar();if(currentStar<0){return new Result(false,StatusCode.ERROR,"请选择评分!");}Integer commentCount = newHotel.getCommentCount();commentCount=commentCount+1;totalStar=currentStar+totalStar;int avgStar = totalStar / commentCount;hotel.setCommentCount(commentCount);hotel.setStar(avgStar);Integer hotel1 = hotelService.updateStar(hotel);
 **/
@Controller
@CrossOrigin
@RequestMapping("/orders")
public class OrdersController {@Autowiredprivate OrdersService ordersService;@Autowiredprivate HotelOrdersService hotel_ordersService;@Autowiredprivate HotelService hotelService;@Autowiredprivate ScenicService scenicService;
		}return ordersService.add(orders,user.getId(),orders.getId(),orders.getQty());}/*** 修改* @param*/@ResponseBody@RequestMapping(value="/{id}",method= RequestMethod.PUT)public Result update(@PathVariable Long id){ordersService.updateStatus(id);return new Result(true,StatusCode.OK,"修改成功");
	}/*** 分页+多条件查询* @param searchMap 查询条件封装* @param page 页码* @param size 页大小* @return 分页结果*/@ResponseBody@RequestMapping(value="/search/{page}/{size}",method=RequestMethod.POST)public Result findSearch(@RequestBody Map searchMap , @PathVariable int page, @PathVariable int size){Page<Hotel> pageList = hotelService.findSearch(searchMap, page, size);return  new Result(true,StatusCode.OK,"查询成功",  new PageResult<Hotel>(pageList.getTotalElements(), pageList.getContent()) );}/*** 根据条件查询* @param searchMap* @return*/@ResponseBody@RequestMapping(value="/search",method = RequestMethod.POST)public Result findSearch( @RequestBody Map searchMap){return new Result(true,StatusCode.OK,"查询成功",hotelService.findSearch(searchMap));

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_882199.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

基于javaweb+springboot的音乐网站音乐平台(java+Springboot+ssm+mysql+maven+jsp)

基于javawebspringboot的音乐网站音乐平台(javaSpringbootssmmysqlmavenjsp) 一、项目简述 功能&#xff1a; 用户管理模块&#xff1a;用户登录、用户注册、修改密码 榜单列表模块&#xff1a;动态地从数据库中获取歌曲的链接和数据 在榜单中显示 歌曲搜索模块&#xff1a;在…

使用drupal8架设网站

首先安装qampp&#xff0c;包括apache、php、mysql、tomcat、perl等组件。 请将mvn目录下的dll全部复制到apache下面&#xff0c;不然会报错。 将php.ini中的max_exe设置为120秒以上&#xff0c;不然会报错。 将iis占用的80端口释放&#xff0c;比如设置为800&#xff0c;不然会…

VS2010如何调试IIS上的网站

通常&#xff0c;我们在Visual Studio里调试ASP.NET网站&#xff0c;都是加个断点&#xff0c;然后按F5&#xff0c;在VS自带的虚拟服务器下调试的。但有时候&#xff0c;VS自带的服务器弱爆了&#xff0c;无法满足一些特定情况的要求&#xff0c;我们必须把网站放在IIS里跑。这…

iis本地搭建网站

如果还没开iis&#xff0c;路径&#xff1a;控制面板->程序和功能->启动或关闭windows功能 将万维网的应用程序开发功能全部勾选重启电脑网站那里新建/添加&#xff0c;将路径添加进去 程序池选择这样的就好&#xff0c;IP地址填本机的&#xff0c;端口由于80已被占用&a…

手机端网站制作

准备 1.前段使用HBuilder 2.使用夜神模拟器来看自己写的页面 链接: https://pan.baidu.com/s/1zUqL2WYnbcM3cR98P-umWw 提取码: bmpe 复制这段内容后打开百度网盘手机App&#xff0c;操作更方便哦 3. 4.下载喜马拉雅软件上面的课程 从Response页签中复制信息内容 -- 未来查…

怎么制作手机网站

网站建设的发展&#xff0c;对于网站建设形式上有了很大的变化和创新&#xff0c;从根据不同行业如企业、集团、门户、商城等 网站建设 &#xff0c;发展到手机、WAP、个人网站等等。实现了网站建设的创新。对于行业类的网站&#xff0c;我想大家都很熟悉了&#xff0c;因为这…

PageAdmin手机网站制作教程

PageAdmin作为国内使用最多的网站管理系统&#xff0c;很多人都知道pageadmin可以用来做传统网站&#xff0c;其实pageadmin一样 很方便的制作手机网站&#xff0c;而且很容易实现和pc版本数据共享功能&#xff0c;原理就是利用分站的数据共享功能&#xff0c;下面直接说制 作…

自己做的html5手机网站

这个网站采用html5css3jquerymobile 只开发了前台的功能&#xff0c;前台的界面比较美观&#xff0c;后端不方便放上&#xff0c;各位有空可以自己开发这个网站的界面有参考各个菜谱网站的页面的样式&#xff0c;但是又不一样&#xff0c;是属于完全独立开发的。代码链接如下&a…

常用IT网站

首先要隆重推荐http://www.moreofit.com/ 这个网站可以发现跟你输入网站类似的网站&#xff0c;如我们在地址栏中输入博客园的地址http://www.cnblogs.com/&#xff0c; 点击查看&#xff0c;系统会列出和博客园类似的网站&#xff0c;没准你会发现很多有意思的网站 类似的网站…

手机网站页面制作

导读&#xff1a;国内手机网站目前还算是个新鲜事物&#xff0c;相应的手机网站前端开发也并不是特别成熟&#xff0c;对于一个网页设计师来说要做一个手机网站还是会碰到许多问题&#xff0c;本文转载自淘宝 UED&#xff0c;分享如何开发进行手机网站的前端卡发。 从09年初接手…

让你的网站支持RSS

step1)后台生成xml并确定一个url能会返回这个xml xml必须按照rss规定的格式 ,下面是个样例&#xff1a; <?xml version"1.0" encoding"utf-8"?> <rss version"2.0"> <channel> <title>最新视频</title> <…

java程序员菜鸟进阶(八)分享一个爬取B2B网站信息的程序

前段时间&#xff0c;女朋友如愿以偿的找到了销售的工作&#xff0c;第一天正式上班还挺高兴&#xff0c;第二天就开始愁眉苦脸了。就是因为他这销售实在是太麻烦&#xff0c;以后每天要到一些B2B网站去找一些客户信息&#xff0c;每天要找几百条&#xff0c;刚开始我还安慰的说…

大型网站架构演变和知识体系

之前也有一些介绍大型网站架构演变的文章&#xff0c;例如LiveJournal的、ebay的&#xff0c;都是非常值得参考的&#xff0c;不过感觉他们讲的更多的是每次演变的结果&#xff0c;而没有很详细的讲为什么需要做这样的演变&#xff0c;再加上近来感觉有不少同学都很难明白为什么…

【支持升级官方最新版】西部数码主机代理系统模板源码IDC网站源码虚拟主机代理管理系统

【关于升级】此系统为西部数码代理系统源码更改的&#xff0c;所以支持后台更新官方最新补丁&#xff08;已测试&#xff0c;此更新只涉及核心文件及自带模板文件&#xff0c;不包括这个二开的模板文件&#xff09; 【开发环境】ASPACCESS win32位系统【你的服务器需要具备这…

10个优质免费PPT模板下载网站推荐

第1名&#xff1a;PPT汇 网址&#xff1a;www.ppthui.com 是否付费&#xff1a;免费 模板质量&#xff1a;★★★★★ &#xff08;5分&#xff09; 浏览体验&#xff1a;★★★★★ &#xff08;5分&#xff09; 下载体验&#xff1a;★★★★★ &#xff08;5分&#xff09; …

哪里有纯免费的PPT模板下载网站?

百度搜索PPT出来的全是打着免费PPT的幌子进去需要注册、充值VIP的网站&#xff0c;费钱费力。 笔者搜索了好久才找到一个纯免费不需要注册的PPT免费模板下载网站&#xff1a; PPT汇 https://www.ppthui.com 无需注册完全免费值得收藏&#xff01;

网站全站变成灰色实现方式参考

1.前言 近几日&#xff0c;大部分的网站的内容都变成了灰色&#xff0c;包括按钮、图片等等。为了纪念伟人。 在前两天临近下班的时候&#xff0c;接到通知 &#xff0c;手中负责的项目门户网要变成灰色&#xff0c;因为我们做的都和ZF相关&#xff0c;以前没有经历过&#xf…

部署个人网站

1.登录云服务器——云服务器实例——拿到公网ip 2.安装xshell&#xff1a; https://www.netsarang.com/zh/free-for-home-school/ 打开xshell新建会话——名称自取——主机填公网ip——端口号随意&#xff1a;22——点链接输入超管账号和密码&#xff1a;一般账号是root——链…

MVC架构公司数据查询网站_某年某月_新浪博客

整合公司资源&#xff0c;实现跨平台&#xff0c;跨区域&#xff0c;跨数据库 后期准备做供应商报价管理

腾讯云服务器部署和数据库连接——【石家庄正定光辉钢化玻璃厂】网站部署

为了做【石家庄正定光辉钢化玻璃厂】的官方网站&#xff0c;购买了腾讯云服务器CVM和云数据库。 现在将部署的步骤记录一下&#xff08;毕竟是第一次建站&#xff0c;还是登记一下备忘&#xff09;。如果哪里有错误感谢大家斧正。 目录 部署的准备 云环境 开发环境 项目部…