diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 8d13ba8d7..6e78b2a96 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -2205,15 +2205,7 @@ public class VisitTaskService(IRepository _visitTaskRepository, _ = _readingCustomTagRepository.AddRangeAsync(readingCustomTagList).Result; - var readingTaskQuestionMarkList = _readingTaskQuestionMarkRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList(); - - foreach (var item in readingTaskQuestionMarkList) - { - item.Id = Guid.Empty; - item.VisitTaskId = newTask.Id; - } - - _ = _readingTaskQuestionMarkRepository.AddRangeAsync(readingTaskQuestionMarkList).Result; + var readingTaskQuestionAnswerList = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList(); @@ -2225,6 +2217,15 @@ public class VisitTaskService(IRepository _visitTaskRepository, _ = _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskQuestionAnswerList).Result; + var readingTaskQuestionMarkList = _readingTaskQuestionMarkRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList(); + + foreach (var item in readingTaskQuestionMarkList) + { + item.Id = Guid.Empty; + item.VisitTaskId = newTask.Id; + } + + //ReadingTableAnswerRowInfo ReadingTableQuestionAnswer 一起加 var readingTableAnswerRowInfoList = _readingTableAnswerRowInfoRepository.Where(t => t.VisitTaskId == origenalTask.Id).Include(t => t.LesionAnswerList).ToList(); @@ -2235,7 +2236,14 @@ public class VisitTaskService(IRepository _visitTaskRepository, var originalVisitTaskId = item.VisitTaskId; var originalFristAddTaskId = item.FristAddTaskId; - item.Id = NewId.NextSequentialGuid(); + var newRowId= NewId.NextSequentialGuid(); + + foreach (var mark in readingTaskQuestionMarkList) + { + mark.RowId = mark.RowId == item.Id ? newRowId : mark.RowId; + } + + item.Id = newRowId; item.VisitTaskId = newTask.Id; //默认值是当前任务添加的 @@ -2250,6 +2258,7 @@ public class VisitTaskService(IRepository _visitTaskRepository, } } + _ = _readingTaskQuestionMarkRepository.AddRangeAsync(readingTaskQuestionMarkList).Result; _ = _readingTableAnswerRowInfoRepository.AddRangeAsync(readingTableAnswerRowInfoList).Result; diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index a53094fa6..5bb8ff5c3 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -56,6 +56,16 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task SetTrialQuestionExportResult(SetTrialQuestionExportResultInDto inDto) { + + var cDISCCodeList = inDto.QuestionList.Where(x => x.CDISCCode.IsNotNullOrEmpty()).Select(x => x.CDISCCode).ToList(); + + cDISCCodeList.AddRange(inDto.TableQuestionList.Where(x => x.CDISCCode.IsNotNullOrEmpty()).Select(x => x.CDISCCode).ToList()); + + if (cDISCCodeList.Distinct().Count() != cDISCCodeList.Count) + { + throw new BusinessValidationFailedException(_localizer["ReadingQuestion_CDISCCodeRepeat"]); + } + List needAdd = new List() { ExportResult.DetailedTableOfAdjudicationResults,