云
2026-10-25 d54fbc9d4f8981fa0f7f613b33a28a8cd4f764ea
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
33
34
35
36
37
38
39
40
package cn.iocoder.yudao.module.mes.enums.em;
 
import lombok.AllArgsConstructor;
import lombok.Getter;
 
import java.util.Arrays;
 
/**
 * MES 能耗预警类型枚举
 *
 * @author 超级管理员
 */
@Getter
@AllArgsConstructor
public enum MesEmAlertTypeEnum {
 
    QUOTA(1, "超定额"),
    MOM(2, "环比异常"),
    YOY(3, "同比异常"),
    LEAK(4, "疑似跑冒滴漏");
 
    /**
     * 类型
     */
    private final Integer type;
    /**
     * 类型名称
     */
    private final String name;
 
    public static MesEmAlertTypeEnum getByType(Integer type) {
        return Arrays.stream(values()).filter(item -> item.getType().equals(type)).findFirst().orElse(null);
    }
 
    public static String getName(Integer type) {
        MesEmAlertTypeEnum item = getByType(type);
        return item == null ? null : item.getName();
    }
 
}