《项目开发团队分配管理软件》,java开发工程师面试问题大全解析

package service;

public class TeamException extends Exception{

public TeamException(){}

public TeamException(String message) {

super(message);

}

}

开发人员管理类NameListService:

package service;

/*

开发人员管理模块

*/

import domain.*;

import view.TSUtility;

import java.util.ArrayList;

public class NameListService {

//装雇员的集合

private static ArrayList employees = new ArrayList();

//添加员工的ID

private int count = 1;

//初始化默认值(代码块)

{

if(employees.isEmpty()){

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 NameListService() {

}

public NameListService(ArrayList employees, int count) {

this.employees = employees;

this.count = count;

}

public ArrayList getEmployees() {

return employees;

}

public void setEmployees(ArrayList employees) {

this.employees = employees;

}

public int getCount() {

return count;

}

public void setCount(int count) {

this.count = count;

}

//得到所有员工数据集合

public ArrayList getAllEmployees() {

return employees;

}

//得到当前员工

public Employee getEmployee(int id) throws TeamException {

for (int i = 0; i < employees.size(); i++) {

if(employees.get(i).getId() == id){

return employees.get(i);

}

}

throw new TeamException(“该员工不存在”);

}

public void addEmployee(){

System.out.println(“请输入需要添加的雇员的职位:”);

System.out.println(“1(无职位)”);

System.out.println(“2(程序员)”);

System.out.println(“3(设计师)”);

System.out.println(“4(架构师)”);

String a=String.valueOf(TSUtility.readMenuSelection());

if(a.equals(“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();

}else if(a.equals(“2”)){//程序员

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();

System.out.println(“请为当前雇员配置一台好的台式电脑”);

PC pc=new PC().addPC();

Programmer programmer=new Programmer(++count,name,age,salary,pc);

employees.add(programmer);

TSUtility.readReturn();

}else if(a.equals(“3”)){//设计师

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();

System.out.println(“请为当前设计师配置一台好的笔记本电脑:”);

NoteBook noteBook=new NoteBook().addNoteBook();

System.out.println(“请输入当前设计师的奖金:”);

double bonus=TSUtility.readDouble();

Designer designer=new Designer(++count,name,age,salary,noteBook,bonus);

employees.add(designer);

System.out.println(“人员添加成功!”);

TSUtility.readReturn();

}else {//架构师

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();

System.out.println(“请为当前架构师配置一台好的打印设备:”);

Printer printer=new Printer().addPrinter();

System.out.println(“请设置当前架构师的奖金:”);

double bonus=TSUtility.readDouble();

System.out.println(“请设置当前架构师的股票:”);

Integer stock=TSUtility.readstock();

Architect architect=new Architect(++count,name,age,salary,printer,bonus,stock);

employees.add(architect);

System.out.println(“人员添加成功!”);

TSUtility.readReturn();

}

}

//员工的删除

public void delEmployee(int id) throws TeamException {

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++) {

//动态ID,随着人员删除ID相应变化(内涵:找到索引减一的那个值,此时这个值对应的就是删除ID后,接上来的那个ID,只要将这个ID减一,就能继续升序而不断开)

employees.get(i-1).setId(employees.get(i-1).getId()-1);

}

flag=true;

}

}

if(flag){

System.out.println(“删除成功!”);

count–;

}else {

throw new TeamException(“该员工不存在”);

}

}

//员工的查看

public void showEmployee() throws InterruptedException {

TSUtility.loadSpecialEffects();

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.println(“姓名(”+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(6,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) {

e.printStackTrace();

}

}

}

}

团队人员管理类Teamservice:

package service;

/*

团队内容判断管理模块

*/

import domain.Architect;

import domain.Designer;

import domain.Employee;

import domain.Programmer;

public class TeamService {

//静态变量,用来为开发团队新增成员自动生成团队中的唯一ID,即memberId。(提示:应使用增1的方式)

private static int counter = 1;

//开发团队最大成员数,final静态为常量,变量名全大写

private final int MAX_MEMBER = 5;

//数组,程序员数组

Programmer[] team = new Programmer[MAX_MEMBER];

//团队实际人数

private int total = 0;

public TeamService() {

}

public TeamService(int counter, Programmer[] team, int total) {

this.counter = counter;

this.team = team;

this.total = total;

}

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_MEMBER];

counter = 1;

total = 0;

this.team = team;

}

