项目介绍
在现代社会中,航空旅行已经成为人们出行的重要方式之一。随着航空业的不断发展和市场竞争的加剧,航空机票的订购和销售也面临着一系列的挑战。为了提供更好的航空服务,开发一个高效、便捷的航空机票订票系统至关重要。
传统的订票方式包括电话预订和前往机场或航空代理商办理,但这种方式存在一些问题。首先,由于电话预订需要人工操作,容易出现信息录入错误或交流不畅的情况。其次,前往机场或航空代理商办理相对繁琐,需要花费时间和精力。此外,由于航班信息和价格实时变动,无法实时获取最新的航班信息和优惠票价,影响用户的选择和比较。
因此,开发一个航空机票订票系统能够解决以上问题,提供更方便、快捷的订票服务。通过这个系统,用户可以在网上浏览和查询各航空公司的航班信息、票价、座位预订情况等。同时,用户可以直接在线支付并获得电子机票,避免了排队和等候的麻烦。系统还可以提供航班动态跟踪功能,及时通知用户航班延误、取消等信息,方便用户做出相应的调整。
此外,航空机票订票系统还可以结合用户需求和偏好,推荐适合的航班和优惠票价。系统可以根据用户的出发地、目的地、时间等条件进行智能筛选,并展示最佳的选择结果。这样一来,用户可以更加方便地进行比较和决策,提升订票的满意度和效率。
通过航空机票订票系统,航空公司和旅客都可以受益。航空公司可以提高销售渠道的覆盖范围和效率,减少人工成本。旅客可以轻松自主地完成航班预订,同时获得实时更新的航班信息,提升旅行体验。这个系统的开发将有助于促进航空旅行服务的创新和发展,为用户提供更好的出行选择。
技术介绍
开发语言:Java
框架:SSM
前端框架:vue.js
JDK版本:JDK1.8+
服务器:tomcat8+
数据库工具:Navicat
开发软件:idea 支持eclipse
ssm是当前最流向的一个框架,它的配置更加的简单,使开发变得更加的简单迅速。
ssm的基础结构共三个文件,具体如下:
src/main/java:程序开发以及主程序入口;
src/main/resources:配置文件;
src/test/java:测试程序。
ssm的数据库配置默认支持两种格式的配置文件
1,application.properties
2,application.yaml
项目界面
航空订票系统是在Windows操作系统中进行开发运用的,而且目前PC机的各项性能已经可以胜任普通网站的web服务器。系统开发所使用的技术也都是自身所具有的,也是当下广泛应用的技术之一。
系统的开发环境和配置都是可以自行安装的,系统使用Java开发工具,使用比较成熟的Mysql数据库进行对系统前台及后台的数据交互,根据技术语言对数据库,结合需求进行修改维护,可以使得网站运行更具有稳定性和安全性,从而完成实现网站的开发。
硬件可行性分析:航空订票管理及信息分析的设计对于所使用的计算机没有什么硬性的要求,计算机只要可以正常的使用进行代码的编写及页面设计就可行,主要是对于服务器有些要求,对于平台搭建完成要上传的服务器是有一定的要求的,服务器必须选择安全性比较高的,然后就是在打开网站必须顺畅,不能停顿太长时间:性价比高:安全性高。
关键代码
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
* 登录相关
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 退出
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("密码已重置为:123456");
}
/**
* 列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
return R.error("用户名已存在。");
}
userService.updateById(user);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
目录
目 录
目 录 III
1 绪论 1
1.1 研究背景 1
1.2 目的和意义 1
1.3 论文结构安排 2
2 相关技术 3
2.1 SSM框架介绍 3
2.2 B/S结构介绍 3
2.3 Mysql数据库介绍 4
3 系统分析 6
3.1 系统可行性分析 6
3.1.1 技术可行性分析 6
3.1.2 经济可行性分析 6
3.1.3 运行可行性分析 6
3.2 系统性能分析 7
3.2.1 易用性指标 7
3.2.2 可扩展性指标 7
3.2.3 健壮性指标 7
3.2.4 安全性指标 8
3.3 系统流程分析 8
3.3.1 操作流程分析 8
3.3.2 登录流程分析 9
3.3.3 信息添加流程分析 10
3.3.4 信息删除流程分析 11
4 系统设计 12
4.1 系统概要设计 12
4.2 系统功能结构设计 12
4.3 数据库设计 13
4.3.1 数据库E-R图设计 13
4.3.2 数据库表结构设计 14
5 系统实现 17
5.1用户部分功能17
5.2 管理员部分功能展示
6 系统测试
6.1 系统测试的特点
6.2 系统功能测试
6.2.1 登录功能测试
6.2.2 添加类别功能测试
6.3 测试结果分析
结 论
致 谢
参考文献