diff --git a/Service/Charger/Client/ClientMgr.cs b/Service/Charger/Client/ClientMgr.cs index 9f0e681..2aaa134 100644 --- a/Service/Charger/Client/ClientMgr.cs +++ b/Service/Charger/Client/ClientMgr.cs @@ -65,7 +65,7 @@ public static class ClientMgr if (equipInfos.Count > 0) { Dictionary set = equipInfos.ToDictionary(it => it.Code, it => it); - List equipNetInfos = netInfoRepository.QueryListByClause(it => set.ContainsKey(it.Code)); + List equipNetInfos = netInfoRepository.QueryListByClause(it => set.Keys.Contains(it.Code)); foreach (EquipNetInfo netInfo in equipNetInfos) { Task.Run(() => @@ -73,6 +73,8 @@ public static class ClientMgr ConnClient(netInfo); }); } + + StartAutoChargeThread(); } } diff --git a/WebStarter/Program.cs b/WebStarter/Program.cs index 08010f6..f31c6b3 100644 --- a/WebStarter/Program.cs +++ b/WebStarter/Program.cs @@ -4,6 +4,7 @@ using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Configuration; using HybirdFrameworkCore.Entity; using HybirdFrameworkCore.Redis; +using Service.Charger.Client; using SqlSugar; using SqlSugar.IOC; @@ -91,4 +92,6 @@ app.MapControllers(); AppInfo.Container = app.Services.GetAutofacRoot(); +ClientMgr.InitClient(); + app.Run(); \ No newline at end of file diff --git a/WebStarter/appsettings.json b/WebStarter/appsettings.json index d39130a..d84dfdd 100644 --- a/WebStarter/appsettings.json +++ b/WebStarter/appsettings.json @@ -2,7 +2,7 @@ "ConnectionStrings": { "ConfigId": "master", "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": { "AutoUpdate": "false", diff --git a/WebStarter/bin/Debug/net6.0/appsettings.json b/WebStarter/bin/Debug/net6.0/appsettings.json index d39130a..d84dfdd 100644 --- a/WebStarter/bin/Debug/net6.0/appsettings.json +++ b/WebStarter/bin/Debug/net6.0/appsettings.json @@ -2,7 +2,7 @@ "ConnectionStrings": { "ConfigId": "master", "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": { "AutoUpdate": "false",