//增加团队成员

public void addMember(Employee e) throws TeamException {

if (total >= MAX_MEMBER) {

throw new TeamException(“成员已满,无法添加”);

}

if (!(e instanceof Programmer)) {

throw new TeamException(“该成员不是开发人员,无法添加”);

}

Programmer p = (Programmer) e;

if (isExist§) {

throw new TeamException(“该员工已在本团队中”);

}

if (!(p.getStatus())) {

throw new TeamException(“该员工已是某一团队成员”);

}

//团队中人员要求,至多一位架构师,至多两位设计师,至多三位程序员

int numArchitect = 0;

int numDesigner = 0;

int numProgrammer = 0;

for (int i = 0; i < total; i++) {

if (team[i] instanceof Architect) {

numArchitect++;

} else if (team[i] instanceof Designer) {

numDesigner++;

} else if (team[i] instanceof Programmer) {

numProgrammer++;

}

}

if (p instanceof Architect) {

if (numArchitect >= 1) {

throw new TeamException(“团队中至多只能有一位架构师”);

}

} else if (p instanceof Designer) {

if (numDesigner >= 2) {

throw new TeamException(“团队中至多只能有两位设计师”);

}

} else if (p instanceof Programmer) {

if (numProgrammer >= 3) {

throw new TeamException(“团队中至多只能有三位程序员”);

}

}

//添加到数组

p.setStatus(false);

p.setMemberId(counter++);

team[total++] = p;

}

//判断团队中是否已经存在这个成员

public boolean isExist(Programmer p) {

for (int i = 0; i < total; i++) {

if (team[i].getId() == p.getId()) {

return true;

}

}

return false;

}

//删除指定memberld的成员(已经在团队内的成员)

