栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

基于javaweb+jsp的在线旅游系统(java+jsp+SSM+Spring+mysql+maven)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

基于javaweb+jsp的在线旅游系统(java+jsp+SSM+Spring+mysql+maven)

一、项目简述

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

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

项目技术:

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




适用

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

    @RequestMapping("/findOtherRooms.do")
    public ModelAndView findOtherRooms(Integer hid)throws Exception{
        ModelAndView mv = new ModelAndView();
        Hotel hotel = hotelService.findByHid(hid);
        mv.addObject("hotel",hotel);
        List list = hotelService.findOtherRooms(hid);
        mv.addObject("room",list);
        mv.setViewName("hotel-room-add");
        return mv;
    }
    //添加未拥有的房型
    @RequestMapping("/addRoom.do")
    public String addRoom(@RequestParam(name = "hid") Integer hid, @RequestParam(name = "ids") int[] ids,@RequestParam(name = "prices")String[] prices)throws Exception{
        List list = new ArrayList();
        for (int i=0;i
            if (prices[i]!=""){
               list.add(Double.valueOf(prices[i]));
            }
        }
        if (ids.length==list.size()){
            hotelService.addRoom(hid,ids,list);
       }
        return "redirect:findAll.do";
    }
    //查看酒店房型详情
    @RequestMapping("/findByUid.do")
        mv.addObject("room",list);
        mv.setViewName("hotel-room-remove");
        return mv;
    }
    //移除已拥有的房型
    @RequestMapping("/removeRoom.do")
    public String removeRoom(@RequestParam(name = "hid") Integer hid, @RequestParam(name = "ids") int[] ids)throws Exception{
        hotelService.removeRoom(hid,ids);
        return "redirect:findAll.do";
    }
    //根据hid查看未拥有的房型
    @RequestMapping("/findOtherRooms.do")
    public ModelAndView findOtherRooms(Integer hid)throws Exception{
        ModelAndView mv = new ModelAndView();
        Hotel hotel = hotelService.findByHid(hid);
        mv.addObject("hotel",hotel);
        List list = hotelService.findOtherRooms(hid);
        mv.addObject("room",list);
        mv.setViewName("hotel-room-add");
        return mv;
    }
    //添加未拥有的房型
    @RequestMapping("/addRoom.do")
        Category cate = categoryService.findByCid(cid);
        mv.addObject("cateInfo",cate);
        mv.setViewName("cate-update");
        return mv;
    }
    //查询所有线路分类
    @RequestMapping("/findAll.do")
    public ModelAndView findAll(
            @RequestParam(name="page",required = true, defaultValue = "1") Integer page,
            @RequestParam(name="size",required = true, defaultValue = "10") Integer size,
            @RequestParam(name="cname",required = true, defaultValue = "") String cname
    ) throws Exception{
        ModelAndView mv = new ModelAndView();
        List list = categoryService.findAll(page,size,"%"+cname+"%");
        PageInfo pageInfo = new PageInfo(list);
        mv.addObject("pageInfo",pageInfo);
        mv.setViewName("cate-list");
        return mv;
    }
}
订单信息控制层:
        List list = categoryService.findAll(page,size,"%"+cname+"%");
        PageInfo pageInfo = new PageInfo(list);
        mv.addObject("pageInfo",pageInfo);
        mv.setViewName("cate-list");
        return mv;
    }
}
订单信息控制层:

@Controller
@RequestMapping("/orders")
    }
}
订单信息控制层:

