Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-devicemonitor-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8380893a
authored
Oct 20, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
根据业务类型获取设备类型
1 parent
9ba19e14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
16 deletions
src/main/java/cn/com/glsx/devicemonitor/api/enums/DeviceTypeRelationEnum.java
src/main/java/cn/com/glsx/devicemonitor/api/enums/DeviceTypeRelationEnum.java
View file @
8380893
...
@@ -2,6 +2,8 @@ package cn.com.glsx.devicemonitor.api.enums;
...
@@ -2,6 +2,8 @@ package cn.com.glsx.devicemonitor.api.enums;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.Objects
;
/**
/**
* @author wangxw
* @author wangxw
* @version 1.0.0
* @version 1.0.0
...
@@ -44,24 +46,9 @@ public enum DeviceTypeRelationEnum {
...
@@ -44,24 +46,9 @@ public enum DeviceTypeRelationEnum {
this
.
deviceName
=
deviceName
;
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
* @param deviceCode
* @return
* @return
*/
*/
...
@@ -80,4 +67,41 @@ public enum DeviceTypeRelationEnum {
...
@@ -80,4 +67,41 @@ public enum DeviceTypeRelationEnum {
return
null
;
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
;
}
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment