diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 6a2f5d6ef..fe970ad63 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -4179,11 +4179,6 @@ 病灶类型 - - - 病灶类型 - - OrganInfoAddOrEdit 列表查询参数模型 diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 42c184a08..093869c77 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -195,7 +195,7 @@ namespace IRaCIS.Core.Application.Service var currentInspection = await _dataInspectionRepository.Where(t => t.Id == id).Select(t => new { t.GeneralId, t.ObjectRelationParentId, t.CreateTime }).FirstOrDefaultAsync(); - var beforeId = await _dataInspectionRepository.Where(x => x.GeneralId == currentInspection.GeneralId /*&& x.ObjectRelationParentId == currentInspection.ObjectRelationParentId*/ && x.CreateTime <= currentInspection.CreateTime && x.Id != id).OrderByDescending(x => x.CreateTime).Select(t => t.Id) + var beforeId = await _dataInspectionRepository.Where(x => x.GeneralId == currentInspection.GeneralId && x.CreateTime <= currentInspection.CreateTime && x.Id != id).OrderByDescending(x => x.CreateTime).Select(t => t.Id) .FirstOrDefaultAsync(); List searchGuidList = new List() { id }; @@ -250,7 +250,7 @@ namespace IRaCIS.Core.Application.Service var objectLsit = new List(); - var commonDataObjList = await GetRelationParentData( item.Id,item.ObjectRelationParentId, item.ObjectRelationParentId2, item.CreateTime, item.BatchId, objectLsit); + var commonDataObjList = await GetRelationParentData(item.Id, item.ObjectRelationParentId, item.ObjectRelationParentId2, item.CreateTime, item.BatchId, objectLsit); @@ -330,9 +330,24 @@ namespace IRaCIS.Core.Application.Service str2 = await SetEnum(dto.TrialId, listIdentification, str2); str2 = await SetDataInspectionDateType(listIdentification, str2); - jsonDict[nameof(InspectionJsonDetail.CommonData)] = JsonConvert.DeserializeObject(str2); + //jsonDict[nameof(InspectionJsonDetail.CommonData)] = JsonConvert.DeserializeObject(str2); #endregion + //后续移除 避免前端看到的不统一 因为采用了新的关联方式,之前数据在Data里面取 现在配置在CommonData 里取 + + var dataDic = JsonConvert.DeserializeObject>(str); + var commonDic= JsonConvert.DeserializeObject>(str2); + foreach (var valuePair in dataDic) + { + if (!commonDic.ContainsKey(valuePair.Key)) + { + commonDic.Add(valuePair.Key, valuePair.Value); + } + } + + jsonDict[nameof(InspectionJsonDetail.CommonData)] = JsonConvert.DeserializeObject(commonDic.ToJsonStr()); + + item.JsonStr = JsonConvert.SerializeObject(jsonDict); } @@ -359,7 +374,7 @@ namespace IRaCIS.Core.Application.Service if (objectRelationParentId != null) { //父子层级的数据可能在同一个批次 进行更新 但是后插入的是父层级的数据 找父层级的稽查应该优先同一批次的 - var relationParentInspection = await _dataInspectionRepository.Where(t => t.GeneralId == objectRelationParentId && (t.CreateTime <= createTime || t.BatchId == batchId) && t.Id !=id).OrderByDescending(x => x.CreateTime).Select(t => new { t.ObjectRelationParentId, t.CreateTime, t.JsonDetail, t.BatchId, t.ObjectRelationParentId2, t.EntityName ,t.Id}).FirstOrDefaultAsync(); + var relationParentInspection = await _dataInspectionRepository.Where(t => t.GeneralId == objectRelationParentId && (t.CreateTime <= createTime || t.BatchId == batchId) && t.Id != id).OrderByDescending(x => x.CreateTime).Select(t => new { t.ObjectRelationParentId, t.CreateTime, t.JsonDetail, t.BatchId, t.ObjectRelationParentId2, t.EntityName, t.Id }).FirstOrDefaultAsync(); if (relationParentInspection != null) @@ -396,7 +411,7 @@ namespace IRaCIS.Core.Application.Service - await AddJsonObjectToDic(relationParentInspection.Id, relationParentInspection.ObjectRelationParentId, relationParentInspection.CreateTime, relationParentInspection.BatchId, objectLsit); + await AddJsonObjectToDic(relationParentInspection.Id, relationParentInspection.ObjectRelationParentId, relationParentInspection.CreateTime, relationParentInspection.BatchId, objectLsit); await AddJsonObjectToDic(relationParentInspection.Id, relationParentInspection.ObjectRelationParentId2, relationParentInspection.CreateTime, relationParentInspection.BatchId, objectLsit); } @@ -407,7 +422,7 @@ namespace IRaCIS.Core.Application.Service var userObj = await _repository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.FullName, t.Phone, t.UserName, UserType = t.UserTypeRole.UserTypeShortName, t.EMail, t.OrganizationName }).FirstOrDefaultAsync(); - if(userObj != null) + if (userObj != null) { objectLsit.Add(userObj); @@ -418,11 +433,11 @@ namespace IRaCIS.Core.Application.Service } - - private async Task> GetRelationParentData(Guid id,Guid? objectRelationParentId, Guid? objectRelationParentId2, DateTime createTime, Guid batchId, List objectLsit) + + private async Task> GetRelationParentData(Guid id, Guid? objectRelationParentId, Guid? objectRelationParentId2, DateTime createTime, Guid batchId, List objectLsit) { - await AddJsonObjectToDic(id,objectRelationParentId, createTime, batchId, objectLsit); - await AddJsonObjectToDic(id,objectRelationParentId2, createTime, batchId, objectLsit); + await AddJsonObjectToDic(id, objectRelationParentId, createTime, batchId, objectLsit); + await AddJsonObjectToDic(id, objectRelationParentId2, createTime, batchId, objectLsit); #region 废弃 //if (objectRelationParentId != null) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index bb33333c4..279e56a02 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -824,24 +824,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingClinicalData))) { - var entity = item.Entity as ReadingClinicalData; - - if (entity.ClinicalDataTrialSet == null && entity.ClinicalDataTrialSetId != Guid.Empty) - { - entity.ClinicalDataTrialSet = await _dbContext.ClinicalDataTrialSet.FindAsync(entity.ClinicalDataTrialSetId); - } - + var entity = item.Entity as ReadingClinicalData; await InsertInspection(item.Entity as ReadingClinicalData, type, x => new InspectionConvertDTO() { SubjectVisitId = x.IsVisit ? x.ReadingId : null, ObjectRelationParentId = entity.ClinicalDataTrialSetId, - }, new - { - entity.ClinicalDataTrialSet.ClinicalUploadType, - entity.ClinicalDataTrialSet.ClinicalDataSetName, - entity.ClinicalDataTrialSet.ClinicalDataLevel, }); }