java项目开发团队分配管理软件

news2024/11/16 7:56:49

需求:

该软件实现以下功能: 软件启动时,首先进入登录界面进行注册和登录功能。 当登陆成功后,进入菜单,首先就可以对开发人员账户和密码进行修改。 然后可以对开发人员进行增删改操作 人员添加成功后,根据菜单提示,基于现有的公司成员,组建一个开发团队以开发一个新的项目。 组建过程包括将成员插入到团队中,或从团队中删除某成员,还可以列出团队中现有成员的列表,开发团队成员包括架构师、设计师和程序员。 团队组建成功,则可以进入项目模块,添加项目,分配开发团队进行开发。

TSUtility用于数据录入的限制
package com.team.view;

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 com.team.view;

import java.util.Random;
import java.util.Scanner;

/**
 * @author :奶糖趣多多
 * @date :Created in 2024/9/25 11:06
 * @description:项目的登录和注册
 */
public class LoginView {
    //首先给定属性:登录用户和密码
    private String userName = "";
    private String password = "";

    //注册功能
    public void regist() 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("未检测到您的账号,请您先注册!");
                regist();

            }
            //已注册
            //正常登录
            else if (this.userName.equals(userName) && this.password.equals(password)) {
                TSUtility.loadSpecialEffects();
                System.out.println("登陆成功!欢迎您:" + userName);
                flag = false;
            } else {
                if (count <= 0) {
                    System.out.println("登录次数不足!退出!");
                    login();
                    return;
                } else {
                    count--;
                    System.out.println("登录失败!用户名或密码不匹配!");
                    System.out.println("登录次数还剩" + count + "次,请重新输入:");
                }
            }
        }

    }

    //修改功能
    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(不修改,退出)");
            Scanner sc = new Scanner(System.in);
            String options = sc.next();
            if (options.equals("1")) {
                System.out.println("请输入你的修改的账户名称:");
                String userName = TSUtility.readKeyBoard(4, false);
                this.userName = userName;
                System.out.println("修改成功!");
            } else if (options.equals("2")) {
                System.out.println("请输入你的修改密码:");
                String password = TSUtility.readKeyBoard(8, false);
                this.password = password;
                System.out.println("修改成功!");
            } else if (options.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 (options.equals("4")) {
                System.out.println("退出中");
                TSUtility.loadSpecialEffects();
                flag = false;
            }
            else  {
                System.out.println("输入错误!请输入“1”或者“2”或者“3”或者“4”:");
            }
        }
    }


}

Employee
package com.team.domain;

public class Employee {
    private int id;
    private String name;
    private int age;
    private double salary;

    public Employee() {
    }

    public Employee(int id, String name, int age, double salary) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.salary = salary;
    }

    public int getAge() {
        return age;
    }

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

    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;
    }

    protected String getDetails() {
        return id + "\t" + name + "\t" + age+ "\t\t" +salary;
    }

    @Override
    public String toString() {
        return getDetails();
    }
}

 

Programmer
package com.team.domain;

public class Programmer extends Employee {
    private int memberId;//用来记录成员加入团队后在团队中的id
    private boolean status = true;//status是项目中人员的状态
    Equipment equipment;//成员领用的设备
    private boolean hasProject; // 团队是否已经被分配项目


    public Programmer() {
    }

    public Programmer(int id, String name, int age, 
                       double salary, Equipment equipment) {
        super(id, name, age, salary);
        this.equipment = equipment;
    }

    public Boolean getStatus() {
        return status;
    }

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

    public Equipment getEquipment() {
        return equipment;
    }

    public void setEquipment(Equipment equipment) {
        this.equipment = equipment;
    }

    public int getMemberId() {
        return memberId;
    }

    public void setMemberId(int memberId) {
        this.memberId = memberId;
    }

    public boolean isHasProject() {
        return hasProject;
    }

    public void setHasProject(boolean hasProject) {
        this.hasProject = hasProject;
    }


    protected String getMemberDetails() {
        return getMemberId() + "/" + getDetails();
    }


    public String getDetailsForTeam() {
        return getMemberDetails() + "\t程序员";
    }

    @Override
    public String toString() {
        return getDetails() + "\t程序员\t" + status + "\t\t\t\t\t" + equipment.getDescription() ;
    }
}

 

 Designer
