From de5fc7c27781b290ee905f7a1f825d92e7b74162 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 25 Jul 2024 10:12:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=97=A0=E5=BA=8F?= =?UTF-8?q?=E9=87=8D=E9=98=85=20=E5=92=8C=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/VisitTaskService.cs | 33 +++++++++++++++---- .../Allocation/AllocationRelation.cs | 4 ++- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index e9aeb5a17..dc1eeddb7 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1416,6 +1416,13 @@ namespace IRaCIS.Core.Application.Service.Allocation { task.ReReadingApplyState = ReReadingApplyState.DocotorHaveApplyed; + + //在PM 的申请重阅的影响列表里也不能申请重阅 + + var pmApply = await _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.TrialId == task.TrialId && t.OriginalReReadingTask.SubjectId == task.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect && t.OriginalReReadingTask.ReadingCategory == ReadingCategory.Visit + && t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.TrialGroupApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default).Include(t => t.OriginalReReadingTask).FirstOrDefaultAsync(); + + // 有序 if (criterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder) { @@ -1429,10 +1436,6 @@ namespace IRaCIS.Core.Application.Service.Allocation } - //在PM 的申请重阅的影响列表里也不能申请重阅 - - var pmApply = await _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.TrialId == task.TrialId && t.OriginalReReadingTask.SubjectId == task.SubjectId && t.OriginalReReadingTask.TaskState == TaskState.Effect && t.OriginalReReadingTask.ReadingCategory == ReadingCategory.Visit - && t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.TrialGroupApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default).Include(t => t.OriginalReReadingTask).FirstOrDefaultAsync(); if (pmApply != null) { @@ -1461,13 +1464,13 @@ namespace IRaCIS.Core.Application.Service.Allocation throw new BusinessValidationFailedException(_localizer["VisitTask_LastReading"]); } - if (task.ReadingCategory == ReadingCategory.Oncology && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Oncology))) + if (task.ReadingCategory == ReadingCategory.Oncology && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Oncology && t.ReadingTaskState==ReadingTaskState.HaveSigned))) { //---有序阅片,只允许申请该受试者阅片人最后一次完成肿瘤学任务重阅 throw new BusinessValidationFailedException(_localizer["VisitTask_LastOncologistRecheck"]); } - if (task.ReadingCategory == ReadingCategory.Judge && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Judge))) + if (task.ReadingCategory == ReadingCategory.Judge && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Judge && t.ReadingTaskState == ReadingTaskState.HaveSigned))) { //---有序阅片,只允许申请该受试者阅片人最后一次完成裁判的任务重阅 throw new BusinessValidationFailedException(_localizer["VisitTask_LastAdjudicatorRecheck"]); @@ -1476,6 +1479,22 @@ namespace IRaCIS.Core.Application.Service.Allocation } else { + + if (pmApply != null) + { + var originalTask = pmApply.OriginalReReadingTask; + + //PM 无序影响列表 + if (await _visitTaskRepository.Where(t => t.TrialId == originalTask.TrialId && t.SubjectId == originalTask.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.IsAnalysisCreate == false && t.TrialReadingCriterionId == originalTask.TrialReadingCriterionId ) + .Where(t=>t.Id==originalTask.Id||t.Id==originalTask.JudgeVisitTaskId) + .AnyAsync(t => t.VisitTaskNum == task.VisitTaskNum)) + { + //---当前为无序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_RandomInvalidRereading"]); + } + + } + //也要支持裁判重阅240701 if (task.ReadingCategory != ReadingCategory.Visit && task.ReadingCategory != ReadingCategory.Judge) @@ -1608,6 +1627,8 @@ namespace IRaCIS.Core.Application.Service.Allocation if ((origenalTask.TaskState != TaskState.Effect && origenalTask.TaskState != TaskState.Freeze)) { + await _visitTaskReReadingRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new VisitTaskReReading() { RequestReReadingConfirmUserId = _userInfo.Id, RequestReReadingResultEnum = RequestReReadingResult.Invalid }); + //---当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作 return ResponseOutput.NotOk(_localizer["VisitTask_ReapplyStatusConflict"]); } diff --git a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs index d5c6dec54..5159dd58a 100644 --- a/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs +++ b/IRaCIS.Core.Domain.Share/Allocation/AllocationRelation.cs @@ -368,7 +368,9 @@ namespace IRaCIS.Core.Domain.Share Agree = 1, - Reject = 2 + Reject = 2, + + Invalid = 3, } public enum ReReadingApplyState