fix 优化sqlsugarpack
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
|
||||
namespace Dlhis.Canteen;
|
||||
|
||||
public class SqlSugarPack : BaseAppPack
|
||||
{
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar();
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Common.Packs;
|
||||
|
||||
public class SqlSugarPack : BaseAppPack
|
||||
{
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar(sp =>
|
||||
{
|
||||
var configuration = sp.GetService<IConfiguration>();
|
||||
|
||||
return new List<ConnectionConfig>
|
||||
{
|
||||
new()
|
||||
{
|
||||
ConfigId = "log",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:LogConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,16 @@ using Kurisu.AspNetCore;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Basic.Packs;
|
||||
namespace Dlhis.Entity;
|
||||
|
||||
public class SqlSugarPack : BaseAppPack
|
||||
{
|
||||
public override bool IsBeforeUseRouting { get; }
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar(sp =>
|
||||
@@ -19,6 +21,34 @@ public class SqlSugarPack : BaseAppPack
|
||||
|
||||
return new List<ConnectionConfig>
|
||||
{
|
||||
new()
|
||||
{
|
||||
ConfigId = "default",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:DefaultConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
},
|
||||
new()
|
||||
{
|
||||
ConfigId = "identity",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
},
|
||||
new()
|
||||
{
|
||||
ConfigId = "face",
|
||||
@@ -267,7 +267,7 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
EntryDate = item.createdate,
|
||||
ResignationDate = item.ZLZRQ,
|
||||
CardType = Convert.ToInt32(item.ZZ_KLX),
|
||||
Workplace = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDJDNM)?.Code ?? item.ZZ_GZDJDNM,
|
||||
Workplace = _tenants.LastOrDefault(x => x.Name == item.ZZ_GZDJDNM)?.Code ?? item.ZZ_GZDJDNM,
|
||||
Factory = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDCQNM)?.Code ?? item.ZZ_GZDCQNM,
|
||||
};
|
||||
|
||||
@@ -308,7 +308,7 @@ public class GainfoUpdateService : IGainfoUpdateService
|
||||
if (gainfo != null)
|
||||
{
|
||||
var workplace = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDJDNM)?.Code ?? item.ZZ_GZDJDNM;
|
||||
var factory = _tenants.FirstOrDefault(x => x.Name == item.ZZ_GZDCQNM)?.Code ?? item.ZZ_GZDCQNM;
|
||||
var factory = _tenants.LastOrDefault(x => x.Name == item.ZZ_GZDCQNM)?.Code ?? item.ZZ_GZDCQNM;
|
||||
await _dbContext.Updateable<GainfoEntity>().SetColumns(g => new GainfoEntity
|
||||
{
|
||||
SapNo = item.PERNR,
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.ScheduledTask.Packs;
|
||||
|
||||
public class SqlSugarPack : BaseAppPack
|
||||
{
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar(sp =>
|
||||
{
|
||||
var configuration = sp.GetService<IConfiguration>();
|
||||
|
||||
return new List<ConnectionConfig>
|
||||
{
|
||||
new()
|
||||
{
|
||||
ConfigId = "identity",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
},
|
||||
new()
|
||||
{
|
||||
ConfigId = "face",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:FaceConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
},
|
||||
new()
|
||||
{
|
||||
ConfigId = "log",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:LogConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Sys;
|
||||
|
||||
public class SqlSugarPack : BaseAppPack
|
||||
{
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar(sp =>
|
||||
{
|
||||
var configuration = sp.GetService<IConfiguration>();
|
||||
|
||||
return new List<ConnectionConfig>
|
||||
{
|
||||
new()
|
||||
{
|
||||
ConfigId = "identity",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
},
|
||||
new()
|
||||
{
|
||||
ConfigId = "default",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:DefaultConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,14 @@
|
||||
"yikatong": "yikatong"
|
||||
}
|
||||
},
|
||||
"SqlSugarOptions": {
|
||||
"DefaultConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;",
|
||||
"IdentityConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=identity;charset=utf8mb4;",
|
||||
"SlaveConnectionString": [],
|
||||
"Timeout": 30,
|
||||
"SlowSqlTime": 1,
|
||||
"EnableSqlLog": true
|
||||
},
|
||||
"IdentityServerOptions": {
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"RequireHttpsMetadata": true,
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Extensions;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Visitor.Packs;
|
||||
|
||||
public class SqlSugarPack : BaseAppPack
|
||||
{
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar(sp =>
|
||||
{
|
||||
var configuration = sp.GetService<IConfiguration>();
|
||||
|
||||
return new List<ConnectionConfig>
|
||||
{
|
||||
new()
|
||||
{
|
||||
ConfigId = "face",
|
||||
|
||||
ConnectionString = configuration.GetSection("SqlSugarOptions:FaceConnectionString").Value,
|
||||
DbType = DbType.MySqlConnector,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
MoreSettings = new ConnMoreSettings
|
||||
{
|
||||
DisableNvarchar = true,
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user