这次开发的项目开发团队分配管理软件是一个基于JAVA面像对象的一个基于文本界面的一个开发项目,它主要是用到我们之前所学的封装,继承,多态,其次考验了我们对异常的使用处理以及数组,arraylist集合的使用

      这个项目主要分为用户注册登录模块,开发人员管理模块。开发团队调度管理模块,以及开发项目管理模块

java 实现任务分配给不同人 java项目人员分配_java 实现任务分配给不同人

 1.用户注册与登录模块

public class LoginView {
    private String username="";//用户名
    private String userpwd="";//用户密码
    //登录
    public void login() throws InterruptedException {
        //登录次数
        int count=5;
        boolean flag=true;
        while (flag){
            System.out.println("********************🐱");
            System.out.println("***   <登录界面>   ***");
            System.out.println("***     (:      ***🐱");
            System.out.println("********************🐱");
            System.out.println("请输入你的登录账户名称:");
            String username = TSUtility.readKeyBoard(4, false);
            System.out.println("请输入你的登录密码:");
            String userpwd = TSUtility.readKeyBoard(8, false);
             if(this.username.length()==0||this.userpwd.length()==0){
                System.out.println("未检测到您的账号,请您先注册!");
                regist();
            }
            else if (this.username.equals(username)&&this.userpwd.equals(userpwd)){
                TSUtility.loadSpecialEffects();
                System.out.println("登陆成功!欢迎您:" + username);
                flag=false;
            }
            else {
                if(count<=0){
                    System.out.println("登录次数不足,退出");
                    return;
                }
                else {
                    count--;
                    System.out.println("登录失败,账户名或密码错误:");
                    System.out.println("次数还剩"+count+"次");
                }
            }
        }
    }
     //注册
    public void regist() throws InterruptedException {
        TSUtility.loadSpecialEffects();
        System.out.println("开始注册");
        System.out.println("请输入你的注册账户名称:");
        String username = TSUtility.readKeyBoard(4, false);
        this.username=username;
        System.out.println("请输入你注册账户的登录密码:");
        String userpwd = TSUtility.readKeyBoard(8, false);
        this.userpwd=userpwd;
        System.out.println("注册成功,请登录");
    }
    //修改用户名和密码
    public void update() throws InterruptedException {
        boolean flag=true;
        while (flag) {
            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不修改,退出");
            char key = TSUtility.readMenuSelection();
            switch (key){
                case '1':
                    System.out.println("请输入你的修改的用户名");
                    String username=TSUtility.readKeyBoard(4,false);
                    this.username=username;
                    System.out.println("修改成功");
                    break;
                case '2':
                    System.out.println("请输入你的修改的密码");
                    String userpwd=TSUtility.readKeyBoard(4,false);
                    this.userpwd=userpwd;
                    System.out.println("修改成功");
                    break;
                case '3':
                    System.out.println("请输入你的修改的用户名");
                    String name=TSUtility.readKeyBoard(4,false);
                    this.username=name;
                    System.out.println("请输入你的修改的密码");
                    String pwd=TSUtility.readKeyBoard(4,false);
                    this.userpwd=pwd;
                    System.out.println("修改成功");
                    break;
                case '4':
                    System.out.println("退出中");
                    TSUtility.loadSpecialEffects();
                    flag=false;
                    break;
            }
        }
    }
}

2.开发人员管理模块

public class NameListService {
    //用来装员工的数据集合
    private ArrayList<Employee> employees = new ArrayList<>();

    //添加员工的id
    private int count = 1;

    //初始化默认值
    {
        employees.add(new Employee(count, "马云 ", 22, 3000));
        employees.add(new Architect(++count, "马化腾", 32, 18000, new NoteBook("联想T4", 6000), 60000, 5000));
        employees.add(new Programmer(++count, "李彦宏", 23, 7000, new PC("戴尔", "NEC 17寸")));
        employees.add(new Programmer(++count, "刘强东", 24, 7300, new PC("戴尔", "三星 17寸")));
        employees.add(new Designer(++count, "雷军 ", 50, 10000, new Printer("激光", "佳能2900"), 5000));
        employees.add(new Programmer(++count, "", 30, 16800, new PC("华硕", "三星 17寸")));
        employees.add(new Designer(++count, "柳传志", 45, 35500, new PC("华硕", "三星 17寸"), 8000));
        employees.add(new Architect(++count, "杨元庆", 35, 6500, new Printer("针式", "爱普生20k"), 15500, 1200));
        employees.add(new Designer(++count, "史玉柱", 27, 7800, new NoteBook("惠普m6", 5800), 1500));
        employees.add(new Programmer(++count, "丁磊 ", 26, 6600, new PC("戴尔", "NEC17寸")));
        employees.add(new Programmer(++count, "张朝阳 ", 35, 7100, new PC("华硕", "三星 17寸")));
        employees.add(new Designer(++count, "杨致远", 38, 9600, new NoteBook("惠普m6", 5800), 3000));
    }
    public void setEmployees(ArrayList<Employee> employees) {
        this.employees = employees;
    }

