diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs index 1aab3c5b5..b8ce79b48 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs @@ -127,7 +127,10 @@ namespace IRaCIS.Core.Application.ViewModel public GenerateTaskCategory ReadingCategory { get; set; } - + /// + /// 原任务的Id + /// + public Guid OriginalVisitId { get; set; } //针对访视产生任务的 有用 public bool IsAssignSubjectToDoctor { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 9b8494e06..8d6e99906 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -732,6 +732,7 @@ namespace IRaCIS.Core.Application.Service //case ReadingCategory.ReadingPeriod: 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) @@ -744,28 +745,18 @@ namespace IRaCIS.Core.Application.Service IsUrgent = item.IsUrgent, VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global], TaskName = item.ReadingName, - ArmEnum = Arm.DoubleReadingArm1,//特殊 + 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 }); - var task2 = await _visitTaskRepository.AddAsync(new VisitTask() - { - TrialId = trialId, - SubjectId = item.SubjectId, - IsUrgent = item.IsUrgent, - VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global], - TaskName = item.ReadingName, - ArmEnum = Arm.DoubleReadingArm2,//特殊 - Code = currentMaxCodeInt + 2, - TaskBlindName = item.ReadingName, - SouceReadModuleId = item.ReadModuleId, - TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 2, nameof(VisitTask)), - ReadingCategory = item.ReadingCategory - }); - currentMaxCodeInt = currentMaxCodeInt + 2; + + currentMaxCodeInt = currentMaxCodeInt + 1; _provider.Set($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30)); } } @@ -780,7 +771,10 @@ namespace IRaCIS.Core.Application.Service IsUrgent = item.IsUrgent, TaskName = item.ReadingName, VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global], - ArmEnum = Arm.SingleReadingArm, //特殊 + DoctorUserId = originalTaskInfo.DoctorUserId, + AllocateTime=DateTime.Now, + TaskAllocationState= TaskAllocationState.Allocated, + ArmEnum = originalTaskInfo.ArmEnum,//特殊 Code = currentMaxCodeInt + 1, SouceReadModuleId = item.ReadModuleId, TaskBlindName = item.ReadingName, diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 9d2d77637..f2e492026 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -871,7 +871,7 @@ namespace IRaCIS.Application.Services //needReadList = needReadList.Where(x => _visitTaskRepository.Where(y => y.SouceReadModuleId == x.ReadModuleId).Count() == 0).ToList(); await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand() { - + OriginalVisitId= visitTaskId, ReadingCategory = GenerateTaskCategory.Global, TrialId = taskInfo.TrialId, ReadingGenerataTaskList = needReadList diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index 3fa9525ab..8d011af22 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -61,7 +61,9 @@ namespace IRaCIS.Core.Domain.Models [Required] public Arm ArmEnum { get; set; } - //分配状态 + /// + /// 分配状态 + /// public TaskAllocationState TaskAllocationState { get; set; }