public void removeMember(int memberld) throws TeamException {

int n = 0;

//找到指定TID(memberld)的员工删除,遍历,找不到报异常

for (; n < total; n++) {

if (team[n].getMemberId() == memberld) {

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;

int a =1;

for(int i =0;i<total;i++){

team[i].setMemberId(a++);

}

}

}

项目开发管理类ProjectService:

package service;

/*

项目开发管理模块

*/

import domain.Programmer;

import domain.Project;

import view.TSUtility;

import java.util.ArrayList;

import java.util.Random;

public class ProjectService {

private ArrayList pro = new ArrayList<>();

private int count = 1;

int a = 1;

int b = 1;

int c = 1;

int d = 1;

//添加项目

public void addProject() throws InterruptedException {

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 ch = TSUtility.readMenuSelection();

switch (ch) {

case ‘1’:

Project p1 = new Project();

p1.setProId(count++);

p1.setProjectName(“小米官网”);

p1.setDesName(“开发完成类似于小米官网的web项目”);

if (a == 1) {

pro.add(p1);

TSUtility.loadSpecialEffects();

System.out.println(“已添加项目:” + p1.getProjectName());

a++;

} else {

System.out.println(“你添加的项目已经被添加,请添加其他的项目!”);

}

break;

case ‘2’:

Project p2 = new Project();

p2.setProId(count++);

p2.setProjectName(“公益在线商城”);

p2.setDesName(“猫宁Morning公益商城是中国公益性在线电子商城”);

if (b == 1) {

pro.add(p2);

TSUtility.loadSpecialEffects();

System.out.println(“已添加项目:” + p2.getProjectName());

b++;

} else {

System.out.println(“你添加的项目已经被添加,请添加其他的项目!”);

}

break;

case ‘3’:

Project p3 = new Project();

p3.setProId(count++);

p3.setProjectName(“博客系统”);

p3.setDesName(“Java博客系统,让每一个有故事的人更好的表达想法!”);

if (c == 1) {

pro.add(p3);

TSUtility.loadSpecialEffects();

System.out.println(“已添加项目:” + p3.getProjectName());

} else {

System.out.println(“你添加的项目已经被添加,请添加其他的项目!”);

}

break;

case ‘4’:

Project p4 = new Project();

p4.setProId(count++);

p4.setProjectName(“在线协作文档编辑系统”);

p4.setDesName(“一个很常用的功能,适合小组内的文档编辑。”);

if (d == 1) {

pro.add(p4);

TSUtility.loadSpecialEffects();

System.out.println(“已添加项目:” + p4.getProjectName());

} else {

System.out.println(“你添加的项目已经被添加,请添加其他的项目!”);

}

break;

default:

System.out.println(“该项目不存在!”);

break;

}

}

//项目分配团队开发

public void dealingPro(Programmer[] team) {

if (pro == null) {

System.out.println(“没有项目,请先添加项目!!!”);

return;

}

System.out.println(“当前团队人员有:”);

for (int i = 0; i < team.length; i++) {

System.out.println(team[i]);

}

System.out.println(“请为当前团队创建一个团队名称:”);

String teamName = TSUtility.readKeyBoard(6, false);

//分配项目随机

if (team.length!=0) {

Random r = new Random();

int RandomNum = r.nextInt(pro.size());

Project project = this.pro.get(RandomNum);

if (!(project.equals(null))) {

project.setTeamName(teamName);

project.setTeam(team);

project.setStatus(true);

pro.set(RandomNum, project);

}

}

}

//查看项目当前状态

public void showPro() throws InterruptedException {

TSUtility.loadSpecialEffects();

if (pro.size() == 0) {

System.out.println(“当前没有项目,请添加项目!!!”);

}

for (int i = 0; i < pro.size(); i++) {

System.out.println(pro.get(i));

}

}

//删除选择的项目

public void delPro(int id) throws TeamException {

boolean flag = false;

for (int i = 0; i < pro.size(); i++) {

if ((pro.get(i).getStatus())) {

if (pro.get(i).getProId() == id) {

pro.remove(i);

for (i = id; i < pro.size(); i++) {

pro.get(i - 1).setProId(pro.get(i - 1).getProId() - 1);//动态ID改变

}

flag = true;

}

} else {

throw new TeamException(“当前项目正在被开发,无法删除!”);

}

}

if (flag) {

System.out.println(“删除成功!”);

count–;

} else {

try {

throw new TeamException(“该项目不存在!”);

} catch (TeamException e) {

e.printStackTrace();

}

}

}

//遍历集合所有元素得到所有数据

public ArrayList getAllPro() {

for (int i = 0; i < pro.size(); i++) {

System.out.println(pro.get(i));

}

return pro;

}

}

3、view包下:


用户登录/注册界面LoginView:

package view;

/*

*用户登录/注册界面

*/

import java.util.Scanner;

@SuppressWarnings(“all”)

public class LoginView {

//需要初始化值,让String类型的默认初始化不是为null;

private String userName=“”;//用户名

private String password=“”;//登录密码

//用户注册信息

public void register() throws InterruptedException {

TSUtility.loadSpecialEffects();

System.out.println(“开始注册…”);

Scanner sc = new Scanner(System.in);

System.out.println(“请输入你要注册的账户名称(名称不大于四位):”);

String userName = TSUtility.readKeyBoard(4, false);

this.userName=userName;

System.out.println(“请输入你的登录密码(位数不大于八位):”);

String password = TSUtility.readKeyBoard(8, false);

this.password=password;

System.out.println(“注册成功,请重新登录。”);

}

//用户登录

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 password = TSUtility.readKeyBoard(8, false);

if (this.userName.length() == 0 || this.password.length() == 0) {

System.out.println(“未检测到你的账号信息,请重新输入或注册”);

register();

} else if (this.userName.equals(userName) && this.password.equals(password)) {

TSUtility.loadSpecialEffects();

System.out.println(“登录成功,欢迎你:” + userName);

flag = false;

} else {

count–;

if (count <= 0) {

System.out.println(“登录次数为零,无法登录,退出。”);

return;

}

System.out.println(“登录失败,用户名不匹配或密码错误,还剩余” + count + “次登录机会,请重新输入”);

}

}

}