package com.team.domain;

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;
    }

    public String getDetailsForTeam() {
        return getMemberDetails() + "\t设计师\t" + getBonus();
    }

    @Override
    public String toString() {
        return getDetails() + "\t设计师\t" + getStatus() + "\t" +
               getBonus() +"\t\t\t" + getEquipment().getDescription();
    }
}

 

Architect
package com.team.domain;


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 getDetailsForTeam() {
        return getMemberDetails() + "\t架构师\t" + 
               getBonus() + "\t" + getStock();
    }

    @Override
    public String toString() {
        return getDetails() + "\t架构师\t" + getStatus() + "\t" +
               getBonus() + "\t" + getStock() + "\t" + getEquipment().getDescription();
    }
}

 

Equipment 
package com.team.domain;

public interface Equipment {
    String getDescription();
}
NoteBook
package com.team.domain;

import com.team.view.TSUtility;

//笔记本电脑
public class NoteBook implements Equipment{
	private String model;//机器的型号
	private double price;//价格
	
	
	public NoteBook() {
		super();
	}


	public NoteBook(String model, double price) {
		super();
		this.model = model;
		this.price = 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 addNoteBook()
	{
		System.out.println("请输入需要配置的笔记本电脑的型号:");
		String model = TSUtility.readKeyBoard(10, false);
		System.out.println("请输入需要配置的笔记本电脑的价格:");
		Double price = TSUtility.readDouble();
		System.out.println("设备添加成功!");
		return new NoteBook(model, price);
	}


	@Override
	public String getDescription() {
		return model + "(" + price + ")";
	}
	
	

}

pc

package com.team.domain;

import com.team.view.TSUtility;

//台式电脑
public class PC implements Equipment{
	//机器型号
	private String model;
	//显示器名称
	private String display;

	

	public PC() {
		super();
	}

	public PC(String model, String display) {
		super();
		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;
	}

	public PC  addPC()
	{
		System.out.println("请输入需要配置的台式电脑的型号:");
		String model = TSUtility.readKeyBoard(10, false);
		System.out.println("请输入需要配置的台式电脑的显示器名称:");
		String display = TSUtility.readKeyBoard(10, false);
		System.out.println("设备添加成功!");
		return new PC(model, display);

	}
	@Override
	public String getDescription() {
		return model + "(" + display + ")";
	}
	
}
Printer
package com.team.domain;
import java.util.Scanner;

public class Printer implements Equipment {
    private String name;
    private String type;

    public Printer() {
    }

    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;
    }

    public Printer addPrinter() {
        System.out.println("请输入新配置的打印机的名称:");
        Scanner sc = new Scanner(System.in);
        String name = sc.next();
        System.out.println("请输入新配置的打印机的类型:");
        String type = sc.next();
        return new Printer(name, type);
    }

    @Override
    public String getDescription() {
        return name + "(" + type + ")";
    }
}

package com.team.service;

import com.team.domain.*;
import com.team.view.TSUtility;

import java.util.ArrayList;
import java.util.Scanner;

//NameListService和TeamService类分别用各自的数组来管理公司员工和开发团队成员对象
//公司员工属性类
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));
    }

    //getAllEmployees ()方法:获取当前所有员工。
    public ArrayList<Employee> getAllEmployees() {

        return employees;
    }

    //getEmployee(id : int)方法:获取指定ID的员工对象。
    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() throws InterruptedException {
        System.out.println("请输入需要添加的雇员的职位:");
        System.out.println("1(无职位)");
        System.out.println("2(程序员)");
        System.out.println("3(设计师)");
        System.out.println("4(架构师)");
        String c = String.valueOf(TSUtility.readMenuSelection());
        if (c.equals("1")) {
            //无职位 new Employee(count++,"马云 ",22,3000)
            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 (c.equals("2")) {
            //程序员 new Programmer(count++,"张朝阳 ",35,7100,new PC("华硕","三星 17寸"))
            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);
            System.out.println("人员添加成功!");
            TSUtility.readReturn();
        } else if (c.equals("3")) {
            //设计师 new Designer(count++,"史玉柱",27,7800,new NoteBook("惠普m6",5800),1500)
            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 {
            //架构师 new Architect(count++,"杨元庆",35,6500,new Printer("针式","爱普生20k"),15500,1200)
            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)  {

        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) {
                e.printStackTrace();
            }
        }

    }

    //员工的查看
    public void showEmployee() throws InterruptedException {
        TSUtility.loadSpecialEffects();
        System.out.println("ID\t 姓名\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) throws  InterruptedException {
        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() + "):");
                String name = TSUtility.readString(4, emp.getName());
                System.out.print("年龄(" + emp.getAge() + "):");
                int age = Integer.parseInt(TSUtility.readString(2,emp.getAge()+""));
                System.out.print("工资(" + emp.getSalary() + "):");
                double salary =Double.parseDouble(TSUtility.readString(10, 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();
            }
        }
    }

}

 

