|
@@ -81,11 +81,11 @@ public class ApiRoomController {
|
|
List<AllRoomDTO> list = buildingService.listByHousingEstateId(Long.parseLong(String.valueOf(params.get("housingEstateId"))));
|
|
List<AllRoomDTO> list = buildingService.listByHousingEstateId(Long.parseLong(String.valueOf(params.get("housingEstateId"))));
|
|
//级联依次查询单元、楼层、房号
|
|
//级联依次查询单元、楼层、房号
|
|
for(AllRoomDTO building : list){
|
|
for(AllRoomDTO building : list){
|
|
- building.setChildren(unitService.listByBuildingId(building.getId()));
|
|
|
|
|
|
+ building.setChildren(unitService.listByBuildingId(building.getValue()));
|
|
for(AllRoomDTO unit : building.getChildren()){
|
|
for(AllRoomDTO unit : building.getChildren()){
|
|
- unit.setChildren(floorService.listByUnitId(unit.getId()));
|
|
|
|
|
|
+ unit.setChildren(floorService.listByUnitId(unit.getValue()));
|
|
for(AllRoomDTO floor : unit.getChildren()){
|
|
for(AllRoomDTO floor : unit.getChildren()){
|
|
- floor.setChildren(roomService.listByFloorId(floor.getId()));
|
|
|
|
|
|
+ floor.setChildren(roomService.listByFloorId(floor.getValue()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -107,17 +107,17 @@ public class ApiRoomController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //同楼上的房间,设置数量和floorList相同的属性全为空的list
|
|
|
|
|
|
+ //楼上的房间,设置数量和floorList相同的属性全为空的list
|
|
List<RoomDetailDTO> upList = new ArrayList<>();
|
|
List<RoomDetailDTO> upList = new ArrayList<>();
|
|
- //同楼下的房间
|
|
|
|
|
|
+ //楼下的房间
|
|
List<RoomDetailDTO> downList = new ArrayList<>();
|
|
List<RoomDetailDTO> downList = new ArrayList<>();
|
|
|
|
|
|
for(RoomDetailDTO room :floorList){
|
|
for(RoomDetailDTO room :floorList){
|
|
if(room.getSelfFlag() == 1){
|
|
if(room.getSelfFlag() == 1){
|
|
RoomDetailDTO upDto = roomService.roomUp(userId);
|
|
RoomDetailDTO upDto = roomService.roomUp(userId);
|
|
- upList.add(upDto);
|
|
|
|
|
|
+ upList.add(upDto == null ? new RoomDetailDTO() : upDto);
|
|
RoomDetailDTO downDto = roomService.roomDown(userId);
|
|
RoomDetailDTO downDto = roomService.roomDown(userId);
|
|
- downList.add(downDto);
|
|
|
|
|
|
+ downList.add(downDto == null ? new RoomDetailDTO() : downDto);
|
|
}else {
|
|
}else {
|
|
//往list中添加空的RoomDetailDTO
|
|
//往list中添加空的RoomDetailDTO
|
|
upList.add(new RoomDetailDTO());
|
|
upList.add(new RoomDetailDTO());
|