diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 0f99f9b17..04289e154 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -285,19 +285,44 @@ namespace IRaCIS.Core.Application.Service } - item.JsonStr = jsonDict[nameof(InspectionJsonDetail.Data)].ToString(); - if (item.Identification == string.Empty || item.JsonStr == string.Empty) + #region Old + //item.JsonStr = jsonDict[nameof(InspectionJsonDetail.Data)].ToString(); + //if (item.Identification == string.Empty || item.JsonStr == string.Empty) + //{ + // continue; + //} + //item.JsonStr = await GetInspectionEnumValue(listIdentification, item.JsonStr); + //item.JsonStr = await SetEnum(dto.TrialId, listIdentification, item.JsonStr); + //item.JsonStr = await SetDataInspectionDateType(listIdentification, item.JsonStr); + + //jsonDict[nameof(InspectionJsonDetail.Data)] = JsonConvert.DeserializeObject(item.JsonStr); + #endregion + + #region New + + var str = jsonDict[nameof(InspectionJsonDetail.Data)].ToString(); + if (item.Identification == string.Empty || str == string.Empty) { continue; } - item.JsonStr = await GetInspectionEnumValue(listIdentification, item.JsonStr); - item.JsonStr = await SetEnum(dto.TrialId, listIdentification, item.JsonStr); - item.JsonStr = await SetDataInspectionDateType(listIdentification, item.JsonStr); + str = await GetInspectionEnumValue(listIdentification, str); + str = await SetEnum(dto.TrialId, listIdentification, str); + str = await SetDataInspectionDateType(listIdentification, str); + + jsonDict[nameof(InspectionJsonDetail.Data)] = JsonConvert.DeserializeObject(str); + var str2 = jsonDict[nameof(InspectionJsonDetail.CommonData)].ToJsonStr(); + if (item.Identification == string.Empty || str2 == string.Empty) + { + continue; + } + str2 = await GetInspectionEnumValue(listIdentification, str2); + str2 = await SetEnum(dto.TrialId, listIdentification, str2); + str2 = await SetDataInspectionDateType(listIdentification, str2); - - jsonDict[nameof(InspectionJsonDetail.Data)] = JsonConvert.DeserializeObject(item.JsonStr); + jsonDict[nameof(InspectionJsonDetail.CommonData)] = JsonConvert.DeserializeObject(str2); + #endregion item.JsonStr = JsonConvert.SerializeObject(jsonDict); } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 426bbffe3..4413d5143 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1089,7 +1089,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common EntityName = entityName, - Data = entityObj, + //后期通过关联 就不需要把 OtherItem 并入到Data中 + Data = AddJsonItem(entityObj, otherItem) , CommonData = AddJsonItem(generalData, otherItem)