diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 4b9fe806c..430ed0e2e 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -2055,11 +2055,12 @@ namespace IRaCIS.Application.Services { //重新算Id Guid studyId = IdentifierHelper.CreateGuid(item.TrialId.ToString(), find.StudyInstanceUid); - find.Id = studyId; + + //find.Id = studyId; var newStuty = _mapper.Map(find); - await _repository.AddAsync(newStuty); - //newStuty.Id = NewId.NextSequentialGuid(); + //await _repository.AddAsync(newStuty); + newStuty.Id = studyId; newStuty.SeqId = NewId.NextSequentialGuid(); newStuty.Code = currentNextCodeInt; @@ -2084,7 +2085,9 @@ namespace IRaCIS.Application.Services series.SubjectVisitId = item.SubjectVisitId; } - await _repository.AddRangeAsync(newSeriesList); + newStuty.SeriesList = newSeriesList; + + //await _repository.AddRangeAsync(newSeriesList); var newInstanceList = _mapper.Map>(find.InstanceList); @@ -2102,7 +2105,13 @@ namespace IRaCIS.Application.Services instance.SubjectId = item.SubjectId; instance.SubjectVisitId = item.SubjectVisitId; } - await _repository.AddRangeAsync(newInstanceList); + + var aa = newInstanceList.Where(t => t.SeqId == Guid.Parse("08dde5f4-2134-31e8-0242-c0a801000000")).ToList(); + + + newStuty.InstanceList = newInstanceList; + await _repository.AddAsync(newStuty); + //await _repository.AddRangeAsync(newInstanceList); } currentNextCodeInt++; diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs index ad1ba2867..59c1b7d59 100644 --- a/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs +++ b/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs @@ -162,6 +162,14 @@ public class AuditEntityInterceptor(IUserInfo _userInfo, if (entities.Count > 0) { + var a1= entities.Where(t=> typeof(DicomStudy).IsAssignableFrom(t.Entity.GetType())).ToList(); + var a2 = entities.Where(t => typeof(DicomSeries).IsAssignableFrom(t.Entity.GetType())).ToList(); + var a3 = entities.Where(t => typeof(DicomInstance).IsAssignableFrom(t.Entity.GetType())).ToList(); + + var list = a3 + .Where(t => ((DicomInstance)t.Entity).SeqId == Guid.Parse("08dde5f4-2134-31e8-0242-c0a801000000")) + .ToList(); + auditingData.InsertAddEntitys(entities).GetAwaiter().GetResult(); }