修改
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;
|
||||||
|
|
|
@ -73,10 +73,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<Attachment, AttachmentDTO>()
|
CreateMap<Attachment, AttachmentDTO>()
|
||||||
.ForMember(d => d.BlindName, u => u.MapFrom(t => t.Doctor.BlindName))
|
.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.BlindNameCN, u => u.MapFrom(t => t.Doctor.BlindNameCN))
|
||||||
.ForMember(d => d.ChineseName, u => u.MapFrom(t => t.Doctor.ChineseName))
|
.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.FirstName, u => u.MapFrom(t => t.Doctor.FirstName))
|
||||||
.ForMember(d => d.LastName, u => u.MapFrom(t => t.Doctor.LastName))
|
.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.UserName, u => u.MapFrom(t => t.Doctor.UserRole.UserName))
|
||||||
;
|
;
|
||||||
CreateMap<Doctor, GetTrialDoctorListOutDto>();
|
CreateMap<Doctor, GetTrialDoctorListOutDto>();
|
||||||
CreateMap<Doctor, ResumeConfirmDTO>();
|
CreateMap<Doctor, ResumeConfirmDTO>();
|
||||||
|
|
Loading…
Reference in New Issue