合并解决
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
57f7b29cc7
|
@ -666,6 +666,14 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||||
//}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
// 不能自动到自己父类这个文件夹
|
||||||
|
if (await _auditDocumentRepository.AnyAsync(x => x.ParentId == inDto.ParentId && inDto.Ids.Contains(x.Id)))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["AuditDocument_CanNotMoveToParent"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
await CopyFileOrFolder(inDto);
|
await CopyFileOrFolder(inDto);
|
||||||
|
|
||||||
await DeleteAuditDocument(new DeleteAuditDocumentInDto()
|
await DeleteAuditDocument(new DeleteAuditDocumentInDto()
|
||||||
|
@ -685,54 +693,7 @@ public class AuditDocumentService(IRepository<AuditDocument> _auditDocumentRepos
|
||||||
public async Task<IResponseOutput> CopyFileOrFolder(MovieFileOrFolderInDto inDto)
|
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)
|
foreach (var item in inDto.Ids)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue