diff --git a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs index 59fd094b8..5c217d0b7 100644 --- a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs @@ -385,6 +385,11 @@ public class AuditDocumentService(IRepository _auditDocumentRepos [HttpPost] public async Task MovieFileOrFolder(MovieFileOrFolderInDto inDto) { + if (inDto.ParentId == null) + { + return ResponseOutput.Ok(); + } + //闭包表中找到 设置Id为祖先的所有 后代 包括自己 var matchIdQuery = _auditDocumentClosureRepository.Where(t => inDto.Ids.Contains(t.AncestorId)).Select(t => t.DescendantId); diff --git a/IRaCIS.Core.Application/Service/Document/DTO/AuditDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/AuditDocumentViewModel.cs index f6135fc06..98e251f13 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/AuditDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/AuditDocumentViewModel.cs @@ -188,7 +188,7 @@ public class MovieFileOrFolderInDto { public List Ids { get; set; } - public Guid ParentId { get; set; } + public Guid? ParentId { get; set; } } public class HistoricalVersionDto : AuditDocumentUpdateDto diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 7341f824c..9118be0be 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -109,7 +109,9 @@ namespace IRaCIS.Core.Application.Service int depth = 1; var currentParentId = doc.ParentId; - while (currentParentId.HasValue) + + //脏数据 parentId==Guid.Empty + while (currentParentId.HasValue && currentParentId != Guid.Empty) { closures.Add(new AuditDocumentClosure {