From 8f0ef86ab9a345464eadc1d62085ee794620b50e Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 1 Apr 2025 17:55:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Document/AuditDocumentService.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs index 85ddaefe2..a947dd946 100644 --- a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs @@ -103,8 +103,7 @@ public class AuditDocumentService(IRepository _auditDocumentRepos /// private async Task AddOrUpdateAuditDocument(AuditDocumentAddOrEdit inDto) { - if (inDto.ParentId != null) - { + var alikeData = await _auditDocumentRepository.Where(x =>x.Id!=inDto.Id&& x.ParentId == inDto.ParentId&&x.Name==inDto.Name&&x.AuditDocumentTypeEnum==inDto.AuditDocumentTypeEnum).FirstOrDefaultAsync(); if (alikeData != null) { @@ -144,7 +143,7 @@ public class AuditDocumentService(IRepository _auditDocumentRepos return entityData; } } - } + var entity = await _auditDocumentRepository.InsertOrUpdateAsync(inDto, true); return entity;