diff --git a/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs b/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs index 7942c55cf..6ef0bb145 100644 --- a/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs @@ -12,6 +12,7 @@ namespace IRaCIS.Core.Application.Service /// [ApiExplorerSettings(GroupName = "Reviewer")] public class AttachmentService(IRepository _attachmentrepository, + IRepository _dictionaryRepository, IRepository _enrollRepository, IRepository _doctorrepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IAttachmentService { @@ -104,6 +105,8 @@ namespace IRaCIS.Core.Application.Service { var doctorIds =await _enrollRepository.Where(x => x.TrialId == inDto.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup).Select(x => x.DoctorId).ToListAsync(); + + var dicList=await _dictionaryRepository.Where(x => x.Parent.Code == "CertificateFileType").Select(x=>x.Code).ToListAsync(); var ids = doctorIds.Select(x=>(Guid?)x).ToList(); var attachmentList = await _attachmentrepository @@ -112,7 +115,11 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inDto.Type.IsNotNullOrEmpty(), x => x.Type == inDto.Type) .WhereIf(inDto.FileName.IsNotNullOrEmpty(), x => inDto.FileName.Contains(x.FileName)) - .Where(a => ids.Contains(a.DoctorId)||a.TrialId==inDto.TrialId ).ProjectTo(_mapper.ConfigurationProvider).ToPagedListAsync(inDto); + .Where(a => dicList.Contains(a.Type)||a.Type==string.Empty) + .Where(a => ids.Contains(a.DoctorId) || a.TrialId == inDto.TrialId) + + + .ProjectTo(_mapper.ConfigurationProvider).ToPagedListAsync(inDto); return attachmentList; diff --git a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs index 2b48f6ac7..70cd9293e 100644 --- a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs @@ -73,10 +73,10 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.BlindName, u => u.MapFrom(t => t.Doctor.BlindName)) .ForMember(d => d.BlindNameCN, u => u.MapFrom(t => t.Doctor.BlindNameCN)) - .ForMember(d => d.ChineseName, u => u.MapFrom(t => t.Doctor.ChineseName)) - .ForMember(d => d.FirstName, u => u.MapFrom(t => t.Doctor.FirstName)) - .ForMember(d => d.LastName, u => u.MapFrom(t => t.Doctor.LastName)) - .ForMember(d => d.UserName, u => u.MapFrom(t => t.Doctor.UserRole.UserName)) + .ForMember(d => d.ChineseName, u => u.MapFrom(t => t.Doctor.ChineseName)) + .ForMember(d => d.FirstName, u => u.MapFrom(t => t.Doctor.FirstName)) + .ForMember(d => d.LastName, u => u.MapFrom(t => t.Doctor.LastName)) + .ForMember(d => d.UserName, u => u.MapFrom(t => t.Doctor.UserRole.UserName)) ; CreateMap(); CreateMap();