From 2aef482fa7431fb47eef94081ff23ec220f89820 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期五, 24 一月 2025 09:10:31 +0800 Subject: [PATCH] 1 --- WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/SqlSugarAop.cs | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/SqlSugarAop.cs b/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/SqlSugarAop.cs index 3dd4ce7..f6babdd 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/SqlSugarAop.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/SqlSugarAop.cs @@ -31,7 +31,7 @@ } PropertyInfo propertyInfo = entityInfo.EntityColumnInfo.PropertyInfo; - SequenceAttirbute? sequenceAttirbute = propertyInfo.GetCustomAttribute<SequenceAttirbute>(); + SequenceAttribute? sequenceAttirbute = propertyInfo.GetCustomAttribute<SequenceAttribute>(); if (sequenceAttirbute != null) { if (propertyInfo.GetValue(entityInfo.EntityValue)?.ObjToInt() <= 0) @@ -100,6 +100,14 @@ } } } + + if (entityInfo.EntityValue is IBaseHistoryEntity baseHistoryEntity) + { + if (entityInfo.OperationType == DataFilterType.InsertByObject && entityInfo.PropertyName == nameof(IBaseHistoryEntity.InsertTime)) + { + baseHistoryEntity.InsertTime = DateTime.Now; + } + } } } } -- Gitblit v1.9.3