package cn.iocoder.yudao.module.mes.enums.safety; import lombok.AllArgsConstructor; import lombok.Getter; /** * 安全生产 - 事故等级枚举 * * @author 超级管理员 */ @Getter @AllArgsConstructor public enum SafetyAccidentLevelEnum { SLIGHT("SLIGHT", "轻伤事故"), GENERAL("GENERAL", "一般事故"), SEVERE("SEVERE", "重伤事故"), MAJOR("MAJOR", "重大事故"); private final String level; private final String name; public static String getNameByLevel(String level) { for (SafetyAccidentLevelEnum value : values()) { if (value.getLevel().equals(level)) { return value.getName(); } } return level; } }