|
|
|
@ -86,7 +86,7 @@ public static class SqlSugarAop |
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
var getType = entityInfo.EntityValue.GetType(); |
|
|
|
|
|
|
|
|
|
int userId = Convert.ToInt32(App.User.ID); |
|
|
|
|
switch (entityInfo.OperationType) |
|
|
|
|
{ |
|
|
|
|
case DataFilterType.InsertByObject: |
|
|
|
@ -94,7 +94,18 @@ public static class SqlSugarAop |
|
|
|
|
var dyCreateTime = getType.GetProperty("CreateTime"); |
|
|
|
|
|
|
|
|
|
if (App.User?.ID > 0 && dyCreateBy != null && dyCreateBy.GetValue(entityInfo.EntityValue) == null) |
|
|
|
|
dyCreateBy.SetValue(entityInfo.EntityValue, App.User.ID); |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
dyCreateBy.SetValue(entityInfo.EntityValue, Convert.ToInt32(App.User.ID)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
catch (Exception) |
|
|
|
|
{ |
|
|
|
|
dyCreateBy.SetValue(entityInfo.EntityValue, App.User.ID); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ((dyCreateTime != null && dyCreateTime.GetValue(entityInfo.EntityValue) is null) || (dyCreateTime != null && dyCreateTime.GetValue(entityInfo.EntityValue) != null && (DateTime)dyCreateTime.GetValue(entityInfo.EntityValue) == DateTime.MinValue)) |
|
|
|
|
dyCreateTime.SetValue(entityInfo.EntityValue, DateTime.Now); |
|
|
|
@ -105,7 +116,18 @@ public static class SqlSugarAop |
|
|
|
|
var dyModifyTime = getType.GetProperty("UpdateTime"); |
|
|
|
|
|
|
|
|
|
if (App.User?.ID > 0 && UpdateBy != null) |
|
|
|
|
UpdateBy.SetValue(entityInfo.EntityValue, App.User.ID); |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
UpdateBy.SetValue(entityInfo.EntityValue, Convert.ToInt32(App.User.ID)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
catch (Exception) |
|
|
|
|
{ |
|
|
|
|
UpdateBy.SetValue(entityInfo.EntityValue, App.User.ID); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (dyModifyTime != null) |
|
|
|
|
dyModifyTime.SetValue(entityInfo.EntityValue, DateTime.Now); |
|
|
|
|