|
|
|
@ -1,7 +1,9 @@ |
|
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
|
using Serilog; |
|
|
|
|
using SqlSugar; |
|
|
|
|
using StackExchange.Profiling; |
|
|
|
|
using Tiobon.Core.Common.LogHelper; |
|
|
|
|
using Tiobon.Core.Common.UserManager; |
|
|
|
|
using Tiobon.Core.Model; |
|
|
|
|
using Tiobon.Core.Model.Models.RootTkey; |
|
|
|
|
using Tiobon.Core.Model.Tenants; |
|
|
|
@ -113,25 +115,45 @@ public static class SqlSugarAop |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
case DataFilterType.UpdateByObject: |
|
|
|
|
var UpdateBy = getType.GetProperty("UpdateBy"); |
|
|
|
|
var dyModifyTime = getType.GetProperty("UpdateTime"); |
|
|
|
|
|
|
|
|
|
if (App.User?.ID > 0 && UpdateBy != null) |
|
|
|
|
if (entityInfo.PropertyName == "UpdateBy") |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
var UpdateBy = getType.GetProperty("UpdateBy"); |
|
|
|
|
if (App.User?.ID > 0 && UpdateBy != null) |
|
|
|
|
{ |
|
|
|
|
UpdateBy.SetValue(entityInfo.EntityValue, Convert.ToInt32(App.User.ID)); |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
UpdateBy.SetValue(entityInfo.EntityValue, Convert.ToInt32(App.User.ID)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
catch (Exception) |
|
|
|
|
{ |
|
|
|
|
UpdateBy.SetValue(entityInfo.EntityValue, App.User.ID); |
|
|
|
|
} |
|
|
|
|
catch (Exception) |
|
|
|
|
{ |
|
|
|
|
UpdateBy.SetValue(entityInfo.EntityValue, App.User.ID); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (entityInfo.PropertyName == "UpdateTime") |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
var dyModifyTime = getType.GetProperty("UpdateTime"); |
|
|
|
|
|
|
|
|
|
if (dyModifyTime != null) |
|
|
|
|
dyModifyTime.SetValue(entityInfo.EntityValue, DateTime.Now); |
|
|
|
|
} |
|
|
|
|
//else if (entityInfo.PropertyName == "UpdateTime") |
|
|
|
|
//{ |
|
|
|
|
|
|
|
|
|
// HttpRequest request = UserContext.Context.Request; |
|
|
|
|
// var api = request.Path.ObjToString().TrimEnd('/').ToLower(); |
|
|
|
|
//} |
|
|
|
|
//else if (entityInfo.PropertyName == "UpdateTime") |
|
|
|
|
//{ |
|
|
|
|
|
|
|
|
|
// var dyModifyTime = getType.GetProperty("UpdateTime"); |
|
|
|
|
|
|
|
|
|
if (dyModifyTime != null) |
|
|
|
|
dyModifyTime.SetValue(entityInfo.EntityValue, DateTime.Now); |
|
|
|
|
// if (dyModifyTime != null) |
|
|
|
|
// dyModifyTime.SetValue(entityInfo.EntityValue, DateTime.Now); |
|
|
|
|
//} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|