Commit 78419c0a by 朱淼
parents c8524501 c5174566
...@@ -99,6 +99,8 @@ public enum CodeMessageEnum { ...@@ -99,6 +99,8 @@ public enum CodeMessageEnum {
PLATFORM_ERROR_SPACE_NAME_DUPLICATE(500, "PLATFORM.ERROR.SPACE.NAME.DUPLICATE"), PLATFORM_ERROR_SPACE_NAME_DUPLICATE(500, "PLATFORM.ERROR.SPACE.NAME.DUPLICATE"),
PLATFORM_ERROR_SPACE_NOT_DEL(500, "PLATFORM.ERROR.SPACE.NOT.DEL"), PLATFORM_ERROR_SPACE_NOT_DEL(500, "PLATFORM.ERROR.SPACE.NOT.DEL"),
PLATFORM_ERROR_SPACE_NOT_AUTH_PARENT(500, "PLATFORM.ERROR.SPACE.NOT.AUTH.PARENT"),
PLATFORM_ERROR_SPACE_USER_NOT_ADD(500, "PLATFORM.ERROR.SPACE.USER.NOT.ADD"),
PLATFORM_ERROR_ROOM_EXIT_BAD(500, "PLATFORM.ERROR.ROOM.EXIT.BAD"), PLATFORM_ERROR_ROOM_EXIT_BAD(500, "PLATFORM.ERROR.ROOM.EXIT.BAD"),
PLATFORM_ERROR_ROOM_BAD_NUMBER_NOT_AUTH(500, "PLATFORM.ERROR.ROOM.BAD.NUMBER.NOT.AUTH"), PLATFORM_ERROR_ROOM_BAD_NUMBER_NOT_AUTH(500, "PLATFORM.ERROR.ROOM.BAD.NUMBER.NOT.AUTH"),
PLATFORM_ERROR_ROOM_NAME_EXIT(500, "PLATFORM.ERROR.ROOM.NAME.EXIT"), PLATFORM_ERROR_ROOM_NAME_EXIT(500, "PLATFORM.ERROR.ROOM.NAME.EXIT"),
......
...@@ -94,6 +94,8 @@ PLATFORM.ERROR.ELDER.CERTIFICATENUMBER.DUPLICATE=证件号不能重复 ...@@ -94,6 +94,8 @@ PLATFORM.ERROR.ELDER.CERTIFICATENUMBER.DUPLICATE=证件号不能重复
PLATFORM.ERROR.SPACE.NAME.DUPLICATE=同一层级,空间名称不能重复 PLATFORM.ERROR.SPACE.NAME.DUPLICATE=同一层级,空间名称不能重复
PLATFORM.ERROR.SPACE.NOT.DEL=该空间下存在下级或者房间,不可删除 PLATFORM.ERROR.SPACE.NOT.DEL=该空间下存在下级或者房间,不可删除
PLATFORM.ERROR.SPACE.NOT.AUTH.PARENT=上级空间不能是自己的下级空间
PLATFORM.ERROR.SPACE.USER.NOT.ADD=当前用户没有所属组织,请先分配组织
PLATFORM.ERROR.ROOM.EXIT.BAD=房间中存在床位,不可删除 PLATFORM.ERROR.ROOM.EXIT.BAD=房间中存在床位,不可删除
PLATFORM.ERROR.ROOM.NAME.EXIT=该房间名称已存在 PLATFORM.ERROR.ROOM.NAME.EXIT=该房间名称已存在
PLATFORM.ERROR.ROOM.BAD.NUMBER.NOT.AUTH=床位数量不能改小 PLATFORM.ERROR.ROOM.BAD.NUMBER.NOT.AUTH=床位数量不能改小
......
...@@ -840,7 +840,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser> ...@@ -840,7 +840,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
} }
private void fillOrgPath(PlatPersonDTOVO dto, PlatUser user) { private void fillOrgPath(PlatPersonDTOVO dto, PlatUser user) {
PlatOrg platOrg = platOrgService.getById(dto.getId()); PlatOrg platOrg = platOrgService.getById(dto.getOrgId());
if (platOrg != null) { if (platOrg != null) {
user.setOrgPath(platOrg.getPath() + "," + platOrg.getId()); user.setOrgPath(platOrg.getPath() + "," + platOrg.getId());
} }
......
...@@ -83,7 +83,7 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild ...@@ -83,7 +83,7 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
fill(voList); fill(voList);
return PageUtil.toPageVO(BeanDtoVoUtils.listVo(voPage.getRecords(), PlatElderChildrenInfoListVO.class), voPage); return PageUtil.toPageVO(voList, voPage);
} }
@Override @Override
......
...@@ -77,6 +77,9 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -77,6 +77,9 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
PlatSpace space = BeanDtoVoUtils.convert(dto, PlatSpace.class); PlatSpace space = BeanDtoVoUtils.convert(dto, PlatSpace.class);
if(StringUtil.isEmpty(dto.getParentId())){ if(StringUtil.isEmpty(dto.getParentId())){
PlatUserVO userVO = PlatUserUtil.getUserVOCanNull(); PlatUserVO userVO = PlatUserUtil.getUserVOCanNull();
if(StringUtil.isEmpty(userVO.getOrgId())){
throw new BusinessException(CodeMessageEnum.PLATFORM_ERROR_SPACE_USER_NOT_ADD);
}
space.setOrgId(userVO.getOrgId()); space.setOrgId(userVO.getOrgId());
PlatOrg org = platOrgService.getById(space.getOrgId()); PlatOrg org = platOrgService.getById(space.getOrgId());
if(org!=null){ if(org!=null){
...@@ -105,6 +108,13 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -105,6 +108,13 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
space.setLongitude(dto.getLongitude()); space.setLongitude(dto.getLongitude());
space.setParentId(dto.getParentId()); space.setParentId(dto.getParentId());
space.setParentPath(dto.getParentPath()); space.setParentPath(dto.getParentPath());
//上级空间
PlatSpace parentSpace = this.getById(dto.getParentId());
if(parentSpace.getParentPath().contains(dto.getId())){
throw new BusinessException(CodeMessageEnum.PLATFORM_ERROR_SPACE_NOT_DEL);
}
this.updateById(space); this.updateById(space);
} }
...@@ -171,6 +181,8 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -171,6 +181,8 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
@Override @Override
public List<PlatSpaceVO> treeByBed(PlatSpaceQueryDTO dto) { public List<PlatSpaceVO> treeByBed(PlatSpaceQueryDTO dto) {
PlatUserVO userVO = PlatUserUtil.getUserVOCanNull();
//房间 //房间
List<PlatRoom> listRoom = platRoomService.list(new LambdaQueryWrapper<>()); List<PlatRoom> listRoom = platRoomService.list(new LambdaQueryWrapper<>());
...@@ -199,6 +211,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -199,6 +211,7 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
LambdaQueryWrapper<PlatSpace> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PlatSpace> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(StringUtil.isNotEmpty(dto.getName()),PlatSpace::getName,dto.getName()); queryWrapper.like(StringUtil.isNotEmpty(dto.getName()),PlatSpace::getName,dto.getName());
queryWrapper.eq(StringUtil.isNotEmpty(userVO.getOrgId()),PlatSpace::getOrgId,userVO.getOrgId());
List<PlatSpace> list = this.list(queryWrapper); List<PlatSpace> list = this.list(queryWrapper);
List<PlatSpaceVO> listSpaceVo = BeanDtoVoUtils.listVo(list,PlatSpaceVO.class); List<PlatSpaceVO> listSpaceVo = BeanDtoVoUtils.listVo(list,PlatSpaceVO.class);
listSpaceVo.addAll(listRoomVo); listSpaceVo.addAll(listRoomVo);
......
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