From 8d1fc46e8f0fbb37b14c27df354b2a7a6843ae62 Mon Sep 17 00:00:00 2001 From: zenghongyao <873884283@qq.com> Date: Thu, 8 May 2025 17:33:07 +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 --- .../AnalysisData/DataStorage.cs | 27 ++++++++++--------- .../Pages/Monitor.cshtml | 1 + 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/protocols/JiShe.CollectBus.Protocol.T37612012/AnalysisData/DataStorage.cs b/protocols/JiShe.CollectBus.Protocol.T37612012/AnalysisData/DataStorage.cs index e3421d1..d43276d 100644 --- a/protocols/JiShe.CollectBus.Protocol.T37612012/AnalysisData/DataStorage.cs +++ b/protocols/JiShe.CollectBus.Protocol.T37612012/AnalysisData/DataStorage.cs @@ -284,7 +284,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData DeviceId = $"{data.DeviceId}", DeviceType = $"{data.DeviceType}", ProjectId = $"{data.ProjectId}", - DataType = IOTDBDataTypeConst.Data, + DataType = IOTDBDataTypeConst.Status, Timestamps = timestamps, SingleMeasuring = (data.FiledName!, data.DataValue!) }; @@ -297,7 +297,7 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData DeviceId = $"{data.DeviceId}", DeviceType = $"{data.DeviceType}", ProjectId = $"{data.ProjectId}", - DataType = IOTDBDataTypeConst.Data, + DataType = IOTDBDataTypeConst.Status, Timestamps = timestamps, SingleMeasuring = (ConcentratorStatusFieldConst.FrameData, analysisBaseDto.HexMessage ?? string.Empty) }; @@ -359,10 +359,11 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData { SystemName = _applicationOptions.SystemType, DeviceId = $"{item.DeviceId}", - DeviceType = $"{item.DeviceType}.{IOTDBDataType.Status}", + DeviceType = $"{item.DeviceType}", ProjectId = $"{item.ProjectId}", + DataType = IOTDBDataTypeConst.Status, Timestamps = timestamps, - SingleMeasuring = new Tuple(item.FiledName!, item.DataValue!) + SingleMeasuring = (item.FiledName!, item.DataValue!) }; _runtimeContext.UseTableSessionPool = false; // 使树模型池 await _dbProvider.InsertAsync(treeData); @@ -370,11 +371,11 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData var treeFrameData = new TreeModelSingleMeasuringEntity() { SystemName = _applicationOptions.SystemType, - DeviceId = $"{item.DeviceId}", - DeviceType = $"{item.DeviceType}.{IOTDBDataType.Status}", + DeviceType = $"{item.DeviceType}", ProjectId = $"{item.ProjectId}", + DataType = IOTDBDataTypeConst.Status, Timestamps = timestamps, - SingleMeasuring = new Tuple(ConcentratorStatusFieldConst.FrameData, analysisBaseDto.HexMessage ?? string.Empty) + SingleMeasuring = (ConcentratorStatusFieldConst.FrameData, analysisBaseDto.HexMessage ?? string.Empty) }; _runtimeContext.UseTableSessionPool = false; // 使树模型池 @@ -384,11 +385,11 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData var treeRecordingTimeData = new TreeModelSingleMeasuringEntity() { SystemName = _applicationOptions.SystemType, - DeviceId = $"{item.DeviceId}", - DeviceType = $"{item.DeviceType}.{IOTDBDataType.Status}", + DeviceType = $"{item.DeviceType}", ProjectId = $"{item.ProjectId}", + DataType = IOTDBDataTypeConst.Status, Timestamps = timestamps, - SingleMeasuring = new Tuple(ConcentratorStatusFieldConst.RecordingTime, (item.TimeSpan.HasValue ? item.TimeSpan.Value : DateTime.Now).GetDateTimeOffset().ToUnixTimeNanoseconds()) + SingleMeasuring = (ConcentratorStatusFieldConst.RecordingTime, (item.TimeSpan.HasValue ? item.TimeSpan.Value : DateTime.Now).GetDateTimeOffset().ToUnixTimeNanoseconds()) }; _runtimeContext.UseTableSessionPool = false; // 使树模型池 await _dbProvider.InsertAsync(treeRecordingTimeData); @@ -396,11 +397,11 @@ namespace JiShe.CollectBus.Protocol.T37612012.AnalysisData var treeRemarkData = new TreeModelSingleMeasuringEntity() { SystemName = _applicationOptions.SystemType, - DeviceId = $"{item.DeviceId}", - DeviceType = $"{item.DeviceType}.{IOTDBDataType.Status}", + DeviceType = $"{item.DeviceType}", ProjectId = $"{item.ProjectId}", + DataType = IOTDBDataTypeConst.Status, Timestamps = timestamps, - SingleMeasuring = new Tuple(ConcentratorStatusFieldConst.Remark, item.FiledDesc ?? string.Empty) + SingleMeasuring =(ConcentratorStatusFieldConst.Remark, item.FiledDesc ?? string.Empty) }; _runtimeContext.UseTableSessionPool = false; // 使树模型池 await _dbProvider.InsertAsync(treeRemarkData); 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 @@ 后端服务 +