From 0c033617914e914b816664b49fbcb5943966f005 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Thu, 5 May 2022 11:22:43 +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.Application/IRaCIS.Core.Application.xml | 5 +++++ .../Service/Common/FrontAuditConfigService.cs | 2 +- IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs | 4 ++-- IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 466756478..79034df95 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -557,6 +557,11 @@ 外键Text + + + 接口名 + + SystemAnonymizationView 列表视图模型 diff --git a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs index 8a24b14bb..a027fa872 100644 --- a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs @@ -305,7 +305,7 @@ namespace IRaCIS.Core.Application.Service // CreateMap< FrontAuditConfig,FrontAuditConfigAddOrEdit>().ReverseMap(); - if (await _frontAuditConfigRepository.AnyAsync(x => x.Identification == addOrEditFrontAuditConfig.Identification && x.Id != addOrEditFrontAuditConfig.Id&&x.ConfigType=="M"&& addOrEditFrontAuditConfig.ConfigType== "M")) + if (await _frontAuditConfigRepository.AnyAsync(x =>x.Identification!=string.Empty&& x.Identification == addOrEditFrontAuditConfig.Identification && x.Id != addOrEditFrontAuditConfig.Id&&x.ConfigType=="M"&& addOrEditFrontAuditConfig.ConfigType== "M")) { return ResponseOutput.NotOk("标识重复"); } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 659cd893f..cc4b85772 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -53,7 +53,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertAddEntitys(entitys.Where(x => x.State == EntityState.Added).ToList(), "Add"); // 修改 - await InsertAddEntitys(entitys.Where(x => x.State == EntityState.Modified).ToList(), "Update"); + await InsertAddEntitys(entitys.Where(x => x.State == EntityState.Modified||x.State==EntityState.Unchanged).ToList(), "Update"); // 删除 await InsertAddEntitys(entitys.Where(x => x.State == EntityState.Deleted).ToList(), "Deleted"); @@ -133,7 +133,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = data.Entity as T; inspection = f(entity); } - inspection.Identification = $"{GetRequestUrl()}/{ data.GetType().ToString().Substring(data.GetType().ToString().LastIndexOf('.') + 1)}/{type}"; + inspection.Identification = $"{GetRequestUrl()}/{ data.Entity.GetType().ToString().Substring(data.Entity.GetType().ToString().LastIndexOf('.') + 1)}/{type}"; var originaldata = data.OriginalValues as T; if (originaldata != null) { diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 8712fc406..113492e0a 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -371,7 +371,7 @@ namespace IRaCIS.Core.Infra.EFCore public async Task AddAudit() { - var entities = ChangeTracker.Entries().Where(u => (u.State == EntityState.Modified || u.State == EntityState.Deleted || u.State == EntityState.Added)).Where(x => x.Entity.GetType() != typeof(DataInspection)).ToList(); + var entities = ChangeTracker.Entries().Where(u => (u.State == EntityState.Modified||u.State==EntityState.Unchanged || u.State == EntityState.Deleted || u.State == EntityState.Added)).Where(x => x.Entity.GetType() != typeof(DataInspection)).ToList(); AuditingData auditingData = new AuditingData(this, _userInfo); await auditingData.IncomingEntitys(entities); }