package com.team.service;

public class TeamException extends Exception {
    public TeamException(){
    }
    public TeamException(String meassge){
        super(meassge);
    }
}

package com.team.service;

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


//teamService  模块为实体对象(Employee及其子类如程序员等)的管理模块
//NameListService和TeamService类分别用各自的数组来管理公司员工和开发团队成员对象

//团队成员属性类
public class TeamService {
    //用于自动生成团队成员的memberId
    private static int counter = 1;
    //团队人数上限
    private final int MAX_MEMBER = 5;
    //保存当前团队成员
    private Programmer[] team = new Programmer[MAX_MEMBER];
    //团队实际人数
    private int total = 0;

    public TeamService() {
    }
    //返回team中所有程序员构成的数组
    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 {
        int numOfArch = 0, numOfDsgn = 0, numOfPrg = 0;
        //团队中架构师数:     设计师数:       程序员数:
        for (int i = 0; i < total; i++) {
            if (team[i] instanceof Architect) {
                numOfArch++;}
            else if (team[i] instanceof Designer){
                numOfDsgn++;}
            else if (team[i] instanceof Programmer){
                numOfPrg++;}
        }
        if (total >= MAX_MEMBER){
            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("该员工已是某团队成员");
        }

        


        if (p instanceof Architect) {
            if (numOfArch >= 1)
            {throw new TeamException("团队中至多只能有一名架构师");}
        } else if (p instanceof Designer) {
            if (numOfDsgn >= 2)
            {throw new TeamException("团队中至多只能有两名设计师");}
        } else if (p instanceof Programmer) {
            if (numOfPrg >= 3)
            {throw new TeamException("团队中至多只能有三名程序员");}
        }
        //添加到数组
        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;
    }
    //删除指定memberId的程序员
    public void removeMember(int memberId) throws TeamException {
        int n = 0;
        //找到指定memberId的员工,并删除
        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;
    }
}

 

package com.team.view;

import com.team.domain.Employee;
import com.team.domain.Programmer;
import com.team.domain.Project;
import com.team.service.NameListService;
import com.team.service.TeamException;
import com.team.service.TeamService;

import java.util.ArrayList;

//teamView 模块为主控模块,负责菜单的显示和处理用户操作

public class TeamView {
    public static final String ANSI_RESET = "\u001B[0m";
    public static final String ANSI_YELLOW = "\u001B[33m";
    private NameListService listSvc = new NameListService();
    private TeamService teamSvc = new TeamService();

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

    //以列出公司所有成员
    public void listAllEmployees() {
        ArrayList<Employee> employees = listSvc.getAllEmployees();
        if (employees == null || employees.size() == 0) {
            System.out.println("公司中没有任何员工信息!");
        } else {
            System.out.println("ID\t 姓名\t 年龄\t 工资\t\t 职位\t 状态\t 奖金\t 股票\t 领用设备");
            for (int i = 0; i < employees.size(); i++) {
                System.out.println("  " + employees.get(i));
            }
        }
    }

