From d42c8477aaa6e45661f9db60837cf97606cc295f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 7 Mar 2024 09:26:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=AA=8C=E8=AF=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/TaskConsistentRuleService.cs | 10 ++++++++++ .../ReadingCalculate/LuganoCalculateService.cs | 12 +++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs index f07af24dc..9a5434305 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs @@ -166,6 +166,11 @@ namespace IRaCIS.Core.Application.Service throw new BusinessValidationFailedException(_localizer["TaskConsistent_NotAllowedGenerate"]); } + if (subjectList.Count<2 * filterObj.PlanSubjectCount) + { + throw new BusinessValidationFailedException(_localizer["TaskConsistent_NotAllowedGenerate1"]); + } + inCommand.SubejctIdList = GetRandomSubjectIdList(subjectList.Select(t => t.SubjectId).ToList(), filterObj.PlanSubjectCount); } @@ -328,6 +333,11 @@ namespace IRaCIS.Core.Application.Service throw new BusinessValidationFailedException(_localizer["TaskConsistent_NotAllowedGenerate"]); } + if (subjectSelectList.Count< 2 * filterObj.PlanSubjectCount) + { + throw new BusinessValidationFailedException(_localizer["TaskConsistent_NotAllowedGenerate1"]); + } + inCommand.SubejctIdList = GetRandomSubjectIdList(subjectSelectList.Select(t => t.SubjectId).ToList(), filterObj.PlanSubjectCount); } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 6490fd157..a3889090e 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -1335,10 +1335,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var addList = _mapper.Map>(tableRowAnswers); - await _readingTaskQuestionMarkRepository.AddRangeAsync(questionMarkList); + //await _readingTaskQuestionMarkRepository.AddRangeAsync(questionMarkList); await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList); - await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); - await _readingTableQuestionAnswerRepository.SaveChangesAsync(); + + foreach (var item in addList) + { + item.MergeRow = null; + item.SplitRow = null; + } + //await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); + await _readingTableQuestionAnswerRepository.SaveChangesAsync(); } }