修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
b835a028ad
commit
86c24e6002
|
@ -600,6 +600,13 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
|||
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotMove"]);
|
||||
}
|
||||
|
||||
// 不能自动到自己父类这个文件夹
|
||||
if (await _auditDocumentRepository.AnyAsync(x => x.ParentId == inDto.ParentId && inDto.Ids.Contains(x.Id)))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotMoveToParent"]);
|
||||
}
|
||||
|
||||
|
||||
await CopyFileOrFolder(inDto);
|
||||
|
||||
await DeleteAuditDocument(new DeleteAuditDocumentInDto()
|
||||
|
@ -619,54 +626,7 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
|||
public async Task<IResponseOutput> CopyFileOrFolder(MovieFileOrFolderInDto inDto)
|
||||
{
|
||||
|
||||
#region 不考虑版本的话处理方式
|
||||
|
||||
////1、当前节点的后代(包括自己) 拷贝的节点以及子节点
|
||||
//var nodeList = await _auditDocumentClosureRepository.Where(t => t.AncestorId == id).Select(t => t.Descendant).ToListAsync();
|
||||
|
||||
//// 2. 创建映射表 OldId -> NewId
|
||||
//var oldToNewId = new Dictionary<Guid, Guid>();
|
||||
|
||||
//// 3. 复制节点
|
||||
|
||||
//var newNodeList = nodeList.Clone();
|
||||
|
||||
//foreach (var node in newNodeList)
|
||||
//{
|
||||
// var newId = NewId.NextSequentialGuid();
|
||||
|
||||
// //存储旧Id 和新Id 关系
|
||||
// oldToNewId[node.Id] = newId;
|
||||
|
||||
// //设置新节点Id
|
||||
// node.Id = newId;
|
||||
//}
|
||||
|
||||
|
||||
//// 4. 调整 ParentId 指向新 Id
|
||||
//foreach (var newNode in newNodeList)
|
||||
//{
|
||||
// if (newNode.ParentId.HasValue && oldToNewId.TryGetValue(newNode.ParentId.Value, out var newParentId))
|
||||
// {
|
||||
// newNode.ParentId = newParentId; // 指向新父节点
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newNode.ParentId = inDto.ParentId; // 顶层节点指向目标父节点
|
||||
// }
|
||||
//}
|
||||
|
||||
//foreach (var node in newNodeList)
|
||||
//{
|
||||
|
||||
// await _auditDocumentRepository.AddAsync(node);
|
||||
|
||||
// //建立新的闭包关系
|
||||
// await AddClosureRelationsAsync(node.Id, inDto.ParentId);
|
||||
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
foreach (var item in inDto.Ids)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue