From ebd70e2202969d9c9c0e6c08ebc79a2fe806b61d Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Mon, 16 Jun 2025 15:59:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BA=86=E8=A3=81=E5=88=A4?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=20=E9=98=85=E7=89=87=E6=9C=9F=E4=B8=8D?= =?UTF-8?q?=E8=AE=A9=E5=88=A0=E9=99=A4=E5=92=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingPeriod/ReadModuleService.cs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs index 51e661adf..ffdf23c5d 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs @@ -97,6 +97,29 @@ namespace IRaCIS.Core.Application.Service throw new BusinessValidationFailedException(_localizer["ReadModule_CRCConfirmCanNtoEdit"]); } + var readModule = await _readModuleRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync(); + + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new + { + x.ReadingType, + x.IsArbitrationReading, + x.IsReadingPeriod, + x.ArbitrationRule, + x.IsGlobalReading, + x.IsOncologyReading, + }).FirstNotNullAsync(); + + // 如果生成了 访视级别的阅片期裁判 不让修改 + if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading) + { + if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge)) + { + //---当前阅片已生成裁判任务,操作失败。 + throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]); + } + } + + await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new ReadModule() { SubjectVisitId = inDto.SubjectVisitIdId, @@ -1078,6 +1101,15 @@ namespace IRaCIS.Core.Application.Service var readModule = await _readModuleRepository.Where(x => x.Id == readModuleId).FirstNotNullAsync(); + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new + { + x.ReadingType, + x.IsArbitrationReading, + x.IsReadingPeriod, + x.ArbitrationRule, + x.IsGlobalReading, + x.IsOncologyReading, + }).FirstNotNullAsync(); if (await _readingClinicalDataRepository.Where(t => t.ReadingId == readModuleId).AnyAsync(t => t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned)) { @@ -1106,6 +1138,17 @@ namespace IRaCIS.Core.Application.Service throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]); } + // 如果生成了 访视级别的阅片期裁判 不让删除 + if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading) + { + if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge)) + { + //---当前阅片已生成裁判任务,操作失败。 + throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]); + } + } + + await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => readModuleId == x.SouceReadModuleId, x => new VisitTask() {