组态功能和台账功能部分开发
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.njcn.csdevice.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author xuyang
|
||||
*/
|
||||
|
||||
@Getter
|
||||
public enum LineBaseEnum {
|
||||
|
||||
/**
|
||||
* 治理终端树结构
|
||||
*/
|
||||
ENGINEERING_LEVEL(0, "工程"),
|
||||
PROJECT_LEVEL(1, "项目"),
|
||||
DEVICE_LEVEL(2, "设备"),
|
||||
LINE_LEVEL(3, "监测点"),
|
||||
INVALID_LEVEL(-1, "非法拓扑等级"),
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
private final String message;
|
||||
|
||||
LineBaseEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public static com.njcn.csdevice.enums.LineBaseEnum getLineBaseEnumByCode(Integer code) {
|
||||
return Arrays.stream(com.njcn.csdevice.enums.LineBaseEnum.values())
|
||||
.filter(lineBaseEnum -> lineBaseEnum.getCode().equals(code))
|
||||
.findAny()
|
||||
.orElse(INVALID_LEVEL);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user