航空管理系统

本文介绍了为某航空公司开发的一个自动化软件系统,该系统包括用户模块和办事处模块,以管理航班信息。用户模块允许用户添加、修改信息、登录及管理角色等,而办事处模块则涉及办事处的增删查操作。管理员和普通用户拥有不同的权限,管理员具有所有功能,普通用户只能修改密码和查看个人信息。文章详细阐述了各个功能的实现,包括用户和办事处类的设计以及登录、添加、删除和查询等操作的实现逻辑。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

某航空公司在其航班到达的不同的国家的不同地方设有不同的办事处,这个项目要求开发一个自动化软件系 统,该系统将提供给这些办事处的管理者(role=1)和普通用户(role=0)用于管理航班信息。根据以上描述,要 求实现系统的用户模块和办事处模块,包含以下功能(注:系统存在一个默认管理员admin/admin123):
用户模块:

  1. 用户添加
  2. 密码修改
  3. 个人信息查看
  4. 账号状态修改(禁用0、启用1)
  5. 用户登录(被禁用账号无法登录并提示友好的消息)
  6. 修改用户角色(设置取消管理员)
  7. 用户列表
  8. 删除用户
    办事处模块
  9. 办事处添加
  10. 办事处列表
    . 3. 查询指定办事处的所有员工 注意:管理员具备以上所有功能,普通用户只有密码修改和个人信息查看功能。 参考类如下:
    15. 用户类(User):
    id,账号(username),密码(passord),年龄(age),角色(role),邮箱(email),办事处id(officeID),账户状态 (status)
    办事处类(Office):
    id,办公室名(officeName)

解题步骤:
首先创建一个User类,定义id,账号(username),密码(passord),年龄(age),角色(role),邮箱(email),办事处id(officeID),账户状态 (status) 的所有属性为私有属性,添加无参和有参构造方法,重写toString方法(将想要输出的内容按字符串的方式输出)
代码如下:**

 package com;

public class User {
	private int id;
	private String username;
	private int age;
	private String role;
	private String email;
	private int officeID;
	private String status;

public User() {
	// TODO Auto-generated constructor stub
}

public User(int id, String username, int age, String role, String email, int officeID, String status) {
	super();
	this.id = id;
	this.username = username;
	this.age = age;
	this.role = role;
	this.email = email;
	this.officeID = officeID;
	this.status = status;
}

public int getId() {
	return id;
}

public void setId(int id) {
	this.id = id;
}

public String getUsername() {
	return username;
}

public void setUsername(String username) {
	this.username = username;
}

public int getAge() {
	return age;
}

public void setAge(int age) {
	this.age = age;
}

public String getRole() {
	return role;
}

public void setRole(String role) {
	this.role = role;
}

public String getEmail() {
	return email;
}

public void setEmail(String email) {
	this.email = email;
}

public int getOfficeID() {
	return officeID;
}

public void setOfficeID(int officeID) {
	this.officeID = officeID;
}

public String getStatus() {
	return status;
}

public void setStatus(String status) {
	this.status = status;
}

@Override
public String toString() {
	return "User [ID=" + id + ", 账户=" + username + ", 年龄=" + age + ",
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值