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
| package cn.iocoder.yudao.module.mes.enums.em;
|
| import lombok.AllArgsConstructor;
| import lombok.Getter;
|
| import java.util.Arrays;
|
| /**
| * MES 能耗数据来源枚举
| *
| * @author 超级管理员
| */
| @Getter
| @AllArgsConstructor
| public enum MesEmRecordSourceEnum {
|
| MANUAL(1, "手工录入"),
| IMPORT(2, "Excel 导入"),
| AUTO(3, "自动采集");
|
| /**
| * 来源
| */
| private final Integer source;
| /**
| * 来源名称
| */
| private final String name;
|
| public static MesEmRecordSourceEnum getBySource(Integer source) {
| return Arrays.stream(values()).filter(item -> item.getSource().equals(source)).findFirst().orElse(null);
| }
|
| public static String getName(Integer source) {
| MesEmRecordSourceEnum item = getBySource(source);
| return item == null ? null : item.getName();
| }
|
| }
|
|