Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
33fbd503
authored
Feb 27, 2024
by
罗志长
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 区域设置设备安装方式同步
parent
f037f4a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
33fbd503
...
...
@@ -395,11 +395,15 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
.
eq
(
PlatDeviceOther:
:
getDeviceId
,
id
).
last
(
"limit 1"
));
PlatDeviceBaseAttrDTO
iotAttr
=
getDeviceBaseAttrDTO
(
db
);
Integer
radarMount
=
iotAttr
.
getRadarMount
();
if
(
other
!=
null
)
{
String
oldAttr
=
other
.
getAttribute
();
if
(
StringUtils
.
isBlank
(
other
.
getAttribute
()))
{
PlatDeviceBaseAttrDTO
defaultAttr
=
getDefaultAttr
(
db
);
String
attr
=
defaultAttr
!=
null
?
JSON
.
toJSONString
(
defaultAttr
)
:
null
;
if
(
defaultAttr
!=
null
)
{
radarMount
=
radarMount
==
null
?
defaultAttr
.
getRadarMount
()
:
radarMount
;
}
other
.
setAttribute
(
attr
);
}
BeanUtils
.
copyProperties
(
other
,
vo
);
...
...
@@ -408,11 +412,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if
(!
StringUtils
.
equals
(
oldAttr
,
attr
))
{
other
.
setAttribute
(
attr
);
platDeviceOtherService
.
updateById
(
other
);
if
(
iotAttr
.
getRadarMount
()
!=
null
)
{
if
(
radarMount
!=
null
)
{
List
<
PlatDevice
>
platDeviceList
=
list
(
new
QueryWrapper
<
PlatDevice
>().
lambda
().
eq
(
PlatDevice:
:
getOriDeviceId
,
db
.
getOriDeviceId
()));
//更新区域设置设备安装方式
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
.
set
(
PlatRegionSetting:
:
getInstallType
,
iotAttr
.
getRadarMount
()
)
.
set
(
PlatRegionSetting:
:
getInstallType
,
radarMount
)
.
in
(
CollectionUtils
.
isNotEmpty
(
platDeviceList
),
PlatRegionSetting:
:
getDeviceId
,
StreamUtil
.
map
(
platDeviceList
,
BaseEntity:
:
getId
)));
}
}
...
...
@@ -483,11 +487,15 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
.
last
(
"limit 1"
));
PlatDeviceBaseAttrDTO
iotAttr
=
getDeviceBaseAttrDTO
(
platDevice
);
Integer
radarMount
=
iotAttr
.
getRadarMount
();
if
(
other
!=
null
)
{
String
oldAttr
=
other
.
getAttribute
();
if
(
StringUtils
.
isBlank
(
other
.
getAttribute
()))
{
PlatDeviceBaseAttrDTO
defaultAttr
=
getDefaultAttr
(
platDevice
);
String
attr
=
defaultAttr
!=
null
?
JSON
.
toJSONString
(
defaultAttr
)
:
null
;
if
(
defaultAttr
!=
null
)
{
radarMount
=
radarMount
==
null
?
defaultAttr
.
getRadarMount
()
:
radarMount
;
}
other
.
setAttribute
(
attr
);
}
BeanUtils
.
copyProperties
(
other
,
vo
);
...
...
@@ -496,11 +504,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if
(!
StringUtils
.
equals
(
oldAttr
,
attr
))
{
other
.
setAttribute
(
attr
);
platDeviceOtherService
.
updateById
(
other
);
if
(
iotAttr
.
getRadarMount
()
!=
null
)
{
if
(
radarMount
!=
null
)
{
List
<
PlatDevice
>
platDeviceList
=
list
(
new
QueryWrapper
<
PlatDevice
>().
lambda
().
eq
(
PlatDevice:
:
getOriDeviceId
,
platDevice
.
getOriDeviceId
()));
//更新区域设置设备安装方式
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
.
set
(
PlatRegionSetting:
:
getInstallType
,
iotAttr
.
getRadarMount
()
)
.
set
(
PlatRegionSetting:
:
getInstallType
,
radarMount
)
.
in
(
CollectionUtils
.
isNotEmpty
(
platDeviceList
),
PlatRegionSetting:
:
getDeviceId
,
StreamUtil
.
map
(
platDeviceList
,
BaseEntity:
:
getId
)));
}
}
...
...
@@ -689,22 +697,26 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
PlatDeviceOther
platDeviceOther
=
platDeviceOtherService
.
getOne
(
deviceOtherLambdaQueryWrapper
,
false
);
PlatDeviceBaseAttrDTO
iotAttr
=
getDeviceBaseAttrDTO
(
platDevice
);
Integer
radarMount
=
iotAttr
.
getRadarMount
();
if
(
platDeviceOther
!=
null
)
{
String
oldAttr
=
platDeviceOther
.
getAttribute
();
if
(
StringUtils
.
isBlank
(
platDeviceOther
.
getAttribute
()))
{
PlatDeviceBaseAttrDTO
defaultAttr
=
getDefaultAttr
(
platDevice
);
String
attr
=
defaultAttr
!=
null
?
JSON
.
toJSONString
(
defaultAttr
)
:
null
;
if
(
defaultAttr
!=
null
)
{
radarMount
=
radarMount
==
null
?
defaultAttr
.
getRadarMount
()
:
radarMount
;
}
platDeviceOther
.
setAttribute
(
attr
);
}
String
attr
=
getAfterComparisonAttr
(
iotAttr
,
platDeviceOther
.
getAttribute
());
if
(!
StringUtils
.
equals
(
oldAttr
,
attr
))
{
platDeviceOther
.
setAttribute
(
attr
);
platDeviceOtherService
.
updateById
(
platDeviceOther
);
if
(
iotAttr
.
getRadarMount
()
!=
null
)
{
if
(
radarMount
!=
null
)
{
List
<
PlatDevice
>
platDeviceList
=
list
(
new
QueryWrapper
<
PlatDevice
>().
lambda
().
eq
(
PlatDevice:
:
getOriDeviceId
,
platDevice
.
getOriDeviceId
()));
//更新区域设置设备安装方式
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
.
set
(
PlatRegionSetting:
:
getInstallType
,
iotAttr
.
getRadarMount
()
)
.
set
(
PlatRegionSetting:
:
getInstallType
,
radarMount
)
.
in
(
CollectionUtils
.
isNotEmpty
(
platDeviceList
),
PlatRegionSetting:
:
getDeviceId
,
StreamUtil
.
map
(
platDeviceList
,
BaseEntity:
:
getId
)));
}
}
...
...
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