Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
3fdaabf0
Commit
3fdaabf0
authored
Jul 18, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
历久设备展示
parent
258708c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
1 deletion
+65
-1
device-manager/src/main/java/com/mortals/xhx/common/code/DeviceSourceEnum.java
...in/java/com/mortals/xhx/common/code/DeviceSourceEnum.java
+63
-0
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+2
-1
No files found.
device-manager/src/main/java/com/mortals/xhx/common/code/DeviceSourceEnum.java
0 → 100644
View file @
3fdaabf0
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* 利旧设备
*/
public
enum
DeviceSourceEnum
{
是
(
0
,
"是"
),
否
(
1
,
"否"
);
private
Integer
value
;
private
String
desc
;
DeviceSourceEnum
(
Integer
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
Integer
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
DeviceSourceEnum
getByValue
(
Integer
value
)
{
for
(
DeviceSourceEnum
enabledEnum
:
DeviceSourceEnum
.
values
())
{
if
(
enabledEnum
.
getValue
()
==
value
)
{
return
enabledEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
Integer
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
DeviceSourceEnum
item
:
DeviceSourceEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
Integer
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
3fdaabf0
...
...
@@ -18,6 +18,7 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.busiz.rsp.ApiResp
;
import
com.mortals.xhx.common.code.ApiRespCodeEnum
;
import
com.mortals.xhx.common.code.DeviceSourceEnum
;
import
com.mortals.xhx.common.code.DeviceStatusEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.key.Constant
;
...
...
@@ -87,7 +88,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
this
.
addDict
(
model
,
"isReceiveMess"
,
paramService
.
getParamBySecondOrganize
(
"Device"
,
"isReceiveMess"
));
this
.
addDict
(
model
,
"deviceStatus"
,
paramService
.
getParamBySecondOrganize
(
"Device"
,
"deviceStatus"
));
this
.
addDict
(
model
,
"enabled"
,
paramService
.
getParamBySecondOrganize
(
"Device"
,
"enabled"
));
this
.
addDict
(
model
,
"source"
,
YesNo
Enum
.
getEnumMap
());
this
.
addDict
(
model
,
"source"
,
DeviceSource
Enum
.
getEnumMap
());
super
.
init
(
model
,
context
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment