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(); + } + }