    //得到全部的员工信息
    public ArrayList<Employee> getEmployees() {
        return employees;
    }

    //添加员工信息
    public void addEmployee() throws InterruptedException {
        System.out.println("请输入要添加的雇员职位");
        System.out.println("1(无职位)");
        System.out.println("2(程序员)");
        System.out.println("3(设计师)");
        System.out.println("4(架构师)");
        char a=TSUtility.readMenuSelection();
        switch (a){
            case '1':
                System.out.println("当前雇员职位分配为:无");
                System.out.println("请输入当前雇员的姓名");
                String name = TSUtility.readKeyBoard(4, false);
                System.out.println("请输入当前雇员的年龄");
                int age = TSUtility.readInt();
                System.out.println("请输入当前雇员的工资");
                double salary = TSUtility.readDouble();
                Employee employee = new Employee(++count, name, age, salary);
                employees.add(employee);
                System.out.println("添加成功");
                TSUtility.readReturn();
                break;
            case '2':
                System.out.println("当前雇员职位分配为:程序员");
                System.out.println("请输入当前雇员的姓名");
                String name1 = TSUtility.readKeyBoard(4, false);
                System.out.println("请输入当前雇员的年龄");
                int age1 = TSUtility.readInt();
                System.out.println("请输入当前雇员的工资");
                double salary1 = TSUtility.readDouble();
                System.out.println("请为当前的程序员配一台好的台式电脑");
                PC pc = new PC().addpc();
                Programmer programmer = new Programmer(++count, name1, age1, salary1, pc);
                employees.add(programmer);
                System.out.println("添加成功");
                TSUtility.readReturn();
                break;
            case '3':
                System.out.println("当前雇员职位分配为:设计师");
                System.out.println("请输入当前雇员的姓名");
                String name2 = TSUtility.readKeyBoard(4, false);
                System.out.println("请输入当前雇员的年龄");
                int age2 = TSUtility.readInt();
                System.out.println("请输入当前雇员的工资");
                double salary2 = TSUtility.readDouble();
                System.out.println("请为当前的设计师分配一台好的笔记本电脑");
                NoteBook noteBook = new NoteBook().addNoteBook();
                System.out.println("请输入当前设计师的奖金");
                double bonus = TSUtility.readDouble();
                Designer designer = new Designer(++count, name2, age2, salary2, noteBook, bonus);
                employees.add(designer);
                System.out.println("添加成功");
                TSUtility.readReturn();
                break;
            case '4':
                System.out.println("当前雇员职位分配为:架构师");
                System.out.println("请输入当前雇员的姓名");
                String name3 = TSUtility.readKeyBoard(4, false);
                System.out.println("请输入当前雇员的年龄");
                int age3 = TSUtility.readInt();
                System.out.println("请输入当前雇员的工资");
                double salary3 = TSUtility.readDouble();
                System.out.println("请为当前的架构师分配一台好的打印机");
                Printer printer = new Printer().addPrinter();
                System.out.println("请输入当前架构师的奖金");
                double bonus3 = TSUtility.readDouble();
                System.out.println("请输入架构师所分配的股票");
                int stock = TSUtility.readstock();
                Architect architect = new Architect(++count, name3, age3, salary3, printer, bonus3, stock);
                employees.add(architect);
                System.out.println("添加成功");
                TSUtility.readReturn();
                break;
            }
        }

    public Employee getEmployee(int id) throws TeamException {
        for (int i = 0; i < employees.size(); i++) {
            if (id == employees.get(i).getId()) {
                return employees.get(i);
            }
        }
        throw new TeamException("该员工不存在");
    }

    //查询所有的成员
    public void showEmployee(){
        System.out.println("ID\t 姓名\t年龄\t 工资\t 职位\t 状态\t 奖金\t 股票\t 领用设备");
        for (int i = 0; i < employees.size(); i++) {
            System.out.println(" " + employees.get(i));
        }
    }

