优化生成DIR 查询判断 是否存在TransferSytaxUID为空的记录
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
hang 2026-02-11 20:22:02 -05:00
parent 93558164de
commit 7879504b71
3 changed files with 15 additions and 8 deletions

View File

@ -45,7 +45,7 @@ namespace IRaCIS.Core.API
}
else
{
options.UseSqlServer(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure().CommandTimeout(60));
options.UseSqlServer(configuration.GetSection("ConnectionStrings:RemoteNew").Value, contextOptionsBuilder => contextOptionsBuilder.EnableRetryOnFailure()/*.CommandTimeout(60)*/);
}

View File

@ -2814,7 +2814,7 @@
<param name="trialId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetExportSubjectVisitImageList(IRaCIS.Core.Application.Contracts.TrialExportImageCommand)">
<member name="M:IRaCIS.Core.Application.Service.ImageAndDoc.DownloadAndUploadService.GetExportSubjectVisitImageList(IRaCIS.Core.Application.Contracts.TrialExportImageCommand,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance})">
<summary>
批量勾选访视 进行下载
</summary>

View File

@ -53,6 +53,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
IDistributedLockProvider _distributedLockProvider,
IRepository<TrialImageDownload> _trialImageDownloadRepository,
IRepository<Subject> _subjectRepository,
IRepository<DicomInstance> _instanceRepository,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, IDownloadAndUploadService
{
@ -1141,7 +1142,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var info = await _subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId).Select(t => new { t.Trial.TrialCode }).FirstOrDefaultAsync();
//有传输语法值的导出 才生成DIR
if (_subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId).SelectMany(t => t.StudyList.SelectMany(t => t.InstanceList)).All(c => c.TransferSytaxUID != string.Empty))
//if (_subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId).SelectMany(t => t.StudyList.SelectMany(t => t.InstanceList)).All(c => c.TransferSytaxUID != string.Empty))
if (!_instanceRepository.Where(t => inQuery.SubjectVisitId == t.SubjectVisitId).Any(c => c.TransferSytaxUID == string.Empty))
{
var list = _subjectVisitRepository.Where(t => t.Id == inQuery.SubjectVisitId).SelectMany(t => t.StudyList)
.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id) : false)
@ -2258,8 +2260,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
{
#region 在下载前先处理DIR文件
//sql 超时
//_subjectVisitRepository.Where(t => inCommand.SubjectVisitIdList.Contains(t.Id))
// .SelectMany(t => t.StudyList.SelectMany(t => t.InstanceList.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true)))
// .All(c => c.TransferSytaxUID != string.Empty)
//有传输语法值的导出 才生成DIR
if (_subjectVisitRepository.Where(t => inCommand.SubjectVisitIdList.Contains(t.Id)).SelectMany(t => t.StudyList.SelectMany(t => t.InstanceList.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true))).All(c => c.TransferSytaxUID != string.Empty))
if (!_instanceRepository.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true)
.Where(t => inCommand.SubjectVisitIdList.Contains(t.SubjectVisitId)).Any(c => c.TransferSytaxUID == string.Empty))
{
var dirInfolist = _subjectVisitRepository.Where(t => inCommand.SubjectVisitIdList.Contains(t.Id)).SelectMany(t => t.StudyList)
.SelectMany(t => t.InstanceList.Where(t => isExportReading ? (t.IsReading && t.DicomSerie.IsReading) : true))