Commit f31e88ca by huangjy

fix:房态查询问题

parent d185576e
......@@ -612,6 +612,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
LambdaQueryWrapper<PlatDevice> removeQw = new LambdaQueryWrapper<PlatDevice>()
.in(PlatDevice::getId, deviceIdList)
.eq(BaseBusEntity::getTenantId, platTenant.getId());
platDeviceOtherService.remove(new QueryWrapper<PlatDeviceOther>().lambda()
.in(PlatDeviceOther::getDeviceId,deviceIdList)
.eq(BaseBusEntity::getTenantId, platTenant.getId()));
remove(removeQw);
// 同时删除关联的设备
......
......@@ -68,6 +68,15 @@ public class PlatRoomDynamicServiceImpl implements PlatRoomDynamicService {
//空间下的房间
List<PlatRoom> rooms = platRoomService.list(new QueryWrapper<PlatRoom>().lambda()
.in(PlatRoom::getSpaceId,spaceIds));
if (CollectionUtils.isEmpty(rooms)) {
spaces = platSpaceService.list(new QueryWrapper<PlatSpace>().lambda()
.in(PlatSpace::getParentId,spaceIds));
if (CollectionUtils.isNotEmpty(spaces)) {
spaceIds = spaces.stream().map(PlatSpace::getId).collect(Collectors.toList());
rooms = platRoomService.list(new QueryWrapper<PlatRoom>().lambda()
.in(PlatRoom::getSpaceId,spaceIds));
}
}
Map<String,List<PlatRoom>> spaceRoomMap = rooms.stream().collect(Collectors.groupingBy(PlatRoom::getSpaceId));
List<String> roomIds = rooms.stream().map(PlatRoom::getId).collect(Collectors.toList());
List<PlatBed> beds = platBedService.list(new QueryWrapper<PlatBed>().lambda()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment