From aa2bd91426e34674313a517db2ec0a2774644fed Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 25 Jun 2025 16:34:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 198f4c228..c3502151e 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -764,6 +764,8 @@ namespace IRaCIS.Core.Application.Service.Common var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray); var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId) + .Where(t => t.Subject.IsSubjectQuit == false || t.SubmitState >= SubmitStateEnum.ToSubmit) + .Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true) .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) .WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId) @@ -811,6 +813,9 @@ namespace IRaCIS.Core.Application.Service.Common { var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray); var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId) + + .Where(t => t.Subject.IsSubjectQuit == false || t.AuditState > AuditStateEnum.ToAudit) + .WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId) .WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId) .WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState) @@ -1221,6 +1226,9 @@ namespace IRaCIS.Core.Application.Service.Common var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray); var dicomStudyQuery = _dicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId) + + .Where(t => t.Subject.IsSubjectQuit == false || t.SubjectVisit.CheckState >= CheckStateEnum.CVIng) + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId)) .WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression) .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo)) @@ -1249,6 +1257,9 @@ namespace IRaCIS.Core.Application.Service.Common var nodeDicomStudyQuery = _noneDicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId) + + .Where(t => t.Subject.IsSubjectQuit == false || t.SubjectVisit.CheckState >= CheckStateEnum.CVIng) + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId)) .WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2) .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo)) @@ -1312,6 +1323,9 @@ namespace IRaCIS.Core.Application.Service.Common var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray); var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId) + + .Where(t => t.Subject.IsSubjectQuit == false || t.CheckState >= CheckStateEnum.CVIng) + .Where(x => x.AuditState == AuditStateEnum.QCPassed) //一致性核查中的,或者还没一致性核查的 .WhereIf(inQuery.CheckState != null, t => t.CheckState == inQuery.CheckState) .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) @@ -1350,7 +1364,9 @@ namespace IRaCIS.Core.Application.Service.Common [FromServices] IRepository _trialRepository) { var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false) - //.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null) + //.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null) + + .Where(t => t.Subject.IsSubjectQuit == false || t.ReadingTaskState >= ReadingTaskState.Reading) .WhereIf(inQuery.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) .WhereIf(inQuery.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned) @@ -1734,7 +1750,7 @@ namespace IRaCIS.Core.Application.Service.Common //.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys) .WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel) .WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria) - .WhereIf(inQuery.CriterionTypeEnum != null, t =>t.CriterionTypeList.Any(c=>c==inQuery.CriterionTypeEnum)) + .WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeList.Any(c => c == inQuery.CriterionTypeEnum)) .WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum) .WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired) .WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable) @@ -2855,7 +2871,7 @@ namespace IRaCIS.Core.Application.Service.Common //多表格,增加的一列,就用Guid.Empty 标识 var extralNameList = new List() { new DynamicColumnConfig.ColumItem() { Id = Guid.Empty, Name = _userInfo.IsEn_Us ? "Table Name" : "表格名称" } }; - var tableQuestionNameList = trialConfigTableQuestionList.OrderBy(t=>t.TableName).Select(t => new DynamicColumnConfig.ColumItem() { Id = t.QuestionId, Name = t.TableName + "_" + t.QuestionName }).ToList(); + var tableQuestionNameList = trialConfigTableQuestionList.OrderBy(t => t.TableName).Select(t => new DynamicColumnConfig.ColumItem() { Id = t.QuestionId, Name = t.TableName + "_" + t.QuestionName }).ToList(); configCoumNameList = fistLeveLNameList.Union(extralNameList).Union(tableQuestionNameList).ToList(); }