From b79e5c1e09367790c952173f825210aa807d75a8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 17 Jun 2022 17:48:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/DTO/TaskAllocationRuleViewModel.cs | 2 +- .../Service/Allocation/VisitTaskHelpeService.cs | 5 ++++- IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs index f52c4735..42f1dc75 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs @@ -49,7 +49,7 @@ namespace IRaCIS.Core.Application.ViewModel //该医生已应用的任务数 - public int? SelfTaskCount { get; set; } + public int? SelfApplyedTaskCount { get; set; } //已分配但是未读片签名的数量 public int? SelfUndoTaskCount { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index fe195be1..6a9aede3 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -119,6 +119,10 @@ namespace IRaCIS.Core.Application.Service if (trialConfig.IsFollowVisitAutoAssign) { + var allocateSubjectArmList = _visitTaskRepository.Where(t => t.SubjectId == subjectVisit.SubjectId && t.TrialId == subjectVisit.TrialId && t.DoctorUserId != null).Select(t => new { t.DoctorUserId, t.ArmEnum }).Distinct().ToList(); + + + var defaultState = trialConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskState.InitAllocated : TaskState.Allocated; @@ -128,7 +132,6 @@ namespace IRaCIS.Core.Application.Service #region 验证历史任务 - var allocateSubjectArmList = _visitTaskRepository.Where(t => t.SubjectId == subjectVisit.SubjectId && t.TrialId == subjectVisit.TrialId && t.DoctorUserId != null).Select(t => new { t.DoctorUserId, t.ArmEnum }).Distinct().ToList(); //不是初次分配 直接分配给Subject 之前的医生 diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index a689156e..61f35bdc 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -34,7 +34,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.SelfUndoTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId == u.DoctorUserId && t.ReadingTaskState != ReadingTaskState.HaveSigned))) - .ForMember(o => o.SelfTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId == u.DoctorUserId))) + .ForMember(o => o.SelfApplyedTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId == u.DoctorUserId))) .ForMember(o => o.TotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count())) .ForMember(o => o.ApplyedTotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count(c => c.SubjectVisitTaskList.Any(d => d.DoctorUserId !=null)))) .ForMember(o => o.WaitApplyTotalSubjectCount, t => t.MapFrom(u =>