当前位置:   article > 正文

Java项目:在线旅游系统(java+jsp+SSM+Spring+mysql+maven)_java全国旅游可视化大屏

java全国旅游可视化大屏

源码获取:博客首页 "资源" 里下载!

一、项目简述


功能:用户的登录注册,旅游景点的展示,旅游预订,收藏,购买,以及酒店住宿留言等等,后台管理员,订单管理,景点管理,留言管理,分类管理吗,以及系统管理等等。

二、项目运行

环境配置:

Jdk1.8 + Tomcat8.5 + mysql + Idea2019(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)

项目技术:

JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等
 

酒店信息控制层:

  1. /**
  2. * @Author: yy
  3. * @Description: TODO(酒店信息)
  4. */
  5. @Controller
  6. @RequestMapping("/hotels")
  7. public class HotelController {
  8. @Autowired
  9. private IHotelService hotelService;
  10. @Autowired
  11. private IUserService iUserService;
  12. //根据hid查看已拥有的房型
  13. @RequestMapping("/findRooms.do")
  14. public ModelAndView findRooms(Integer hid)throws Exception{
  15. ModelAndView mv = new ModelAndView();
  16. List<Hoteldetail> list = hotelService.findDetail(hid);
  17. mv.addObject("room",list);
  18. mv.setViewName("hotel-room-remove");
  19. return mv;
  20. }
  21. //移除已拥有的房型
  22. @RequestMapping("/removeRoom.do")
  23. public String removeRoom(@RequestParam(name = "hid") Integer hid, @RequestParam(name = "ids") int[] ids)throws Exception{
  24. hotelService.removeRoom(hid,ids);
  25. return "redirect:findAll.do";
  26. }
  27. //根据hid查看未拥有的房型
  28. @RequestMapping("/findOtherRooms.do")
  29. public ModelAndView findOtherRooms(Integer hid)throws Exception{
  30. ModelAndView mv = new ModelAndView();
  31. Hotel hotel = hotelService.findByHid(hid);
  32. mv.addObject("hotel",hotel);
  33. List<Hoteltype> list = hotelService.findOtherRooms(hid);
  34. mv.addObject("room",list);
  35. mv.setViewName("hotel-room-add");
  36. return mv;
  37. }
  38. //添加未拥有的房型
  39. @RequestMapping("/addRoom.do")
  40. public String addRoom(@RequestParam(name = "hid") Integer hid, @RequestParam(name = "ids") int[] ids,@RequestParam(name = "prices")String[] prices)throws Exception{
  41. List list = new ArrayList();
  42. for (int i=0;i<prices.length;i++) {
  43. if (prices[i]!=""){
  44. list.add(Double.valueOf(prices[i]));
  45. }
  46. }
  47. if (ids.length==list.size()){
  48. hotelService.addRoom(hid,ids,list);
  49. }
  50. return "redirect:findAll.do";
  51. }
  52. //查看酒店房型详情
  53. @RequestMapping("/findByUid.do")
  54. public ModelAndView findByUid(Integer hid)throws Exception{
  55. ModelAndView mv = new ModelAndView();
  56. Hotel hotel = hotelService.findByHid(hid);
  57. mv.addObject("hotel",hotel);
  58. List<Hoteldetail> hoteldetail = hotelService.findDetail(hid);
  59. mv.addObject("details",hoteldetail);
  60. mv.setViewName("hotel-detail");
  61. return mv;
  62. }
  63. //新增酒店
  64. @RequestMapping("/findUsers.do")
  65. public ModelAndView findUsers() throws Exception{
  66. List<User> list = hotelService.findUsers();
  67. ModelAndView mv = new ModelAndView();
  68. mv.addObject("users",list);
  69. mv.setViewName("hotel-add");
  70. return mv;
  71. }
  72. @RequestMapping("/save.do")
  73. public String save(Hotel hotel) throws Exception{
  74. if (hotel.getHimageFile()!=null){
  75. String filename = Upload.uploadImg(HIMAGE,hotel.getHimageFile());
  76. hotel.setHimage("img/hotel/"+filename);
  77. hotelService.save(hotel);
  78. }
  79. return "redirect:findAll.do";
  80. }
  81. //删除酒店
  82. @RequestMapping("/delete.do")
  83. public String delete(Integer hid) throws Exception {
  84. hotelService.delete(hid);
  85. return "redirect:findAll.do";
  86. }
  87. //修改酒店信息
  88. @RequestMapping("/findU.do")
  89. public ModelAndView findU(Integer hid) throws Exception{
  90. ModelAndView mv = new ModelAndView();
  91. Hotel hotel = hotelService.findByHid(hid);
  92. mv.addObject("hotel",hotel);
  93. List<User> list = iUserService.findAll(1,100,"%%");
  94. mv.addObject("UList",list);
  95. mv.setViewName("hotel-update");
  96. return mv;
  97. }
  98. @RequestMapping("/update.do")
  99. public String update(Hotel hotel) throws Exception{
  100. if (hotel.getHimageFile().getSize()!=0&&hotel.getHimageFile()!=null){//修改过图片
  101. String filename = Upload.uploadImg(HIMAGE,hotel.getHimageFile());
  102. hotel.setHimage("img/hotel/"+filename);
  103. hotelService.update(hotel);
  104. }else{//未修改图片
  105. hotelService.update(hotel);
  106. }
  107. return "redirect:findAll.do";
  108. }
  109. //查询所有订单
  110. @RequestMapping("/findAll.do")
  111. public ModelAndView findAll(
  112. @RequestParam(name = "page",defaultValue = "1")Integer page,
  113. @RequestParam(name = "size",defaultValue = "10")Integer size,
  114. @RequestParam(name = "search",defaultValue = "")String search
  115. ) throws Exception{
  116. ModelAndView mv = new ModelAndView();
  117. List<Hotel> list = hotelService.findAll(page,size,"%"+search+"%");
  118. PageInfo pageInfo = new PageInfo(list);
  119. mv.addObject("pageInfo",pageInfo);
  120. mv.setViewName("hotel-list");
  121. return mv;
  122. }
  123. }

