From 4fdb0737fc0e0d7ead6b0a20d0c754e97bace201 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 9 Apr 2025 17:07:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/QC/QCCommon.cs | 35 +++++++++++++++++++ .../Service/QC/QCListService.cs | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/QC/QCCommon.cs b/IRaCIS.Core.Application/Service/QC/QCCommon.cs index 012befc5e..02c4f650e 100644 --- a/IRaCIS.Core.Application/Service/QC/QCCommon.cs +++ b/IRaCIS.Core.Application/Service/QC/QCCommon.cs @@ -121,6 +121,41 @@ namespace IRaCIS.Core.Application.Service + } + + return svExpression; + } + + public static Expression> GetSubjectVisitImageBackRecordFilter(string[]? VisitPlanArray) + { + Expression> svExpression = x => true; + + bool isNeedVisitSearch = VisitPlanArray != null && VisitPlanArray?.Length > 0; + + if (isNeedVisitSearch) + { + var inPlanArray = VisitPlanArray!.Where(t => !t.Contains('.')).Select(t => decimal.Parse(t)).ToArray(); + var isSelectOutPlan = VisitPlanArray!.Any(t => t.Contains('.')); + + + if (inPlanArray.Length > 0) + { + svExpression = svExpression.And(t => inPlanArray.Contains(t.SubjectVisit.VisitNum)); + + if (isSelectOutPlan) + { + svExpression = svExpression.Or(t => t.SubjectVisit.InPlan == false); + + } + } + else if (isSelectOutPlan) + { + svExpression = t => t.SubjectVisit.InPlan == false; + } + + + + } return svExpression; diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index 382f120e1..8c9274e2d 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -39,7 +39,7 @@ namespace IRaCIS.Core.Application.Image.QA [HttpPost] public async Task>> GetImageBackList(ImageBackQueryDto inQuery) { - var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray); + var svExpression = QCCommon.GetSubjectVisitImageBackRecordFilter(inQuery.VisitPlanArray); var query = _subjectVisitImageBackRecordReposiotry.Where(t => t.SubjectVisit.TrialId == inQuery.TrialId) .WhereIf(inQuery.TrialSiteId != null, t => t.SubjectVisit.TrialSiteId == inQuery.TrialSiteId)