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 |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/SqlSugarAop.cs b/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/SqlSugarAop.cs
index e69682a..f6babdd 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/SqlSugarAop.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_Core/AOP/SqlSugarAop.cs
@@ -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