    //修改指定的员工
    public void modifyEmployee(int id){
        boolean flag = false;
        for (int i = 0; i < employees.size(); i++) {
            Employee emp = employees.get(i);
            if (employees.get(i).getId() == id) {
                System.out.print("姓名(" + emp.getName() + ")");//emp.getname回车时默认不做修改
                String name = TSUtility.readString(4, emp.getName());
                System.out.println("年龄(" + emp.getAge() + ")");
                int age = Integer.parseInt(TSUtility.readString(2, emp.getAge() + ""));
                System.out.println("工资(" + emp.getSalary() + ")");
                double salary = Double.parseDouble(TSUtility.readString(5, emp.getSalary() + ""));
                emp.setName(name);
                emp.setAge(age);
                emp.setSalary(salary);
                employees.set(i, emp);
                flag = true;
            }
        }
        if (flag) {
            System.out.println("修改成功");
        } else {
            try {
                throw new TeamException("该员工不存在");
            } catch (TeamException e) {
                System.out.println(e.getMessage());
            }
        }
    }
   //删除指定的员工
    public void deleteEmployee(int id){
        boolean flag = false;
        for (int i = 0; i < employees.size(); i++) {
            if (employees.get(i).getId() == id) {
                employees.remove(i);
                for (i = id; i <= employees.size(); i++) {
                    employees.get(i - 1).setId(employees.get(i - 1).getId() - 1);
                }
                flag = true;
            }
        }
        if (flag) {
            System.out.println("删除成功");
            count--;
        } else {
            try {
                throw new TeamException("该员工不存在");
            } catch (TeamException e) {
                System.out.println(e.getMessage());
            }
        }
    }
}

3.开发团队调度管理

package project.team.service;

import project.team.domain.Architect;
import project.team.domain.Designer;
import project.team.domain.Employee;
import project.team.domain.Programmer;

public class TeamService {
    //团队的memberid
    private static int counter = 1;
    //团队人数上限
    private final int max = 5;
    //团队成员
    private Programmer[] team = new Programmer[max];
    //团队实际人数
    private int total = 0;
    //返回程序员数组
    public Programmer[] getTeam() {
        Programmer[] team = new Programmer[total];
        for (int i = 0; i < total; i++) {
            team[i] = this.team[i];
        }
        return team;
    }
    //初始化当前团队成员数组
    public void clearTeam() {
        team = new Programmer[max];
        counter=1;
        total=0;
        this.team = team;
    }

   //添加人员
    public void addmember(Employee e) throws TeamException {
        if (total >= max) {
            throw new TeamException("人员最大上限五位,已无法在继续添加");
        }

        if (!(e instanceof Programmer)) {
            throw new TeamException("该成员不是开发成员");
        }

        Programmer p = (Programmer) e;
        if (isExist(p)) {
            throw new TeamException("该成员已在该团队当中");
        }

        if (!p.getStatus()) {
            throw new TeamException("该成员已加入其他团队");
        }
        int num1 = 0, num2 = 0, num3 = 0;
        for (int i = 0; i < total; i++) {
            if (team[i] instanceof Architect) {
                num1++;//架构师
            }
            else if (team[i] instanceof Designer) {
                num2++;//设计师
            }
            else if (team[i] instanceof Programmer) {
                num3++;//程序员
            }
        }

        if (p instanceof Architect) {
            if (num1 >= 1) {
                throw new TeamException("架构师最多只能有一个");
            }
        } else if (p instanceof Designer) {
            if (num2 >= 2)
                throw new TeamException("设计师最多只能有两个");
        } else if (p instanceof Programmer) {
            if (num3 >= 3)
                throw new TeamException("程序员最多只能有三个");
        }
        //员工在加入团队后将状态改为false
        p.setStatus(false);
        p.setMemberid(counter++);
        team[total++] = p;
    }

    //判断该成员是否已经加入该团队
    private boolean isExist(Programmer p) {
        for (int i = 0; i < total; i++) {
            if (team[i].getId() == p.getId()) {
                return true;
            }
        }
        return false;
    }

    //删除团队中指定的成员
    public void removeMember(int memberid) throws TeamException {
        int n = 0;
        for (; n < total; n++) {
            if (team[n].getMemberid() == memberid) {
                team[n].setStatus(true);
                break;
            }
        }
        if (n == total) {
            throw new TeamException("找不到该成员无法删除");
        }
        //删除的后面每一项都往前移一位
        for (int i = n + 1; i < total; i++) {
            team[i-1] = team[i];
        }
        team[--total] = null;
    }

}
public class TeamView {
    private ArrayList<Programmer[]> team = new ArrayList<>();
    private NameListService nl = null;
    private TeamService ts = new TeamService();

