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
dc592b26
authored
Oct 26, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:小程序设备编辑
parent
dcaef69a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
server-module/src/main/java/com/makeit/module/controller/wechat/device/PlatDeviceWechatController.java
server-service/src/main/java/com/makeit/service/platform/device/PlatDeviceService.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-module/src/main/java/com/makeit/module/controller/wechat/device/PlatDeviceWechatController.java
View file @
dc592b26
...
...
@@ -55,6 +55,12 @@ public class PlatDeviceWechatController {
return
ApiResponseUtils
.
success
(
platDeviceService
.
view
(
baseIdDTO
.
getId
()));
}
@ApiOperation
(
"详情通过iot设备id"
)
@PostMapping
(
"viewByDeviceId"
)
public
ApiResponseEntity
<
PlatDeviceViewVO
>
viewByDeviceId
(
@RequestBody
BaseIdDTO
baseIdDTO
)
{
return
ApiResponseUtils
.
success
(
platDeviceService
.
viewByDeviceId
(
baseIdDTO
.
getId
()));
}
@ApiOperation
(
"配网"
)
@PostMapping
(
"setUp"
)
public
ApiResponseEntity
<?>
setup
(
@Validated
@RequestBody
PlatDeviceSetupDTO
dto
)
{
...
...
server-service/src/main/java/com/makeit/service/platform/device/PlatDeviceService.java
View file @
dc592b26
...
...
@@ -68,4 +68,6 @@ public interface PlatDeviceService extends IService<PlatDevice> {
Page
<
PlatDeviceListVO
>
getDevices
(
PlatDataScreenQueryDTO
dto
,
Page
<
PlatDevice
>
p
);
void
savePlatDevice
();
PlatDeviceViewVO
viewByDeviceId
(
String
id
);
}
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
dc592b26
...
...
@@ -216,6 +216,27 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
}
@Override
public
PlatDeviceViewVO
viewByDeviceId
(
String
id
)
{
PlatDevice
platDevice
=
getOne
(
new
QueryWrapper
<
PlatDevice
>().
lambda
().
eq
(
PlatDevice:
:
getOriDeviceId
,
id
)
.
last
(
"limit 1"
));
if
(
platDevice
==
null
)
{
return
new
PlatDeviceViewVO
();
}
PlatDeviceViewVO
vo
=
BeanDtoVoUtils
.
convert
(
platDevice
,
PlatDeviceViewVO
.
class
);
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getDeviceId
,
platDevice
.
getId
()));
if
(
other
!=
null
)
{
BeanUtils
.
copyProperties
(
other
,
vo
);
}
vo
.
setId
(
platDevice
.
getId
());
return
vo
;
}
@Override
public
void
setup
(
PlatDeviceSetupDTO
dto
)
{
log
.
info
(
"设备配网请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
PlatDevice
db
=
getOne
(
new
QueryWrapper
<
PlatDevice
>().
lambda
()
...
...
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