【8.1.1】【sys】更新组织机构类型的枚举

pull/60/head
fengshuonan 2024-02-18 16:13:03 +08:00
parent 8b00503b7f
commit ed25e0a476
1 changed files with 36 additions and 3 deletions

View File

@ -38,17 +38,50 @@ public enum OrgTypeEnum {
/**
*
*/
COMPANY(1),
COMPANY(1, "公司"),
/**
*
*/
DEPT(2);
DEPT(2, "部门");
private final Integer code;
OrgTypeEnum(Integer code) {
private final String message;
OrgTypeEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
/**
* codeenum
*
* @author fengshuonan
* @since 2024-02-18 16:11
*/
public static OrgTypeEnum toEnum(Integer code) {
for (OrgTypeEnum orgTypeEnum : OrgTypeEnum.values()) {
if (orgTypeEnum.getCode().equals(code)) {
return orgTypeEnum;
}
}
return null;
}
/**
* codemessage
*
* @author fengshuonan
* @since 2024-02-18 16:11
*/
public static String getCodeMessage(Integer code) {
OrgTypeEnum orgTypeEnum = toEnum(code);
if (orgTypeEnum != null) {
return orgTypeEnum.getMessage();
} else {
return "";
}
}
}