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 369996ee
authored
May 15, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
设备类型解析
1 parent
b86b48ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
src/main/java/cn/com/glsx/devicemonitor/api/enums/DeviceTypeRelationEnum.java
src/main/java/cn/com/glsx/devicemonitor/api/enums/DeviceWireTypeEnum.java
src/main/java/cn/com/glsx/devicemonitor/api/enums/DeviceTypeRelationEnum.java
View file @
369996e
...
@@ -87,4 +87,29 @@ public enum DeviceTypeRelationEnum {
...
@@ -87,4 +87,29 @@ public enum DeviceTypeRelationEnum {
return
null
;
return
null
;
}
}
/**
* 通过业务设备类型查询 枚举
*
* @param deviceType
* @return
*/
public
static
String
findByBizDeviceType
(
Integer
deviceType
,
Integer
deviceSource
)
{
if
(
Objects
.
isNull
(
deviceType
))
{
return
""
;
}
DeviceTypeRelationEnum
[]
dataArray
=
DeviceTypeRelationEnum
.
values
();
for
(
int
i
=
0
;
i
<
dataArray
.
length
;
i
++)
{
DeviceTypeRelationEnum
deviceTypeRelationEnum
=
dataArray
[
i
];
if
(
deviceTypeRelationEnum
.
getBizDeviceType
().
equals
(
deviceType
))
{
if
(
DeviceTypeRelationEnum
.
OBD
.
getBizDeviceType
().
equals
(
deviceType
))
{
//odb只会是有线设备
return
deviceTypeRelationEnum
.
getDeviceName
();
}
return
(
deviceSource
==
null
?
""
:
DeviceWireTypeEnum
.
getNameBySource
(
deviceSource
))
+
deviceTypeRelationEnum
.
getDeviceName
();
}
}
return
""
;
}
}
}
src/main/java/cn/com/glsx/devicemonitor/api/enums/DeviceWireTypeEnum.java
View file @
369996e
...
@@ -36,4 +36,13 @@ public enum DeviceWireTypeEnum {
...
@@ -36,4 +36,13 @@ public enum DeviceWireTypeEnum {
return
null
;
return
null
;
}
}
public
static
String
getNameBySource
(
Integer
source
)
{
for
(
DeviceWireTypeEnum
typeEnum
:
DeviceWireTypeEnum
.
values
())
{
if
(
typeEnum
.
getType
().
equals
(
source
))
{
return
typeEnum
.
getTypeDesc
();
}
}
return
""
;
}
}
}
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