|
@@ -66,11 +66,21 @@ public class DirServiceImpl extends IBaseServiceImpl<DirEntity, Long> implements
|
|
|
entity.setParentId(1L);
|
|
|
}
|
|
|
entity.setUserId(phone);
|
|
|
+ List<DirEntity> dirEntities = findByIdAndName(entity.getId(), entity.getName(), entity.getType());
|
|
|
+ if (ObjectUtil.isNotNull(dirEntities)&&dirEntities.size()>0){
|
|
|
+ log.info("{}",dirEntities);
|
|
|
+ throw new BaseRuntimeException(ErrorEnum.FAILURE_CODE_3104.code(), ErrorEnum.FAILURE_CODE_3104.message());
|
|
|
+ }
|
|
|
this.save(entity);
|
|
|
} else {
|
|
|
entity = this.findById(id);
|
|
|
BaseRuntimeException.isNull(entity, ErrorEnum.FAILURE_SYS_3001.code(), ErrorEnum.FAILURE_SYS_3001.message());
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
+ List<DirEntity> dirEntities = findByIdAndName(entity.getId(), entity.getName(), entity.getType());
|
|
|
+ if (ObjectUtil.isNotNull(dirEntities)&&dirEntities.size()>0){
|
|
|
+ log.info("{}",dirEntities);
|
|
|
+ throw new BaseRuntimeException(ErrorEnum.FAILURE_CODE_3104.code(), ErrorEnum.FAILURE_CODE_3104.message());
|
|
|
+ }
|
|
|
this.update(entity);
|
|
|
}
|
|
|
return Result.success(entity);
|