@Controller
@RequestMapping("/orders")
public class OrderController {
    @Autowired
    private IOrderService orderService;
    //删除酒店订单
    @RequestMapping("/delete.do")
    @PreAuthorize("hasAnyAuthority('/orders/delete.do')")
    public String delete(Integer id) throws Exception{
        orderService.delete(id);
        return "redirect:findAll.do";
    }
    //删除景点订单
        List hoteldetail = hotelService.findDetail(hid);
        mv.addObject("details",hoteldetail);
        mv.setViewName("hotel-detail");
        return mv;
    }
    //新增酒店
    @RequestMapping("/findUsers.do")
    public ModelAndView findUsers() throws Exception{
        List list = hotelService.findUsers();
        ModelAndView mv = new ModelAndView();
        mv.addObject("users",list);
        mv.setViewName("hotel-add");
        return mv;
    }
    }
    //查询所有线路分类
    @RequestMapping("/findAll.do")
    public ModelAndView findAll(
            @RequestParam(name="page",required = true, defaultValue = "1") Integer page,
            @RequestParam(name="size",required = true, defaultValue = "10") Integer size,
            @RequestParam(name="cname",required = true, defaultValue = "") String cname
    ) throws Exception{
        ModelAndView mv = new ModelAndView();
        List list = categoryService.findAll(page,size,"%"+cname+"%");
        PageInfo pageInfo = new PageInfo(list);
        mv.addObject("pageInfo",pageInfo);
        mv.setViewName("cate-list");
        return mv;
    //删除酒店
    @RequestMapping("/delete.do")
    public String delete(Integer hid) throws Exception {
        hotelService.delete(hid);
        return "redirect:findAll.do";
    }
    //修改酒店信息
    @RequestMapping("/findU.do")
    public ModelAndView findU(Integer hid) throws Exception{
        ModelAndView mv = new ModelAndView();
        Hotel hotel = hotelService.findByHid(hid);
        mv.addObject("hotel",hotel);
        List list = iUserService.findAll(1,100,"%%");
        List list = hotelService.findUsers();
        ModelAndView mv = new ModelAndView();
        mv.addObject("users",list);
        mv.setViewName("hotel-add");
        return mv;
    }
    @RequestMapping("/save.do")
    public String save(Hotel hotel) throws Exception{
        if (hotel.getHimageFile()!=null){
            String filename = Upload.uploadImg(HIMAGE,hotel.getHimageFile());
            hotel.setHimage("img/hotel/"+filename);
            hotelService.save(hotel);
        }
        return "redirect:findAll.do";
    }
    //删除酒店
    @RequestMapping("/delete.do")
    public String delete(Integer hid) throws Exception {
        hotelService.delete(hid);
        return "redirect:findAll.do";
    }
    //修改酒店信息
    @RequestMapping("/findU.do")
        ModelAndView mv = new ModelAndView();
        List list = hotelService.findDetail(hid);
        mv.addObject("room",list);
        mv.setViewName("hotel-room-remove");
        return mv;
    }
    //移除已拥有的房型
    @RequestMapping("/removeRoom.do")
    public String removeRoom(@RequestParam(name = "hid") Integer hid, @RequestParam(name = "ids") int[] ids)throws Exception{
        hotelService.removeRoom(hid,ids);
        return "redirect:findAll.do";
    }
    //根据hid查看未拥有的房型
    @RequestMapping("/findOtherRooms.do")
    public ModelAndView findOtherRooms(Integer hid)throws Exception{
        ModelAndView mv = new ModelAndView();
        Hotel hotel = hotelService.findByHid(hid);
        mv.addObject("hotel",hotel);
        List list = hotelService.findOtherRooms(hid);
        mv.addObject("room",list);
        mv.setViewName("hotel-room-add");
        return mv;
    }
               list.add(Double.valueOf(prices[i]));
            }
        }
        if (ids.length==list.size()){
            hotelService.addRoom(hid,ids,list);
       }
        return "redirect:findAll.do";
    }
    //查看酒店房型详情
    @RequestMapping("/findByUid.do")
    public ModelAndView findByUid(Integer hid)throws Exception{
        ModelAndView mv = new ModelAndView();
        Hotel hotel = hotelService.findByHid(hid);
        mv.addObject("hotel",hotel);
        List hoteldetail = hotelService.findDetail(hid);
        mv.addObject("details",hoteldetail);
        mv.setViewName("hotel-detail");
        return mv;
    }
    //新增酒店
    @RequestMapping("/findUsers.do")
    public ModelAndView findUsers() throws Exception{
        List list = hotelService.findUsers();

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/915294.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号