From 0c0c6b8297c18184edf5cfb08e1dcdaf9751115e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 27 Jul 2022 18:01:05 +0800 Subject: [PATCH] x --- .../Allocation/DTO/TaskConsistentRuleViewModel.cs | 2 +- .../Allocation/TaskConsistentRuleService.cs | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs index 180987ae5..2c53fbe47 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs @@ -94,7 +94,7 @@ namespace IRaCIS.Core.Application.ViewModel public class DoctorGroupConsistentSubjectView: ConsistentCommonView { - public List TaskList => VisitTaskList.GroupBy(t => new { t.SubjectId, t.VisitTaskNum }).Where(g => g.Count() == 2).SelectMany(g => g.ToList()).OrderBy(t=>t.VisitTaskNum).ToList(); + public List SubjectTaskVisitList => VisitTaskList.GroupBy(t => new { t.SubjectId, t.VisitTaskNum }).Where(g => g.Count() == 2).Select(g => g.First()).OrderBy(t=>t.VisitTaskNum).ToList(); public List VisitTaskList { get; set; } = new List(); } diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs index 6f64737c6..3cb39cd0c 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs @@ -243,7 +243,11 @@ namespace IRaCIS.Core.Application.Service SubjectId = c.SubjectId, VisitTaskNum = c.VisitTaskNum, TrialId = c.TrialId, - DoctorUserId = c.DoctorUserId + DoctorUserId = c.DoctorUserId, + + SourceSubjectVisitId = c.SourceSubjectVisitId, + SouceReadModuleId = c.SouceReadModuleId, + }).ToList() // @@ -328,7 +332,7 @@ namespace IRaCIS.Core.Application.Service { //每个医生 都生成处理的任务 - foreach (var task in subject.TaskList.Take(filterObj.PlanVisitCount)) + foreach (var task in subject.SubjectTaskVisitList.Take(filterObj.PlanVisitCount)) { subjectAddTaskList.Add(new VisitTaskGroupSimpleDTO() @@ -351,7 +355,7 @@ namespace IRaCIS.Core.Application.Service if (filterObj.IsGenerateGlobalTask) { - var globalTask = (subject.TaskList.Take(filterObj.PlanVisitCount).Last()).Clone(); + var globalTask = (subject.SubjectTaskVisitList.Take(filterObj.PlanVisitCount).Last()).Clone(); globalTask.TaskName = (int)globalTask.VisitTaskNum + "Global"; globalTask.TaskBlindName = (int)globalTask.VisitTaskNum + "Global"; globalTask.ReadingCategory = ReadingCategory.Global; @@ -417,10 +421,13 @@ namespace IRaCIS.Core.Application.Service //这里的过滤条件 不能用 where(comonTaskFilter) 会报错,奇怪的问题 只能重新写一遍 visitTaskFilter = visitTaskFilter.And(c => c.Subject.SubjectVisitTaskList.Any(t => t.VisitTaskNum == c.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global] && t.ReadingCategory == ReadingCategory.Global && t.IsAnalysisCreate == false && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7) < DateTime.Now && (t.ReReadingApplyState == ReReadingApplyState.Default || t.ReReadingApplyState == ReReadingApplyState.Reject))); + + } - var subjectQuery = _subjectRepository.Where(t => t.TrialId == trialId && t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Count() >= filterObj.PlanVisitCount); + var subjectQuery = _subjectRepository.Where(t => t.TrialId == trialId && t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Count() >= filterObj.PlanVisitCount) + ; var query = subjectQuery.Select(t => new DoctorSelfConsistentSubjectView()