1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package cn.iocoder.yudao.module.mes.enums.safety;
 
import lombok.AllArgsConstructor;
import lombok.Getter;
 
/**
 * 安全生产 - 巡检周期枚举
 *
 * @author 超级管理员
 */
@Getter
@AllArgsConstructor
public enum SafetyInspectCycleEnum {
 
    SHIFT("SHIFT", "每班"),
    DAILY("DAILY", "每日"),
    WEEKLY("WEEKLY", "每周"),
    MONTHLY("MONTHLY", "每月");
 
    private final String cycle;
    private final String name;
 
    public static String getNameByCycle(String cycle) {
        for (SafetyInspectCycleEnum value : values()) {
            if (value.getCycle().equals(cycle)) {
                return value.getName();
            }
        }
        return cycle;
    }
 
}