public enum AttachmentType { account("人员"),monitorEnv("设施环境评测评价"),monitorUse("临床使用效果评价"),monitorSafe("质量安全检测评价"), equipment("设备合同文件"); private String description; AttachmentType(String description) { this.description = description; } public String getDescription() { return description; } public static AttachmentType getAttechmentTypeByDesc(String desc) { if (!StringUtil.hasText(desc)) return null; for (AttachmentType t : values()) { if (t.getDescription().equals(desc)) return t; } return null; } public static String getCnName(String enName) {//得到汉语名称 if (!StringUtil.hasText(enName)) return ""; for (AttachmentType e : values()) { if (enName.equals(e.name())) return e.getDescription(); } return ""; } }
时间: 2024-11-05 21:42:21