修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
0f682dd184
commit
7a75d107dc
|
@ -12,6 +12,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||||
public class AttachmentService(IRepository<Attachment> _attachmentrepository,
|
public class AttachmentService(IRepository<Attachment> _attachmentrepository,
|
||||||
|
IRepository<Dictionary> _dictionaryRepository,
|
||||||
IRepository<Enroll> _enrollRepository,
|
IRepository<Enroll> _enrollRepository,
|
||||||
IRepository<Doctor> _doctorrepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IAttachmentService
|
IRepository<Doctor> _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 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 ids = doctorIds.Select(x=>(Guid?)x).ToList();
|
||||||
|
|
||||||
var attachmentList = await _attachmentrepository
|
var attachmentList = await _attachmentrepository
|
||||||
|
@ -112,7 +115,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.WhereIf(inDto.Type.IsNotNullOrEmpty(), x => x.Type == inDto.Type)
|
.WhereIf(inDto.Type.IsNotNullOrEmpty(), x => x.Type == inDto.Type)
|
||||||
.WhereIf(inDto.FileName.IsNotNullOrEmpty(), x => inDto.FileName.Contains(x.FileName))
|
.WhereIf(inDto.FileName.IsNotNullOrEmpty(), x => inDto.FileName.Contains(x.FileName))
|
||||||
|
|
||||||
.Where(a => ids.Contains(a.DoctorId)||a.TrialId==inDto.TrialId ).ProjectTo<AttachmentDTO>(_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<AttachmentDTO>(_mapper.ConfigurationProvider).ToPagedListAsync(inDto);
|
||||||
|
|
||||||
|
|
||||||
return attachmentList;
|
return attachmentList;
|
||||||
|
|
Loading…
Reference in New Issue