由于代码很长所以就放在最后吧。
目录
系统功能结构
?系统流程
目标
?需求说明
软件设计结构?
代码流程
1.用户注册和登录模块
2.开发人员管理模块(domain包)
? ? ? ? 设计结构
????????domain模块中包含了所有实体类:
????????Equipment接口及其实现子类的设计
Employee类及其子类的设计
3.开发人员管理模块(NameService包)
? ? ? ? 设计结构
?4.开发团队调度管理模块
????????需求说明
3.开发团队调度管理模块
参考实现:TeamService类的设计:
?TeamView类的设计
4.开发项目管理模块
?源代码
运行效果概览
系统功能结构

?系统流程

目标
①模拟实现一个基于文本界面的《项目开发团队分配管理软件》
②熟悉Java面向对象的高级特性,进一步掌握编程技巧和调试技巧
主要涉及以下知识点:
???????? 类的继承性和多态性
????????对象的值传递、接口
????????static和final修饰符
????????特殊类的使用:包装类、抽象类、内部类
????????异常处理
????????Java基本语法和流程控制
????????数组,ArrayList集合
?需求说明
该软件实现以下功能:
软件启动时,首先进入登录界面进行注册和登录功能。
当登陆成功后,进入菜单,首先就可以对开发人员账户和密码进行修改。
然后可以对开发人员进行增删改操作
人员添加成功后,根据菜单提示,基于现有的公司成员,组建一个开发团队以开发一个新的项目。
组建过程包括将成员插入到团队中,或从团队中删除某成员,还可以列出团队中现有成员的列表,开发团队成员包括架构师、设计师和程序员。
团队组建成功,则可以进入项目模块,添加项目,分配开发团队进行开发。
软件设计结构?

domain包:存放该项目所需的类
Service包:各个模块的操作方法(增删改查等等)
View包:界面展示
代码流程
1.用户注册和登录模块
定义一个LoginView类
????????实现注册方法
????????????????如果没有账户则需要注册
????????????????如果有账号则直接进行登录
????????实现登录功能
????????????????判断用户输入的值是否正确
????????????????如果正确则进入软件菜单
????????????????如果错误则重新输入,限制次数只有5次,超过次数则程序停止,重新启动
????????实现修改用户密码功能
????????????????可以实现对用户名,密码,或者两者都可以进行修改即可。
2.开发人员管理模块(domain包)
? ? ? ? 设计结构
????????domain模块中包含了所有实体类:

?????????其中程序员(Programmer)及其子类,均会领用某种电子设备(Equipment)。
????????Equipment接口及其实现子类的设计

?说明:
????????model 表示机器的型号
????????display 表示显示器名称
????????type 表示机器的类型
根据需要提供各属性的get/set方法以及重载构造器
实现类实现接口的方法,返回各自属性的信息
Employee类及其子类的设计

说明: memberId 用来记录成员加入开发团队后在团队中的ID
Status是项目中人员的状态,先赋值为true,当添加到团队时为false
equipment 表示该成员领用的设备
可根据需要为类提供各属性的get/set方法以及重载构造器?
?
?说明:
bonus 表示奖金
stock 表示公司奖励的股票数量
可根据需要为类提供各属性的get/set方法以及重载构造器
3.开发人员管理模块(NameService包)
????????在NameListService类中完成功能操作
????????????????实现员工的添加(根据职业添加(无,程序员,设计师,架构师))
????????????????实现员工的修改(至少修改员工的姓名,年龄,工资)
????????????????实现员工的删除(注意员工id需要动态显示,也就是删除后,员工id需要更新)
????????????????实现员工的查看 (显示所有数据)
????????
? ? ? ? 设计结构

说明:
????????getAllEmployees ()方法:获取当前所有员工。 返回:包含所有员工集合
????????getEmployee(id : int)方法:获取指定ID的员工对象。 参数:指定员工的ID 返回:指定员工对象
????????异常:找不到指定的员工?
在service子包下提供自定义异常类:TeamException
另外,可根据需要自行添加其他方法或重载构造器
按照设计要求编写NameListService类
一个属性为:private ArrayList<Employee> employees
有一个代码块用作数据的填充,如图(注意不同人的身份和设备都不同)
有一个方法:getAllEmployees(),返回employees对象即可
还有一个方法:getEmployee(int id),得到指定id的员工,没有则抛出自定义的异常。
其他方法

?4.开发团队调度管理模块
????????需求说明
????????????????团队界面显示公司成员的列表(这些是默认值,请在开发人员管理模块中实现),如下:

如果添加操作因某种原因失败,将显示类似以下信息(失败原因视具体原因而不同):
1-团队列表 ?2-添加团队成员 ?3-删除团队成员 4-退出 ? 请选择(1-4):2
---------------------添加成员---------------------
请输入要添加的员工ID:2
添加失败,原因:该员工已是某团队成员 按回车键继续... ?? ?
失败信息包含以下几种: ?(需要抛出自定义异常)
成员已满,无法添加
该成员不是开发人员,无法添加
该员工已在本开发团队中
该员工已是某团队成员
团队中至多只能有一名架构师(以下判断可借用instanceof进行判断)
团队中至多只能有两名设计师
团队中至多只能有三名程序员?
当选择“添加团队成员”菜单时,将执行从列表中添加指定(通过ID)成员到开发团队的功能:
1-团队列表 ?2-添加团队成员 ?3-删除团队成员 ?4-退出 ? 请选择(1-4):
2 ---------------------添加成员---------------------
请输入要添加的员工ID:2
添加成功 按回车键继续...
添加成功后,按回车键将重新显示主界面。
开发团队人员组成要求:
最多一名架构师
最多两名设计师
最多三名程序员
当选择“删除团队成员”菜单时,将执行从开发团队中删除指定(通过TeamID)成员的功能:
1-团队列表 ?2-添加团队成员 ?3-删除团队成员 4-退出 ? 请选择(1-4):3
---------------------删除成员---------------------
请输入要删除员工的TID:1
确认是否删除(Y/N):y
删除成功
按回车键继续...
删除成功后,按回车键将重新显示主界面。
当选择“团队列表”菜单时,将列出开发团队中的现有成员,例如:
1-团队列表 ?2-添加团队成员 ?3-删除团队成员 4-退出 ? 请选择(1-4):1
--------------------团队成员列表---------------------
TDI/ID ?姓名 ? ?年龄 ? ? ?工资 ? ? ? 职位 ? ? ?奖金 ? ? ? ?股票
?2/4 ? ? 刘强东 ? 24 ? ? ?7300.0 ? ?程序员 ?3/2 ? ? 马化腾 ? 32 ? ? ?18000.0 ?架构师 ? 15000.0 ?2000 ?4/6 ? ? 任志强 ? 22 ? ? ?6800.0 ? ?程序员 ?5/12 ? 杨致远 ? 27 ? ? ?600.0 ? ? ?设计师 ? 4800.0
3.开发团队调度管理模块
参考实现:TeamService类的设计:

