From 79e9b1c20bd604c637d4976327348dffddb5ce48 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 20 Jul 2022 13:03:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Allocation/VisitTaskHelpeService.cs | 72 ++++++------------- 1 file changed, 20 insertions(+), 52 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 8d6e99906..5e79252e4 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -733,61 +733,29 @@ namespace IRaCIS.Core.Application.Service case GenerateTaskCategory.Global: var originalTaskInfo = await _visitTaskRepository.Where(x => x.Id == generateTaskCommand.OriginalVisitId).FirstNotNullAsync(); - if (trialConfig.ReadingType == ReadingMethod.Double) + foreach (var item in generateTaskCommand.ReadingGenerataTaskList) { - foreach (var item in generateTaskCommand.ReadingGenerataTaskList) + + var task1 = await _visitTaskRepository.AddAsync(new VisitTask() { - //每个访视 根据项目配置生成任务 双审生成两个 - var task1 = await _visitTaskRepository.AddAsync(new VisitTask() - { - TrialId = trialId, - SubjectId = item.SubjectId, - IsUrgent = item.IsUrgent, - VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global], - TaskName = item.ReadingName, - DoctorUserId= originalTaskInfo.DoctorUserId, - ArmEnum = originalTaskInfo.ArmEnum,//特殊 - AllocateTime = DateTime.Now, - TaskAllocationState = TaskAllocationState.Allocated, - Code = currentMaxCodeInt + 1, - TaskBlindName = item.ReadingName, - SouceReadModuleId = item.ReadModuleId, - TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), - ReadingCategory = item.ReadingCategory - }); - - currentMaxCodeInt = currentMaxCodeInt + 1; - _provider.Set($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30)); - } - } - else - { - foreach (var item in generateTaskCommand.ReadingGenerataTaskList) - { - var singleTask = await _visitTaskRepository.AddAsync(new VisitTask() - { - TrialId = trialId, - SubjectId = item.SubjectId, - IsUrgent = item.IsUrgent, - TaskName = item.ReadingName, - VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global], - DoctorUserId = originalTaskInfo.DoctorUserId, - AllocateTime=DateTime.Now, - TaskAllocationState= TaskAllocationState.Allocated, - ArmEnum = originalTaskInfo.ArmEnum,//特殊 - Code = currentMaxCodeInt + 1, - SouceReadModuleId = item.ReadModuleId, - TaskBlindName = item.ReadingName, - TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), - ReadingCategory = item.ReadingCategory - }); + TrialId = trialId, + SubjectId = item.SubjectId, + IsUrgent = item.IsUrgent, + VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global], + TaskName = item.ReadingName, + DoctorUserId = originalTaskInfo.DoctorUserId, + ArmEnum = originalTaskInfo.ArmEnum,//特殊 + AllocateTime = DateTime.Now, + TaskAllocationState = TaskAllocationState.Allocated, + Code = currentMaxCodeInt + 1, + TaskBlindName = item.ReadingName, + SouceReadModuleId = item.ReadModuleId, + TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), + ReadingCategory = item.ReadingCategory + }); - singleTask.AllocateTime = DateTime.Now; - - currentMaxCodeInt = currentMaxCodeInt + 1; - - _provider.Set($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30)); - } + currentMaxCodeInt = currentMaxCodeInt + 1; + _provider.Set($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30)); } break; case GenerateTaskCategory.Oncology: