From 30e7addc3bf4056a05a789cac5c5b2c43d426cdb Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 8 Jul 2022 16:33:51 +0800 Subject: [PATCH] X --- .../Allocation/TaskConsistentRuleService.cs | 64 ++++++++++--------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs index b01adceb4..272b145ac 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs @@ -164,20 +164,20 @@ namespace IRaCIS.Core.Application.Service - /// - /// 组间一致性分析 选择Subejct 列表 - /// - /// - /// - [HttpPost] - public async Task> GetGroupConsistentRuleSubjectList(GroupConsistentQuery inQuery) - { - var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis==false); + ///// + ///// 组间一致性分析 选择Subejct 列表 + ///// + ///// + ///// + //[HttpPost] + //public async Task> GetGroupConsistentRuleSubjectList(GroupConsistentQuery inQuery) + //{ + // var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis==false); - var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj).ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc); + // var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj).ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc); - return pagedList; - } + // return pagedList; + //} @@ -210,10 +210,10 @@ namespace IRaCIS.Core.Application.Service //最后一个访视添加全局 - var globalTask = (subject.VisitTaskList[filterObj.PlanVisitCount - 1]).Clone(); - globalTask.ReadingCategory = ReadingCategory.Global; - globalTask.VisitTaskNum += ReadingCommon.TaskNumDic[ReadingCategory.Global]; - subject.VisitTaskList.Add(globalTask); + //var globalTask = (subject.VisitTaskList[filterObj.PlanVisitCount - 1]).Clone(); + //globalTask.ReadingCategory = ReadingCategory.Global; + //globalTask.VisitTaskNum += ReadingCommon.TaskNumDic[ReadingCategory.Global]; + //subject.VisitTaskList.Add(globalTask); await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand() { @@ -235,8 +235,14 @@ namespace IRaCIS.Core.Application.Service } - - private IQueryable GetIQueryableDoctorSelfConsistentSubjectView(TaskConsistentRule filterObj, Guid? doctorUserId=null, List? subejctIdList = null) + /// + /// 仅仅组内一致性时使用( + /// + /// + /// + /// + /// + private IQueryable GetIQueryableDoctorSelfConsistentSubjectView(TaskConsistentRule filterObj, Guid doctorUserId, List? subejctIdList = null) { var trialId = filterObj.TrialId; @@ -250,16 +256,16 @@ namespace IRaCIS.Core.Application.Service Expression> subjectIsHaveGeneratedTaskFilter = c => c.IsAnalysisCreate; - //组间一致性 - if (doctorUserId == null) - { - subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c => c.IsSelfAnalysis == false); - } - //组内 - else - { - subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c => c.DoctorUserId == doctorUserId && c.IsSelfAnalysis == true); - } + ////组间一致性 + //if (doctorUserId == null) + //{ + // subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c => c.IsSelfAnalysis == false); + //} + ////组内 + //else + //{ + // subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c => c.DoctorUserId == doctorUserId && c.IsSelfAnalysis == true); + //} if (subejctIdList != null && subejctIdList?.Count > 0) { @@ -288,7 +294,7 @@ namespace IRaCIS.Core.Application.Service BlindSubjectCode=t.SubjectVisitTaskList.Where(t=>t.IsAnalysisCreate).OrderByDescending(t=>t.BlindSubjectCode).Select(t=>t.BlindSubjectCode).FirstOrDefault(), - IsHaveGeneratedTask = t.SubjectVisitTaskList.AsQueryable().Any(subjectIsHaveGeneratedTaskFilter), + IsHaveGeneratedTask = t.SubjectVisitTaskList.Any(c => c.DoctorUserId == doctorUserId && c.IsSelfAnalysis == true), ValidVisitCount = t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Count(),