修改
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
he 2025-03-17 15:31:53 +08:00
parent d1ea886e76
commit 5490630922
2 changed files with 7 additions and 5 deletions

View File

@ -105,23 +105,23 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
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 ids = doctorIds.Select(x=>(Guid?)x).ToList();
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.IsAuthorizedView != null, x => x.IsAuthorizedView == inDto.IsAuthorizedView)
.WhereIf(inDto.Type.IsNotNullOrEmpty(), x => x.Type == inDto.Type)
.WhereIf(inDto.FileName.IsNotNullOrEmpty(), x => inDto.FileName.Contains(x.FileName))
.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;

View File

@ -13,6 +13,8 @@ namespace IRaCIS.Core.Application.Service
{
var isEn_Us = false;
Guid TrialId = Guid.Empty;
// 从 DateTime 映射到 DateOnly
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.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.UserName, u => u.MapFrom(t => t.Doctor.EnrollList.Where(y=>y.TrialId== TrialId).Select(x=>x.DoctorUser.UserName).First()))
;
CreateMap<Doctor, GetTrialDoctorListOutDto>();
CreateMap<Doctor, ResumeConfirmDTO>();