功能:关于开发团队成员的管理:添加、删除等(还需要自行实现)。
说明: counter为静态变量,用来为开发团队新增成员自动生成团队中的唯一ID,即memberId。(提示:应使用增1的方式)
MAX_MEMBER:表示开发团队最大成员数
team数组:用来保存当前团队中的各成员对象 (也可以用一个新的集合)
total:记录团队成员的实际人数?

说明:
getTeam()方法:返回当前团队的所有对象
返回:包含所有成员对象的数组,数组大小与成员人数一致
addMember(e: Employee)方法:向团队中添加成员
参数:待添加成员的对象
异常:添加失败, TeamException中包含了失败原因
removeMember(memberId: int)方法:从团队中删除成员
参数:待删除成员的memberId
异常:找不到指定memberId的员工,删除失败
另外,可根据需要自行添加其他方法或重载构造器
?TeamView类的设计

说明: listSvc和teamSvc属性:供类中的方法使用
enterMainMenu ()方法:主界面显示及控制方法。
以下方法仅供enterMainMenu()方法调用:
listAllEmployees ()方法:以表格形式列出公司所有成员
getTeam()方法:显示团队成员列表操作
addMember ()方法:实现添加成员操作
deleteMember ()方法:实现删除成员操作?
4.开发项目管理模块
在domain包中完成项目实体类Project的创建

在service包中完成项目操作类ProjectService的创建

