修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
d1ea886e76
commit
5490630922
|
@ -105,23 +105,23 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<AttachmentDTO>> GetTrialAttachments(GetTrialAttachmentsInDto inDto)
|
public async Task<PageOutput<AttachmentDTO>> GetTrialAttachments(GetTrialAttachmentsInDto inDto)
|
||||||
{
|
{
|
||||||
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 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
|
var attachmentList = await _attachmentrepository
|
||||||
|
.Where(a =>a.Doctor.EnrollList.Any(x=>x.TrialId == inDto.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)|| a.TrialId == inDto.TrialId)
|
||||||
.WhereIf(inDto.DoctorId!=null,x=>x.DoctorId==inDto.DoctorId)
|
.WhereIf(inDto.DoctorId!=null,x=>x.DoctorId==inDto.DoctorId)
|
||||||
.WhereIf(inDto.IsAuthorizedView != null, x => x.IsAuthorizedView == inDto.IsAuthorizedView)
|
.WhereIf(inDto.IsAuthorizedView != null, x => x.IsAuthorizedView == inDto.IsAuthorizedView)
|
||||||
.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 => dicList.Contains(a.Type)||a.Type==string.Empty)
|
.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);
|
|
||||||
|
.ProjectTo<AttachmentDTO>(_mapper.ConfigurationProvider, new { TrialId = inDto.TrialId }).ToPagedListAsync(inDto);
|
||||||
|
|
||||||
|
|
||||||
return attachmentList;
|
return attachmentList;
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
var isEn_Us = false;
|
var isEn_Us = false;
|
||||||
|
|
||||||
|
Guid TrialId = Guid.Empty;
|
||||||
|
|
||||||
// 从 DateTime 映射到 DateOnly
|
// 从 DateTime 映射到 DateOnly
|
||||||
CreateMap<DateTime, DateOnly>().ConvertUsing(dt => DateOnly.FromDateTime(dt));
|
CreateMap<DateTime, DateOnly>().ConvertUsing(dt => DateOnly.FromDateTime(dt));
|
||||||
|
|
||||||
|
@ -76,7 +78,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.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.EnrollList.Where(y=>y.TrialId== TrialId).Select(x=>x.DoctorUser.UserName).First()))
|
||||||
;
|
;
|
||||||
CreateMap<Doctor, GetTrialDoctorListOutDto>();
|
CreateMap<Doctor, GetTrialDoctorListOutDto>();
|
||||||
CreateMap<Doctor, ResumeConfirmDTO>();
|
CreateMap<Doctor, ResumeConfirmDTO>();
|
||||||
|
|
Loading…
Reference in New Issue