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
82b40f9f
authored
Nov 16, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:设备编辑问题
parent
dc5d5120
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 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 @
82b40f9f
...
@@ -250,16 +250,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -250,16 +250,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if
(
StringUtils
.
isNotEmpty
(
dto
.
getAttribute
()))
{
if
(
StringUtils
.
isNotEmpty
(
dto
.
getAttribute
()))
{
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getDeviceId
,
db
.
getId
()));
.
eq
(
PlatDeviceOther:
:
getDeviceId
,
db
.
getId
()));
if
(
other
!=
null
)
{
if
(
dto
.
getAttribute
().
equals
(
other
.
getAttribute
()))
{
return
;
}
other
.
setAttribute
(
dto
.
getAttribute
());
other
.
setAttribute
(
dto
.
getAttribute
());
platDeviceOtherService
.
updateById
(
other
);
platDeviceOtherService
.
updateById
(
other
);
}
else
{
other
=
new
PlatDeviceOther
();
other
.
setDeviceId
(
db
.
getId
());
other
.
setOriDeviceId
(
db
.
getOriDeviceId
());
other
.
setAttribute
(
dto
.
getAttribute
());
platDeviceOtherService
.
save
(
other
);
}
// 写入设备
// 写入设备
PlatDeviceAttrWechatDTO
platDeviceAttrWechatDTO
=
JSON
.
parseObject
(
dto
.
getAttribute
(),
PlatDeviceAttrWechatDTO
.
class
);
PlatDeviceAttrWechatDTO
platDeviceAttrWechatDTO
=
JSON
.
parseObject
(
dto
.
getAttribute
(),
PlatDeviceAttrWechatDTO
.
class
);
...
@@ -397,6 +392,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -397,6 +392,9 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platDeviceOtherService
.
saveOrUpdate
(
other
);
platDeviceOtherService
.
saveOrUpdate
(
other
);
if
(
StringUtils
.
isNotEmpty
(
dto
.
getAttribute
()))
{
if
(
StringUtils
.
isNotEmpty
(
dto
.
getAttribute
()))
{
if
(
dto
.
getAttribute
().
equals
(
other
.
getAttribute
()))
{
return
;
}
// 写入设备
// 写入设备
PlatDeviceAttrWechatDTO
platDeviceAttrWechatDTO
=
JSON
.
parseObject
(
dto
.
getAttribute
(),
PlatDeviceAttrWechatDTO
.
class
);
PlatDeviceAttrWechatDTO
platDeviceAttrWechatDTO
=
JSON
.
parseObject
(
dto
.
getAttribute
(),
PlatDeviceAttrWechatDTO
.
class
);
platDeviceAttrWechatDTO
.
setDeviceId
(
db
.
getOriDeviceId
());
platDeviceAttrWechatDTO
.
setDeviceId
(
db
.
getOriDeviceId
());
...
...
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