Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-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
赵啸非
sample-form-platform
Commits
9169df1e
Commit
9169df1e
authored
Feb 25, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加样表设备列表
parent
121233cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
sample-form-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
...a/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
+2
-3
No files found.
sample-form-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteDeviceTaskImpl.java
View file @
9169df1e
...
@@ -54,7 +54,7 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
...
@@ -54,7 +54,7 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
sitePdu
.
setId
(
1L
);
sitePdu
.
setId
(
1L
);
Rest
<
List
<
SitePdu
>>
siteRest
=
siteFeign
.
getFlatSitesBySiteId
(
sitePdu
);
Rest
<
List
<
SitePdu
>>
siteRest
=
siteFeign
.
getFlatSitesBySiteId
(
sitePdu
);
if
(
siteRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
if
(
siteRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
log
.
info
(
"总数量:{}"
,
siteRest
.
getData
().
size
());
log
.
info
(
"
站点
总数量:{}"
,
siteRest
.
getData
().
size
());
siteRest
.
getData
().
forEach
(
site
->
{
siteRest
.
getData
().
forEach
(
site
->
{
DevicePdu
devicePdu
=
new
DevicePdu
();
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setProductCode
(
"ybj"
);
devicePdu
.
setProductCode
(
"ybj"
);
...
@@ -62,8 +62,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
...
@@ -62,8 +62,8 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
Rest
<
RespData
<
List
<
DevicePdu
>>>
deviceRest
=
deviceFeign
.
list
(
devicePdu
);
Rest
<
RespData
<
List
<
DevicePdu
>>>
deviceRest
=
deviceFeign
.
list
(
devicePdu
);
if
(
YesNoEnum
.
YES
.
getValue
()
==
deviceRest
.
getCode
())
{
if
(
YesNoEnum
.
YES
.
getValue
()
==
deviceRest
.
getCode
())
{
List
<
DevicePdu
>
devicePduList
=
deviceRest
.
getData
().
getData
();
List
<
DevicePdu
>
devicePduList
=
deviceRest
.
getData
().
getData
();
log
.
info
(
"样表机总数量:{}"
,
devicePduList
.
size
());
if
(!
ObjectUtils
.
isEmpty
(
devicePduList
))
{
if
(!
ObjectUtils
.
isEmpty
(
devicePduList
))
{
List
<
DeviceEntity
>
newDeviceList
=
devicePduList
.
stream
().
map
(
newDevice
->
{
List
<
DeviceEntity
>
newDeviceList
=
devicePduList
.
stream
().
map
(
newDevice
->
{
DeviceEntity
deviceEntity
=
new
DeviceEntity
();
DeviceEntity
deviceEntity
=
new
DeviceEntity
();
deviceEntity
.
initAttrValue
();
deviceEntity
.
initAttrValue
();
...
@@ -72,7 +72,6 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
...
@@ -72,7 +72,6 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
List
<
DeviceEntity
>
oldDeviceList
=
deviceService
.
find
(
new
DeviceQuery
().
siteId
(
site
.
getId
()));
List
<
DeviceEntity
>
oldDeviceList
=
deviceService
.
find
(
new
DeviceQuery
().
siteId
(
site
.
getId
()));
Map
<
String
,
DeviceEntity
>
oldDeviceMap
=
oldDeviceList
.
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getDeviceCode
(),
y
->
y
,
(
o
,
n
)
->
n
));
Map
<
String
,
DeviceEntity
>
oldDeviceMap
=
oldDeviceList
.
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getDeviceCode
(),
y
->
y
,
(
o
,
n
)
->
n
));
List
<
DeviceEntity
>
updateDeviceLsit
=
newDeviceList
.
stream
().
map
(
item
->
{
List
<
DeviceEntity
>
updateDeviceLsit
=
newDeviceList
.
stream
().
map
(
item
->
{
if
(
oldDeviceMap
.
containsKey
(
item
.
getDeviceCode
()))
{
if
(
oldDeviceMap
.
containsKey
(
item
.
getDeviceCode
()))
{
...
...
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