From 5a9b60dfa02bbf903bde8825b32bac1f7f35cabb Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 21 Jul 2022 15:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 6 ++++ .../Service/Allocation/VisitTaskService.cs | 34 ++++++++++++++----- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 54119fa7c..d9794a848 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -306,6 +306,12 @@ 申请记录的Id + + + 获取已影响的列表 + + + 系统模板文档配置表 diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 2de8b4b48..94b66bb04 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1161,16 +1161,24 @@ namespace IRaCIS.Core.Application.Service.Allocation //origenalTask.ReReadingApplyState = agreeReReadingCommand.RequestReReadingResultEnum == RequestReReadingResult.Agree ? ReReadingApplyState.Agree : ReReadingApplyState.Reject; //origenalTask.TaskState = agreeReReadingCommand.RequestReReadingResultEnum == RequestReReadingResult.Agree ? TaskState.HaveReturned : origenalTask.TaskState; - + var origenalTask = (await _visitTaskRepository.Where(t => item.OriginalReReadingTaskId == t.Id).FirstOrDefaultAsync()).IfNullThrowException(); // 当前访视之前 已有任务申请 - if (trialConfig.IsReadingTaskViewInOrder && await _visitTaskReReadingRepository.AnyAsync(t => t.OriginalReReadingTask.SubjectId == origenalTask.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect && t.OriginalReReadingTask.ReadingCategory == ReadingCategory.Visit - && t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.OriginalReReadingTask.VisitTaskNum > origenalTask.VisitTaskNum && t.RequestReReadingResultEnum == RequestReReadingResult.Default)) + if (trialConfig.IsReadingTaskViewInOrder ) { - return ResponseOutput.NotOk("当前为有序阅片,当前访视之后,也申请了重阅 必须从后向前处理"); + + var query = _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.SubjectId == origenalTask.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect && t.OriginalReReadingTask.ReadingCategory == ReadingCategory.Visit + && t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.OriginalReReadingTask.VisitTaskNum > origenalTask.VisitTaskNum && t.RequestReReadingResultEnum == RequestReReadingResult.Default) + .Where(t => t.OriginalReReadingTask.IsAnalysisCreate == origenalTask.IsAnalysisCreate); + + if(await query.AnyAsync()) + { + return ResponseOutput.NotOk("当前为有序阅片,当前访视之后,也申请了重阅 必须从后向前处理"); + + } } Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == origenalTask.SubjectId && t.TaskState == TaskState.Effect; @@ -1215,7 +1223,7 @@ namespace IRaCIS.Core.Application.Service.Allocation //有序阅片 if (trialConfig.IsReadingTaskViewInOrder) { - + //访视影响当前以及当前之后的 两个阅片人的 filterExpression = filterExpression.And(t => t.VisitTaskNum > origenalTask.VisitTaskNum && t.DoctorUserId == origenalTask.DoctorUserId || t.VisitTaskNum >= origenalTask.VisitTaskNum && t.DoctorUserId != origenalTask.DoctorUserId); @@ -1270,7 +1278,7 @@ namespace IRaCIS.Core.Application.Service.Allocation { influenceTask.TaskState = TaskState.Adbandon; } - + } } #endregion @@ -1400,7 +1408,7 @@ namespace IRaCIS.Core.Application.Service.Allocation case ReadingCategory.Oncology: //仅仅影响自己 后续任务如果是访视任务、全局任务或裁判任务,均不处理 - filterExpression = filterExpression.And(t => t.Id == origenalTask.Id ); + filterExpression = filterExpression.And(t => t.Id == origenalTask.Id); break; case ReadingCategory.Judge: @@ -1840,7 +1848,7 @@ namespace IRaCIS.Core.Application.Service.Allocation { influenceTask.TaskState = TaskState.Adbandon; } - + } } @@ -2280,5 +2288,15 @@ namespace IRaCIS.Core.Application.Service.Allocation } + /// + /// 获取已影响的列表 + /// + /// + public async Task> GetInfluencedTaskList(Guid taskId) + { + var list = await _repository.Where(t => t.OriginalTaskId == taskId).Select(t => t.OriginalTask).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + return list; + } } }