    public TeamView(NameListService nls){
        //获取namelist中的值
        this.nl = nls;
    }

    public TeamView(){

    }
    public ArrayList<Programmer[]> getTeam() {
        boolean flag = true;
        do {
            System.out.println("**********************");
            System.out.println("      团队调度界面     ");
            System.out.println("**********************");
            System.out.println("1-添加团队  2-查看团队 3-删除团队  4-退出");
            char c = TSUtility.readMenuSelection();
            switch (c) {
                case '1':
                    enterMainmenu();
                    break;
                case '2':
                    System.out.println("-------团队列表--------");
                    for (Programmer[] team : team) {
                        for (int i = 0; i < team.length; i++) {
                            System.out.println(team[i]);
                        }
                        System.out.println("------------------");
                    }
                    break;
                case '3':
                    deleteteam();
                    break;
                case '4':
                    System.out.println("是否确认退出(Y/N)");
                    char y = TSUtility.readConfirmSelection();
                    if (y == 'Y') {
                        ts.clearTeam();
                        flag = false;
                    }
                    break;
            }
        } while (flag);
        return team;
    }

    //主界面显示及控制方法
    public void enterMainmenu() {
        //展示成员信息
        listAllEmployees();
        boolean flag = true;
        do {
            System.out.println("1-团队列表  2-添加团队成员  3-删除团队成员  4-退出  请选择(1-4)");
            char a = TSUtility.readMenuSelection();
            switch (a) {
                case '1':
                    showteam();//展示开发团队成员
                    break;
                case '2':
                    addMember();
                    break;
                case '3':
                    deleteMember();
                    break;
                case '4':
                    System.out.println("是否确认退出(Y/N)");
                    char y = TSUtility.readConfirmSelection();
                    if (y == 'Y') {
                        team.add(ts.getTeam());
                        ts.clearTeam();
                        flag = false;

                    }
                    break;
            }
        } while (flag);
    }

    //删除团队
    public void deleteteam() {
        System.out.println("目前的队伍有:");
        if (team.size() == 0) {
            System.out.println("暂时没有队伍");
        } else {
            System.out.println("请输入你要删除第几个团队");
            int num = TSUtility.readInt();
            if (num > 0 && num <= team.size()) {
                System.out.println("是否确认删除");
                char y = TSUtility.readConfirmSelection();
                if (y == 'Y') {
                    team.remove(num - 1);
                    System.out.println("删除成功");
                } else {
                    System.out.println("删除失败");
                }
            } else {
                System.out.println("没有该团队,请重新输入");
            }
        }
    }

    //展示团队成员列表
    private void showteam() {
        System.out.println("-------------团队成员列表---------------");
        Programmer[] team = ts.getTeam();
        if (team.length == 0) {
            System.out.println("开发团队目前没有成员");
        } else {
            System.out.println("TID/ID\t姓名\t年龄\t 工资\t 职位\t 奖金\t 股票");
        }
        for (int i = 0; i < team.length; i++) {
            System.out.println(team[i].getDetailsForTeam());
        }
        System.out.println("----------------------------------------");
    }

    //以表格形式列出公司所有成员
    public void listAllEmployees() {
        ArrayList<Employee> emp = nl.getEmployees();
        System.out.println("----------------------开发团队调度软件-----------------------");
        if (emp.size() == 0) {
            System.out.println("没有客户信息记录");
        } else {
                System.out.println("ID\t 姓名\t年龄\t 工资\t 职位\t 状态\t 奖金\t 股票\t 领用设备");
            for (int i = 0; i < emp.size(); i++) {
                System.out.println(" " + emp.get(i));
            }
        }
        System.out.println("-----------------------------------------------------------");
    }

    //实现删除成员操作
    private void deleteMember() {
        System.out.println("------------删除成员-------------");
        System.out.println("请输入要删除的员工id");
        int id = TSUtility.readInt();
        System.out.println("是否确认删除");
        char y = TSUtility.readConfirmSelection();
        if (y == 'N') {
            return;
        }
        try {
            ts.removeMember(id);
            System.out.println("删除成功");
        } catch (TeamException e) {
            System.out.println("删除失败");
        }
    }