//用户修改

public void revise() 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(不修改,退出)”);

Scanner sc = new Scanner(System.in);

String num = sc.next();

if (num.equals(“1”)) {

System.out.println(“请输入你需要修改的新账户名称:”);

String userName = TSUtility.readKeyBoard(4, false);

this.userName = userName;

System.out.println(“修改成功!”);

} else if (num.equals(“2”)) {

System.out.println(“请输入你需要修改的新账户密码:”);

String password = TSUtility.readKeyBoard(8, false);

this.password = password;

System.out.println(“修改成功!”);

} else if (num.equals(“3”)) {

System.out.println(“请输入你需要修改的新账户名称:”);

String userName = TSUtility.readKeyBoard(4, false);

this.userName = userName;

System.out.println(“请输入你需要修改的新密码:”);

String password = TSUtility.readKeyBoard(8, false);

this.password = password;

System.out.println(“修改成功!”);

} else if (num.equals(“4”)) {

System.out.println(“你确定退出吗?Y/N”);

char ch = TSUtility.readConfirmSelection();

if (ch == ‘Y’) {

System.out.println(“正在退出…”);

TSUtility.loadSpecialEffects();

flag = false;

}

} else {

System.out.println(“输入错误!请输入“1”或者“2”或者“3”或者“4”:”);

}

}

}

}

团队修改界面Teamview:

package view;

/*

管理团队模块的配置管理

*/

import com.sun.org.apache.xpath.internal.objects.XNumber;

import domain.Employee;

import domain.Programmer;

import service.NameListService;

import service.TeamException;

import service.TeamService;

import java.util.ArrayList;