?源代码
Package domain:?
1.Architect.java
package com.Project_development_team_allocation_management_software.domain;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public class Architect extends Designer{
private int stock;
public Architect() {
}
public Architect(int id, String name, int age, double salary, Equipment equipment, double bonus, int stock) {
super(id, name, age, salary, equipment, bonus);
this.stock=stock;
}
public int getStock() {
return stock;
}
public void setStock(int stock) {
this.stock = stock;
}
@Override
public String toString() {
if (getName().length() == 2) {
if (getSalary() < 10000.0) {
if (getBonus() >= 10000.0)
return " " + getId() + "\t\t" + getName() + "\t\t" + getAge() + "\t\t" + getSalary() + " " + "架构师" + "\t" + isStatus() + "\t" + getBonus() +" "+ stock+"\t" + getEquipment().getDescription();
else
return " " + getId() + "\t\t" + getName() + "\t\t" + getAge() + "\t\t" + getSalary() + " " + "架构师" + "\t" + isStatus() + "\t" + getBonus() +" "+ stock+"\t" + getEquipment().getDescription();
} else {
if (getBonus()>=10000)
return " " + getId() + "\t\t" + getName() + "\t\t" + getAge() + "\t\t" + getSalary() + " " + "架构师" + "\t" + isStatus() + "\t" + getBonus()+" "+ stock+"\t" + getEquipment().getDescription();
else
return " " + getId() + "\t\t" + getName() + "\t\t" + getAge() + "\t\t" + getSalary() + " " + "架构师" + "\t" + isStatus() + "\t" + getBonus()+" "+ stock+"\t" + getEquipment().getDescription();
}
} else if (getName().length() == 3) {
if (getSalary() < 10000.0) {
if (getBonus() >= 10000.0)
return " " + getId() + "\t\t" + getName() + "\t" + getAge() + "\t\t" + getSalary() + " " + "架构师" + "\t" + isStatus() + "\t" + getBonus() +" "+ stock+"\t" + getEquipment().getDescription();
else
return " " + getId() + "\t\t" + getName() + "\t" + getAge() + "\t\t" + getSalary() + " " + "架构师" + "\t" + isStatus() + "\t" + getBonus() +" "+ stock+"\t" + getEquipment().getDescription();
} else {
if (getBonus() >= 10000.0)
return " " + getId() + "\t\t" + getName() + "\t" + getAge() + "\t\t" + getSalary() + " " + "架构师" + "\t" + isStatus() + "\t" + getBonus() +" "+ stock+"\t" + getEquipment().getDescription();
else
return " " + getId() + "\t\t" + getName() + "\t" + getAge() + "\t\t" + getSalary() + " " + "架构师" + "\t" + isStatus() + "\t" + getBonus() +" "+ stock+"\t" + getEquipment().getDescription();
}
}
return "";
}
}
2.Designer.java
package com.Project_development_team_allocation_management_software.domain;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public class Designer extends Programmer {
private double bonus;
public Designer() {
}
public Designer(int id, String name, int age, double salary, Equipment equipment, double bonus) {
super(id, name, age, salary, equipment);
this.bonus = bonus;
}
public double getBonus() {
return bonus;
}
public void setBonus(double bonus) {
this.bonus = bonus;
}
@Override
public String toString() {
if (getName().length() == 2) {
if (getSalary() < 10000.0) {
if (bonus >= 10000.0)
return " " + getId() + "\t\t" + getName() + "\t\t" + getAge() + "\t\t" + getSalary() + " " + "设计师" + "\t" + isStatus() + "\t" + bonus + "\t\t \t" + getEquipment().getDescription();
else
return " " + getId() + "\t\t" + getName() + "\t\t" + getAge() + "\t\t" + getSalary() + " " + "设计师" + "\t" + isStatus() + "\t" + bonus + "\t\t \t" + getEquipment().getDescription();
} else {
if (bonus >= 10000)
return " " + getId() + "\t\t" + getName() + "\t\t" + getAge() + "\t\t" + getSalary() + " " + "设计师" + "\t" + isStatus() + "\t" + bonus + "\t\t \t" + getEquipment().getDescription();
else
return " " + getId() + "\t\t" + getName() + "\t\t" + getAge() + "\t\t" + getSalary() + " " + "设计师" + "\t" + isStatus() + "\t" + bonus + "\t\t \t" + getEquipment().getDescription();
}
} else if (getName().length() == 3) {
if (getSalary() < 10000.0) {
if (bonus >= 10000.0)
return " " + getId() + "\t\t" + getName() + "\t" + getAge() + "\t\t" + getSalary() + " " + "设计师" + "\t" + isStatus() + "\t" + bonus + "\t\t \t" + getEquipment().getDescription();
else
return " " + getId() + "\t\t" + getName() + "\t" + getAge() + "\t\t" + getSalary() + " " + "设计师" + "\t" + isStatus() + "\t" + bonus + "\t\t \t" + getEquipment().getDescription();
} else {
if (bonus >= 10000.0)
return " " + getId() + "\t\t" + getName() + "\t" + getAge() + "\t\t" + getSalary() + " " + "设计师" + "\t" + isStatus() + "\t" + bonus + "\t\t \t" + getEquipment().getDescription();
else
return " " + getId() + "\t\t" + getName() + "\t" + getAge() + "\t\t" + getSalary() + " " + "设计师" + "\t" + isStatus() + "\t" + bonus + "\t\t \t" + getEquipment().getDescription();
}
}
return "";
}
}
3.Employee.java
package com.Project_development_team_allocation_management_software.domain;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public class Employee {
private int id;
private String name;
private int age;
private double salary;
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Employee(int id, String name, int age, double salary) {
this.id = id;
this.name = name;
this.age = age;
this.salary = salary;
}
public Employee() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
@Override
public String toString() {
if (name.length() == 2) {
if (salary < 10000.0) {
return " " + id + "\t\t" + name + "\t\t" + age + "\t\t" + salary + " ";
} else {
return " " + id + "\t\t" + name + "\t\t" + age + "\t\t" + salary + " ";
}
} else if (name.length() == 3) {
if (salary < 10000.0) {
return " " + id + "\t\t" + name + "\t" + age + "\t\t" + salary + " ";
} else {
return " " + id + "\t\t" + name + "\t" + age + "\t\t" + salary + " ";
}
}
return "";
}
}
4.Equipment.java
package com.Project_development_team_allocation_management_software.domain;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public interface Equipment {
String getDescription();
}
5.NoteBook.java
package com.Project_development_team_allocation_management_software.domain;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public class NoteBook implements Equipment{
private String model;
private double price;
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public NoteBook(String model, double price) {
this.model = model;
this.price = price;
}
@Override
public String getDescription() {
return model+"("+price+")";
}
}
6.PC.java
package com.Project_development_team_allocation_management_software.domain;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public class PC implements Equipment{
private String model;
private String display;
public PC(String model, String display) {
this.model = model;
this.display = display;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getDisplay() {
return display;
}
public void setDisplay(String display) {
this.display = display;
}
@Override
public String getDescription() {
return model+"("+display+")";
}
}
7.Printer.java
package com.Project_development_team_allocation_management_software.domain;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public class Printer implements Equipment{
private String name;
private String type;
public Printer(String name, String type) {
this.name = name;
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public String getDescription() {
return name+"("+type+")";
}
}
8.Programmer.java
package com.Project_development_team_allocation_management_software.domain;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public class Programmer extends Employee{
private int memberid;
private boolean status=true;
private Equipment equipment;
public int getMemberid() {
return memberid;
}
public void setMemberid(int memberid) {
this.memberid = memberid;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
public Equipment getEquipment() {
return equipment;
}
public void setEquipment(Equipment equipment) {
this.equipment = equipment;
}
public Programmer(int id, String name, int age, double salary, Equipment equipment) {
super(id, name, age, salary);
this.equipment = equipment;
}
public Programmer(int id, String name, int age, double salary) {
super(id, name, age, salary);
}
public Programmer() {
}
@Override
public String toString() {
return super.toString()+"程序员"+"\t"+status+"\t \t\t \t"+equipment.getDescription();
}
}
9.Project.java
package com.Project_development_team_allocation_management_software.domain;
import java.util.ArrayList;
/**
* @author 尤小鹏
* 2021/8/2/002
*/
public class Project {
private int proId; //项目id
private String projectName; //项目名
private String desName; //项目描述
private String teamName; //团队名称
//差一个开发团队的数组 不知道要不要
private ArrayList<Programmer> programmers;
private boolean status; //开发状态,true为开发中
public Project(int proId, String projectName, String desName, String teamName, boolean status) {
this.proId = proId;
this.projectName = projectName;
this.desName = desName;
this.teamName = teamName;
this.status = status;
}
@Override
public String toString() {
return "项目{" +
"项目号=" + proId +
", 项目名='" + projectName + '\'' +
", 项目描述='" + desName + '\'' +
", 开发团队名称='" + teamName + '\'' +
", 开发状态=" + status +
'}';
}
public int getProId() {
return proId;
}
public void setProId(int proId) {
this.proId = proId;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getDesName() {
return desName;
}
public void setDesName(String desName) {
this.desName = desName;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public ArrayList<Programmer> getProgrammers() {
return programmers;
}
public void setProgrammers(ArrayList<Programmer> programmers) {
this.programmers = programmers;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
}
?Package? ?Service
1.Account.java
package com.Project_development_team_allocation_management_software.Service;
import com.Project_development_team_allocation_management_software.View.LoginView;
import java.util.ArrayList;
import java.util.Scanner;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public class Account {
private String accountid;
private String password;
public Account(String accountid, String password) {
this.accountid = accountid;
this.password = password;
}
public Account() {
}
public String getAccountid() {
return accountid;
}
public void setAccountid(String accountid) {
this.accountid = accountid;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String[] isTrue(ArrayList<Account> list,String[] strings) {
System.out.println("请输入您的账号名称:");
Scanner sc = new Scanner(System.in);
String ai = sc.nextLine();
System.out.println("请输入您的登录密码:");
String ps = sc.nextLine();
for (int i = 0; i < list.size(); i++) {
if (ai.equals(list.get(i).getAccountid())) {
if (ps.equals(list.get(i).getPassword())) {
System.out.println("请稍等:");
strings[0] = ai;
strings[1] = ps;
strings[2] = "true";
System.out.println("登录成功!欢迎你:" + ai);
return strings;
} else {
System.out.println("密码错误,请重新输入");
}
}
}
System.out.println("未检测到您的账号,请您先注册!");
return strings;
}
public void addAcount(ArrayList<Account> list) {
System.out.println("请输入您的注册账号名称:");
Scanner sc = new Scanner(System.in);
String ai = sc.nextLine();
System.out.println("请输入您的注册登录密码:");
String ps = sc.nextLine();
for (int i = 0; i < list.size(); i++) {
if (ai.equals(list.get(i).getAccountid())) {
System.out.println("该账号已存在,请重新注册");
return;
}
}
list.add(new Account(ai, ps));
}
public void modifyAccount(ArrayList<Account> list, String[] strings) {
LoginView.modifyMenu();
char c = TSUtility.readMenuSelection();
while (c != '4') {
switch (c) {
case '1': {
System.out.println("请输入修改后的账户名称");
String s = new Scanner(System.in).nextLine();
for (int i = 0; i < list.size(); i++) {
if (list.get(i).accountid.equals(strings[0])) {
list.get(i).setAccountid(s);
System.out.println("修改成功!");
strings[0]=s;
break;//跳出循环
}
}
break;//跳出switch
}
case '2': {
System.out.println("请输入修改后的密码:");
String s = new Scanner(System.in).nextLine();
for (int i = 0; i < list.size(); i++) {
if (list.get(i).password.equals(strings[1])) {
list.get(i).setPassword(s);
System.out.println("修改成功!");
strings[1]=s;
break;
}
}
break;
}
case '3': {
System.out.println("请输入修改后的账户名称");
String ai = new Scanner(System.in).nextLine();
System.out.println("请输入修改后的密码:");
String ps = new Scanner(System.in).nextLine();
System.out.println("请稍等.....");
for (int i = 0; i < list.size(); i++) {
if (list.get(i).accountid.equals(strings[0])) {
list.get(i).setAccountid(ai);
list.get(i).setPassword(ps);
System.out.println("修改成功!");
strings[0]=ai;
strings[1]=ps;
break;
}
}
break;
}
case '4': {
break;
}
}
LoginView.modifyMenu();
c = TSUtility.readMenuSelection();
}
}
}
?2.NameListService.java
package com.Project_development_team_allocation_management_software.Service;
import com.Project_development_team_allocation_management_software.domain.*;
import java.util.ArrayList;
import java.util.Scanner;
/**
* @author 尤小鹏
* 2021/7/30/030
*/
public class NameListService {
private static ArrayList<Employee> employees = new ArrayList<>();
public static ArrayList<Employee> getEmployees() {
return employees;
}
static {
employees.add(new Employee(1, "马云", 22, 3000.0));
employees.add(new Architect(2, "马化腾", 32, 18000.0, new NoteBook("联想T4", 6000), 60000.0, 5000));
employees.add(new Programmer(3, "李彦宏", 23, 7000.0, new PC("戴尔", "NEC 17寸")));
employees.add(new Programmer(4, "刘强东", 24, 7300.0, new PC("戴尔", "NEC 17寸")));
employees.add(new Designer(5, "雷军", 50, 10000.0, new Printer("激光", "佳能2900"), 5000));
employees.add(new Programmer(6, "任志强", 30, 16800.0, new PC("华硕", "三星 17寸")));
employees.add(new Designer(7, "柳传志", 45, 35500.0, new PC("华硕", "三星 17寸"), 8000));
employees.add(new Architect(8, "杨元庆", 35, 6500.0, new Printer("针式", "爱普生20k"), 15500.0, 1200));
employees.add(new Designer(9, "史玉柱", 27, 7800.0, new NoteBook("惠普m6", 5800.0), 1500.0));
employees.add(new Programmer(10, "丁磊", 26, 6600.0, new PC("戴尔", "NEC 17寸")));
employees.add(new Programmer(11, "张朝阳", 35, 7100.0, new PC("华硕", "三星 17寸")));
employees.add(new Designer(12, "杨致远", 38, 9600.0, new NoteBook("惠普m6", 5800), 3000));
}
public void getAllEmployees() {
System.out.println("ID\t\t姓名\t\t年龄\t\t工资\t\t职位\t\t状态\t\t奖金\t\t股票\t\t领用设备");//\t代表三个空格
for (int i = 0; i < employees.size(); i++) {
System.out.println(employees.get(i));
}
}
public char modifyDevelopPeople(char c) throws TeamException {
switch (c) {
case '1': {
addPeople();
break;
}
case '2': {
getAllEmployees();
break;
}
case '3': {
alterPeople();
break;
}
case '4': {
deletePeople();
break;
}
case '5': {
System.out.print("确认是否退出(Y/N)");
char c1 = TSUtility.readConfirmSelection();
if (c1 == 'Y') {
c = 'Y';
}
break;
}
}
return c;
}
private static void addPeople() {
System.out.println("请输入需要添加的雇员的职位:");
System.out.println("1(无职位)");
System.out.println("2(程序员)");
System.out.println("3(设计师)");
System.out.println("4(架构师)");
char c = TSUtility.readMenuSelection();
String s = "";
switch (c) {
case '1': {
s = "无职位";
break;
}
case '2': {
s = "程序员";
break;
}
case '3': {
s = "设计师";
break;
}
case '4': {
s = "架构师";
break;
}
}
System.out.println("当前雇员职位分配为:" + s);
if (s.equals("无职位")) {
Employee employee = new Employee();
employee.setId(employees.size() + 1); //id自动设置为所有已存在员工id的下一位
System.out.println("请输入当前雇员的姓名:");
employee.setName(TSUtility.readString(3, ""));
System.out.println("请输入当前雇员的年龄:");
employee.setAge(TSUtility.readInt());
System.out.println("请输入当前雇员的工资:");
employee.setSalary(TSUtility.readDouble());
employees.add(employee);
System.out.println("人员添加成功!");
} else if (s.equals("程序员")) {
Programmer programmer = new Programmer();
programmer.setId(employees.size() + 1); //id自动设置为所有已存在员工id的下一位
System.out.println("请输入当前雇员的姓名:");
programmer.setName(TSUtility.readString(3, ""));
System.out.println("请输入当前雇员的年龄:");
programmer.setAge(TSUtility.readInt());
System.out.println("请输入当前雇员的工资:");
programmer.setSalary(TSUtility.readDouble());
System.out.println("请为当前程序员配置一台好的台式电脑:");
System.out.println("请输入需要配置的台式电脑的型号:");
String model = new Scanner(System.in).nextLine();
System.out.println("请输入需要配置的台式电脑的显示器名称:");
String display = new Scanner(System.in).nextLine();
programmer.setEquipment(new PC(model, display));//实现类在这里完成了接口多态
employees.add(programmer);
System.out.println("设备添加成功!");
System.out.println("人员添加成功!");
} else if (s.equals("设计师")) {
Designer designer = new Designer();
designer.setId(employees.size() + 1); //id自动设置为所有已存在员工id的下一位
System.out.println("请输入当前雇员的姓名:");
designer.setName(TSUtility.readString(3, ""));
System.out.println("请输入当前雇员的年龄:");
designer.setAge(TSUtility.readInt());
System.out.println("请输入当前雇员的工资:");
designer.setSalary(TSUtility.readDouble());
System.out.println("请为当前设计师配置一台好的笔记本电脑:");
System.out.println("请输入需要配置笔记本电脑的型号:");
String model = new Scanner(System.in).nextLine();
System.out.println("请输入需要配置的笔记本电脑的价格:");
double v = TSUtility.readDouble();
designer.setEquipment(new NoteBook(model, v));//实现类在这里完成了接口多态
System.out.println("请输入当前设计师的奖金:");
designer.setBonus(TSUtility.readDouble());
employees.add(designer);
System.out.println("设备添加成功!");
System.out.println("人员添加成功!");
} else if (s.equals("架构师")) {
Architect architect = new Architect();
architect.setId(employees.size() + 1); //id自动设置为所有已存在员工id的下一位
System.out.println("请输入当前雇员的姓名:");
architect.setName(TSUtility.readString(3, ""));
System.out.println("请输入当前雇员的年龄:");
architect.setAge(TSUtility.readInt());
System.out.println("请输入当前雇员的工资:");
architect.setSalary(TSUtility.readDouble());
System.out.println("请为当前架构师配置一台好的设备:");
System.out.println("请输入需要配置的型号:");
String model = new Scanner(System.in).nextLine();
System.out.println("请输入需要配置的种类或价格:");
String type = new Scanner(System.in).nextLine();
architect.setEquipment(new Printer(model, type));//实现类在这里完成了接口多态
System.out.println("请输入当前架构师的奖金:");
architect.setBonus(TSUtility.readDouble());
System.out.println("请输入当前架构师的股票:");
architect.setStock(TSUtility.readstock());
employees.add(architect);
System.out.println("设备添加成功!");
System.out.println("人员添加成功!");
}
TSUtility.readReturn();
}
private static void alterPeople() throws TeamException {
System.out.println("请输入需要修改的员工id");
int id = TSUtility.readInt();
Employee employee = getEmployee(id);
if (employee == (null)) { //为什么这里不可以用.equals呢
return;
}
String name = employee.getName();
int age = employee.getAge();
double salary = employee.getSalary();
System.out.println("姓名(" + name + "):");
employee.setName(TSUtility.readString(4, name));
System.out.println("年龄(" + age + "):");
employee.setAge(Integer.parseInt(TSUtility.readString(2, String.valueOf(age))));
System.out.println("工资(" + salary + "):");
employee.setSalary(Double.parseDouble(TSUtility.readString(8,String.valueOf(salary))));
System.out.println("修改成功");
}
private static void deletePeople() throws TeamException {
System.out.println("请输入要删除的员工id:");
int id = TSUtility.readInt();
Employee remove = getEmployee(id);
if (remove == (null)) {
return;
}
System.out.println(remove.getId() + "号删除成功");
}
public static Employee getEmployee(int id) throws TeamException {
Employee employee = new Employee();
try {
if (id - 1 >= employees.size()) {//输入12 索引11 输入13 索引12就超出范围了
throw new TeamException();
} else {
employee = employees.get(id - 1);
return employee;
}
} catch (TeamException t) {
System.out.println("找不到指定的员工");
}
return null;
}
/* public static void main(String[] args) {
new NameListService().getAllEmployees(); //测试显示情况
}*/
}
3.ProjectService.java
package com.Project_development_team_allocation_management_software.Service;
import com.Project_development_team_allocation_management_software.View.LoginView;
import com.Project_development_team_allocation_management_software.domain.Programmer;
import com.Project_development_team_allocation_management_software.domain.Project;
import java.util.ArrayList;
import java.util.Random;
/**
* @author 尤小鹏
* 2021/8/2/002
*/
public class ProjectService {
private static ArrayList<Project> projects = new ArrayList<>(); //用来存项目 需要初始化 否则会空指针异常
private int count = 1; //添加项目的标号
private static ArrayList<String> strings = new ArrayList<>();
public static void Projectdo() {
ArrayList<ArrayList> arrayLists = TeamService.getArrayLists();
char c = LoginView.developProjectMenu();
while (true) {
switch (c) {
case '1': {
addProject();
break;
}
case '2': {
dealingPro(arrayLists);
break;
}
case '3': {
showPro();
break;
}
case '4': {
System.out.println("请输入要删除的项目号");
int i = TSUtility.readInt();
delPro(i);
}
case '5': {
//退出
System.out.println("是否退出(Y/N)");
char c1 = TSUtility.readConfirmSelection();
if (c1 == 'Y')
return;
else break;
}
}
LoginView.developProjectMenu();
c = TSUtility.readMenuSelection();
}
}
private static void addProject() {//当添加项目时创建该项目到集合中以便于配合时统一分配
System.out.println("项目参考:-----------------------------------------");
System.out.println("1.小米官网:开发完成类似于小米官网的web项目。");
System.out.println("2.公益在线商城:猫宁Morning公益商城是中国公益性在线电子商城。");
System.out.println("3.博客系统:Java博客系统,让每一个在故事的人有更好的表达想法!");
System.out.println("4.在线协作文档编辑:一个很常用的功能,适合小组内的文档编辑。");
System.out.println("--------------------------------------------------");
TSUtility.readReturn();
System.out.println("请输入你想添加的项目编号:");
char c = TSUtility.readMenuSelection();
System.out.println("请稍等:");
switch (c) {
case '1': {
Project p1 = new Project(1, "小米官网", "开发完成类似于小米官网的web项目", null, false);
projects.add(p1);
break;
}
case '2': {
Project p2 = new Project(2, "公益在线商城", "猫宁Morning公益商城是中国公益性在线电子商城。", null, false);
projects.add(p2);
break;
}
case '3': {
Project p3 = new Project(3, "博客系统", "Java博客系统,让每一个在故事的人有更好的表达想法!", null, false);
projects.add(p3);
break;
}
case '4': {
Project p4 = new Project(4, "在线协作文档编辑", "一个很常用的功能,适合小组内的文档编辑。", null, false);
projects.add(p4);
break;
}
}
}
private static void dealingPro(ArrayList<ArrayList> arrayLists) {
//这里形参为什么不用开发文档给出的 程序员集合呢
// 因为我的开发团队每次加入完都会添加到集合的集合中
// 而程序员集合就被置空了
// 如果调用的话只能获得最新的团队而我要的是所有
for (int i = 0; i < arrayLists.size(); i++) {
System.out.println("当前团队有人员:");
ArrayList arrayList = arrayLists.get(i);
for (int j = 0; j < arrayList.size(); j++) {
Programmer programmer = (Programmer) arrayList.get(j);
System.out.println(programmer);
}
System.out.println("请为当前团队创建一个名称");
String s = TSUtility.readString(8, "");
strings.add(s);//这里存储了每个团队的名字
}
//随机选出一个团队给一个项目
int size = strings.size(); //获取团队数
for (int k = 0; k < projects.size(); k++) {
Random random = new Random();
Project project = projects.get(k);
if (!project.isStatus()) {//如果状态为false说明未被开发
int i1 = random.nextInt(size); //0-size-1
project.setTeamName(strings.get(i1)); //设置开发团队名
project.setStatus(true);//将状态设为TRUE
// break; //存在疑点
}
}
}
private static void showPro() {
System.out.println("请稍等:");
for (int i = 0; i < projects.size(); i++) {
Project project = projects.get(i);
if (project.isStatus()) {
System.out.println("项目[" + project.getProjectName() + "]---->正在被[" + project.getTeamName() + "]开发中");
} else if (!project.isStatus()) {
System.out.println("项目[" + project.getProjectName() + "]---->还未被开发。");
}
}
}
private static void delPro(int id) {
for (int i = 0; i < projects.size(); i++) {
Project project = projects.get(i);
if (project.getProId() == id) {
System.out.println("是否删除(Y/N)");
char c = TSUtility.readConfirmSelection();
if (c == 'Y') {
projects.remove(project);
System.out.println("删除成功.");
return;
}
}
}
System.out.println("未找到该项目号");
}
}
4.TeamException.java
package com.Project_development_team_allocation_management_software.Service;
/**
* @author 尤小鹏
* 2021/8/1/001
*/
public class TeamException extends Exception{
public TeamException() {
}
public TeamException(String message) {
super(message);
}
}
5.TeamService.java
package com.Project_development_team_allocation_management_software.Service;
import com.Project_development_team_allocation_management_software.View.LoginView;
import com.Project_development_team_allocation_management_software.domain.Architect;
import com.Project_development_team_allocation_management_software.domain.Designer;
import com.Project_development_team_allocation_management_software.domain.Employee;
import com.Project_development_team_allocation_management_software.domain.Programmer;
import java.util.ArrayList;
/**
* @author 尤小鹏
* 2021/8/1/001
*/
public class TeamService {
private static int counter = 1;//为开发团队新增成员自动生成团队中的唯一id
private static final int MAX_MEMBER = 5;
private static ArrayList<Programmer> programmers = new ArrayList<>();
private static ArrayList<ArrayList> arrayLists = new ArrayList<>(); //真的可以集合包含集合!666
static int total = 0;//记录团队成员实际人数
public static ArrayList<ArrayList> getArrayLists() {
return arrayLists;
}
public static void setArrayLists(ArrayList<ArrayList> arrayLists) {
TeamService.arrayLists = arrayLists;
}
public static void Teamdo() throws TeamException {
LoginView.TeamMenu();
char c = TSUtility.readMenuSelection();
while (true) {
switch (c) {
case '1': {
addTeam();
ArrayList clone = (ArrayList) programmers.clone();
arrayLists.add(clone);//如果加完直接清空的话会导致集合的元素也消失 所以要不要重新创一个
programmers.clear();
break;
}
case '2': {
listTeam();
break;
}
case '3': {
deleteTeam();
break;
}
case '4': {
//退出
System.out.println("是否退出(Y/N)");
char c1 = TSUtility.readConfirmSelection();
if (c1 == 'Y') {
return;
} else break;
}
}
LoginView.TeamMenu();
c = TSUtility.readMenuSelection();
}
}
private static void addTeam() throws TeamException {
System.out.println("--------------------------开发团队调度软件-------------------------------------");
NameListService listSvc = new NameListService();
listSvc.getAllEmployees();
ArrayList<Employee> employees = NameListService.getEmployees();
System.out.println("----------------------------------------------------------------------------");
System.out.print("1-团队列表\t");
System.out.print("2-添加团队成员\t");
System.out.print("3-删除团队成员\t");
System.out.print("4-退出\t");
System.out.print("请选择(1-4):");
char c = TSUtility.readMenuSelection();
while (true) {
switch (c) {
case '1': {
getTeam();
//团队列表
break;
}
case '2': {
//添加团队成员
System.out.println("请输入要添加的员工ID:");
int ID = TSUtility.readInt();
Employee employee = NameListService.getEmployee(ID);
addMember(employee);
break;
}
case '3': {
//删除团队成员
System.out.println("请输入要删除的员工TID:");
int ID = TSUtility.readInt();
System.out.println("确认是否删除(Y/N)");
char c1 = TSUtility.readConfirmSelection();
if (c1 == 'Y') {
removeMember(ID);
}
break;
}
case '4': {
//退出
System.out.println("是否退出(Y/N)");
char c1 = TSUtility.readConfirmSelection();
if (c1 == 'Y') {
return;
} else break;
}
}
System.out.println("----------------------------------------------------------------------------");
System.out.print("1-团队列表\t");
System.out.print("2-添加团队成员\t");
System.out.print("3-删除团队成员\t");
System.out.print("4-退出\t");
System.out.print("请选择(1-4):");
c = TSUtility.readMenuSelection();
}
}
private static void listTeam() {
System.out.println("-----------------------团队列表---------------------------");
for (int i = 0; i < arrayLists.size(); i++) {
//外层 用于获取每个团队
for (int j = 0; j < arrayLists.get(i).size(); j++) {
//内层 用于获取团队成员
System.out.println(arrayLists.get(i).get(j));
}
System.out.println("-----------------------------------------------------");
}
}
private static void deleteTeam() {
System.out.println("请输入你想删除第几个团队");
int index = TSUtility.readInt();
if (index>arrayLists.size() ||index<=0){
System.out.println("输入有误。");
return;
}
System.out.println("是否确认删除(Y/N)");
char c = TSUtility.readConfirmSelection();
if (c == 'Y') {
arrayLists.remove(index - 1);
System.out.println("删除成功");
}
}
private static void getTeam() {
System.out.println("--------------------------团队成员列表-------------------------------------");
System.out.println("TID/ID\t\t姓名\t\t年龄\t\t工资\t\t职位\t\t状态\t\t奖金\t\t股票\t\t领用设备");//\t代表三个空格
for (int i = 0; i < programmers.size(); i++) {
System.out.println(programmers.get(i).getMemberid() + "/" + programmers.get(i));
}
}
private static void addMember(Employee e) throws TeamException {
//无法使用至少是程序员的成员变量
int numofAr = 0;
int numofDes = 0;
int numofPro = 0;
// e=new Programmer();
// System.out.println(programmer.getEquipment());
for (int i = 0; i < programmers.size(); i++) {
Programmer programmer1 = programmers.get(i);
if (programmer1 instanceof Architect) {
numofAr++;
} else if (programmer1 instanceof Designer) {
numofDes++;
} else if (programmer1 instanceof Programmer) {
numofPro++;
}
}
try {
if (programmers.size() == MAX_MEMBER) {
throw new TeamException("1");
} else if (e == (null) || !(e instanceof Programmer)) {
throw new TeamException("2");
} else if (programmers.indexOf(e) != -1) {
throw new TeamException("3");
}
Programmer programmer = (Programmer) e;//因此向下转型 但我发现使用向下转型之前似乎是要向上转型?! 尝试了好几遍无从下手只能截断if else
if (!programmer.isStatus()) {
throw new TeamException("4");
} else if (programmer instanceof Architect && numofAr == 1) {
throw new TeamException("5");
} else if (programmer instanceof Designer && numofDes == 2) {
throw new TeamException("6");
} else if (programmer instanceof Programmer && numofPro == 3) {
throw new TeamException("7");
}
programmer.setStatus(false);
programmer.setMemberid(counter); //初始值为1
counter++;
programmers.add(programmer); //将获取到的对象添加到程序员集合中
total++;
System.out.println("添加成功");
TSUtility.readReturn();
} catch (TeamException teamException) {
String message = teamException.getMessage();
switch (message) {
case "1": {
System.out.println("成员已满,无法添加");
break;
}
case "2": {
System.out.println("该成员不是开发人员,无法添加");
break;
}
case "3": {
System.out.println("该员工已在本开发团队中");
break;
}
case "4": {
System.out.println("该员工已是某团队成员");
break;
}
case "5": {
System.out.println("团队中至多只能有一名架构师");
break;
}
case "6": {
System.out.println("团队中至多只能有两名设计师");
break;
}
case "7": {
System.out.println("团队中至多只能有三名程序员");
break;
}
}
}
}
private static void removeMember(int memberid) throws TeamException {
/*Employee employee = NameListService.getEmployee(memberid);
programmers.remove(employee);*/
//这里定位对象就不是用id定位了 而是memberid 而且也不是在开发人员里面删除 而是在开发团队 换句话说就是在开发人员里面删除的人就没了 开发团队删除的人还在
try {
for (int i = 0; i < programmers.size(); i++) {
Programmer programmer = programmers.get(i);
/* System.out.println(programmer);
System.out.println(memberid + " ");
System.out.println("当前memberid: " + programmer.getMemberid());*/
if (programmer.getMemberid() == memberid) {
programmer.setStatus(true);
programmers.remove(programmer);
System.out.println("删除成功");
return; //只要满足条件就删掉并且结束方法*/
}
}
//下面的做法是不行的 因为还没出这个swtich方法中所以arraylist依然没有元素
/* for (int j=0;j<arrayLists.size();j++){
ArrayList<Programmer> arrayList = arrayLists.get(j);
if (arrayList.indexOf(programmer)!=-1){ //这里找到该程序员
arrayList.get(arrayList.indexOf(programmer)).setStatus(true);
programmer.setStatus(true);
programmers.remove(programmer);
System.out.println("删除成功");
return; //只要满足条件就删掉并且结束方法*/
//没有满足条件的
throw new TeamException();
} catch (TeamException t) {
System.out.println("本团队不存在该成员TID");
}
}
}
6.TSUtility.java
package com.Project_development_team_allocation_management_software.Service;
import java.util.Random;
import java.util.Scanner;
public class TSUtility {
private static Scanner scanner = new Scanner(System.in);
public static char readMenuSelection() {
char c;
for (; ; ) {
String str = readKeyBoard(1, false);
c = str.charAt(0);
if (c != '1' && c != '2' &&
c != '3' && c != '4') {
System.out.print("选择错误,请重新输入:");
} else break;
}
return c;
}
public static char readMenuSelectionPro() {
char c;
for (; ; ) {
String str = readKeyBoard(1, false);
c = str.charAt(0);
if (c != '1' && c != '2' &&
c != '3' && c != '4' && c != '5') {
System.out.print("选择错误,请重新输入:");
} else break;
}
return c;
}
public static void readReturn() {
System.out.print("按回车键继续...");
readKeyBoard(100, true);
}
public static int readInt() {
int n;
for (; ; ) {
String str = readKeyBoard(2, false);
try {
n = Integer.parseInt(str);
break;
} catch (NumberFormatException e) {
System.out.print("数字输入错误,请重新输入:");
}
}
return n;
}
public static int readstock() {//股票
int n;
for (; ; ) {
String str = readKeyBoard(6, false);
try {
n = Integer.parseInt(str);
break;
} catch (NumberFormatException e) {
System.out.print("数字输入错误,请重新输入:");
}
}
return n;
}
public static Double readDouble() {
Double n;
for (; ; ) {
String str = readKeyBoard(6, false);
try {
n = Double.parseDouble(str);
break;
} catch (NumberFormatException e) {
System.out.print("数字输入错误,请重新输入:");
}
}
return n;
}
public static char readConfirmSelection() {
char c;
for (; ; ) {
String str = readKeyBoard(1, false).toUpperCase();
c = str.charAt(0);
if (c == 'Y' || c == 'N') {
break;
} else {
System.out.print("选择错误,请重新输入:");
}
}
return c;
}
public static String readString(int limit, String defaultValue) {
String str = readKeyBoard(limit, true);
return str.equals("")? defaultValue : str;
}
public static String readKeyBoard(int limit, boolean blankReturn) {
String line = "";
while (scanner.hasNextLine()) {
line = scanner.nextLine();
if (line.length() == 0) {
if (blankReturn) return line;
else continue;
}
if (line.length() < 1 || line.length() > limit) {
System.out.print("输入长度(不大于" + limit + ")错误,请重新输入:");
continue;
}
break;
}
return line;
}
public static void loadSpecialEffects() throws InterruptedException {
System.out.println("请稍等:");
for (int i1 = 1; i1 <= 100; i1++) {
System.out.print("加载中:" + i1 + "%");
Thread.sleep(new Random().nextInt(25) + 1);
if (i1 == 100) {
Thread.sleep(50);
}
System.out.print("\r");
}
}
}
Package View
LoginView.java
package com.Project_development_team_allocation_management_software.View;
import com.Project_development_team_allocation_management_software.Service.Account;
import com.Project_development_team_allocation_management_software.Service.NameListService;
import com.Project_development_team_allocation_management_software.Service.ProjectService;
import com.Project_development_team_allocation_management_software.Service.TeamService;
import com.Project_development_team_allocation_management_software.Service.TeamException;
import com.Project_development_team_allocation_management_software.Service.TSUtility;
import java.util.ArrayList;
/**
* @author 尤小鹏
* 2021/7/29/029
*/
public class LoginView {
private static ArrayList<Account> list = new ArrayList<>();
private static String[] strings = new String[]{"0", "0", "0"};
public static void main(String[] args) throws TeamException {
//来个代码块设定初始存在的账户名
{
list.add(new Account("尤小鹏", "123"));
}
start();
int i = 0;
while (i < 5) {
AccountLogin(list);
if (strings[2].equals("true")) {
break;
} else {
new Account().addAcount(list);
}
i++;
}
while (true) {
Mainmenu();
}
}
public static void start() {
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆ 欢迎来到项目开发团队分配管理软件 ☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("请您先进行登录:");
TSUtility.readReturn();
}
public static void AccountLogin(ArrayList<Account> list) {
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆ 登录界面 ☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆☆☆--------------------------☆☆☆");
strings = new Account().isTrue(list, strings);
return;
}
public static void Mainmenu() throws TeamException {
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆ 软件主菜单 ☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("?1. <用户信息修改> *");
System.out.println("?2. <开发人员管理> *");
System.out.println("?3. <开发团队调度管理> *");
System.out.println("?4. <开发项目管理> *");
System.out.println("?5. <退出软件> *");
System.out.println("? 请选择:");
char c = TSUtility.readMenuSelectionPro();
switch (c) {
case '1': {
new Account().modifyAccount(list, strings);
break;
}
case '2': {
NameListService nameListService = new NameListService();
System.out.println("请稍等:");
nameListService.getAllEmployees();
while (true) {
char c1 = developPeopleMenu();
char c2 = nameListService.modifyDevelopPeople(c1);
if (c2 == 'Y') break;
}
break;
}
case '3': {
TeamService.Teamdo();
// System.out.println("调用开发团队调度管理");
break;
}
case '4': {
ProjectService.Projectdo();
// System.out.println("调用开发项目管理");
break;
}
case '5': {
System.out.println("是否退出(Y/N)");
char c1 = TSUtility.readConfirmSelection();
if (c1 == 'Y')
System.exit(0);
else break;
// System.out.println("退出");
}
}
}
public static void modifyMenu() {
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆ 修改界面 ☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("请输入你要修改的类型:");
System.out.println("1 修改用户名");
System.out.println("2 修改密码名");
System.out.println("3 修改用户名和密码名");
System.out.println("4 不修改 退出");
}
public static void TeamMenu(){
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆ 团队调度界面 ☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.print("1-添加团队\t");
System.out.print("2-查看团队\t");
System.out.print("3-删除团队\t");
System.out.print("4-退出\t");
System.out.println("请选择(1-4):");
}
public static char developPeopleMenu() {
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆ 开发人员管理主菜单 ☆");
System.out.println("☆☆☆ ☆☆☆");
System.out.println("☆☆☆--------------------------☆☆☆");
System.out.println("?1. <开发人员的添加> *");
System.out.println("?2. <开发人员的查看> *");
System.out.println("?3. <开发人员的修改> *");
System.out.println("?4. <开发人员的删除> *");
System.out.println("?5. <退出当前菜单> *");
System.out.println("? 请选择:");
char c = TSUtility.readMenuSelectionPro();
return c;
}
public static char developProjectMenu(){
System.out.println("☆ 开发项目管理主菜单 ☆");
System.out.println("?1. <项目的添加> *");
System.out.println("?2. <项目分配开发团队> *");
System.out.println("?3. <项目的查看> *");
System.out.println("?4. <项目的删除> *");
System.out.println("?5. <退出当前菜单> *");
System.out.println("? 请选择:");
char c = TSUtility.readMenuSelectionPro();
return c;
}
}
运行效果概览

|