From 92063da2bf51d2996d7b6520ef472126901ce082 Mon Sep 17 00:00:00 2001 From: hang <87227557@qq.com> Date: Sun, 28 Sep 2025 19:38:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8B=B7=E8=B4=9D=E5=88=B0?= =?UTF-8?q?=E6=A0=B9=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Document/AuditDocumentService.cs | 5 +++++ .../Service/Document/DTO/AuditDocumentViewModel.cs | 2 +- IRaCIS.Core.Application/TestService.cs | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) 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 {