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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
14 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,40 +46,62 @@ public enum DeviceTypeRelationEnum {
...
@@ -44,40 +46,62 @@ public enum DeviceTypeRelationEnum {
this
.
deviceName
=
deviceName
;
this
.
deviceName
=
deviceName
;
}
}
public
String
getDeviceCode
()
{
/**
return
deviceCode
;
* 通过业务设备类型查询 枚举
*
* @param deviceCode
* @return
*/
public
static
DeviceTypeRelationEnum
findByDeviceCode
(
String
deviceCode
)
{
if
(
StringUtils
.
isEmpty
(
deviceCode
))
{
return
null
;
}
}
public
Integer
getBizDeviceType
()
{
DeviceTypeRelationEnum
[]
dataArray
=
DeviceTypeRelationEnum
.
values
();
return
bizDeviceType
;
for
(
int
i
=
0
;
i
<
dataArray
.
length
;
i
++)
{
DeviceTypeRelationEnum
deviceTypeRelationEnum
=
dataArray
[
i
];
if
(
deviceTypeRelationEnum
.
deviceCode
.
equals
(
deviceCode
))
{
return
deviceTypeRelationEnum
;
}
}
public
Integer
getDataDeviceType
()
{
return
dataDeviceType
;
}
}
return
null
;
public
String
getDeviceName
()
{
return
deviceName
;
}
}
/**
/**
* 通过业务设备类型查询 枚举
* 通过业务设备类型查询 枚举
* @param deviceCode
*
* @param deviceType
* @return
* @return
*/
*/
public
static
DeviceTypeRelationEnum
findBy
DeviceCode
(
String
deviceCod
e
)
{
public
static
DeviceTypeRelationEnum
findBy
BizDeviceType
(
Integer
deviceTyp
e
)
{
if
(
StringUtils
.
isEmpty
(
deviceCod
e
))
{
if
(
Objects
.
isNull
(
deviceTyp
e
))
{
return
null
;
return
null
;
}
}
DeviceTypeRelationEnum
[]
dataArray
=
DeviceTypeRelationEnum
.
values
();
DeviceTypeRelationEnum
[]
dataArray
=
DeviceTypeRelationEnum
.
values
();
for
(
int
i
=
0
;
i
<
dataArray
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
dataArray
.
length
;
i
++)
{
DeviceTypeRelationEnum
deviceTypeRelationEnum
=
dataArray
[
i
];
DeviceTypeRelationEnum
deviceTypeRelationEnum
=
dataArray
[
i
];
if
(
deviceTypeRelationEnum
.
deviceCode
.
equals
(
deviceCod
e
))
{
if
(
deviceTypeRelationEnum
.
getBizDeviceType
().
equals
(
deviceTyp
e
))
{
return
deviceTypeRelationEnum
;
return
deviceTypeRelationEnum
;
}
}
}
}
return
null
;
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