Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-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
赵啸非
attendance-performance-platform
Commits
328546cd
Commit
328546cd
authored
Apr 09, 2025
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考勤机管理
parent
16096179
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
5 deletions
+66
-5
attendance-performance-manager/src/main/java/com/mortals/xhx/common/code/DeviceStatusEnum.java
...in/java/com/mortals/xhx/common/code/DeviceStatusEnum.java
+61
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+5
-5
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/common/code/DeviceStatusEnum.java
0 → 100644
View file @
328546cd
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
public
enum
DeviceStatusEnum
{
未激活
(
0
,
"未激活"
),
离线
(
1
,
"离线"
),
在线
(
1
,
"在线"
);
private
Integer
value
;
private
String
desc
;
DeviceStatusEnum
(
Integer
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
Integer
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
DeviceStatusEnum
getByValue
(
Integer
value
)
{
for
(
DeviceStatusEnum
deviceStatusEnum
:
DeviceStatusEnum
.
values
())
{
if
(
deviceStatusEnum
.
getValue
()
==
value
)
{
return
deviceStatusEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
Integer
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
DeviceStatusEnum
item
:
DeviceStatusEnum
.
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
;
}
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
328546cd
...
@@ -43,10 +43,10 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
...
@@ -43,10 +43,10 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
@Override
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"deviceType"
,
DeviceTypeEnum
.
getEnumMap
()
);
Map
<
String
,
String
>
deviceType
=
new
HashMap
<>(
);
this
.
addDict
(
model
,
"building"
,
BuildingEnum
.
getEnumMap
()
);
deviceType
.
put
(
"1"
,
"考勤机"
);
this
.
addDict
(
model
,
"floor"
,
FloorEnum
.
getEnumMap
()
);
this
.
addDict
(
model
,
"deviceType"
,
deviceType
);
this
.
addDict
(
model
,
"status"
,
StatusEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"status"
,
Device
StatusEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"enabled"
,
EnabledEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"enabled"
,
EnabledEnum
.
getEnumMap
());
super
.
init
(
model
,
context
);
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