package com.dh.hrmanager.entity;
// 类与对象
public class Employee {
// 用户ID
private int userID;
// 用户名
private String userName;
// 密码
private String password;
// 角色ID
private int roleID;
// 员工编号
private String empNo;
// 部门ID
private int departID;
// 薪资
private double salary;
public int getUserID() {
return userID;
}
public void setUserID(int userID) {
this.userID = userID;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getRoleID() {
return roleID;
}
public void setRoleID(int roleID) {
this.roleID = roleID;
}
public String getEmpNo() {
return empNo;
}
public void setEmpNo(String empNo) {
this.empNo = empNo;
}
public int getDepartID() {
return departID;
}
public void setDepartID(int departID) {
this.departID = departID;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
public Employee(){
}
public Employee(int userID, String empNo, String userName, String password, int departID, int roleID, double salary) {
this.userID = userID;
this.empNo = empNo;
this.userName = userName;
this.password = password;
this.departID = departID;
this.roleID = roleID;
this.salary = salary;
}
/**
* 显示员工信息
*/
public void displayInfo(){
String position=null;
if (roleID==1) {
position="Staff";
} else if (roleID==2) {
position="Manager";
} else if (roleID==3) {
position="Admin";
}
String department=null;
if (departID==1) {
department="市场部";
} else if (departID==2) {
department="开发部";
} else if (departID==3) {
department="信息部";
}
System.out.println("\t\t 当前用户信息 \n\n");
System.out.println("********************************************");
System.out.println("\t\t雇员编号:"+empNo);
System.out.println("\t\t姓名:"+userName);
System.out.println("\t\t职务:"+position);
System.out.println("\t\t部门:"+department);
System.out.println("\t\t薪水:"+String.valueOf(salary));
System.out.println("********************************************");
}
/**
* 修改密码
* @param newPassword
*/
public void modifyPassword(String newPassword) {
this.password=newPassword;
System.out.println("密码修改成功!");
}
}
package com.dh.hrmanager.util;
// 类与对象
import java.util.Scanner;
public class Menu {
Scanner input=new Scanner(System.in);
// 其他省略
/**
* 返回登录菜单
*/
private void returnLoginMenu(Scanner input) {
boolean flag=true;
do {
String num=input.next();
if (num.toUpperCase().equals("R")) {
flag=false;
showLoginMenu();
break;
}else{
System.out.println("具体功能实现将在后面实践篇实现,现在请输入r/R返回登录菜单:");
}
} while (flag);
}
public void showLoginMenu(){
System.out.println("\n\n\t\t\t欢迎进入企业人力资源管理系统");
System.out.println("***********************************************************\n");
System.out.println("\t\t\t 1.登录系统\n");
System.out.println("\t\t\t 2.注册用户\n");
System.out.println("\t\t\t 3.退出系统\n");
System.out.println("***********************************************************\n");
System.out.println("请输入菜单选项数字:");
}
/**
* 普通员工菜单
*/
public void showStaffMenu(){
System.out.println("企业人力资源管理系统=>普通员工");
System.out.println("***********************************************************\n");
System.out.println("\t\t\t 1.汇报工作\n");
System.out.println("\t\t\t 2.查看个人信息\n");
System.out.println("\t\t\t 3.修改密码\n");
System.out.println("\t\t\t 4.查看评测\n");
System.out.println("\t\t\t 5.工资范畴\n");
System.out.println("\t\t\t 6.今日工作\n");
System.out.println("\t\t\t 7.在线工作交流\n");
System.out.println("***********************************************************\n");
System.out.println("请输入菜单选项数字或者输入R/r返回上一菜单:");
returnLoginMenu(input);
}
/**
* 经理主菜单
*/
public void showManagerMenu(){
System.out.println("企业人力资源管理系统=>部门经理");
System.out.println("***********************************************************\n");
System.out.println("\t\t\t 1.查看工作汇报\n");
System.out.println("\t\t\t 2.考评员工 \n");
System.out.println("\t\t\t 3.查看个人信息\n");
System.out.println("\t\t\t 4.修改密码\n");
System.out.println("\t\t\t 5.工资范畴\n");
System.out.println("\t\t\t 6.今日工作\n");
System.out.println("\t\t\t 7.在线工作交流\n");
System.out.println("***********************************************************\n");
System.out.println("请输入菜单选项数字或者输入R/r返回上一菜单:");
returnLoginMenu(input);
}
/**
* 显示管理员主菜单
*/
public void showAdminMenu(){
System.out.println("企业人力资源管理系统=>管理员");
System.out.println("***********************************************************\n");
System.out.println("\t\t\t 1.查看员工信息\n");
System.out.println("\t\t\t 2.修改员工角色\n");
System.out.println("\t\t\t 3.查看个人信息\n");
System.out.println("\t\t\t 4.修改密码\n");
System.out.println("\t\t\t 5.工资范畴\n");
System.out.println("\t\t\t 6.今日工作\n");
System.out.println("***********************************************************\n");
System.out.println("请输入菜单选项数字或者输入R/r返回上一菜单:");
returnLoginMenu(input);
}
}