Commit a36e0f78 by 汪志阳

fix:修复bug

parent 6e4e7cfe
......@@ -11,7 +11,7 @@ public enum PlatAlarmRecordType {
FALL("fall","长者跌倒"),
BEHAVIOR("behavior","行为异常"),
OFF_BED("off_bed","离床异常");
OFF_BED("off_bed","离床告警");
private final String value;
private final String name;
......
......@@ -147,16 +147,22 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
}
this.updateById(space);
List<String> laseSpaceIds = recursionLastSpaceIds(space.getId(), new ArrayList<>());
if (CollUtil.isEmpty(laseSpaceIds)) {
List<String> lastSpaceIds = recursionLastSpaceIds(space.getId(), new ArrayList<>());
if (CollUtil.isEmpty(lastSpaceIds)) {
return;
}
List<PlatRoom> platRoomList = platRoomService.list(Wrappers.<PlatRoom>lambdaQuery().in(PlatRoom::getSpaceId, laseSpaceIds));
List<PlatRoom> platRoomList = platRoomService.list(Wrappers.<PlatRoom>lambdaQuery().in(PlatRoom::getSpaceId, lastSpaceIds));
if (CollUtil.isEmpty(platRoomList)) {
return;
}
for (PlatRoom platRoom : platRoomList) {
platRoom.setSpacePath(dto.getParentPath() + "," + space.getId());
String roomSpacePath;
if (lastSpaceIds.get(0).equals(space.getId())) {
roomSpacePath = dto.getParentPath() + "," + String.join(",", lastSpaceIds);
} else {
roomSpacePath = dto.getParentPath() + "," + space.getId() + "," + String.join(",", lastSpaceIds);
}
platRoom.setSpacePath(roomSpacePath);
platRoomService.updateById(platRoom);
}
List<String> roomIds = platRoomList.stream().map(PlatRoom::getId).collect(Collectors.toList());
......
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