Commit 8380893a by 刘宇峰

根据业务类型获取设备类型

1 parent 9ba19e14
......@@ -2,6 +2,8 @@ package cn.com.glsx.devicemonitor.api.enums;
import org.springframework.util.StringUtils;
import java.util.Objects;
/**
* @author wangxw
* @version 1.0.0
......@@ -44,24 +46,9 @@ public enum DeviceTypeRelationEnum {
this.deviceName = deviceName;
}
public String getDeviceCode() {
return deviceCode;
}
public Integer getBizDeviceType() {
return bizDeviceType;
}
public Integer getDataDeviceType() {
return dataDeviceType;
}
public String getDeviceName() {
return deviceName;
}
/**
* 通过业务设备类型查询 枚举
*
* @param deviceCode
* @return
*/
......@@ -80,4 +67,41 @@ public enum DeviceTypeRelationEnum {
return null;
}
/**
* 通过业务设备类型查询 枚举
*
* @param deviceType
* @return
*/
public static DeviceTypeRelationEnum findByBizDeviceType(Integer deviceType) {
if (Objects.isNull(deviceType)) {
return null;
}
DeviceTypeRelationEnum[] dataArray = DeviceTypeRelationEnum.values();
for (int i = 0; i < dataArray.length; i++) {
DeviceTypeRelationEnum deviceTypeRelationEnum = dataArray[i];
if (deviceTypeRelationEnum.getBizDeviceType().equals(deviceType)) {
return deviceTypeRelationEnum;
}
}
return null;
}
public String getDeviceCode() {
return deviceCode;
}
public Integer getBizDeviceType() {
return bizDeviceType;
}
public Integer getDataDeviceType() {
return dataDeviceType;
}
public String getDeviceName() {
return deviceName;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!