景点分类控制层:

  1. /**
  2. * @Author: yy
  3. * @Description: TODO(景点分类)
  4. */
  5. @Controller
  6. @RequestMapping("/cates")
  7. public class CategoryController {
  8. @Autowired
  9. private ICategoryService categoryService;
  10. //新增分类
  11. @RequestMapping("/save.do")
  12. @PreAuthorize("hasAnyAuthority('/cates/save.do')")
  13. public String save(Category category) throws Exception{
  14. categoryService.save(category);
  15. return "redirect:findAll.do";
  16. }
  17. //删除分类
  18. @RequestMapping("/delete.do")
  19. @PreAuthorize("hasAnyAuthority('/cates/delete.do')")
  20. public String delete(Integer cid) throws Exception{
  21. categoryService.delete(cid);
  22. return "redirect:findAll.do";
  23. }
  24. //修改分类
  25. @RequestMapping("/update.do")
  26. public String update(Category category) throws Exception{
  27. categoryService.update(category);
  28. return "redirect:findAll.do";
  29. }
  30. //根据cid查询
  31. @RequestMapping("/findByCid.do")
  32. public ModelAndView findByCid(Integer cid) throws Exception {
  33. ModelAndView mv = new ModelAndView();
  34. Category cate = categoryService.findByCid(cid);
  35. mv.addObject("cateInfo",cate);
  36. mv.setViewName("cate-update");
  37. return mv;
  38. }
  39. //查询所有线路分类
  40. @RequestMapping("/findAll.do")
  41. public ModelAndView findAll(
  42. @RequestParam(name="page",required = true, defaultValue = "1") Integer page,
  43. @RequestParam(name="size",required = true, defaultValue = "10") Integer size,
  44. @RequestParam(name="cname",required = true, defaultValue = "") String cname
  45. ) throws Exception{
  46. ModelAndView mv = new ModelAndView();
  47. List<Category> list = categoryService.findAll(page,size,"%"+cname+"%");
  48. PageInfo pageInfo = new PageInfo(list);
  49. mv.addObject("pageInfo",pageInfo);
  50. mv.setViewName("cate-list");
  51. return mv;
  52. }
  53. }

订单信息控制层:

  1. /**
  2. * @Author: yy
  3. * @Description: TODO(订单信息)
  4. */
  5. @Controller
  6. @RequestMapping("/orders")
  7. public class OrderController {
  8. @Autowired
  9. private IOrderService orderService;
  10. //删除酒店订单
  11. @RequestMapping("/delete.do")
  12. @PreAuthorize("hasAnyAuthority('/orders/delete.do')")
  13. public String delete(Integer id) throws Exception{
  14. orderService.delete(id);
  15. return "redirect:findAll.do";
  16. }
  17. //删除景点订单
  18. @RequestMapping("/deleteRoute.do")
  19. @PreAuthorize("hasAnyAuthority('/orders/deleteRoute.do')")
  20. public String deleteRoute(Integer id) throws Exception{
  21. orderService.deleteRoute(id);
  22. return "redirect:findAllRoute.do";
  23. }
  24. //查询所有景点订单
  25. @RequestMapping("/findAllRoute.do")
  26. public ModelAndView findAllRoute(
  27. @RequestParam(name = "page",defaultValue = "1")Integer page,
  28. @RequestParam(name = "size",defaultValue = "7")Integer size,
  29. @RequestParam(name = "search",defaultValue = "")String search
  30. ) throws Exception{
  31. ModelAndView mv = new ModelAndView();
  32. List<RouteOrder> list = orderService.findAllRoute(page,size,"%"+search+"%");
  33. PageInfo pageInfo = new PageInfo(list);
  34. mv.addObject("pageInfo",pageInfo);
  35. mv.setViewName("rorder-list");
  36. return mv;
  37. }
  38. //查询所有酒店订单
  39. @RequestMapping("/findAll.do")
  40. @PreAuthorize("hasAnyAuthority('/orders/findAll.do')")
  41. public ModelAndView findAll(
  42. @RequestParam(name = "page",defaultValue = "1")Integer page,
  43. @RequestParam(name = "size",defaultValue = "7")Integer size,
  44. @RequestParam(name = "search",defaultValue = "")String search
  45. ) throws Exception{
  46. ModelAndView mv = new ModelAndView();
  47. List<Order> list = orderService.findAll(page,size,"%"+search+"%");
  48. PageInfo pageInfo = new PageInfo(list);
  49. mv.addObject("pageInfo",pageInfo);
  50. mv.setViewName("order-list");
  51. return mv;
  52. }
  53. }

 

源码获取:博客首页 "资源" 里下载!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/872774
推荐阅读
相关标签
  

闽ICP备14008679号