From 6481d37b8efa16340d36be0b5bc527a37354382d Mon Sep 17 00:00:00 2001 From: CZ Date: Fri, 2 Aug 2024 13:53:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E5=A4=96=E5=85=85=E7=94=B5=E6=9C=BA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Charger/Client/ChargerClient.cs | 18 +++++++++++++++++- Service/Charger/Common/ChargerUtils.cs | 2 +- .../PileUploadRemoteSignalHandler.cs | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Service/Charger/Client/ChargerClient.cs b/Service/Charger/Client/ChargerClient.cs index 67494a7..08b6849 100644 --- a/Service/Charger/Client/ChargerClient.cs +++ b/Service/Charger/Client/ChargerClient.cs @@ -172,7 +172,23 @@ public class ChargerClient : TcpClient /// /// 充电桩状态信息 /// - public ConcurrentDictionary ChargerPile = new(); + public ConcurrentDictionary ChargerPile = new() + { + [1]=new ChargerPile(), + [2]=new ChargerPile(), + [3]=new ChargerPile(), + [4]=new ChargerPile(), + [5]=new ChargerPile(), + [6]=new ChargerPile(), + [7]=new ChargerPile(), + [8]=new ChargerPile(), + [9]=new ChargerPile(), + [10]=new ChargerPile(), + [11]=new ChargerPile(), + [12]=new ChargerPile(), + [13]=new ChargerPile(), + [14]=new ChargerPile(), + }; /// /// 充电桩功率 diff --git a/Service/Charger/Common/ChargerUtils.cs b/Service/Charger/Common/ChargerUtils.cs index ab3e2aa..655b6dd 100644 --- a/Service/Charger/Common/ChargerUtils.cs +++ b/Service/Charger/Common/ChargerUtils.cs @@ -99,7 +99,7 @@ public static class ChargerUtils { // 除2,向上取整,拿到本地充电机code int ceilResult = (int)Math.Ceiling(parsedNumber / 2.0); - return ceilResult.ToString(); + return "C200" + ceilResult.ToString(); } else { diff --git a/Service/Charger/Handler/OutCharger/PileUploadRemoteSignalHandler.cs b/Service/Charger/Handler/OutCharger/PileUploadRemoteSignalHandler.cs index f7a678b..bebc10a 100644 --- a/Service/Charger/Handler/OutCharger/PileUploadRemoteSignalHandler.cs +++ b/Service/Charger/Handler/OutCharger/PileUploadRemoteSignalHandler.cs @@ -1,4 +1,5 @@ using DotNetty.Transport.Channels; +using HybirdFrameworkCore.Autofac.Attribute; using log4net; using Service.Charger.Client; using Service.Charger.Handler; @@ -8,6 +9,8 @@ namespace Service.Charger.Handler.OutCharger; /// /// 3.7.11 充电桩遥信数据上报 /// +[Order(8)] +[Scope("InstancePerDependency")] public class PileUploadRemoteSignalHandler: SimpleChannelInboundHandler, IBaseHandler { private static readonly ILog Log = LogManager.GetLogger(typeof(PileUploadRemoteSignalHandler));