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
e7c6bb9c
authored
Nov 01, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:设备写入
parent
131db3a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 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 @
e7c6bb9c
...
@@ -404,9 +404,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -404,9 +404,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
public
void
editDeviceProperties
(
PlatDeviceAttrWechatDTO
dto
)
{
public
void
editDeviceProperties
(
PlatDeviceAttrWechatDTO
dto
)
{
log
.
info
(
"写入设备属性请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
log
.
info
(
"写入设备属性请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
String
deviceId
=
dto
.
getDeviceId
();
String
deviceId
=
dto
.
getDeviceId
();
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getOriDeviceId
,
deviceId
));
UserServerInfo
usrServerInfo
=
dto
.
getUsrServerInfo
();
UserServerInfo
usrServerInfo
=
dto
.
getUsrServerInfo
();
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getOriDeviceId
,
deviceId
)
.
last
(
"limit 1"
));
if
(
other
!=
null
&&
usrServerInfo
!=
null
)
{
if
(
other
!=
null
&&
usrServerInfo
!=
null
)
{
other
.
setProtocolAccount
(
usrServerInfo
.
getUsername
());
other
.
setProtocolAccount
(
usrServerInfo
.
getUsername
());
other
.
setProtocolPassword
(
usrServerInfo
.
getPassword
());
other
.
setProtocolPassword
(
usrServerInfo
.
getPassword
());
...
@@ -418,10 +419,13 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -418,10 +419,13 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
}
}
Map
<
String
,
Object
>
map
=
getAttrMap
(
dto
);
Map
<
String
,
Object
>
map
=
getAttrMap
(
dto
);
if
(
dto
.
getUsrServerInfo
()
!=
null
)
{
if
(
usrServerInfo
!=
null
)
{
map
.
put
(
"usrServerInfo"
,
JSON
.
toJSONString
(
dto
.
getUsrServerInfo
()));
map
.
put
(
"usrServerInfo"
,
JSON
.
toJSONString
(
usrServerInfo
));
}
String
result
=
devicePropertiesOperateService
.
deviceWriteAttr
(
deviceId
,
map
);
if
(
StringUtils
.
isNotEmpty
(
result
))
{
throw
new
RuntimeException
(
"设备写入失败:"
+
result
);
}
}
devicePropertiesOperateService
.
deviceWriteAttr
(
deviceId
,
map
);
if
(
dto
.
getRadarMount
()
!=
null
)
{
if
(
dto
.
getRadarMount
()
!=
null
)
{
//更新区域设置设备安装方式
//更新区域设置设备安装方式
...
...
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