Commit e331e534 by huangjy

fix:删除房间关联床位问题,导入空间属性问题

parent 2cf25453
...@@ -122,6 +122,13 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i ...@@ -122,6 +122,13 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i
} }
removeByIds(ids); removeByIds(ids);
List<PlatBed> bedList = platBedService.list(new QueryWrapper<PlatBed>().lambda()
.in(PlatBed::getRoomId, ids));
boolean hashFree = bedList.stream().anyMatch(platBed -> CommonEnum.NO.getValue().equals(platBed.getStatus()));
if (hashFree) {
throw new BusinessException(CodeMessageEnum.PLATFORM_ERROR_BAD_NOT_DEL);
}
//删除床位 //删除床位
platBedService.remove(new QueryWrapper<PlatBed>().lambda() platBedService.remove(new QueryWrapper<PlatBed>().lambda()
.in(PlatBed::getRoomId, ids)); .in(PlatBed::getRoomId, ids));
......
...@@ -132,6 +132,9 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -132,6 +132,9 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
space.setParentId(null); space.setParentId(null);
}else { }else {
space.setParentId(dto.getParentId()); space.setParentId(dto.getParentId());
PlatSpace parentSpace = getById(dto.getParentId());
space.setOrgId(parentSpace.getOrgId());
space.setAttribute(parentSpace.getAttribute());
} }
//上级空间 //上级空间
...@@ -547,6 +550,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -547,6 +550,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if (org != null) { if (org != null) {
platSpace.setAttribute(org.getType()); platSpace.setAttribute(org.getType());
} }
PlatSpace parentSpace = getById(firstId);
if (parentSpace != null) {
platSpace.setOrgId(parentSpace.getOrgId());
platSpace.setAttribute(parentSpace.getAttribute());
}
save(platSpace); save(platSpace);
childrenIdMap.put(secondKey, platSpace.getId()); childrenIdMap.put(secondKey, platSpace.getId());
secondId = platSpace.getId(); secondId = platSpace.getId();
...@@ -579,6 +587,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -579,6 +587,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if (org != null) { if (org != null) {
platSpace.setAttribute(org.getType()); platSpace.setAttribute(org.getType());
} }
PlatSpace parentSpace = getById(secondId);
if (parentSpace != null) {
platSpace.setOrgId(parentSpace.getOrgId());
platSpace.setAttribute(parentSpace.getAttribute());
}
save(platSpace); save(platSpace);
childrenIdMap.put(threeKey, platSpace.getId()); childrenIdMap.put(threeKey, platSpace.getId());
threeId = platSpace.getId(); threeId = platSpace.getId();
...@@ -609,6 +622,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -609,6 +622,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
if (org != null) { if (org != null) {
platSpace.setAttribute(org.getType()); platSpace.setAttribute(org.getType());
} }
PlatSpace parentSpace = getById(threeId);
if (parentSpace != null) {
platSpace.setOrgId(parentSpace.getOrgId());
platSpace.setAttribute(parentSpace.getAttribute());
}
platSpace.setParentId(threeId); platSpace.setParentId(threeId);
platSpace.setParentPath(firstId + "," + secondId + "," + threeId); platSpace.setParentPath(firstId + "," + secondId + "," + threeId);
save(platSpace); save(platSpace);
......
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