From 7957a33fc4fd1baac600c050dca9c8a1fd82d420 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 7 May 2026 14:31:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=AA=E9=98=85=E7=89=87?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=9A=84=E8=AE=BF=E8=A7=86=EF=BC=8C=E6=96=B9?= =?UTF-8?q?=E4=BE=BF=E8=BF=9B=E8=A1=8C=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/TrialImageDownloadService.cs | 9 +++++++-- .../ImageAndDoc/DownloadAndUploadService.cs | 19 +++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/TrialImageDownloadService.cs b/IRaCIS.Core.Application/Service/Common/TrialImageDownloadService.cs index d1b1c3ed7..26b3e73a8 100644 --- a/IRaCIS.Core.Application/Service/Common/TrialImageDownloadService.cs +++ b/IRaCIS.Core.Application/Service/Common/TrialImageDownloadService.cs @@ -61,6 +61,9 @@ namespace IRaCIS.Core.Application.Service [AllowAnonymous] public async Task DownloadTrialImage(Guid trialId) { + //找到项目里面未阅片的影像 + + //var subjectCodeList = new List() { "05002", "07006", "07026" }; var downloadInfo = _trialRepository.Where(t => t.Id == trialId).Select(t => new { @@ -213,7 +216,7 @@ namespace IRaCIS.Core.Application.Service } catch (Exception ex) { - Console.WriteLine($"下载失败: {ex.Message}"); + Log.Logger.Error($"下载失败: {ex.Message}"); } downloadedCount++; @@ -221,7 +224,9 @@ namespace IRaCIS.Core.Application.Service // 每处理50个,输出一次进度(或最后一个时也输出) if (downloadedCount % 50 == 0 || downloadedCount == totalCount) { - Console.WriteLine($"已下载 {downloadedCount} / {totalCount} 个文件,完成 {(downloadedCount * 100.0 / totalCount):F2}%"); + + Log.Logger.Error($"已下载 {downloadedCount} / {totalCount} 个文件,完成 {(downloadedCount * 100.0 / totalCount):F2}%"); + } } #endregion diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index f7267956f..db29531ad 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -1660,7 +1660,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc #endregion var query = from sv in _subjectRepository.Where(t => t.Id == inQuery.SubjectId).SelectMany(t => t.SubjectVisitList.Where(t => subjectVisitIdList.Contains(t.Id) && t.CheckState == CheckStateEnum.CVPassed)) - //一致性分析,导致查询出来两条数据 + //一致性分析,导致查询出来两条数据 join visitTask in _visitTaskRepository.Where(t => taskIdList.Contains(t.Id)) on sv.Id equals visitTask.SourceSubjectVisitId into cc from leftVisitTask in cc.DefaultIfEmpty() select new ImageDownloadDto() @@ -2005,6 +2005,21 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc } + + /// + /// 获取未阅片完成的访视,方便前端调用下载 + /// + /// + /// + public async Task> GetTrialUnreadVisitList(Guid trialId) + { + + var subjectVisitList = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.SourceSubjectVisitId!=null).Select(t => t.SourceSubjectVisitId) + .Distinct().ToListAsync(); + + return subjectVisitList; + } + /// /// 批量勾选访视 进行下载 /// @@ -2585,7 +2600,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc } - + /// /// 后台任务调用,前端忽略该接口 ///