diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index 7f55d3ed3..462bad2e2 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -108,20 +108,26 @@ namespace IRaCIS.Core.SCP.Service var _hospitalGroupRepository = _serviceProvider.GetService>(); + var _dicomAERepository = _serviceProvider.GetService>(); + + var aeList = _dicomAERepository/*.Where(t => t.PacsTypeEnum == PacsType.PacsServer)*/.Select(t => t.CalledAE).ToList(); + var list = _hospitalGroupRepository.Where(t => t.IsEnable).ToList(); - CurrentHospitalGroup = list.FirstOrDefault(t => t.CallingAE == Association.CallingAE); + CurrentHospitalGroup = list.FirstOrDefault(t => t.CallingAE == association.CallingAE); + var unionAEList = aeList.Union(list.Select(t => t.CallingAE)).ToList(); + var calledAEList = option.CalledAEList; - if (!calledAEList.Contains(association.CalledAE)) + if (!calledAEList.Contains(association.CalledAE) || !unionAEList.Any(t => t == association.CallingAE)) { - Log.Logger.Warning($"拒绝CalledAE:{association.CalledAE}的连接"); + Log.Logger.Warning($"拒绝CalledAE:{association.CalledAE} CallingAE:{association.CallingAE}连接"); return SendAssociationRejectAsync( DicomRejectResult.Permanent, @@ -332,7 +338,7 @@ namespace IRaCIS.Core.SCP.Service #region 1帧拆成多个固定大小的,方便移动端浏览 // 回到开头,读取 dicom - ms.Position = 0; + ms.Position = 0; var dicomFile = DicomFile.Open(ms); var pixelData = DicomPixelData.Create(dicomFile.Dataset); diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs index 9246de335..bb05a5d8a 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs @@ -261,6 +261,8 @@ namespace IRaCIS.Application.Contracts public class UserHospitalGroupInfoWithName : UserHospitalGroupInfo { public string Name { get; set; } + + public string Code { get; set; } } public class UserHospitalGroupInfo diff --git a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs index eabc93639..024876d0d 100644 --- a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs @@ -74,7 +74,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.UserType, u => u.MapFrom(t => t.UserTypeName)); CreateMap() - .ForMember(d => d.HospitalGroupList, u => u.MapFrom(s => s.IdentityUserHospitalGroupList.Select(t => new UserHospitalGroupInfoWithName() { HospitalGroupId = t.HospitalGroupId, IsDisabled = t.IsDisabled, Name = t.HospitalGroup.Name }))); + .ForMember(d => d.HospitalGroupList, u => u.MapFrom(s => s.IdentityUserHospitalGroupList.Select(t => new UserHospitalGroupInfoWithName() { HospitalGroupId = t.HospitalGroupId, IsDisabled = t.IsDisabled, Name = t.HospitalGroup.Name,Code=t.HospitalGroup.Code }))); CreateMap()