diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs index 4e9572ded..2a6078c3b 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs @@ -974,8 +974,7 @@ namespace IRaCIS.Application.Contracts public class VisitImageDownloadQuery : PageInput { - [NotDefault] - public Guid TrialId { get; set; } + public Guid? TrialId { get; set; } public string? IP { get; set; } diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 90ad81fe0..bcc9681ee 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -54,7 +54,7 @@ namespace IRaCIS.Application.Services [ApiExplorerSettings(GroupName = "HIR")] public class PatientService(IRepository _studySubjectVisitRepository, IRepository _trialIdentityUserRepository, - IRepository _SCPStudyRepository, IOSSService _oSSService, + IRepository _SCPStudyRepository, IOSSService _oSSService, IRepository _identityUserRepository, IRepository _subjectPatientRepository, IRepository _SCPStudyHospitalGroupRepository, IRepository _trialRepository, @@ -3235,7 +3235,7 @@ namespace IRaCIS.Application.Services catch (Exception ex) { - Console.WriteLine($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] SCP下载失败 SeriesId: {item.SeriesId} Path:{item.Path} Error: {ex.Message}\n" ); + Console.WriteLine($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] SCP下载失败 SeriesId: {item.SeriesId} Path:{item.Path} Error: {ex.Message}\n"); } @@ -3284,7 +3284,7 @@ namespace IRaCIS.Application.Services Console.WriteLine($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] 下载失败 SeriesId: {item.SeriesId} Path:{item.Path} Error: {ex.Message}\n"); } - + } @@ -3605,12 +3605,14 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task>> GetTrialSubjectVisitDownloadList(VisitImageDownloadQuery inQuery) { - var query = _subejctVisitDownloadRepository.Where(t => t.SubjectVisit.TrialId == inQuery.TrialId) + var query = _subejctVisitDownloadRepository + .WhereIf(inQuery.TrialId != null, t => t.SubjectVisit.TrialId == inQuery.TrialId) + .WhereIf(inQuery.TrialId == null, t => t.SubjectVisitId == null) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.IP), t => t.IP.Contains(inQuery.IP)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubjectCode), t => t.SubjectVisit.Subject.Code.Contains(inQuery.SubjectCode)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.VisitName), t => t.SubjectVisit.VisitName.Contains(inQuery.VisitName)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.CreateUserRole.UserName.Contains(inQuery.Name) || t.CreateUserRole.FullName.Contains(inQuery.Name)) - .WhereIf(inQuery.UserTypeEnum != null, t => t.CreateUserRole.UserTypeRole.UserTypeEnum == inQuery.UserTypeEnum) + .WhereIf(inQuery.UserTypeEnum != null, t => t.CreateUserRole.UserTypeRole.UserTypeEnum == inQuery.UserTypeEnum) .WhereIf(inQuery.BeginDownloadTime != null, t => t.CreateTime >= inQuery.BeginDownloadTime) .WhereIf(inQuery.EndDownloadTime != null, t => t.CreateTime <= inQuery.EndDownloadTime)