    //得到创建好的团队
    public void getTeam() {
        System.out.println("-----------------------团队成员列表-----------------------");
        //对象调用,获取团队
        Programmer[] team = teamSvc.getTeam();
        System.out.println("TID/ID\t 姓名\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 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();
    }

    public void removeMember() {
        System.out.println("----------------------------------删除团队成员------------------------------------");
        System.out.println("请输入要删除员工的TID:");
        int TID = TSUtility.readInt();
        try {
            teamSvc.removeMember(TID);
            System.out.println("删除成功!");
        } catch (TeamException e) {
            System.out.println("删除失败,原因:"+e.getMessage());
        }
        TSUtility.readReturn();
    }

    public ArrayList<Programmer[]> showTeam() {
        System.out.println("---------------------------团队列表-------------------------");
        if (team.size() == 0) {
            return null;
        } else {
            System.out.println("TID/ID\t 姓名\t年龄\t\t 工资\t 职位\t 奖金\t 股票");
            for (Programmer[] team : team) {
                for (int i = 0; i < team.length; i++) {
                    System.out.println(" " + team[i].getDetailsForTeam());
                }
                System.out.println("----------------------------------------------------");
            }
            return team;
        }
    }

    //删除指定的团队
    public void removeTeam(ArrayList<Project> pros) {
        System.out.println("请输入删除第几个团队:");
        int num = TSUtility.readInt();
        if (num <= 0 || num > team.size()) {
            System.out.println("输入无效,团队不存在!");
            return; // 退出方法,不继续执行
        }
        if (num <= team.size()) {
            for (int i = 0; i < team.get(num - 1).length; i++) {
                team.get(num - 1)[i].setStatus(true);
            }
            Programmer[] remove = team.remove(num - 1);
            if (remove == null || remove.length == 0) {
                System.out.println("团队为空,无法删除!");
                return; // 退出方法,不继续执行
            }
            for (int i = 0; i < pros.size(); i++) {
                if (pros.get(i).getTeam()!=null) {
                    if (remove[0].getId() == pros.get(i).getTeam()[0].getId()) {
                        pros.get(i).setProjectName(null);
                        pros.get(i).setTeamName(null);
                        pros.get(i).setStatus(false);
                    }
                }
            }
        }
        System.out.println("团队删除成功!");
    }

    public ArrayList<Programmer[]> getManyTeam(NameListService nameListService, ArrayList<Project> pros) throws TeamException, InterruptedException {
        boolean flag = true;
        listSvc = nameListService;
        do {
                System.out.println("🔣        ~开发团队调度界面~            🔣");
                System.out.println("1-添加团队  2-查看团队  3-删除团队  4-退出  请选择(1-4):        *");
                char keyTeam = TSUtility.readMenuSelectionPro();
                switch (keyTeam) {
                    case '1':
                        listAllEmployees();
                        enterMainMenu();
                        break;
                    case '2':
                        showTeam();
                        break;
                    case '3':
                        removeTeam(pros);
                        break;
                    case '4':
                        System.out.print("确认是否退出(Y/N):");
                        char yn = TSUtility.readConfirmSelection();
                        if (yn == 'Y') {
                            flag = false;
                        }
                        break;
                }

        }while (flag) ;
        return team;
    }



    private void enterMainMenu() throws TeamException, InterruptedException{
        char keySec = 0;
        boolean loopFlagSec = true;
        do {
            System.out.print(ANSI_RESET + ANSI_YELLOW);
            System.out.println("🔣        ~开发团队调度软件~            🔣");
            System.out.println("🐕1-团队列表  🐖2-添加团队成员  🐱3-删除团队人员  🐂4-退出   请选择(1-4):    *");
            keySec = TSUtility.readMenuSelectionPro();
            switch (keySec) {
                case '1':
                    getTeam();
                    break;
                case '2':
                    listAllEmployees();
                    addMember();
                    break;
                case '3':
                    listAllEmployees();
                    getTeam();
                    removeMember();
                    break;
//                case '4':
//                    this.enterMainMenu();  //进入团队成员管理
//                    break;
                case '4':
                    System.out.println("确认是否退出(Y/N):");
                    char yn = TSUtility.readConfirmSelection();
                    if (yn == 'Y') {
                        if (teamSvc.getTeam().length == 0) {
                            loopFlagSec = false;
                        } else {
                            team.add(teamSvc.getTeam());
                            teamSvc.clearTeam();
                            loopFlagSec = false;
                        }
                    }
                    break;
                default:
                    System.out.println("输入有误!请重新输入!");
                    break;
            }
        } while (loopFlagSec);
    }


    public static void main(String[] args) throws TeamException, InterruptedException {
        TeamView teamView = new TeamView();
        NameListService nameListService = new NameListService();
        ArrayList<Project>pros = new ArrayList<>();
        teamView.getManyTeam(nameListService,pros);
    }
}

package com.team.domain;

import java.util.Arrays;

public class Project {
   private int proId;//项目号
   private String projectName;//项目名称
   private String desName;//项目描述
   Programmer[]team=new Programmer[5];//开发团队
   private String teamName;//开发团队名称
   private boolean status;//开发状态

    public Project() {
    }