public class TeamView {

private NameListService listSvc = new NameListService();

private TeamService teamSvc = new TeamService();

private ArrayList<Programmer[]> team = new ArrayList<Programmer[]>();

//团队管理

public void enterMainMenu() {

boolean flag = true;

char key = ‘0’;

do {

if (key != ‘1’) {

listAllEmployees();

}

System.out.println(“1-团队列表 2-添加团队成员 3-删除团队成员 4-退出 请选择(1-4):”);

key = TSUtility.readMenuSelection();

System.out.println();

switch (key) {

case ‘1’:

listTeam();

break;

case ‘2’:

addMember();

break;

case ‘3’:

deleteMember();

break;

case ‘4’:

System.out.println(“请确认是否退出?y/n”);

char ch = TSUtility.readConfirmSelection();

if (ch == ‘Y’) {

team.add(teamSvc.getTeam());//返回数组

teamSvc.clearTeam();//初始化当前团队成员数组

flag = false;

}

break;

default:

System.out.println(“你输入的信息有误,请重新输入!”);

break;

}

} while (flag);

}

//显示查看所有团队成员

private void listAllEmployees() {

System.out.println(“\n-------------------------------开发团队调度软件--------------------------------\n”);

ArrayList emps = listSvc.getAllEmployees();

if (emps.size() == 0) {

System.out.println(“没有客户记录存在!”);

} else {

System.out.println(“ID\t 姓名\t年龄\t 工资\t 职位\t 状态\t 奖金\t 股票\t 领用设备”);

}

for (Employee e : emps) {

System.out.println(“” + e);

}

System.out.println(“-------------------------------------------------------------------------------”);

}

//显示开发团队成员列表

private void listTeam() {

System.out.println(“\n--------------------团队成员列表---------------------\n”);

Programmer[] team = teamSvc.getTeam();

if (team.length == 0) {

System.out.println(“开发团队目前没有成员!”);

} else {

System.out.println(“TID/ID\t姓名\t 年龄\t 工资\t 职位\t 奖金\t 股票”);

}

//增强for循环

System.out.println(“-----------------------------------------------------”);

for (Programmer p : team) {

System.out.println(" " + p.getDetailsForTeam());

}

System.out.println(“-----------------------------------------------------”);

}

//添加成员到团队

private void addMember() {

System.out.println(“---------------------添加成员---------------------”);

System.out.println(“请输入要添加的员工ID:”);

int id = TSUtility.readInt();

try {

Employee e = listSvc.getEmployee(id);

teamSvc.addMember(e);

System.out.println(“添加成功!”);

} catch (TeamException e) {

System.out.println(“添加失败,原因是:” + e.getMessage());

}

//回车继续

TSUtility.readReturn();

}

//删除团队中指定ID的人员

private void deleteMember() {

System.out.println(“---------------------删除成员---------------------”);

listTeam();

if (teamSvc.getTeam().length != 0) {

System.out.print(“请输入要删除员工的TID:”);

int TID = TSUtility.readInt();

if (TID < 1) {

try {

throw new TeamException(“不存在该成员的TID”);

} catch (TeamException e) {

// e.printStackTrace();

System.out.println(e.getMessage());

}

}

System.out.println(“请问是否继续删除?(y/n)”);

char ch = TSUtility.readConfirmSelection();

if (ch == ‘n’) {

return;

}

try {

teamSvc.removeMember(TID);

System.out.println(“删除成功”);

} catch (TeamException e) {

System.out.println(“删除失败,原因:” + e.getMessage());

}

// 按回车键继续…

TSUtility.readReturn();

}

}

// 加入团队并得到更多的团队

public ArrayList<Programmer[]> getManyTeam() {

boolean flag = true;

char key = 0;

do {

System.out.println(“※※※※※※※※※※※”);

System.out.println(“※ 团队调度界面 ※”);

System.out.println(“※※※※※※※※※※※”);

System.out.print(“1-添加团队 2-查看团队 3-删除团队 4-退出 请选择(1-4):”);

key = TSUtility.readMenuSelection();

System.out.println();

switch (key) {

case ‘1’:

enterMainMenu();

break;

case ‘2’:

System.out.println(“-------团队列表--------”);

System.out.println(“----------------------”);

for (Programmer[] team : team) {

for (int i = 0; i < team.length; i++) {

System.out.println(team[i]);

}

System.out.println(“----------------------”);

teamSvc.clearTeam();

}

if (team.size() == 0) {

System.out.println(“当前并无团队,请添加团队!”);

}

break;

case ‘3’:

if (team.size() == 0) {

try {

throw new TeamException(“当前并无团队,请添加团队!”);

} catch (TeamException e) {

System.out.println(e.getMessage());

}

}

if (team.size() != 0) {

System.out.println(“请输入想要删除第几个团队”);

int num = TSUtility.readInt();

if (num <= team.size()) {

System.out.print(“确认是否删除(Y/N):”);

char de = TSUtility.readConfirmSelection();

if (de == ‘Y’) {

team.remove(num - 1);

} else {

System.out.println(“请考虑清楚!”);

}

} else {

System.out.println(“没有该团队,请正常输入!” + “目前团队只有” + team.size() + “个”);

}

}

break;

case ‘4’:

System.out.print(“确认是否退出(Y/N):”);

char yn = TSUtility.readConfirmSelection();

if (yn == ‘Y’) {

flag = false;

}

break;

default:

System.out.println(“你输入的信息有误,请重新输入!”);

break;

}

} while (flag);

return team;

}

}

