|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fdkankan.common.constant.SceneConstant;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
+import com.fdkankan.ucenter.constant.ErrorConstant;
|
|
|
import com.fdkankan.ucenter.constant.LoginConstant;
|
|
|
import com.fdkankan.ucenter.entity.Folder;
|
|
|
import com.fdkankan.ucenter.entity.FolderScene;
|
|
@@ -131,9 +132,14 @@ public class FolderServiceImpl extends ServiceImpl<IFolderMapper, Folder> implem
|
|
|
if(!folderEntity.getType().equals(param.getType())){
|
|
|
throw new BusinessException(SceneConstant.FAILURE_CODE_5030, SceneConstant.FAILURE_MSG_5030);
|
|
|
}
|
|
|
- if(folderEntity.getParentId().equals(param.getParentId())){
|
|
|
- throw new BusinessException(SceneConstant.FAILURE_CODE_5030, SceneConstant.FAILURE_MSG_5030);
|
|
|
+ Folder folder = this.getById(param.getParentId());
|
|
|
+ if(folder == null){
|
|
|
+ throw new BusinessException(ErrorConstant.FAILURE_CODE_5050, ErrorConstant.FAILURE_MSG_5050);
|
|
|
+ }
|
|
|
+ if(folder.getParentId() != null && folder.getParentId().equals(folderEntity.getId())){
|
|
|
+ throw new BusinessException(ErrorConstant.FAILURE_CODE_5051, ErrorConstant.FAILURE_MSG_5051);
|
|
|
}
|
|
|
+
|
|
|
List<Folder> byParentIdAndName = findByParentIdAndName(param.getParentId(), folderEntity.getName(), user.getId(),param.getType());
|
|
|
if(byParentIdAndName != null && byParentIdAndName.size() > 0){
|
|
|
//表示迁移回当前目录,不做处理
|