    public Project(int proId, String projectName, String desName, Programmer[] team, String teamName, boolean status) {
        this.proId = proId;
        this.projectName = projectName;
        this.desName = desName;
        this.team = team;
        this.teamName = teamName;
        this.status = 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 Programmer[] getTeam() {
        return team;
    }

    public void setTeam(Programmer[] team) {
        this.team = team;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public boolean isStatus() {
        return status;
    }

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

    @Override
    public String toString() {
        return "项目{" +
                "项目号=" + proId +
                ", 项目名='" + projectName + '\'' +
                ", 项目描述='" + desName + '\'' +
                ", 开发团队名称='" + teamName + '\'' +
                ", 开发状态=" + status +
                '}';
    }
    public String getProName() {
        return getProjectName() + "->" + getDesName();
    }

}

 

 

package com.team.service;

import com.team.domain.Employee;
import com.team.domain.Programmer;
import com.team.domain.Project;
import com.team.view.TSUtility;
import com.team.view.TeamView;

import java.util.ArrayList;
import java.util.Random;

/**
 * @author :奶糖趣多多
 * @date :Created in 2024/9/26 15:44
 * @description:项目相关模块操作
 * 项目参考:
 * 1.小米官网:开发完成类似于小米官网的web项目
 * 2.公益在线商城:猫宁Morning公益商城是中国公益性在线电子商城,以商城B2C模式运营的公益在线商城。
 * 3.博客系统:Java博客系统,让每一个有故事的人更好的表达想法!使用了轻量级 mvc 框架Blade开发,默认主题使用了漂亮的pinghsu。
 * 4.在线协作文档编辑系统:多人在线协作文档编辑器是一个很常用的功能,适合小组内的文档编辑。
 */

//ProjectService是对项目的操作对象类

public class ProjectService {
    //    pro: Arraylist<Project> 用来存项目的集合
    private ArrayList<Project> pro = new ArrayList<>();
//    count: int = 1 添加项目的标号
private Programmer[] team;//***


    private int count = 1;

    //addProject(): 新项目添加
    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 c = TSUtility.readMenuSelection();

        switch (c) {
            case '1':
                Project p1 = new Project();
                p1.setProId(count++);
                p1.setProjectName("小米官网");
                p1.setDesName("开发完成类似于小米官网的web项目.");
                pro.add(p1);
                TSUtility.loadSpecialEffects();
                System.out.println("已添加项目:" + p1.getProName());
                break;
            case '2':
                Project p2 = new Project();
                p2.setProId(count++);
                p2.setProjectName("公益在线商城");
                p2.setDesName("猫宁Morning公益商城是中国公益性在线电子商城.");
                pro.add(p2);
                TSUtility.loadSpecialEffects();
                System.out.println("已添加项目:" + p2.getProName());
                break;
            case '3':
                Project p3 = new Project();
                p3.setProId(count++);
                p3.setProjectName("博客系统");
                p3.setDesName("Java博客系统,让每一个有故事的人更好的表达想法!");
                pro.add(p3);
                TSUtility.loadSpecialEffects();
                System.out.println("已添加项目:" + p3.getProName());
                break;
            case '4':
                Project p4 = new Project();
                p4.setProId(count++);
                p4.setProjectName("在线协作文档编辑系统");
                p4.setDesName("一个很常用的功能,适合小组内的文档编辑。");
                pro.add(p4);
                TSUtility.loadSpecialEffects();
                System.out.println("已添加项目:" + p4.getProName());
                break;
            default:
                System.out.println("项目不存在");
                break;
        }
    }


    //给项目分配团队
    public void dealingPro(Programmer[] team) {
        for(Project proj:pro) {
            boolean status = proj.isStatus();
            if (!status) {
                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);
               /* //随机分配项目
                Random ra = new Random();
                int ranNum = ra.nextInt(pro.size());
                Project project = this.pro.get(ranNum);
                while (project.isStatus()) {
                    ranNum = ra.nextInt(pro.size());
                    project = this.pro.get(ranNum);
                    if (project.isStatus()) {
                        break;
                    }
                }*/
                if (!proj.isStatus()) {
                    proj.setTeamName(teamName);
                    proj.setTeam(team);
                    proj.setStatus(true);
//                    pro.set(ranNum, project);
                    for (Programmer programmer : team) {
                        programmer.setHasProject(true);
                    }
                    System.out.println("项目" + "(" + proj.getProjectName() + ")" + "----->正在被(" + proj.getTeamName() + ")开发中");
                }
            }
        }
}

//        project.setTeamName(teamName);
//        project.setTeam(team);
//        project.setStatus(true);
//
//        pro.set(ranNum,project);


