增加初始化

zw
smartwyy 6 months ago
parent 468e825396
commit 6f2c47dcc1

@ -65,7 +65,7 @@ public static class ClientMgr
if (equipInfos.Count > 0) if (equipInfos.Count > 0)
{ {
Dictionary<string,EquipInfo> set = equipInfos.ToDictionary(it => it.Code, it => it); Dictionary<string,EquipInfo> set = equipInfos.ToDictionary(it => it.Code, it => it);
List<EquipNetInfo> equipNetInfos = netInfoRepository.QueryListByClause(it => set.ContainsKey(it.Code)); List<EquipNetInfo> equipNetInfos = netInfoRepository.QueryListByClause(it => set.Keys.Contains(it.Code));
foreach (EquipNetInfo netInfo in equipNetInfos) foreach (EquipNetInfo netInfo in equipNetInfos)
{ {
Task.Run(() => Task.Run(() =>
@ -73,6 +73,8 @@ public static class ClientMgr
ConnClient(netInfo); ConnClient(netInfo);
}); });
} }
StartAutoChargeThread();
} }
} }

@ -4,6 +4,7 @@ using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Configuration; using HybirdFrameworkCore.Configuration;
using HybirdFrameworkCore.Entity; using HybirdFrameworkCore.Entity;
using HybirdFrameworkCore.Redis; using HybirdFrameworkCore.Redis;
using Service.Charger.Client;
using SqlSugar; using SqlSugar;
using SqlSugar.IOC; using SqlSugar.IOC;
@ -91,4 +92,6 @@ app.MapControllers();
AppInfo.Container = app.Services.GetAutofacRoot(); AppInfo.Container = app.Services.GetAutofacRoot();
ClientMgr.InitClient();
app.Run(); app.Run();

@ -2,7 +2,7 @@
"ConnectionStrings": { "ConnectionStrings": {
"ConfigId": "master", "ConfigId": "master",
"DbType": "MySql", "DbType": "MySql",
"SqlConnection": "server=localhost;Port=3306;Database=winformdevframework;Uid=root;Pwd=123456;Charset=utf8;" "SqlConnection": "server=180.76.133.253;Port=16306;Database=huanneng_dev;Uid=root;Pwd=Rszn123;Charset=utf8"
}, },
"Update": { "Update": {
"AutoUpdate": "false", "AutoUpdate": "false",

@ -2,7 +2,7 @@
"ConnectionStrings": { "ConnectionStrings": {
"ConfigId": "master", "ConfigId": "master",
"DbType": "MySql", "DbType": "MySql",
"SqlConnection": "server=localhost;Port=3306;Database=winformdevframework;Uid=root;Pwd=123456;Charset=utf8;" "SqlConnection": "server=180.76.133.253;Port=16306;Database=huanneng_dev;Uid=root;Pwd=Rszn123;Charset=utf8"
}, },
"Update": { "Update": {
"AutoUpdate": "false", "AutoUpdate": "false",

Loading…
Cancel
Save