From 91386007ae053a41672cf765cee7755780357095 Mon Sep 17 00:00:00 2001 From: zenghongyao <873884283@qq.com> Date: Thu, 8 May 2025 11:58:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=B8=8B=E5=8F=91=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E5=8F=91=E4=B8=BA=E5=AD=97=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Protocol3761Extensions.cs | 2 +- .../JiShe.CollectBus.Application/Samples/SampleAppService.cs | 3 ++- web/JiShe.CollectBus.Host/Pages/Monitor.cshtml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/protocols/JiShe.CollectBus.Protocol.T37612012/Protocol3761Extensions.cs b/protocols/JiShe.CollectBus.Protocol.T37612012/Protocol3761Extensions.cs index f9f3801..caa6793 100644 --- a/protocols/JiShe.CollectBus.Protocol.T37612012/Protocol3761Extensions.cs +++ b/protocols/JiShe.CollectBus.Protocol.T37612012/Protocol3761Extensions.cs @@ -257,7 +257,7 @@ namespace JiShe.CollectBus.Protocol.T37612012 else decimal.TryParse(data[i], out value); meter.DataValue = value; - meter.DataType = dataType; + meter.DataType = dataType.ToUpper(); meter.FiledDesc = filedDesc; meter.FiledName = meter.DataType.GetDataFieldByGatherDataType() ?? string.Empty; if (DateTime.TryParse(CalculateTimeSpan(i - 3, data[0], density), out DateTime readingDate)) diff --git a/services/JiShe.CollectBus.Application/Samples/SampleAppService.cs b/services/JiShe.CollectBus.Application/Samples/SampleAppService.cs index 4cb325c..56e895a 100644 --- a/services/JiShe.CollectBus.Application/Samples/SampleAppService.cs +++ b/services/JiShe.CollectBus.Application/Samples/SampleAppService.cs @@ -25,6 +25,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading.Tasks; +using TouchSocket.Core; using TouchSocket.Sockets; namespace JiShe.CollectBus.Samples; @@ -434,7 +435,7 @@ public class SampleAppService : CollectBusAppService, ISampleAppService, IKafkaS if (_tcpService.ClientExists(dto.Address)) { // 发送给设备 - await _tcpService.SendAsync(dto.Address, dto.Frame); + await _tcpService.SendAsync(dto.Address, Convert.FromHexString(dto.Frame)); _logger.LogWarning($"{dto.Address}下发消息报文:{dto.Frame}"); } else diff --git a/web/JiShe.CollectBus.Host/Pages/Monitor.cshtml b/web/JiShe.CollectBus.Host/Pages/Monitor.cshtml index a58ded5..30e91e8 100644 --- a/web/JiShe.CollectBus.Host/Pages/Monitor.cshtml +++ b/web/JiShe.CollectBus.Host/Pages/Monitor.cshtml @@ -16,6 +16,7 @@ 后端服务 +