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