From 80b3defd374c3fa89d3a04922b5f65e454ae8e5d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 18 May 2026 17:57:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=8Epacs=20=E6=B7=BB=E5=8A=A0=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Visit/PatientService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 80b8057e8..026b02280 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -412,7 +412,7 @@ namespace IRaCIS.Core.Application.Service using (await @lock.AcquireAsync()) { - var dbStudyCodeIntMax = _dicomStudyRepository.Where(s => s.TrialId == inCommand.TrialId).Select(t => t.Code).DefaultIfEmpty().Max(); + var dbStudyCodeIntMax = _trialRepository.Where(s => s.Id == trialId, ignoreQueryFilters: true).Select(t => t.MaxDicomCode).DefaultIfEmpty().Max(); int currentNextCodeInt = dbStudyCodeIntMax + 1; @@ -469,7 +469,7 @@ namespace IRaCIS.Core.Application.Service //回更StudyCode await _fileUploadRecordRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.Path.Contains(newStuty.StudyInstanceUid), u => new FileUploadRecord() { StudyCode = studyCode, SubjectId = newStuty.SubjectId, SubjectVisitId = newStuty.SubjectVisitId }); - + await _trialRepository.BatchUpdateNoTrackingAsync(t => t.Id == trialId, u => new Trial() { MaxDicomCode = currentNextCodeInt }); await _scpPatientRepository.BatchUpdateNoTrackingAsync(t => t.Id == find.SCPStudy.PatientId, u => new SCPPatient() { SubjectId = subjectId }); await _scpStudyRepository.BatchUpdateNoTrackingAsync(t => t.Id == scpStudyId, u => new SCPStudy() { SubjectVisitId = subjectVisitId });