From 1560a0278e7ebf4806a39463d0b0f5a07f89b95a Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Sun, 27 Apr 2025 13:05:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs | 2 +- IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs | 5 +++++ IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 12 ++++++------ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs b/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs index d5935d293..3c146fb3c 100644 --- a/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs +++ b/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs @@ -46,7 +46,7 @@ /// /// 稽查额外字符串 /// - string? AuditIdentification { get; set; } + string AuditIdentification { get; set; } bool IsNotNeedInspection { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs b/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs index 099baccea..1d991238c 100644 --- a/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs +++ b/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs @@ -318,6 +318,11 @@ namespace IRaCIS.Core.Domain.Share /// 是否不需要记录稽查 /// public bool IsNotNeedInspection { get; set; } = false; + + /// + /// 稽查额外字符串 + /// + public string AuditIdentification { get; set; } = string.Empty; } public static class ClaimAttributes diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 44b123a71..4b30a1f6d 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -3228,7 +3228,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common u.ShowOrder } ).OrderBy(t => t.ShowOrder).ToList() - }); + },_userInfo.AuditIdentification); ////添加/修改病灶接口 只会对单个病灶进行操作 @@ -3671,7 +3671,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// 表达式 /// 其他对象 /// - public async Task InsertInspection(T entityObj, string type, Expression> expression = null, object otherItem = null) where T : Entity + public async Task InsertInspection(T entityObj, string type, Expression> expression = null, object otherItem = null,string auditIdentification = "") where T : Entity { InspectionConvertDTO inspection = new InspectionConvertDTO(); @@ -3688,7 +3688,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id; inspection.GeneralId = generalId; - inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine) + inspection.ExtraIndentification; + inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine, auditIdentification) + inspection.ExtraIndentification; //将实体对象属性 映射到稽查实体 MapEntityPropertyToAuditEntity(entityObj, inspection); @@ -3898,7 +3898,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// 获取稽查记录的标识符 部分业务会进行特殊处理 /// /// - public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false) + public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false,string auditIdentification="") { //var entityType = _dbContext.Model.FindEntityType(entityObj.GetType()); //var tableName = entityType.GetTableName(); @@ -3940,9 +3940,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common } - if (_userInfo.AuditIdentification != null) + if (auditIdentification.IsNotNullOrEmpty()) { - result = result + "/" + _userInfo.AuditIdentification; + result = result + "/" + auditIdentification; } return result;