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
be8c9835
authored
Sep 07, 2023
by
lzy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
绑定设备
parent
d1861701
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
9 deletions
server-module/src/main/java/com/makeit/module/controller/space/PlatBedController.java
server-module/src/main/java/com/makeit/module/controller/space/PlatRoomController.java
server-service/src/main/java/com/makeit/dto/platform/space/PlatSpaceDeviceQueryDTO.java
server-service/src/main/java/com/makeit/service/platform/space/PlatBedService.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatBedServiceImpl.java
server-module/src/main/java/com/makeit/module/controller/space/PlatBedController.java
View file @
be8c9835
...
@@ -9,6 +9,7 @@ import com.makeit.dto.platform.device.PlatDeviceDTO;
...
@@ -9,6 +9,7 @@ import com.makeit.dto.platform.device.PlatDeviceDTO;
import
com.makeit.dto.platform.space.PlatBedDeviceQueryDTO
;
import
com.makeit.dto.platform.space.PlatBedDeviceQueryDTO
;
import
com.makeit.dto.platform.space.PlatBedEditDTO
;
import
com.makeit.dto.platform.space.PlatBedEditDTO
;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.dto.platform.space.PlatSpaceDeviceQueryDTO
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.service.platform.space.PlatBedService
;
import
com.makeit.service.platform.space.PlatBedService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -65,12 +66,12 @@ public class PlatBedController {
...
@@ -65,12 +66,12 @@ public class PlatBedController {
@ApiOperation
(
"设备列表(选择设备)"
)
@ApiOperation
(
"设备列表(选择设备)"
)
@PostMapping
(
"pageDevice"
)
@PostMapping
(
"pageDevice"
)
public
ApiResponseEntity
<
PageVO
<
PlatDeviceDTO
>>
pageDevice
(
@RequestBody
PageReqDTO
<
Plat
Device
DTO
>
page
)
{
public
ApiResponseEntity
<
PageVO
<
PlatDeviceDTO
>>
pageDevice
(
@RequestBody
PageReqDTO
<
Plat
SpaceDeviceQuery
DTO
>
page
)
{
PageVO
<
PlatDeviceDTO
>
data
=
platBedService
.
pageDevice
(
page
);
PageVO
<
PlatDeviceDTO
>
data
=
platBedService
.
pageDevice
(
page
);
return
ApiResponseUtils
.
success
(
data
);
return
ApiResponseUtils
.
success
(
data
);
}
}
@ApiOperation
(
"绑定设备列表"
)
@ApiOperation
(
"
已
绑定设备列表"
)
@PostMapping
(
"listBindDevice"
)
@PostMapping
(
"listBindDevice"
)
public
ApiResponseEntity
<
List
<
PlatDeviceDTO
>>
listBindDevice
(
@RequestBody
PlatBedDeviceQueryDTO
dto
)
{
public
ApiResponseEntity
<
List
<
PlatDeviceDTO
>>
listBindDevice
(
@RequestBody
PlatBedDeviceQueryDTO
dto
)
{
List
<
PlatDeviceDTO
>
data
=
platBedService
.
listBindDevice
(
dto
);
List
<
PlatDeviceDTO
>
data
=
platBedService
.
listBindDevice
(
dto
);
...
...
server-module/src/main/java/com/makeit/module/controller/space/PlatRoomController.java
View file @
be8c9835
...
@@ -66,4 +66,5 @@ public class PlatRoomController {
...
@@ -66,4 +66,5 @@ public class PlatRoomController {
PageVO
<
PlatRoom
>
data
=
platRoomService
.
page
(
page
);
PageVO
<
PlatRoom
>
data
=
platRoomService
.
page
(
page
);
return
ApiResponseUtils
.
success
(
data
);
return
ApiResponseUtils
.
success
(
data
);
}
}
}
}
server-service/src/main/java/com/makeit/dto/platform/space/PlatSpaceDeviceQueryDTO.java
0 → 100644
View file @
be8c9835
package
com
.
makeit
.
dto
.
platform
.
space
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @Author:lzy
* @Date:2023/9/7 14:58
* @Describe:
*/
@Data
@ApiModel
(
"PlatSpaceDeviceQueryDTO 参数"
)
public
class
PlatSpaceDeviceQueryDTO
{
@ApiModelProperty
(
value
=
"原始设备ID"
)
private
String
oriDeviceId
;
@ApiModelProperty
(
value
=
"设备名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"产品名称"
)
private
String
productName
;
@ApiModelProperty
(
value
=
"状态 数据字典 1 在线 0离线"
)
private
String
status
;
@ApiModelProperty
(
value
=
"设备类型 device.category 0-呼吸心率雷达 1-空间人体雷达 2-跌倒检测雷达"
)
private
String
category
;
}
server-service/src/main/java/com/makeit/service/platform/space/PlatBedService.java
View file @
be8c9835
...
@@ -5,9 +5,7 @@ import com.makeit.common.dto.StatusDTO;
...
@@ -5,9 +5,7 @@ import com.makeit.common.dto.StatusDTO;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageReqDTO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.common.page.PageVO
;
import
com.makeit.dto.platform.device.PlatDeviceDTO
;
import
com.makeit.dto.platform.device.PlatDeviceDTO
;
import
com.makeit.dto.platform.space.PlatBedDeviceQueryDTO
;
import
com.makeit.dto.platform.space.*
;
import
com.makeit.dto.platform.space.PlatBedEditDTO
;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatRoom
;
import
com.makeit.entity.platform.space.PlatRoom
;
...
@@ -58,7 +56,7 @@ public interface PlatBedService extends IService<PlatBed> {
...
@@ -58,7 +56,7 @@ public interface PlatBedService extends IService<PlatBed> {
* @param pageReqDTO
* @param pageReqDTO
* @return
* @return
*/
*/
PageVO
<
PlatDeviceDTO
>
pageDevice
(
PageReqDTO
<
Plat
Device
DTO
>
pageReqDTO
);
PageVO
<
PlatDeviceDTO
>
pageDevice
(
PageReqDTO
<
Plat
SpaceDeviceQuery
DTO
>
pageReqDTO
);
/**
/**
* 已绑定设备
* 已绑定设备
...
@@ -67,6 +65,12 @@ public interface PlatBedService extends IService<PlatBed> {
...
@@ -67,6 +65,12 @@ public interface PlatBedService extends IService<PlatBed> {
*/
*/
List
<
PlatDeviceDTO
>
listBindDevice
(
PlatBedDeviceQueryDTO
dto
);
List
<
PlatDeviceDTO
>
listBindDevice
(
PlatBedDeviceQueryDTO
dto
);
/**
*
* @param dto
*/
void
bindDevice
(
PlatRoomBindDeviceDTO
dto
);
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatBedServiceImpl.java
View file @
be8c9835
...
@@ -10,6 +10,7 @@ import com.makeit.dto.platform.device.PlatDeviceDTO;
...
@@ -10,6 +10,7 @@ import com.makeit.dto.platform.device.PlatDeviceDTO;
import
com.makeit.dto.platform.space.PlatBedDeviceQueryDTO
;
import
com.makeit.dto.platform.space.PlatBedDeviceQueryDTO
;
import
com.makeit.dto.platform.space.PlatBedEditDTO
;
import
com.makeit.dto.platform.space.PlatBedEditDTO
;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.dto.platform.space.PlatBedQueryDTO
;
import
com.makeit.dto.platform.space.PlatSpaceDeviceQueryDTO
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatBed
;
import
com.makeit.entity.platform.space.PlatRoom
;
import
com.makeit.entity.platform.space.PlatRoom
;
...
@@ -149,18 +150,18 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
...
@@ -149,18 +150,18 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
}
}
@Override
@Override
public
PageVO
<
PlatDeviceDTO
>
pageDevice
(
PageReqDTO
<
Plat
Device
DTO
>
pageReqDTO
)
{
public
PageVO
<
PlatDeviceDTO
>
pageDevice
(
PageReqDTO
<
Plat
SpaceDeviceQuery
DTO
>
pageReqDTO
)
{
LambdaQueryWrapper
<
PlatRoomBedDevice
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PlatRoomBedDevice
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
select
(
PlatRoomBedDevice:
:
getEquipmentId
);
queryWrapper1
.
select
(
PlatRoomBedDevice:
:
getEquipmentId
);
List
<
PlatRoomBedDevice
>
list
=
platRoomBedDeviceService
.
list
(
queryWrapper1
);
List
<
PlatRoomBedDevice
>
list
=
platRoomBedDeviceService
.
list
(
queryWrapper1
);
List
<
String
>
listEquipmentIds
=
list
.
stream
().
map
(
item
->
item
.
getEquipmentId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
listEquipmentIds
=
list
.
stream
().
map
(
item
->
item
.
getEquipmentId
()).
collect
(
Collectors
.
toList
());
Plat
Device
DTO
dto
=
pageReqDTO
.
getData
();
Plat
SpaceDeviceQuery
DTO
dto
=
pageReqDTO
.
getData
();
Page
<
PlatDevice
>
p
=
PageUtil
.
toMpPage
(
pageReqDTO
);
Page
<
PlatDevice
>
p
=
PageUtil
.
toMpPage
(
pageReqDTO
);
LambdaQueryWrapper
<
PlatDevice
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PlatDevice
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
PlatDevice:
:
getCategory
,
PlatDeviceEnum
.
CategoryEnum
.
HEART
);
queryWrapper
.
notIn
(
PlatDevice:
:
getId
,
listEquipmentIds
);
queryWrapper
.
notIn
(
PlatDevice:
:
getId
,
listEquipmentIds
);
queryWrapper
.
eq
(
PlatDevice:
:
getCategory
,
dto
.
getCategory
());
queryWrapper
.
like
(
StringUtil
.
isNotEmpty
(
dto
.
getOriDeviceId
()),
PlatDevice:
:
getOriDeviceId
,
dto
.
getOriDeviceId
());
queryWrapper
.
like
(
StringUtil
.
isNotEmpty
(
dto
.
getOriDeviceId
()),
PlatDevice:
:
getOriDeviceId
,
dto
.
getOriDeviceId
());
queryWrapper
.
like
(
StringUtil
.
isNotEmpty
(
dto
.
getName
()),
PlatDevice:
:
getName
,
dto
.
getName
());
queryWrapper
.
like
(
StringUtil
.
isNotEmpty
(
dto
.
getName
()),
PlatDevice:
:
getName
,
dto
.
getName
());
queryWrapper
.
like
(
StringUtil
.
isNotEmpty
(
dto
.
getProductName
()),
PlatDevice:
:
getProductName
,
dto
.
getProductName
());
queryWrapper
.
like
(
StringUtil
.
isNotEmpty
(
dto
.
getProductName
()),
PlatDevice:
:
getProductName
,
dto
.
getProductName
());
...
...
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