最终集合展示模块(运行主界面)IndexView:

package view;

/*

运行主界面类

*/

import domain.Programmer;

import service.NameListService;

import service.ProjectService;

import service.TeamException;

import java.util.ArrayList;

public class IndexView {

private final static LoginView loginView = new LoginView();

private final static NameListService nameListService = new NameListService();

private final static TeamView teamView = new TeamView();

private final static ProjectService projectService = new ProjectService();

private ArrayList<Programmer[]> manyTeam = null;

public void Menu() throws TeamException {

boolean flag = true;

char key = ‘0’;

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 {

loginView.Login();

} catch (InterruptedException e) {

e.printStackTrace();

}

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("⬇请选择: ");

key = TSUtility.readMenuSelectionPro();

switch (key) {

case ‘1’:

try {

loginView.revise();

} catch (InterruptedException e) {

System.out.println(e.getMessage());

// e.printStackTrace();

}

break;

case ‘2’:

try {

nameListService.showEmployee();

} catch (InterruptedException e) {

// e.printStackTrace();

System.out.println(e.getMessage());

}

boolean flagSec = true;

char keySec = ‘0’;

do {

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("⬇请选择: ");

keySec = TSUtility.readMenuSelectionPro();

switch (keySec) {

case ‘1’:

nameListService.addEmployee();

break;

case ‘2’:

try {

nameListService.showEmployee();

} catch (InterruptedException e) {

// e.printStackTrace();

System.out.println(e.getMessage());

}

break;

case ‘3’:

System.out.println(“请输入需要修改的员工id:”);

int j = TSUtility.readInt();

nameListService.modifyEmployee(j);

break;

case ‘4’:

System.out.println(“请输入需要删除的员工id:”);

int i = TSUtility.readInt();

try {

nameListService.delEmployee(i);

} catch (TeamException e) {

// e.printStackTrace();

System.out.println(e.getMessage());

}

break;

case ‘5’:

System.out.println(“请确认是否退出:(Y/N)”);

char ch = TSUtility.readConfirmSelection();

if (ch == ‘Y’) {

flagSec = false;

}

break;

default:

System.out.println(“输入有误,请重新输入!”);

break;

}

} while (flagSec);

break;

case ‘3’:

manyTeam = teamView.getManyTeam();

break;

case ‘4’:

boolean flagThr = true;

char keyThr = ‘0’;

do {

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("⬇请选择: ");

keyThr = TSUtility.readMenuSelectionPro();

switch (keyThr) {

case ‘1’:

try {

projectService.addProject();

} catch (InterruptedException e) {

// e.printStackTrace();

System.out.println(e.getMessage());

}

break;

case ‘2’:

for (Programmer[] pro : manyTeam) {

projectService.dealingPro(pro);

}

break;

case ‘3’:

try {

projectService.showPro();

} catch (InterruptedException e) {

// e.printStackTrace();

System.out.println(e.getMessage());

}

break;

case ‘4’:

System.out.println(“请输入需要删除的项目id:”);

int j = TSUtility.readInt();

projectService.delPro(j);

break;

case ‘5’:

System.out.print(“确认是否退出(Y/N):”);

char ch = TSUtility.readConfirmSelection();

if (ch == ‘Y’) {

flagThr = false;

}

break;

default:

System.out.println(“输入有误!请重新输入!”);

break;

}

} while (flagThr);

break;

case ‘5’:

System.out.print(“确认是否退出(Y/N):”);

char ch = TSUtility.readConfirmSelection();

if (ch == ‘Y’) {

flag = false;

}

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
img
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加V获取:vip1024b (备注Java)
img

总结

面试难免让人焦虑不安。经历过的人都懂的。但是如果你提前预测面试官要问你的问题并想出得体的回答方式,就会容易很多。

此外,都说“面试造火箭,工作拧螺丝”,那对于准备面试的朋友,你只需懂一个字:刷!

给我刷刷刷刷,使劲儿刷刷刷刷刷!今天既是来谈面试的,那就必须得来整点面试真题,这不花了我整28天,做了份“Java一线大厂高岗面试题解析合集:JAVA基础-中级-高级面试+SSM框架+分布式+性能调优+微服务+并发编程+网络+设计模式+数据结构与算法等”

image

且除了单纯的刷题,也得需准备一本【JAVA进阶核心知识手册】:JVM、JAVA集合、JAVA多线程并发、JAVA基础、Spring 原理、微服务、Netty与RPC、网络、日志、Zookeeper、Kafka、RabbitMQ、Hbase、MongoDB、Cassandra、设计模式、负载均衡、数据库、一致性算法、JAVA算法、数据结构、加密算法、分布式缓存、Hadoop、Spark、Storm、YARN、机器学习、云计算,用来查漏补缺最好不过。

image

一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
img

}

break;

case ‘2’:

for (Programmer[] pro : manyTeam) {

projectService.dealingPro(pro);

}

break;

case ‘3’:

try {

projectService.showPro();

} catch (InterruptedException e) {

// e.printStackTrace();

System.out.println(e.getMessage());

}

break;

case ‘4’:

System.out.println(“请输入需要删除的项目id:”);

int j = TSUtility.readInt();

projectService.delPro(j);

break;

case ‘5’:

System.out.print(“确认是否退出(Y/N):”);

char ch = TSUtility.readConfirmSelection();

if (ch == ‘Y’) {

flagThr = false;

}

break;

default:

System.out.println(“输入有误!请重新输入!”);

break;

}

} while (flagThr);

