|
|
|
@ -56,7 +56,7 @@ public static class SqlsugarInstall
|
|
|
|
|
{
|
|
|
|
|
dbList.Add(item);
|
|
|
|
|
}
|
|
|
|
|
var _serviceProvider =services.GetService<IServiceProvider>();
|
|
|
|
|
var _serviceProvider = services.GetService<IServiceProvider>();
|
|
|
|
|
ICacheService myCache = new SqlSugarCsRedisCache(_serviceProvider);
|
|
|
|
|
var connectConfigList = SqlsugarHelper.ReturnConnectionConfig(dbList, myCache);
|
|
|
|
|
|
|
|
|
@ -178,7 +178,7 @@ public static class SqlsugarInstall
|
|
|
|
|
{
|
|
|
|
|
var tenantId = ((dynamic)entityInfo.EntityValue).TenantId;
|
|
|
|
|
if (tenantId == null || tenantId == 0)
|
|
|
|
|
entityInfo.SetValue(user.GetTenantId());
|
|
|
|
|
entityInfo.SetValue(user.TenantId);
|
|
|
|
|
}
|
|
|
|
|
if (entityInfo.PropertyName == "TenantName")
|
|
|
|
|
{
|
|
|
|
@ -253,13 +253,13 @@ public static class SqlsugarInstall
|
|
|
|
|
var time = it.Time;
|
|
|
|
|
var diffType = it.DiffType; //enum insert 、update and delete
|
|
|
|
|
|
|
|
|
|
var diffData = SqlSugarDiffUtil.GetDiff(editBeforeData,editAfterData);
|
|
|
|
|
var diffData = SqlSugarDiffUtil.GetDiff(editBeforeData, editAfterData);
|
|
|
|
|
|
|
|
|
|
var auditData = new SysLogAudit()
|
|
|
|
|
{
|
|
|
|
|
KeyId =Convert.ToInt64(diffData.Id),
|
|
|
|
|
KeyId = Convert.ToInt64(diffData.Id),
|
|
|
|
|
Sql = it.Sql,
|
|
|
|
|
Param = JsonConvert.SerializeObject(it.Parameters),
|
|
|
|
|
Param = JsonConvert.SerializeObject(it.Parameters),
|
|
|
|
|
OperateType = diffType.ToString(),
|
|
|
|
|
OldValue = JsonConvert.SerializeObject(editBeforeData),
|
|
|
|
|
NewValue = JsonConvert.SerializeObject(editAfterData),
|
|
|
|
@ -273,7 +273,7 @@ public static class SqlsugarInstall
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
//全局过滤租户
|
|
|
|
|
dbProvider.QueryFilter.AddTableFilter<ITenantId>(m => m.TenantId == user.GetTenantId());
|
|
|
|
|
dbProvider.QueryFilter.AddTableFilter<ITenantId>(m => m.TenantId == long.Parse(user.TenantId));
|
|
|
|
|
//全局过滤机构Id
|
|
|
|
|
dbProvider.QueryFilter.AddTableFilter<IOrgId>(m => m.OrgId == user.OrgId);
|
|
|
|
|
//全局软删除过滤
|
|
|
|
|