    //实现添加成员操作
    private void addMember() {
        System.out.println("------------添加成员-------------");
        System.out.println("请输入要添加的员工id");
        int id = TSUtility.readInt();
        try {
            Employee e = nl.getEmployee(id);
            ts.addmember(e);
            System.out.println("添加成功");
        } catch (TeamException e) {
            System.out.println("添加失败,因为" + e.getMessage());
        }
    }
}

4.开发项目管理模块

public class ProjectService {
    //用来存储项目的集合
    private ArrayList<Project> pro = new ArrayList<>();
    //添加项目的标号
    private int count = 1;

    //新项目添加
    public 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("------------------------------------------------------------");
        System.out.println("请输入你想添加的项目编号");
        char a = TSUtility.readMenuSelection();
        switch (a) {
            case '1':
                for (int i = 0; i < pro.size(); i++) {
                    if (pro.get(i).getProjectName().equals("小米官网")) {
                        System.out.println("项目已被添加,无法再次添加");
                        return;
                    }
                }
                Project p1 = new Project();
                p1.setProld(count++);
                p1.setProjectName("小米官网");
                p1.setDesName("开发完成类似于小米官网的web项目");
                pro.add(p1);
                System.out.println("已添加项目:小米官网");
                break;
            case '2':
                for (int i = 0; i < pro.size(); i++) {
                    if (pro.get(i).getProjectName().equals("公益在线商城")) {
                        System.out.println("项目已被添加,无法再次添加");
                        return;
                    }
                }
                Project p2 = new Project();
                p2.setProld(count++);
                p2.setProjectName("公益在线商城");
                p2.setDesName("猫宁Morning公益商城是中国公益性在线电子商城.");
                pro.add(p2);
                System.out.println("已添加项目:公益在线商城");
                break;
            case '3':
                for (int i = 0; i < pro.size(); i++) {
                    if (pro.get(i).getProjectName().equals("博客系统")) {
                        System.out.println("项目已被添加,无法再次添加");
                        return;
                    }
                }
                Project p3 = new Project();
                p3.setProld(count++);
                p3.setProjectName("博客系统");
                p3.setDesName("Java博客系统,让每一个有故事的人更好的表达想法!");
                pro.add(p3);
                System.out.println("已添加项目:博客系统");
                break;
            case '4':
                for (int i = 0; i < pro.size(); i++) {
                    if (pro.get(i).getProjectName().equals("在线协作文档编辑系统")) {
                        System.out.println("项目已被添加,无法再次添加");
                        return;
                    }
                }
                Project p4 = new Project();
                p4.setProld(count++);
                p4.setProjectName("在线协作文档编辑系统");
                p4.setDesName("一个很常用的功能,适合小组内的文档编辑。");
                pro.add(p4);
                System.out.println("已添加项目:在线协作文档编辑系统");
                break;
        }
    }

    //项目分配团队开发

    public void dealingpro(ArrayList<Programmer[]> team) throws TeamException {
        boolean flag = true;
        int i = 0;
        while (i < team.size()) {
            if (pro.size() > 0) {
                System.out.println("团队人员");
                for (Programmer pro : team.get(i)) {
                    System.out.println(pro);
                }
                if (pro.get(i).getTeamName() == null) {
                    System.out.println("请为该团队添加一个团队名字");
                    String teamname = TSUtility.readKeyBoard(8, false);
                    System.out.println("请输入你要添加的项目号");
                    int num = TSUtility.readInt();
                    if (pro.get(num - 1).getStatus() == false) {
                        Project pj = this.pro.get(num - 1);
                        pj.setTeamName(teamname);
                        pj.setTeam(team.get(i));
                        pj.setStatus(true);
                        pro.set(num - 1, pj);
                        System.out.println("分配成功");
                    } else {
                        throw new TeamException("该项目正在被其他团队开发");
                    }
                } else {
                    throw new TeamException(pro.get(i).getTeamName() + "团队正在开发项目");
                }
                i++;
            } else {
                throw new TeamException("还未添加项目,请返回添加");
            }
        }


    }


    //查看项目当前状态
    public void showpro() {
        if (pro.size() == 0) {
            System.out.println("当前没有添加项目");
        } else {
            for (int i = 0; i < pro.size(); i++) {
                if (pro.get(i).getStatus() == true) {
                    System.out.println("项目" + pro.get(i).getProjectName() + "正在被-->" + pro.get(i).getTeamName() + "团队开发当中");
                } else {
                    System.out.println(pro.get(i).toString());
                }

            }
        }
    }

    //删除选择的项目
    public void delpro(int id) throws TeamException {
        boolean flag = true;

        if (pro.size() == 0) {
            System.out.println("当前没有可删除的项目");
        } else {
            for(int i=0;i<pro.size();i++){
                if (pro.get(i).getProld() == id) {
                    if (pro.get(i).getStatus()) {
                        throw new TeamException("被开发的项目不能删除");
                    } else {
                        pro.remove(i);
                        for (int j = id; j < pro.size(); j++) {
                            pro.get(j - 1).setProld(pro.get(j - 1).getProld() - 1);
                        }
                        System.out.println("删除成功");
                        count--;
                        flag=false;
                    }
                }
            }
             if(flag){
                 throw new TeamException("找不到该项目");
             }
        }


    }
}