break;

case ‘5’:

System.out.print(“确认是否退出(Y/N):”);

char ch = TSUtility.readConfirmSelection();

if (ch == ‘Y’) {

flag = false;

}

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
[外链图片转存中…(img-4rLRCftB-1712681797005)]
[外链图片转存中…(img-ZHBQ7R6r-1712681797006)]
[外链图片转存中…(img-ATc68EHV-1712681797006)]
[外链图片转存中…(img-u6gXIJRC-1712681797007)]
[外链图片转存中…(img-d7X3oCrc-1712681797007)]
[外链图片转存中…(img-5OdiyCPr-1712681797007)]

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加V获取:vip1024b (备注Java)
[外链图片转存中…(img-eaBR0ri5-1712681797008)]

总结

面试难免让人焦虑不安。经历过的人都懂的。但是如果你提前预测面试官要问你的问题并想出得体的回答方式,就会容易很多。

此外,都说“面试造火箭,工作拧螺丝”,那对于准备面试的朋友,你只需懂一个字:刷!

给我刷刷刷刷,使劲儿刷刷刷刷刷!今天既是来谈面试的,那就必须得来整点面试真题,这不花了我整28天,做了份“Java一线大厂高岗面试题解析合集:JAVA基础-中级-高级面试+SSM框架+分布式+性能调优+微服务+并发编程+网络+设计模式+数据结构与算法等”

[外链图片转存中…(img-IXW5OpVA-1712681797008)]

且除了单纯的刷题,也得需准备一本【JAVA进阶核心知识手册】:JVM、JAVA集合、JAVA多线程并发、JAVA基础、Spring 原理、微服务、Netty与RPC、网络、日志、Zookeeper、Kafka、RabbitMQ、Hbase、MongoDB、Cassandra、设计模式、负载均衡、数据库、一致性算法、JAVA算法、数据结构、加密算法、分布式缓存、Hadoop、Spark、Storm、YARN、机器学习、云计算,用来查漏补缺最好不过。

[外链图片转存中…(img-KS8V6Atg-1712681797009)]

一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
[外链图片转存中…(img-8Ys5J5k4-1712681797009)]

  • 12
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值