From 57021e2b9cbcb24ebd22c8875f91b373f66d6e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=9B=8A?= Date: Wed, 23 Apr 2025 23:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Abstracts/ProtocolPlugin.cs | 7 ++----- .../Interfaces/IProtocolPlugin.cs | 2 +- .../StandardProtocolPlugin.cs | 11 ++++++++++- .../BasicScheduledMeterReadingService.cs | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/protocols/JiShe.CollectBus.Protocol.Contracts/Abstracts/ProtocolPlugin.cs b/protocols/JiShe.CollectBus.Protocol.Contracts/Abstracts/ProtocolPlugin.cs index da99681..9144c55 100644 --- a/protocols/JiShe.CollectBus.Protocol.Contracts/Abstracts/ProtocolPlugin.cs +++ b/protocols/JiShe.CollectBus.Protocol.Contracts/Abstracts/ProtocolPlugin.cs @@ -373,12 +373,9 @@ namespace JiShe.CollectBus.Protocol.Contracts.Abstracts /// 组装透明转发报文 /// /// - /// + /// 设备数据实体 /// - public virtual List GenerateAFN10HContent(T entity) - { - throw new Exception(); - } + public abstract Task> GenerateAFN10HContent(T entity) where T : class; } } diff --git a/protocols/JiShe.CollectBus.Protocol.Contracts/Interfaces/IProtocolPlugin.cs b/protocols/JiShe.CollectBus.Protocol.Contracts/Interfaces/IProtocolPlugin.cs index 074fa48..8da228e 100644 --- a/protocols/JiShe.CollectBus.Protocol.Contracts/Interfaces/IProtocolPlugin.cs +++ b/protocols/JiShe.CollectBus.Protocol.Contracts/Interfaces/IProtocolPlugin.cs @@ -22,7 +22,7 @@ namespace JiShe.CollectBus.Protocol.Contracts.Interfaces /// 组装透明转发报文 /// /// - List GenerateAFN10HContent(T entity); + Task> GenerateAFN10HContent(T entity) where T : class; //Task LoginAsync(MessageReceivedLogin messageReceived); diff --git a/protocols/JiShe.CollectBus.Protocol/StandardProtocolPlugin.cs b/protocols/JiShe.CollectBus.Protocol/StandardProtocolPlugin.cs index 27f7466..b2e7a58 100644 --- a/protocols/JiShe.CollectBus.Protocol/StandardProtocolPlugin.cs +++ b/protocols/JiShe.CollectBus.Protocol/StandardProtocolPlugin.cs @@ -262,7 +262,16 @@ namespace JiShe.CollectBus.Protocol - + /// + /// 组装透明转发报文 + /// + /// + /// 设备数据实体 + /// + public override async Task> GenerateAFN10HContent(T entity) where T : class + { + return await Task.FromResult(new List()); + } #region 上行命令 diff --git a/services/JiShe.CollectBus.Application/ScheduledMeterReading/BasicScheduledMeterReadingService.cs b/services/JiShe.CollectBus.Application/ScheduledMeterReading/BasicScheduledMeterReadingService.cs index 849f570..a9b1953 100644 --- a/services/JiShe.CollectBus.Application/ScheduledMeterReading/BasicScheduledMeterReadingService.cs +++ b/services/JiShe.CollectBus.Application/ScheduledMeterReading/BasicScheduledMeterReadingService.cs @@ -952,13 +952,13 @@ namespace JiShe.CollectBus.ScheduledMeterReading } else { - _logger.LogWarning($"{nameof(WatermeterCreatePublishTaskAction)} 集中器{watermeter.FocusAddress}的电表{watermeter.Name}采集项{tempItem}无效编码。"); + _logger.LogWarning($"{nameof(WatermeterCreatePublishTaskAction)} 集中器{watermeter.FocusAddress}的水表{watermeter.Name}采集项{tempItem}无效编码。"); continue; } if (builderResponse == null || builderResponse.Data.Length <= 0) { - _logger.LogWarning($"{nameof(WatermeterCreatePublishTaskAction)} 集中器{watermeter.FocusAddress}的电表{watermeter.Name}采集项{tempItem}未能正确获取报文。"); + _logger.LogWarning($"{nameof(WatermeterCreatePublishTaskAction)} 集中器{watermeter.FocusAddress}的水表{watermeter.Name}采集项{tempItem}未能正确获取报文。"); continue; }