From 711fa5a2b8b272d8d93ca14fe5330afe96529aca Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Fri, 12 Dec 2025 16:58:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 4abdb083d..b819a7b5b 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1979,7 +1979,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(entity, type, x => new InspectionConvertDTO() { SubjectId = x.Id, - + Reason= entity.SuspendReason, TrialSiteId = x.TrialSiteId, //项目的信息 找离的最近的项目稽查信息 @@ -4204,6 +4204,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common inspection = f(entityObj); } + var reason = inspection.Reason; //避免重复赋值 有些特殊的GeneralId var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id; @@ -4217,6 +4218,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //var generalData = await GetInspectionGeneralDataAsync(inspection); var generalData = await GetInspectionGeneralGuidAsync(inspection); + //不可少 因为稽查实体可能某些Id没有 MapEntityPropertyToAuditEntity(generalData, inspection); @@ -4276,11 +4278,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common CommonData = new { SiteCode = generalData.SiteCode, SubjectCode = generalData.SubjectCode }, }.ToJsonStr(); - inspection.BatchId = _userInfo.BatchId.Value; inspection.EntityName = entityName; + inspection.Reason=inspection.Reason==string.Empty&&reason!=string.Empty?reason:inspection.Reason; await _dbContext.DataInspection.AddAsync(inspection); From 064101b155ff395f94be84d97979241639d126c8 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Mon, 15 Dec 2025 10:51:52 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A8=BD=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/ReadingImageTask/ReadingImageTaskService.cs | 2 +- IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index a1db67038..b7c67088f 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1978,7 +1978,7 @@ namespace IRaCIS.Core.Application.Service SplitOrMergeType = SplitOrMergeType.Merge, }); - await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(inDto.MergeMainRowId, x => new ReadingTableAnswerRowInfo() + await _readingTableAnswerRowInfoRepository.BatchUpdateNoTrackingAsync(x=>x.Id== inDto.MergeMainRowId, x => new ReadingTableAnswerRowInfo() { SplitOrMergeType = SplitOrMergeType.MergeMain, }); diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index b819a7b5b..ffb0417ec 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -3896,12 +3896,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common //if (_userInfo.RequestUrl == " ReadingImageTask/splitLesion") var originalRowMark = string.Empty; + var mergeRowMark = string.Empty; if (entity.SplitRowId != null) { originalRowMark = await _dbContext.ReadingTableAnswerRowInfo.Where(t => t.Id == entity.SplitRowId).Select(t => t.RowMark).FirstOrDefaultAsync(); } + if (entity.MergeRowId != null) + { + + mergeRowMark = await _dbContext.ReadingTableAnswerRowInfo.Where(t => t.Id == entity.MergeRowId).Select(t => t.RowMark).FirstOrDefaultAsync(); + } + //处理标识 因为触发器在稽查后才进行操作 entity.OrderMark = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == entity.QuestionId).Select(x => x.OrderMark).FirstOrDefaultAsync(); @@ -3939,6 +3946,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common }, new { OriginalRowMark = originalRowMark, + MergeRowMark= mergeRowMark, //TableName = tableName, QuestionAnswerList = From 7a84eebf980b63bd5fbf9c64840899106e8e41a0 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 16 Dec 2025 09:04:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E7=97=85=E7=81=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingCalculate/IRECIST1Point1CalculateService.cs | 6 +++--- .../Service/ReadingCalculate/LuganoCalculateService.cs | 2 ++ .../ReadingCalculate/LuganoWithoutPETCalculateService.cs | 2 +- .../Service/ReadingCalculate/MRECISTHCCCalculateService.cs | 4 ++-- .../Service/ReadingCalculate/PCWG3CalculateService.cs | 2 +- .../ReadingCalculate/RECIST1Point1CalculateService.cs | 2 +- .../ReadingCalculate/RECIST1Point1_BMCalculateService.cs | 4 ++-- .../Service/ReadingCalculate/SelfDefineCalculateService.cs | 7 ++++++- 8 files changed, 18 insertions(+), 11 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index e9ac5155d..b1cb82bec 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -704,7 +704,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { var visitTaskId = inDto.VisitTaskId; - var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).ProjectTo(_mapper.ConfigurationProvider).FirstNotNullAsync(); + var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync(); var baseLineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskinfo.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstOrDefaultAsync(); @@ -790,13 +790,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate TableQuestionId = x.TableQuestionId, TrialId = x.TrialId, VisitTaskId = visitTaskId, - }); + }).ToList(); var addList = _mapper.Map>(tableRowAnswers); - + await _generalCalculateService.CopyHistoryAnswer(taskinfo, addList, tableAnswers); await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList); await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); await _readingTableQuestionAnswerRepository.SaveChangesAsync(); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 86294b8f0..1102a37e8 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -1245,6 +1245,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var addList = _mapper.Map>(tableRowAnswers).OrderBy(x => x.RowIndex).ToList(); + await _generalCalculateService.CopyHistoryAnswer(taskinfo, addList, tableAnswers); + foreach (var item in addList) { await _readingTableAnswerRowInfoRepository.AddAsync(item); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs index 80e2f74ee..f4e00df13 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs @@ -1244,7 +1244,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var addList = _mapper.Map>(tableRowAnswers).OrderBy(x => x.RowIndex).ToList(); - + await _generalCalculateService.CopyHistoryAnswer(taskinfo, addList, tableAnswers); foreach (var item in addList) { await _readingTableAnswerRowInfoRepository.AddAsync(item); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs index 77e516d4c..5217b83ae 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/MRECISTHCCCalculateService.cs @@ -591,13 +591,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate TableQuestionId = x.TableQuestionId, TrialId = x.TrialId, VisitTaskId = visitTaskId, - }); + }).ToList(); var addList = _mapper.Map>(tableRowAnswers); - + await _generalCalculateService.CopyHistoryAnswer(taskinfo, addList, tableAnswers); await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList); await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); await _readingTableQuestionAnswerRepository.SaveChangesAsync(); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index 3b3da96ad..8017ddb37 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -488,7 +488,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var addList = _mapper.Map>(tableRowAnswers); - + await _generalCalculateService.CopyHistoryAnswer(taskinfo, addList, tableAnswers); await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList); await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); await _readingTableQuestionAnswerRepository.SaveChangesAsync(); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index 66379bbe9..ae4f7325f 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -601,7 +601,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var addList = _mapper.Map>(tableRowAnswers); - await _generalCalculateService.CopyHistoryAnswer(taskinfo, addList, tableAnswers); + await _generalCalculateService.CopyHistoryAnswer(taskinfo, addList, tableAnswers); await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList); await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs index cb3934cc9..1789cbf3c 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs @@ -594,13 +594,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate TableQuestionId = x.TableQuestionId, TrialId = x.TrialId, VisitTaskId = visitTaskId, - }); + }).ToList(); var addList = _mapper.Map>(tableRowAnswers); - + await _generalCalculateService.CopyHistoryAnswer(taskinfo, addList, tableAnswers); await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList); await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); await _readingTableQuestionAnswerRepository.SaveChangesAsync(); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs index b11cd4f57..8701ab1f7 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs @@ -157,6 +157,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { var visitTaskId = inDto.VisitTaskId; var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync(); + var trialReadingCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).FirstNotNullAsync(); var isReadingTaskViewInOrder = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).Select(x => x.IsReadingTaskViewInOrder).FirstOrDefaultAsync(); var baseLineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskinfo.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstOrDefaultAsync(); @@ -298,7 +299,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } } - + if(trialReadingCriterion.IsOncologyReading) + { + await _generalCalculateService.CopyHistoryAnswer(taskinfo, addRowList, addTableQuestionAnswerList); + } + await _readingTableAnswerRowInfoRepository.AddRangeAsync(addRowList); await _readingTableQuestionAnswerRepository.AddRangeAsync(addTableQuestionAnswerList); await _readingTableQuestionAnswerRepository.SaveChangesAsync();