5.主界面

public class indexView {
    private LoginView lv = new LoginView();
    private NameListService nls = new NameListService();
    private TeamView tv=new TeamView(nls);
    private ArrayList<Programmer[]> team=null;
    private ProjectService pjs=new ProjectService();

    public static void main(String[] args){
        indexView iv = new indexView();
        iv.menu();
    }

    public void menu()  {
        System.out.println("****************************************");
        System.out.println("**                                    **");
        System.out.println("**    欢迎来到项目开发团队分配管理软件    **");
        System.out.println("**                                    **");
        System.out.println("****************************************");
        System.out.println("🐕");
        System.out.println("🐕");
        System.out.println("🐕");
        System.out.println("🐕-----------<请您先进行登录>-------------🐕");
        TSUtility.readReturn();
        try {//登录
            lv.login();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        boolean flag=true;
        do {
            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 key = TSUtility.readMenuSelectionPro();
            switch (key) {
                case '1':
                    try {//修改用户信息
                        lv.update();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    break;
                case '2':
                    nls.showEmployee();
                    boolean flag1 = true;
                    while (flag1) {
                        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 keys = TSUtility.readMenuSelectionPro();
                        switch (keys) {
                            case '1':
                                //开发人员的添加
                                try {
                                    nls.addEmployee();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                break;
                            case '2':
                                //开发人员的展示
                                nls.showEmployee();
                                break;
                            case '3':
                                //开发人员的修改
                                System.out.println("请输入需要修改的员工id");
                                int id=TSUtility.readInt();
                                nls.modifyEmployee(id);
                                break;
                            case '4':
                                //开发人员进行删除操作
                                System.out.println("请输入需要删除的员工id");
                                int id1=TSUtility.readInt();
                                nls.deleteEmployee(id1);
                                break;
                            case '5':
                                System.out.println("是否确认退出(Y/N)");
                                char y=TSUtility.readConfirmSelection();
                                if (y=='Y'){
                                    flag1=false;
                                    System.out.println("退出成功");
                                }
                                break;
                        }
                    }
                    break;
                case '3':
                    team=tv.getTeam();
                    break;
                case '4':
                    boolean flag2 = true;
                    do {
                        System.out.println("    开发项目管理主菜单");
                        System.out.println("1项目的添加");
                        System.out.println("2项目分配开发团队");
                        System.out.println("3项目的查看");
                        System.out.println("4项目的删除");
                        System.out.println("5退出当前菜单");
                        char a = TSUtility.readMenuSelectionPro();
                        switch (a) {
                            case '1':
                                pjs.addProject();
                                break;
                            case '2':
                                if(team==null){
                                    System.out.println("当前未添加团队");
                                }else {
                                    try {
                                        pjs.dealingpro(team);
                                    } catch (TeamException e) {
                                        System.out.println(e.getMessage());
                                    }
                                }
                                break;
                            case '3':
                                pjs.showpro();
                                break;
                            case '4':
                                System.out.println("请输入你要删除的项目号");
                                int j = TSUtility.readInt();
                                try {
                                    pjs.delpro(j);
                                } catch (TeamException e) {
                                    System.out.println(e.getMessage());
                                }
                                break;
                            case '5':
                                System.out.println("是否确认退出");
                                char y = TSUtility.readConfirmSelection();
                                if (y == 'Y') {
                                    flag2 = false;
                                    System.out.println("退出成功");
                                }
                                break;
                        }
                    } while (flag2);
                    break;
                case '5':
                    System.out.print("确认是否退出(Y/N):");
                    char yn = TSUtility.readConfirmSelection();
                    if (yn == 'Y') {
                        flag = false;
                    }
                    break;
            }
        } while (flag);
    }
}

在本次开发的过程中严重的发现自己对面向对象的不熟练导致项目一拖再拖,实践是检验真理的标准,做项目才能不断的提高我的代码编辑能力