    //查看目前项目情况
    public void showPro() throws InterruptedException {
//        TSUtility.loadSpecialEffects();

        for (int i = 0; i < pro.size(); i++) {
            System.out.println(pro.get(i));
            if (!pro.get(i).isStatus()){
                System.out.println("项目未被开发!");
            }else {
                System.out.println("项目"+"("+pro.get(i).getProjectName()+")"+"----->正在被("+pro.get(i).getTeamName()+")开发中");
            }
        }
    }
    //删除选择的项目
    public void delPro(int id){
        boolean flag = false;
        for (int i = 0; i < pro.size(); i++) {
            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);
                }
                flag = true;
            }
        }
        if (flag) {
            System.out.println("删除成功!");
            count--;
        } else {
            try {
                throw new TeamException("该项目不存在");
            } catch (TeamException e) {
                System.out.println(e.getMessage());
            }
        }
    }
    //得到所有项目数据集合
    public ArrayList<Project> getAllPro() {
        return pro;
    }


}

package com.team.view;

import com.team.domain.Programmer;
import com.team.service.NameListService;
import com.team.service.ProjectService;
import com.team.service.TeamException;

import java.util.ArrayList;

/**
 * @author :奶糖趣多多
 * @date :Created in 2024/9/28 20:35
 * @description:项目程序运行主界面
 */
public class IndexView {
    /**
     * 颜色特效
     */
    public static final String ANSI_RESET = "\u001B[0m";
    public static final String ANSI_GREEN = "\u001B[32m";
    public static final String ANSI_YELLOW = "\u001B[33m";
    public static final String ANSI_PURPLE = "\u001B[35m";
    public static final String ANSI_BLUE = "\u001B[34m";
    public static final String ANSI_CYAN = "\u001B[36m";

    private LoginView loginVi = new LoginView();
    private NameListService nameListSer = new NameListService();
    private TeamView teamVi = new TeamView();
    private ProjectService projectSer = new ProjectService();
    private ArrayList<Programmer[]> manyTeam=null;


