52 lines
1.4 KiB
Java
52 lines
1.4 KiB
Java
|
|
package com.engine.salary.enums;
|
||
|
|
|
||
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
||
|
|
|
||
|
|
import java.util.Arrays;
|
||
|
|
import java.util.Optional;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @Description: 薪资-员工状态
|
||
|
|
* @Author: wangxiangzhong
|
||
|
|
* @Date: 2021/11/1 16:06
|
||
|
|
*/
|
||
|
|
public enum SalaryUserStatusEnum {
|
||
|
|
|
||
|
|
normal("normal", "在职", 100120),
|
||
|
|
unavailable("unavailable", "离职", 85902),
|
||
|
|
locked("locked", "锁定", 102825),
|
||
|
|
unactive("unactive", "未激活", 102826),
|
||
|
|
detached("detached", "无公司", 102827),
|
||
|
|
temp("temp", "临时账号", 102828),
|
||
|
|
invited("invited", "已邀请", 102829);
|
||
|
|
|
||
|
|
private String value;
|
||
|
|
|
||
|
|
private String defaultLabel;
|
||
|
|
|
||
|
|
private int labelId;
|
||
|
|
|
||
|
|
SalaryUserStatusEnum(String value, String defaultLabel, int labelId) {
|
||
|
|
this.value = value;
|
||
|
|
this.defaultLabel = defaultLabel;
|
||
|
|
this.labelId = labelId;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String getValue() {
|
||
|
|
return value;
|
||
|
|
}
|
||
|
|
|
||
|
|
public String getDefaultLabel() {
|
||
|
|
return defaultLabel;
|
||
|
|
}
|
||
|
|
|
||
|
|
public int getLabelId() {
|
||
|
|
return labelId;
|
||
|
|
}
|
||
|
|
|
||
|
|
public static String getDefaultLabelByValue(String value) {
|
||
|
|
Optional<SalaryUserStatusEnum> optional = Arrays.stream(SalaryUserStatusEnum.values()).filter(r -> r.getValue().equals(value)).findFirst();
|
||
|
|
return optional.isPresent() ? SalaryI18nUtil.getI18nLabel(optional.get().getLabelId(), optional.get().getDefaultLabel()) : "";
|
||
|
|
}
|
||
|
|
}
|