From 37454e625df68d40897112b2e8c2e3cf4d7163e3 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期三, 25 三月 2026 11:43:10 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs"
index 14b05f2..ecf2a9c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs"
@@ -72,7 +72,14 @@
                 }
             }
 
-            if (entityInfo.EntityValue is BaseEntity baseEntity)
+            if (entityInfo.EntityValue is BaseEntity entity && entityInfo.EntityValue is IBaseHistoryEntity historyEntity)
+            {
+                if (entityInfo.OperationType == DataFilterType.InsertByObject && entityInfo.PropertyName == nameof(BaseEntity.CreateDate))
+                {
+                    historyEntity.InsertTime = DateTime.Now;
+                }
+            }
+            else if (entityInfo.EntityValue is BaseEntity baseEntity)
             {
                 // 鏂板鎿嶄綔
                 if (entityInfo.OperationType == DataFilterType.InsertByObject && entityInfo.PropertyName == nameof(BaseEntity.CreateDate))
@@ -96,14 +103,6 @@
                             baseEntity.Creater = App.User.UserName;
                             break;
                     }
-                }
-            }
-
-            if (entityInfo.EntityValue is IBaseHistoryEntity baseHistoryEntity)
-            {
-                if (entityInfo.OperationType == DataFilterType.InsertByObject && entityInfo.PropertyName == nameof(IBaseHistoryEntity.InsertTime))
-                {
-                    baseHistoryEntity.InsertTime = DateTime.Now;
                 }
             }
         }

--
Gitblit v1.9.3