From 017d8fac2412a1b061440b55447494ae46f2bfe9 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 29 Sep 2022 16:05:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DTO/TaskConsistentRuleViewModel.cs | 2 ++ .../Allocation/DTO/VisitTaskViewModel.cs | 9 ++++++--- .../Allocation/VisitTaskHelpeService.cs | 2 +- .../Service/Allocation/VisitTaskService.cs | 20 +++++++++---------- .../Service/Allocation/_MapConfig.cs | 2 +- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs index cd47a86f2..4e09eae88 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs @@ -211,6 +211,8 @@ namespace IRaCIS.Core.Application.ViewModel public bool? IsSelfAnalysis { get; set; } + public string TrialReadingCriterionName { get; set; } + } diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index bb234a51e..7c05491b8 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -423,10 +423,8 @@ namespace IRaCIS.Core.Application.ViewModel public class CancelSubjectAssignedDoctorCommand { public Guid Id { get; set; } - public Guid TrialId { get; set; } - [NotDefault] - public Guid TrialReadingCriterionId { get; set; } + public Guid SubjectId { get; set; } public Guid DoctorUserId { get; set; } public Arm ArmEnum { get; set; } @@ -439,6 +437,11 @@ namespace IRaCIS.Core.Application.ViewModel public class CancelSubjectDoctorCommand { + [NotDefault] + public Guid TrialId { get; set; } + + [NotDefault] + public Guid TrialReadingCriterionId { get; set; } public List CancelList { get; set; } public string Note { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 223ab8c64..2b618a4ae 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -577,7 +577,7 @@ namespace IRaCIS.Core.Application.Service var newTask = await _visitTaskRepository.AddAsync(new VisitTask() { - + TrialReadingCriterionId=reReadingVisitTask.TrialReadingCriterionId, TrialId = reReadingVisitTask.TrialId, SubjectId = reReadingVisitTask.SubjectId, diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index a73e6d9d0..24d5f11cc 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -189,14 +189,14 @@ namespace IRaCIS.Core.Application.Service.Allocation { foreach (var command in cancelCommand.CancelList.Where(t => t.IsCancelAssign)) { - if (await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId==command.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState != ReadingTaskState.WaitReading)) + if (await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId== cancelCommand.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState != ReadingTaskState.WaitReading)) { throw new BusinessValidationFailedException("当前医生已开始做该Subject 该标准的任务,不允许取消分配"); } await _subjectUserRepository.DeleteFromQueryAsync(t => t.Id == command.Id); - await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.TrialReadingCriterionId==command.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState == ReadingTaskState.WaitReading && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false, u => new VisitTask() + await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.TrialReadingCriterionId== cancelCommand.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState == ReadingTaskState.WaitReading && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false, u => new VisitTask() { AllocateTime = null, DoctorUserId = null, @@ -1432,9 +1432,6 @@ namespace IRaCIS.Core.Application.Service.Allocation } - - - Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == origenalTask.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated; //是否是一致性分析任务 正常申请 会影响一致性分析任务 @@ -1483,7 +1480,7 @@ namespace IRaCIS.Core.Application.Service.Allocation - //PM申请 SPM / CPM审批 回退访视,在此不生成访视任务 + //PM申请 SPM / CPM审批 回退访视,在此不生成访视任务 影响多个标准的任务 if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.TrialGroupApply && (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM)) { @@ -1685,8 +1682,8 @@ namespace IRaCIS.Core.Application.Service.Allocation //IR申请 PM 审批 注意这里有一致性分析的申请同意 不会回退访视,在此要生成影响的访视任务 else if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.DocotorApply && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) { - - + //影响申请标准的任务 + filterExpression = filterExpression.And(t => t.TrialReadingCriterionId==origenalTask.TrialReadingCriterionId); //有序阅片 if (trialConfig.IsReadingTaskViewInOrder) @@ -2368,7 +2365,7 @@ namespace IRaCIS.Core.Application.Service.Allocation var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.IsReadingTaskViewInOrder, t.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException(); - Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated; + Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated; //是否是一致性分析任务 (一致性分析的任务 不会产生裁判 肿瘤学 仅仅有生成的访视和全局) @@ -2377,7 +2374,8 @@ namespace IRaCIS.Core.Application.Service.Allocation //重阅影响 if (isReReading) { - + + filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId); //IR 申请 PM 同意 仅仅影响自己 @@ -2521,7 +2519,7 @@ namespace IRaCIS.Core.Application.Service.Allocation } - //退回影响 仅仅针对是访视类型的 + //退回影响 仅仅针对是访视类型的 影响多个标准的任务 else { diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index e622aeed9..c8575d992 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -269,7 +269,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)); CreateMap() - //.ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.DoctorUser)) + .ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName)) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)) .ForMember(o => o.OptType, t => t.Ignore());