企业人事管理系统

企业人事管理系统

完成一个企业人事管理系统,该系统中包含两个实体类:员工(Emp),部门(Dept),两个类中分别包含以下属性:

员工(工号,姓名,性别,职位,年龄,月薪,部门)

部门(编号,部门名,部门介绍,分机号,)

要求实现以下功能:

完成部门的创建,添加3个部门

向各个部门中添加若干员工

查询所有的员工信息和所在的部门信息

根据员工工号显示员工信息和所在的部门信息

修改指定工号员工的薪资

根据部门号查询出门中的所有员工

部门类:

根据需求,先创立一个部门类,在部门类中加入一个带员工类的链表,将每次向此部门添加的员工都放入本链表中:

package com;

import java.util.ArrayList;

public class Section {
   
	private Integer deptid;
	private String deptname;
	private String deptsynopsis;
	private Integer deptnumber;
	private ArrayList<EmployeeData> emps;

    public Section(Integer deptid, String deptname, String deptsynopsis, Integer deptnumber) {
   
		super();
		this.emps = new ArrayList<EmployeeData>();	//创建一个员工类的链表
		this.deptid = deptid;
		this.deptname = deptname;
		this.deptsynopsis = deptsynopsis;
		this.deptnumber = deptnumber;
	}
	protected Integer getDeptid() {
   
		return deptid;
	}

	protected void setDeptid(Integer deptid) {
   
		this.deptid = deptid;
	}

	protected String getDeptname() {
   
		return deptname;
	}

	protected void setDeptname(String deptname) {
   
		this.deptname = deptname;
	}

	protected String getDeptsynopsis() {
   
		return deptsynopsis;
	}

	protected void setDeptsynopsis(String deptsynopsis) {
   
		this.deptsynopsis = deptsynopsis;
	}

	protected Integer getDeptnumber() {
   
		return deptnumber;
	}

	protected void setDeptnumber(Integer deptnumber) {
   
		this.deptnumber = deptnumber;
	}

	protected ArrayList<EmployeeData> getEmps() {
   
		return emps;
	}

	protected void setEmps(ArrayList<EmployeeData> emps) {
   
		this.emps = emps;
	}

	@Override
	public String toString() {
   
		return "部门Id为 " + deptid + ",部门名 " + deptname + ",部门介绍 " + deptsynopsis + ",部门分机号 " + deptnumber + "]";
	}


	public Section() {
   

		super();
		this.emps = new ArrayList<EmployeeData>();
	}

}

员工类:

创建一个员工类,用于保存员工信息,其中输入部门,以此将其加入相应的部门中

package com;

public class EmployeeData {
   
	private Integer id;
	private String name;
	private String sex;
	private String position;
	private Integer age;
	private Double salary;
	private String section;

	public EmployeeData(Integer id, String name, String sex, String position, Integer age, Double salary,
			String section) {
   
		super();
		this.id = id;
		this.name = name;
		this.sex = sex;
		this.position = position;
		this.age = age;
		this.salary = salary;
		this.section = section;
	}

	protected Integer getId() {
   
		return id;
	}

	
  • 4
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值