博主介绍:java高级开发,从事互联网行业六年,熟悉各种主流语言,精通java、python、php、爬虫、web开发,已经从做了六年的毕业设计程序开发,开发过上千套毕业设计程序,没有什么华丽的语言,只有实实在在的写点程序。
🍅文末获取联系🍅
基于SSM的航空订票系统根据功能设计划分为管理员用户和注册用户,从这两种用户的功能所需展开设计,管理员对注册用户管理、航班管理、航班时刻管理、通知公告管理、订票管理、退票管理等;注册用户主要是注册成功后登录,机票查询,预定机票,退票、管理个人资料、修改密码、查看订票记录、查看退票记录等功能。
管理员管理航班信息,添加航班的编号、出发地机场、出发地航站楼、目的地、目的地机场、目的地航站楼、行程时间、座位数、头等舱座位数、头等舱价格、经济舱价格、经济舱座位数,然后进行座位的排号,添加后可以修改、删除、搜索查看航班信息,如图所示:
相关代码:
public String mgHangList(Model model, QueryVo vo, HttpServletRequest rq, HttpSession httpSession,@RequestParam(required = false, defaultValue = "1") Integer page,@RequestParam(required = false, defaultValue = "10") Integer pageSize) {PageHelper.startPage(page, pageSize);HangExample example = new HangExample();example.setOrderByClause("hid desc");example.setDistinct(false);HangExample.Criteria c = example.createCriteria();if ((vo.getQname() != null) && !("".equals(vo.getQname()))) {/*c.andHidLike("%" + vo.getQname() + "%");*/c.andHnoLike("%" + vo.getQname() + "%");c.andHbplaceLike("%" + vo.getQname() + "%");c.andHbjichLike("%" + vo.getQname() + "%");c.andHblouLike("%" + vo.getQname() + "%");c.andHeplaceLike("%" + vo.getQname() + "%");c.andHejichLike("%" + vo.getQname() + "%");c.andHelouLike("%" + vo.getQname() + "%");/*c.andHstatusLike("%" + vo.getQname() + "%");*/c.andHtimeLike("%" + vo.getQname() + "%");/*c.andHzwnumLike("%" + vo.getQname() + "%");c.andHtdczwLike("%" + vo.getQname() + "%");c.andHtdcpriceLike("%" + vo.getQname() + "%");c.andHjjczwLike("%" + vo.getQname() + "%");c.andHjicpriceLike("%" + vo.getQname() + "%");c.andHrekLike("%" + vo.getQname() + "%");*/}List list = hangService.GetList(example);PageInfo p = new PageInfo(list);Integer count = hangService.GetCountOfList(example);model.addAttribute("ulist", list);model.addAttribute("count", count);model.addAttribute("p", p);model.addAttribute("vo", vo);return "/admin/hang/list";}
管理员对注册用户信息管理,查看用户的姓名、账号、性别、电话、邮箱信息、地址,并可以搜索、删除用户信息,如图所示:
相关代码:
public String doUserinfoUdt(Model model,Userinfo nsfo, HttpServletRequest rq, HttpSession httpSession) {Userinfo entity = userinfoService.GetInfoById(nsfo.getUid());entity.setUlog(nsfo.getUlog());entity.setUpwd(nsfo.getUpwd());userinfoService.Update(entity);model = new utils.BaseCls().setReModel(model, "201", , "/hyticket/ur/mgUserinfoList.action");return "/admin/user/update";public String delUserinfo(Model model, Integer id, HttpServletRequest rq, HttpSession httpSession) {Userinfo entity = userinfoService.GetInfoById(id);entity.setUstatus(1);userinfoService.Update(entity);return "redirect:mgUserinfoList.action";
管理员管理航班的时刻信息,添加航班、出发地、出发地机场、目的地、目的地机场、出发时间、到达时间、行程时间,并可以搜索、修改、删除航班时刻,如图所示:
代码:
public String doVtimeAdd(Model model, Vtime nsfo, HttpServletRequest rq, HttpSession httpSession) {Hang entity = hangService.GetInfoById(nsfo.getVthid());nsfo.setVttdczw0(entity.getHtdczw());nsfo.setVtjjczw0(entity.getHjjczw());nsfo.setVtstatus(0);vtimeService.Add(nsfo);VtimeExample example = new VtimeExample();example.setOrderByClause("vtid desc");List list = vtimeService.GetList(example);Integer newid=list.get(0).getVtid();HpositionExample exp=new HpositionExample();HpositionExample.Criteria cp=exp.createCriteria();cp.andZhidEqualTo(entity.getHid());List lstp = hpositionService.GetList(exp);for(int i=0; i
管理员查看用户的订票详细,如航班、出发地、到达时间、订票数量、总价等信息,并可以查看退票情况,如图所示:
相关代码:
public String mgOrderdsList(Model model, QueryVo vo, HttpServletRequest rq, HttpSession httpSession,@RequestParam(required = false, defaultValue = "1") Integer page,@RequestParam(required = false, defaultValue = "10") Integer pageSize) {PageHelper.startPage(page, pageSize);OrderdsExample example = new OrderdsExample();example.setOrderByClause("odid desc");example.setDistinct(false);OrderdsExample.Criteria c = example.createCriteria();if ((vo.getQname() != null) && !("".equals(vo.getQname()))) {c.andOdtidLike("%" + vo.getQname() + "%");c.andOdoidLike("%" + vo.getQname() + "%");*/c.andOduidentidLike("%" + vo.getQname() + "%");c.andOdutelLike("%" + vo.getQname() + "%");c.andOdunameLike("%" + vo.getQname() + "%");PageInfo p = new PageInfo(list);Integer count = orderdsService.GetCountOfList(example);model.addAttribute("ulist", list);model.addAttribute("count", count);model.addAttribute("p", p);model.addAttribute("vo", vo);return "/admin/Orderds/list";
用户想要预定机票必须要先注册,点击注册按钮,填写相关的注册信息,点击注册按钮,完成注册,如图所示:
代码:
public String regis(Userinfo userinfo, Model model) {PageHelper.startPage(1, 1);UserinfoExample example = new UserinfoExample();UserinfoExample.Criteria c = example.createCriteria();c.andUlogEqualTo(userinfo.getUlog());List list = userinfoService.GetList(example);if (list.size() > 0) {model = new utils.BaseCls().setReModel(model, "404", "账号已存在,请更换!", "/hyticket/ur/toregis.action");return "/home/regis";}SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");userinfo.setUaddtime(sdf.format(new Date()));userinfo.setUrole(1);userinfoService.Add(userinfo);model = new utils.BaseCls().setReModel(model, "201", "注册成功,快去登录吧!", "/hyticket/ur/tologin.action");return "/home/regis";}
用户可以按照出发城市、到达城市、出发日期、返程日期查询具体的机票信息,查看剩余票数、价格等信息,如图所示:
相关代码:
public String mgHangList(Model model, QueryVo vo, HttpServletRequest rq, HttpSession httpSession,@RequestParam(required = false, defaultValue = "1") Integer page,@RequestParam(required = false, defaultValue = "10") Integer pageSize) {PageHelper.startPage(page, pageSize);HangExample example = new HangExample();example.setOrderByClause("hid desc");example.setDistinct(false);HangExample.Criteria c = example.createCriteria();if ((vo.getQname() != null) && !("".equals(vo.getQname()))) {/*c.andHidLike("%" + vo.getQname() + "%");*/c.andHnoLike("%" + vo.getQname() + "%");c.andHbplaceLike("%" + vo.getQname() + "%");c.andHbjichLike("%" + vo.getQname() + "%");c.andHblouLike("%" + vo.getQname() + "%");c.andHeplaceLike("%" + vo.getQname() + "%");c.andHejichLike("%" + vo.getQname() + "%");c.andHelouLike("%" + vo.getQname() + "%");/*c.andHstatusLike("%" + vo.getQname() + "%");*/c.andHtimeLike("%" + vo.getQname() + "%");
机票预定页面
注册用户登录后输入订票人姓名、身份证号、手机号码可以预定机票,最多只能预定三位乘客的机票,如图所示:
相关代码:
public String toOrdersAdd(Model model, HttpServletRequest rq,HttpSession httpSession) {return "/admin/order/add";public String doOrdersAdd(Model model, Orders nsfo, HttpServletRequest rq,HttpSession httpSession) {ordersService.Add(nsfo);model = new utils.BaseCls().setReModel(model, "201", "添加成功!","/hyticket/od/mgOrdersList.action");return "/admin/order/add";public String mgOrdersList(Model model,QueryVo vo,HttpServletRequest rq,HttpSession httpSession,@RequestParam(required = false, defaultValue = "1") Integer page,@RequestParam(required = false, defaultValue = "10") Integer pageSize) {PageHelper.startPage(page, pageSize);VworderExample example = new VworderExample();example.setOrderByClause("oid desc");example.setDistinct(false);
订票明细页面
用户预定机票后可以查看具体机票信息,并可以退票,如图所示:
相关代码:
public String toOrdersDs(model.addAttribute("entity", entity);VworderdsExample.Criteria c = example.createCriteria();c.andOdoidEqualTo(id);List list = vworderdsService.GetList(example);PageInfo p = new PageInfo(list);Integer count = vworderdsService.GetCountOfList(example);model.addAttribute("ulist", list);model.addAttribute("count", count);model.addAttribute("p", p);
以上是基于SSM的航空订票系统的分析与设计主要功能和实现页面的介绍。