    public  void menu() throws TeamException, InterruptedException {
        boolean loopFlag = true;
        char key = 0;


        System.out.println(ANSI_PURPLE);
        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 {
//            loginVi.login();
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        do {
            System.out.println(ANSI_RESET + ANSI_CYAN);
            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("⬇请选择:  ");
            System.out.print(ANSI_RESET);
            key = TSUtility.readMenuSelectionPro();
            switch (key) {
                case '1':
                    try {
                        loginVi.update();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    break;
                case '2':
                    try {
                        nameListSer.showEmployee();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    boolean loopFlagSec = true;
                    char keySec = 0;
                    do {
                        System.out.print(ANSI_RESET + ANSI_YELLOW);
                        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':
                                try {
                                    nameListSer.addEmployee();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                break;
                            case '2':
                                try {
                                    nameListSer.showEmployee();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                break;
                            case '3':
                                System.out.println("请输入需要修改的员工id:");
                                int i = TSUtility.readInt();
                                try {
                                    nameListSer.modifyEmployee(i);
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                break;
                            case '4':
                                System.out.println("请输入需要删除的员工id:");
                                int j  = TSUtility.readInt();
                                nameListSer.delEmployee(j);
                                break;
                            case '5':
                                System.out.print("确认是否退出(Y/N):");
                                char yn = TSUtility.readConfirmSelection();
                                if (yn == 'Y') {
                                    loopFlagSec = false;
                                }
                                break;
                            default:
                                System.out.println("输入有误!请重新输入!");
                                break;
                        }
                    } while (loopFlagSec);
                    break;
                case '3':
                    System.out.println(ANSI_BLUE);
                    try {
                        manyTeam = teamVi.getManyTeam(nameListSer, projectSer.getAllPro());
                    }catch (TeamException e){
                        System.out.println(e.getMessage());
                    }
                    TSUtility.readReturn();
                    break;
                case '4':
                    boolean loopFlagThr = true;
                    char keyThr = 0;
                    do {
                        System.out.print(ANSI_RESET + ANSI_GREEN);
                        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("⬇请选择:  ");
                        System.out.print(ANSI_RESET + ANSI_YELLOW);
                        keyThr=TSUtility.readMenuSelectionPro();
                        switch (keyThr) {
                            case '1':
                                try {
                                    projectSer.addProject();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                break;

                            case '2':
                                if(manyTeam==null){
                                    System.out.println("当前没有团队");
                                }else {
                                    for (Programmer[] pro : manyTeam) {
                                        if (!pro[0].isHasProject()) {
                                            projectSer.dealingPro(pro);
                                        }

                                    }
                                }
                                break;
                            case '3':
                                try {
                                    projectSer.showPro();
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }
                                break;
                            case '4':
                                System.out.println("请输入需要删除的项目id:");
                                int j  = TSUtility.readInt();
                                projectSer.delPro(j);
                                break;
                            case '5':
                                System.out.print("确认是否退出(Y/N):");
                                char yn = TSUtility.readConfirmSelection();
                                if (yn == 'Y') {
                                    loopFlagThr = false;
                                }
                                break;
                            default:
                                System.out.println("输入有误!请重新输入!");
                                break;
                        }
                    } while (loopFlagThr);
                    break;
                case '5':
                    System.out.print("确认是否退出(Y/N):");
                    char yn = TSUtility.readConfirmSelection();
                    if (yn == 'Y') {
                        loopFlag = false;
                    }
                    break;
                default:
                    break;
            }
        } while (loopFlag);
    }

    public static void main(String[] args) throws TeamException, InterruptedException {
        new IndexView().menu();
    }

}

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2171023.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

传奇GEE引擎版本如何封挂?GEE引擎设置简单的封挂脚本教程

网关参数设置gee引擎封挂脚本 1、打开M2-选项-参数设置-游戏速度 把所有的设置限速关闭 2、打开M2-选项-客户端设置-内挂控制-速度控制&#xff1a;移动速度 攻击速度 魔法速度 设置好参数&#xff0c;一旦设置不要修改 否则封挂网关参数需重新设置 打开M2-选项-功能设置-…

【C++算法】栈

删除字符中的所有相邻重复项 题目链接 删除字符中的所有相邻重复项https://leetcode.cn/problems/remove-all-adjacent-duplicates-in-string/description/ 算法原理 代码展示 class Solution { public:string removeDuplicates(string s) {string ret;for(int i 0; i &l…

C# 的枚举(Enum)应用说明

一.Enum的定义&#xff1a; 枚举是一组命名整型的常量。枚举类型是使用 enum 关键字声明的&#xff0c;它是值类型。枚举包含自己的值&#xff0c;且不能继承或传递继承。 二.声明 enum 变量&#xff1a; 声明枚举的一般语法&#xff1a; enum <enum_name> { enumerati…

Harbor使用

文章目录 1、上传镜像1.1、在Harbor上创建一个项目1.2、docker添加安全访问权限1.3、推送docker镜像到该项目中1.3.1、登录到Harbor1.3.2、给镜像重新打一个标签1.3.3、推送镜像到Harbor中 2、拉取镜像2.1、先删掉原来的镜像2.2、执行拉取命令 1、上传镜像 需求&#xff1a;将…

[Python]什么是K-Means均值聚类算法?

K-Means均值聚类分析是一种无监督学习算法&#xff0c;用于将数据集分成k个簇&#xff08;cluster&#xff09;&#xff0c;其中每个簇的成员在某种意义上是相似的。算法的目标是找到质心&#xff08;centroid&#xff09;&#xff0c;使得每个点到其最近质心的距离之和最小。通…

【科研小小白】理解图片容量、像素、尺寸、分辨率各自含义、 像素、分辨率与实际尺寸之间的转换关系

理解图片容量、像素、尺寸、分辨率各自含义&#xff1a; 通过之前的学习&#xff0c;我们知道了图片有这4个参数&#xff0c;下面给大家总结一这下4个参数的具体含义。 1、容量&#xff08;占内存&#xff09;&#xff1a;是指图像文件的存贮空间&#xff0c;也就是文件的大小…

职场基本功:情绪管理的行动指南(前置情绪管理)

文章目录 引言情绪管理的目标情绪产生的阶段前置情绪管理避免情绪失控的技巧案例分析引言 成熟的职场人,必备的五项技能: 管理自己的情绪:职场需要你的行为是可控的,只有情绪是稳定的,其他人才能顺利地跟你展开协作。称赞他人:赞赏能让你获得一个友好的交流环境求助他人…

lte sss加扰序列c产生 MATLAB和c语言实现

参考3GPP 36.211 今日给大家介绍一下LTE SSS信号产生过程中加扰序列c的产生过程以及用MATLAB 和 c语言给大家实现一下&#xff1a; 加扰序列c产生过程如下&#xff1a; 1 首先产生公共的序列x的生成 X的初始值 两个加扰序列c0和c1 c语言实现 void lte_sss_gen_c(char *c,u…

Zlibrary安装包下载与使用

文章目录 Zlibrary安装包下载与使用一 写在前面网盘链接1 百度网盘链接2 夸克网盘链接3 阿里云盘 二 安装1 Windows系统2 安卓3 苹果电脑端4 Linux系统Ubantu的下载与安装 三 Zlibrary的使用四 写在最后 Zlibrary安装包下载与使用 2024年9月27日下午4点 一 写在前面 1 Zlibr…

智慧农业案例 (一)- 自动化机械

橙蜂智能公司致力于提供先进的人工智能和物联网解决方案&#xff0c;帮助企业优化运营并实现技术潜能。公司主要服务包括AI数字人、AI翻译、领域知识库、大模型服务等。其核心价值观为创新、客户至上、质量、合作和可持续发展。 橙蜂智农的智慧农业产品涵盖了多方面的功能&…

Ubuntu环境下字体安装

本文介绍Ubuntu环境下字体安装。 软件&#xff08;如Qt应用软件&#xff09;开发过程中经常会涉及到字体的选择&#xff0c;有时候Ubuntu环境下并没有我们想要的字体&#xff0c;本文介绍常用字体及在Ubuntu环境下如何安装。 1.常用开源字体 有些字体商用并不是免费的&#…

jQuery——表单选择器

本文分享到此结束&#xff0c;欢迎大家评论区相互讨论学习&#xff0c;下一篇继续分享jQuery中$常见工具的学习。

暴力与正常人体行为检测系统源码分享

暴力与正常人体行为检测检测系统源码分享 [一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示] 1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 项目来源AACV Association for the Advancement of Co…

高翔【自动驾驶与机器人中的SLAM技术】学习笔记(十)高翔书中的细节:参考链接;卫星导航;ESKF

一、 参考链接 我认真查找了好多地方:结果在最后一页。 作者GITHUB链接如下: https://github.com/gaoxiang12/slam_in_autonomous_driving 全书所有参考链接 :如下 1 https://www.sae.org/standards/content/j3016_202104 2 http://www.evinchina.com/articleshow-217.htm…

在线相亲系统:新时代的婚恋观与传统习俗的碰撞

随着互联网技术的发展&#xff0c;相亲交友平台已成为年轻人寻找伴侣的新方式。这些平台不仅改变了人们的社交习惯&#xff0c;也反映了当代婚恋观与传统习俗之间的碰撞与融合。开发h17711347205本文将探讨在线相亲系统是如何在尊重传统的基础上&#xff0c;为现代年轻人提供更…

年龄性别与手势识别系统源码分享

年龄性别与手势识别检测系统源码分享 [一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示] 1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 项目来源AACV Association for the Advancement of Comput…

Docekrfile和docker compose编写指南及注意事项

Dockerfile 基础语法 我们通过编写dockerfile,将每一层要做的事情使用语法固定下来&#xff0c;之后运行指令就可以通过docker来制作自己的镜像了。 构建镜像的指令&#xff1a;docker build /path -t imageName:tag 注意&#xff0c;docker build后的path必须是dockerfile…

什么是文件完整性监控(FIM)

组织经常使用基于文件的系统来组织、存储和管理信息。文件完整性监控&#xff08;FIM&#xff09;是一种用于监控和验证文件和系统完整性的技术&#xff0c;识别用户并提醒用户对文件、文件夹和配置进行未经授权或意外的变更是 FIM 的主要目标&#xff0c;有助于保护关键数据和…

贝锐洋葱头浏览器随时随地访问教务系统,轻松搞定选课

教育网的“拥堵”早已是老生常谈&#xff0c;学生数量庞大、上网时间集中、带宽有限&#xff0c;导致网络速度慢。尤其是从外部网络访问教育网时&#xff0c;更是因为跨运营商的缘故变得缓慢。 而学校内网也是类似的情况&#xff0c;课余时间和上课时间的网络使用情况差别巨大…

【Python报错已解决】TypeError: unhashable type: ‘numpy.ndarray‘

&#x1f3ac; 鸽芷咕&#xff1a;个人主页 &#x1f525; 个人专栏: 《C干货基地》《粉丝福利》 ⛺️生活的理想&#xff0c;就是为了理想的生活! 专栏介绍 在软件开发和日常使用中&#xff0c;BUG是不可避免的。本专栏致力于为广大开发者和技术爱好者提供一个关于BUG解决的经…