From 6f2c47dcc18f8a9d4292f226c00a84d7550ee4c9 Mon Sep 17 00:00:00 2001 From: smartwyy <645583145@qq.com> Date: Sat, 25 May 2024 19:40:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Charger/Client/ClientMgr.cs | 4 +++- WebStarter/Program.cs | 3 +++ WebStarter/appsettings.json | 2 +- WebStarter/bin/Debug/net6.0/appsettings.json | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) 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",