From 3cdfd3a771fee33c3f99a8c699d3dbb78925a714 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 23 Jul 2024 15:35:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9dicom=20ae=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrialSiteUser/DTO/DicomAEViewModel.cs | 6 +++--- .../TrialSiteUser/TrialDicomAEService.cs | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/DicomAEViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/DicomAEViewModel.cs index f3f03e1ce..50cc7d550 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/DicomAEViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/DicomAEViewModel.cs @@ -53,9 +53,9 @@ namespace IRaCIS.Core.Application.ViewModel [NotDefault] public Guid TrialId { get; set; } - public string CalledAE { get; set; } - public string IP { get; set; } - public int Port { get; set; } + public string CalledAE { get; set; } = string.Empty; + public string IP { get; set; } = string.Empty; + public int? Port { get; set; } public string Modality { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs index beb413107..c5b11ba00 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs @@ -83,12 +83,21 @@ namespace IRaCIS.Core.Application.Service // IsVerify=addOrEditDicomAE.Id==null //}; - // 在此处拷贝automapper 映射 - var entity = await _dicomAERepository.InsertOrUpdateAsync(addOrEditDicomAE, true, verifyExp1); - await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == addOrEditDicomAE.TrialId, u => new Trial() { IsPACSConnect = addOrEditDicomAE.IsPACSConnect }, true); - return ResponseOutput.Ok(entity.Id.ToString()); + + if (addOrEditDicomAE.IsPACSConnect) + { + // 在此处拷贝automapper 映射 + var entity = await _dicomAERepository.InsertOrUpdateAsync(addOrEditDicomAE, true, verifyExp1); + + return ResponseOutput.Ok(entity.Id.ToString()); + } + else + { + return ResponseOutput.Ok(); + } + }