Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
self-service
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
廖旭伟
self-service
Commits
ae12f015
Commit
ae12f015
authored
Jul 10, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备列表接口增加统计字段
parent
ca17eaa4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
sst-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+28
-1
No files found.
sst-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
ae12f015
...
@@ -364,9 +364,36 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
...
@@ -364,9 +364,36 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
int
code
;
int
code
;
try
{
try
{
Rest
<
RespData
<
List
<
DevicePdu
>>>
rest
=
deviceFeign
.
list
(
query
);
Rest
<
RespData
<
List
<
DevicePdu
>>>
rest
=
deviceFeign
.
list
(
query
);
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
()))
{
model
.
put
(
"data"
,
rest
.
getData
());
int
onlineTotal
=
0
;
int
offlineTotal
=
0
;
int
not_active
=
0
;
int
stop_using
=
0
;
for
(
DevicePdu
deviceEntity
:
rest
.
getData
().
getData
())
{
if
(
deviceEntity
.
getDeviceStatus
()
==
0
)
{
not_active
++;
}
if
(
deviceEntity
.
getDeviceStatus
()
==
1
)
{
offlineTotal
++;
}
if
(
deviceEntity
.
getDeviceStatus
()
==
2
)
{
onlineTotal
++;
}
if
(
deviceEntity
.
getEnabled
()
==
0
)
{
stop_using
++;
}
}
model
.
put
(
"online"
,
onlineTotal
);
model
.
put
(
"offline"
,
offlineTotal
);
model
.
put
(
"notActive"
,
not_active
);
model
.
put
(
"stopUsing"
,
stop_using
);
model
.
put
(
"pageInfo"
,
rest
.
getData
().
getPageInfo
());
//model.put("dict", rest.getData().getDict());
}
ret
.
setCode
(
rest
.
getCode
());
ret
.
setCode
(
rest
.
getCode
());
ret
.
setMsg
(
rest
.
getMsg
());
ret
.
setMsg
(
rest
.
getMsg
());
ret
.
setData
(
rest
.
getData
()
);
ret
.
setData
(
model
);
ret
.
setDict
(
rest
.
getDict
());
ret
.
setDict
(
rest
.
getDict
());
}
catch
(
Exception
var9
)
{
}
catch
(
Exception
var9
)
{
...
...
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