- 项目概述
1.1项目目标和主要内容
进入飞机订票管理系统后,可以选择身份类型,进入相应的用户管理系统,管理员管理系统。用户管理系统可以进行注册,登录,查看航班,订票,找回密码。管理员管理系统可以进行注册,登录,进入三个信息系统,进入飞机信息管理系统,对飞机的信息进行增删改查,航班系统,对航班信息进行增删改查,进入机票系统,对机票系统进行增删改查。
- 项目设计
- 创建各数据库类表用来存放个人信息,管理员信息,飞机信息,航班信息和飞机票订票信息
-
CREATE TABLE Users( user_id VARCHAR(10) NOT NULL PRIMARY KEY COMMENT '身份证号', user_name VARCHAR(10) NOT NULL COMMENT '姓名', user_password VARCHAR(10) NOT NULL COMMENT '密码', user_sex CHAR(1) NOT NULL COMMENT '性别', user_phone VARCHAR(11) COMMENT '电话号码', user_health VARCHAR(10) NOT NULL COMMENT '核酸检测' )ENGINE = INNODB DEFAULT CHARSET = utf8; CREATE TABLE Administrator( adm_name VARCHAR(10) NOT NULL PRIMARY KEY COMMENT '管理员名', adm_password VARCHAR(10) NOT NULL COMMENT '管理员密码' )ENGINE = INNODB DEFAULT CHARSET = utf8; CREATE TABLE Airplane( plane_id VARCHAR(10) NOT NULL PRIMARY KEY COMMENT '飞机编号', plane_model VARCHAR(10) NOT NULL COMMENT '飞机型号', plane_seatNum INT(255) NOT NULL COMMENT '飞机总座位数', plane_age INT(100) NOT NULL COMMENT '飞机飞行年份' )ENGINE = INNODB DEFAULT CHARSET = utf8; CREATE TABLE Fight( fight_id VARCHAR(10) NOT NULL PRIMARY KEY COMMENT '航班号', origin VARCHAR(10) NOT NULL COMMENT '出发地', destination VARCHAR(10) NOT NULL COMMENT '目的地', go_time VARCHAR(10) NOT NULL COMMENT '出发时间', arr_time VARCHAR(10) NOT NULL COMMENT '到达时间', fly_time VARCHAR(10) NOT NULL COMMENT '飞行时间', planemodel VARCHAR(10) NOT NULL COMMENT '飞机型号' )ENGINE = INNODB DEFAULT CHARSET = utf8; CREATE TABLE Ticket( username VARCHAR(10) NOT NULL PRIMARY KEY COMMENT '用户姓名', fight_id VARCHAR(10) NOT NULL COMMENT '航班号', board_time VARCHAR(10) NOT NULL COMMENT '登机时间', board_gate VARCHAR(10) NOT NULL COMMENT '登机口', terminal VARCHAR(5) NOT NULL COMMENT '航站楼', seat_num INT(255) NOT NULL COMMENT '座位号', local_time VARCHAR(10) NOT NULL COMMENT '起飞日期', origin VARCHAR(10) NOT NULL COMMENT '出发地', ship_gate INT(255) NOT NULL COMMENT '托运口' )ENGINE = INNODB DEFAULT CHARSET = utf8; package bean; public class Users { //用户实体类 private String user_name; //用户名 private String user_password; //用户密码 private String user_sex;//用户性别 private String user_id;//身份证号 private String user_phone;//电话号码 private String user_health;//核酸检测信息
创建类用来使得各类人群分别具有查看,修改,更新,订票等功能例如
-
public class Users { //用户实体类 private String user_name; //用户名 private String user_password; //用户密码 private String user_sex;//用户性别 private String user_id;//身份证号 private String user_phone;//电话号码 private String user_health;//核酸检测信息 public Users() { // TODO Auto-generated constructor stub } public Users(String name,String password,String sex,String id,String phone,String health) { this.user_name = name; this.user_password = password; this.user_sex = sex; this.user_id = id; this.user_phone = phone; this.user_health = health; } public String getUser_name() { return user_name; } public void setUser_name(String user_name) { this.user_name = user_name; } public String getUser_password() { return user_password; } public void setUser_password(String user_password) { this.user_password = user_password; } public String getUser_sex() { return user_sex; } public void setUser_sex(String user_sex) { this.user_sex = user_sex; } public String getUser_id() { return user_id; } public void setUser_id(String user_id) { this.user_id = user_id; } public String getUser_phone() { return user_phone; } public void setUser_phone(String user_phone) { this.user_phone = user_phone; } public String getUser_health() { return user_health; } public void setUser_health(String user_health) { this.user_health = user_health; } @Override public String toString() { return "Users [user_name=" + user_name + ", user_password=" + user_password + ", user_sex=" + user_sex + ", user_id=" + user_id + ", user_phone=" + user_phone + ", user_health=" + user_health + "]"; } }
创建一个类用来实现具体操作客户的订票和查看,管理员增删改查等功能