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
6d06b4bf
authored
Dec 20, 2023
by
罗志长
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 批量编辑设备属性
parent
78ff14d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 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 @
6d06b4bf
...
@@ -738,7 +738,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -738,7 +738,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if
(
CollectionUtils
.
isEmpty
(
deviceIdList
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceIdList
))
{
return
;
return
;
}
}
String
reqJson
=
JSON
.
toJSONString
(
dto
);
for
(
String
deviceId
:
deviceIdList
)
{
for
(
String
deviceId
:
deviceIdList
)
{
PlatDeviceBaseAttrDTO
platDeviceBaseAttrDTO
=
getPlatDeviceBaseAttrDTO
(
deviceId
);
PlatDeviceBaseAttrDTO
platDeviceBaseAttrDTO
=
getPlatDeviceBaseAttrDTO
(
deviceId
);
Map
<
String
,
Object
>
map
=
getReqMap
(
dto
,
platDeviceBaseAttrDTO
);
Map
<
String
,
Object
>
map
=
getReqMap
(
dto
,
platDeviceBaseAttrDTO
);
...
@@ -746,12 +745,13 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -746,12 +745,13 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if
(
StringUtils
.
isNotEmpty
(
result
))
{
if
(
StringUtils
.
isNotEmpty
(
result
))
{
throw
new
RuntimeException
(
"修改设备属性失败:"
+
result
);
throw
new
RuntimeException
(
"修改设备属性失败:"
+
result
);
}
}
List
<
PlatDeviceOther
>
otherList
=
platDeviceOtherService
.
list
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
// 写入设备后等iot MQTT消息回复单独更新,不直接修改数据库属性
.
eq
(
PlatDeviceOther:
:
getOriDeviceId
,
deviceId
));
// List<PlatDeviceOther> otherList = platDeviceOtherService.list(new QueryWrapper<PlatDeviceOther>().lambda()
for
(
PlatDeviceOther
platDeviceOther
:
otherList
)
{
// .eq(PlatDeviceOther::getOriDeviceId, deviceId));
platDeviceOther
.
setAttribute
(
reqJson
);
// for (PlatDeviceOther platDeviceOther : otherList) {
platDeviceOtherService
.
updateById
(
platDeviceOther
);
// platDeviceOther.setAttribute(reqJson);
}
// platDeviceOtherService.updateById(platDeviceOther);
// }
}
}
...
...
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