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
260e7e4e
authored
Sep 20, 2023
by
lzy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
绑定设备列表-bug
parent
c6815154
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomBedDeviceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomBedDeviceServiceImpl.java
View file @
260e7e4e
...
@@ -13,14 +13,14 @@ import com.makeit.dto.platform.space.PlatSpaceDeviceQueryDTO;
...
@@ -13,14 +13,14 @@ import com.makeit.dto.platform.space.PlatSpaceDeviceQueryDTO;
import
com.makeit.dto.platform.space.PlatUnbindingDeviceDTO
;
import
com.makeit.dto.platform.space.PlatUnbindingDeviceDTO
;
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.PlatRoomBedDevice
;
import
com.makeit.entity.platform.space.PlatRoomBedDevice
;
import
com.makeit.entity.platform.space.PlatSpace
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.enums.platform.device.PlatDeviceEnum
;
import
com.makeit.enums.platform.device.PlatDeviceEnum
;
import
com.makeit.mapper.platform.space.PlatRoomBedDeviceMapper
;
import
com.makeit.mapper.platform.space.PlatRoomBedDeviceMapper
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.space.PlatBedService
;
import
com.makeit.service.platform.space.*
;
import
com.makeit.service.platform.space.PlatRegionSettingService
;
import
com.makeit.service.platform.space.PlatRoomBedDeviceService
;
import
com.makeit.utils.data.convert.BeanDtoVoUtils
;
import
com.makeit.utils.data.convert.BeanDtoVoUtils
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
...
@@ -50,6 +50,10 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
...
@@ -50,6 +50,10 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
private
PlatBedService
platBedService
;
private
PlatBedService
platBedService
;
@Autowired
@Autowired
private
PlatRegionSettingService
platRegionSettingService
;
private
PlatRegionSettingService
platRegionSettingService
;
@Autowired
private
PlatRoomService
platRoomService
;
@Autowired
private
PlatSpaceService
platSpaceService
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -84,12 +88,19 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
...
@@ -84,12 +88,19 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
if
(
StringUtil
.
isNotEmpty
(
dto
.
getRoomId
()))
{
if
(
StringUtil
.
isNotEmpty
(
dto
.
getRoomId
()))
{
queryWrapper1
.
ne
(
PlatRoomBedDevice:
:
getRoomId
,
dto
.
getRoomId
());
queryWrapper1
.
ne
(
PlatRoomBedDevice:
:
getRoomId
,
dto
.
getRoomId
());
}
}
if
(
CommonEnum
.
NO
.
getValue
().
equals
(
dto
.
getIsRoom
()))
{
if
(
CommonEnum
.
YES
.
getValue
().
equals
(
dto
.
getIsRoom
()))
{
queryWrapper1
.
isNull
(
PlatRoomBedDevice:
:
getBedId
);
queryWrapper1
.
isNull
(
PlatRoomBedDevice:
:
getBedId
);
}
}
List
<
PlatRoomBedDevice
>
list
=
list
(
queryWrapper1
);
List
<
PlatRoomBedDevice
>
list
=
list
(
queryWrapper1
);
List
<
String
>
listEquipmentIds
=
list
.
stream
().
map
(
item
->
item
.
getDeviceId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
listEquipmentIds
=
list
.
stream
().
map
(
item
->
item
.
getDeviceId
()).
collect
(
Collectors
.
toList
());
String
orgId
=
null
;
if
(
StringUtil
.
isNotEmpty
(
dto
.
getRoomId
())){
PlatRoom
platRoom
=
platRoomService
.
getById
(
dto
.
getRoomId
());
PlatSpace
platSpace
=
platSpaceService
.
getById
(
platRoom
.
getSpaceId
());
orgId
=
platSpace
.
getOrgId
();
}
Page
<
PlatDevice
>
p
=
PageUtil
.
toMpPage
(
pageReqDTO
);
Page
<
PlatDevice
>
p
=
PageUtil
.
toMpPage
(
pageReqDTO
);
LambdaQueryWrapper
<
PlatDevice
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PlatDevice
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
...
@@ -99,6 +110,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
...
@@ -99,6 +110,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
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
());
queryWrapper
.
eq
(
StringUtil
.
isNotEmpty
(
dto
.
getStatus
()),
PlatDevice:
:
getStatus
,
dto
.
getStatus
());
queryWrapper
.
eq
(
StringUtil
.
isNotEmpty
(
dto
.
getStatus
()),
PlatDevice:
:
getStatus
,
dto
.
getStatus
());
queryWrapper
.
eq
(
StringUtil
.
isNotEmpty
(
orgId
),
PlatDevice:
:
getOrgId
,
orgId
);
Page
<
PlatDevice
>
pages
=
platDeviceService
.
page
(
p
,
queryWrapper
);
Page
<
PlatDevice
>
pages
=
platDeviceService
.
page
(
p
,
queryWrapper
);
List
<
PlatDeviceDTO
>
listRecord
=
BeanDtoVoUtils
.
listVo
(
pages
.
getRecords
(),
PlatDeviceDTO
.
class
);
List
<
PlatDeviceDTO
>
listRecord
=
BeanDtoVoUtils
.
listVo
(
pages
.
getRecords
(),
PlatDeviceDTO
.
class
);
...
...
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