|
@@ -240,6 +240,9 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
|
|
|
String userId = UserUtils.getCurrentPrincipleID();
|
|
|
Date now = DateUtil.now();
|
|
|
Long id = idVO.getId();
|
|
|
+ if (idVO.getId().equals(-1)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前医院不能删除");
|
|
|
+ }
|
|
|
HospitalInfo hospitalInfo = hospitalInfoService.getById(id);
|
|
|
if (hospitalInfo == null) {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "数据不存在");
|
|
@@ -253,7 +256,7 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", id));
|
|
|
if (ListUtil.isNotEmpty(mappingConfigList)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在映射关联,无法删除");
|
|
|
}
|
|
|
|
|
|
List<Plan> planList
|
|
@@ -261,14 +264,14 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", id));
|
|
|
if (ListUtil.isNotEmpty(planList)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在方案配置关联,无法删除");
|
|
|
}
|
|
|
|
|
|
int count = tranHospitalRelationService.count(new QueryWrapper<TranHospitalRelation>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", id));
|
|
|
if (count > 0) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联子医院,无法删除");
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在子医院关联,无法删除");
|
|
|
}
|
|
|
// 主表逻辑删除
|
|
|
hospitalInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
|