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
4ea504da
Commit
4ea504da
authored
Feb 28, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备添加产品编码字段,并添加同步更新产品编码字段
parent
cb90eb4c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
device-manager-ui/admin/src/components/SearchForm.vue
device-manager-ui/admin/src/components/SearchForm.vue
+1
-1
device-manager-ui/admin/src/views/device/list.vue
device-manager-ui/admin/src/views/device/list.vue
+7
-0
device-manager/src/main/java/com/mortals/xhx/daemon/task/DeviceStatTaskImpl.java
.../java/com/mortals/xhx/daemon/task/DeviceStatTaskImpl.java
+8
-3
No files found.
device-manager-ui/admin/src/components/SearchForm.vue
View file @
4ea504da
...
...
@@ -273,7 +273,7 @@ export default {
onSubmit
()
{
let
{
path
,
query
}
=
this
.
$route
;
let
data
=
this
.
decode
(
this
.
form
);
delete
this
.
form
[
"
deviceStatusList
"
]
//
delete this.form["deviceStatusList"]
this
.
$router
.
push
({
path
:
path
,
query
:
Object
.
assign
({},
query
,
data
),
...
...
device-manager-ui/admin/src/views/device/list.vue
View file @
4ea504da
...
...
@@ -319,6 +319,7 @@ export default {
},
changeStat
(
val
,
enabled
)
{
return
;
//去除其它条件
delete
this
.
query
[
"
productId
"
]
delete
this
.
query
[
"
deviceName
"
]
...
...
@@ -524,6 +525,12 @@ export default {
type
:
"
select
"
,
label
:
"
设备类型
"
,
},
{
name
:
"
deviceStatus
"
,
type
:
"
select
"
,
label
:
"
设备状态
"
,
},
],
columns
:
[
{
...
...
device-manager/src/main/java/com/mortals/xhx/daemon/task/DeviceStatTaskImpl.java
View file @
4ea504da
...
...
@@ -44,16 +44,21 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
//获取所有在线设备
List
<
DeviceEntity
>
deviceList
=
deviceService
.
find
(
new
DeviceQuery
().
deviceStatus
(
DeviceStatusEnum
.
在线
.
getValue
()));
//更新离线
List
<
DeviceEntity
>
deviceOfflineList
=
deviceList
.
stream
().
map
(
item
->
{
List
<
DeviceEntity
>
deviceOfflineList
=
deviceList
.
parallelStream
().
map
(
item
->
{
if
(
ObjectUtils
.
isEmpty
(
item
.
getDeviceCode
()))
return
null
;
boolean
exists
=
cacheService
.
exists
(
RedisKey
.
KEY_DEVICE_ONLINE_CACHE
+
item
.
getDeviceCode
());
log
.
info
(
"deviceCode:{},exists:{}"
,
item
.
getDeviceCode
(),
exists
);
if
(!
exists
)
{
item
.
setDeviceStatus
(
DeviceStatusEnum
.
离线
.
getValue
());
item
.
setOfflineTime
(
new
Date
());
return
item
;
}
return
item
;
}).
filter
(
f
->
f
.
getDeviceStatus
().
equals
(
DeviceStatusEnum
.
离线
.
getValue
())
).
collect
(
Collectors
.
toList
());
return
null
;
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
deviceOfflineList
))
{
log
.
info
(
"修正设备数量:size:{}"
,
deviceOfflineList
.
size
());
deviceService
.
update
(
deviceOfflineList
);
deviceOfflineList
.
forEach
(
deviceEntity
->
{
PlatformEntity
platformEntity
=
platformService
.
get
(
deviceEntity
.
getPlatformId
());
...
...
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