From 6461c2ae98500acd1a7a4b6a380b05f40d82ded8 Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Mon, 27 Oct 2025 17:31:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=9A=E5=8A=A1=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- host/JiShe.IoT.HttpApi.Host/Program.cs | 25 +++++++++++++++++++ ...ut.cs => BatchQueryDeviceDataInfoInput.cs} | 2 +- .../BusinessSystemAggregationService.cs | 10 +++++--- .../Workshops/WorkshopAggregationService.cs | 2 ++ 4 files changed, 35 insertions(+), 4 deletions(-) rename src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/Dto/{BatchQueryDeviceInfoInput.cs => BatchQueryDeviceDataInfoInput.cs} (95%) diff --git a/host/JiShe.IoT.HttpApi.Host/Program.cs b/host/JiShe.IoT.HttpApi.Host/Program.cs index ab410ba..5bf06ff 100644 --- a/host/JiShe.IoT.HttpApi.Host/Program.cs +++ b/host/JiShe.IoT.HttpApi.Host/Program.cs @@ -1,3 +1,5 @@ +using JiShe.ServicePro.Core; + namespace JiShe.IoT; public class Program @@ -11,6 +13,29 @@ public class Program //long nanosecondsFromSnowflakeId = ServicePro.Core.TimestampHelper.NextUnixNanosecondsFromSnowflakeId(); //long nanosecondsDateOffset = ServicePro.Core.TimestampHelper.ToUnixTimeNanoseconds(DateTimeOffset.UtcNow); + //BusinessSystemAggregation.Dto.BatchQueryDeviceDataInfoInput batchQueryDeviceDataInfoInput = new BusinessSystemAggregation.Dto.BatchQueryDeviceDataInfoInput() + //{ + // DeviceType = ServicePro.Enums.DeviceTypeEnum.Ammeter, + // DeviceAddresses = new List() + // { + // "332018305", + // "332053764", + // }, + // BeginTime = DateTime.Now.AddDays(-1), + // EndTime = DateTime.Now, + // IoTDataType = "Data", + //}; + //OpenApiRequest openApiRequest = new OpenApiRequest() + //{ + // Message = JiShe.ServicePro.Core.ServiceProJsonSerializer.Serialize(batchQueryDeviceDataInfoInput,false), + // Signature = "admin:admin123", + // Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), + // Nonce = "admin:admin123", + //}; + + //string signature = openApiRequest.Serialize(); + + //string text = Convert.ToBase64String(Encoding.UTF8.GetBytes("admin:admin123")); Log.Information("JiShe.IoT.HttpApi.Host."); var builder = WebApplication.CreateBuilder(args); diff --git a/src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/Dto/BatchQueryDeviceInfoInput.cs b/src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/Dto/BatchQueryDeviceDataInfoInput.cs similarity index 95% rename from src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/Dto/BatchQueryDeviceInfoInput.cs rename to src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/Dto/BatchQueryDeviceDataInfoInput.cs index 1f1cbf2..b1f8e51 100644 --- a/src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/Dto/BatchQueryDeviceInfoInput.cs +++ b/src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/Dto/BatchQueryDeviceDataInfoInput.cs @@ -10,7 +10,7 @@ namespace JiShe.IoT.BusinessSystemAggregation.Dto /// /// 批量查询设备信息输入 /// - public class BatchQueryDeviceInfoInput + public class BatchQueryDeviceDataInfoInput { /// /// 设备类型 diff --git a/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs b/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs index 696bc23..9d8556b 100644 --- a/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs +++ b/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs @@ -16,12 +16,14 @@ using Mapster; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using System.Collections.Generic; +using Volo.Abp.Auditing; namespace JiShe.IoT.BusinessSystemAggregation { /// /// 业务系统聚合服务 /// + [DisableAuditing] public class BusinessSystemAggregationService(IOptions options, IReliableRedisPubSubService redisPubSubService, IDeviceAppService deviceAppService, IIoTDBDataChannelManageService ioTDBDataChannelManageService, IOptions _ioTDBOptions, ITreeModelService treeModelService, IDeviceAggregationService deviceAggregationService, ILogger _logger) : IoTAppService, IBusinessSystemAggregationService { ServerApplicationOptions serverOptions = options.Value; @@ -88,7 +90,7 @@ namespace JiShe.IoT.BusinessSystemAggregation /// - /// 业务系统批量查询设备数据,Msg 字段为BatchQueryDeviceInfoInput实体 + /// 业务系统批量查询设备数据,Msg 字段为 BatchQueryDeviceDataInfoInput 实体 /// /// /// @@ -97,7 +99,7 @@ namespace JiShe.IoT.BusinessSystemAggregation { try { - var handleResult = HandleOpenApiRequest(input, serverOptions); + var handleResult = HandleOpenApiRequest(input, serverOptions); if (handleResult.Success == false) { return HttpDataResultExtensions.Failed>(null, handleResult.Message, handleResult.LocationCode); @@ -146,12 +148,14 @@ namespace JiShe.IoT.BusinessSystemAggregation continue; } - var pageResult = await treeModelService.DeviceDataInfoPageAsync(new DeviceTreeModelDataInfoInput() + var pageResult = await treeModelService.OpenRequestDeviceDataInfoPageAsync(new DeviceTreeModelDataInfoInput() { DeviceAddress = deviceAddress, DeviceType = messageBody.DeviceType, IoTDataType = messageBody.IoTDataType, IsNeedPaging = false, + StartCreationTime = messageBody.BeginTime, + EndCreationTime = messageBody.EndTime }); //todo 根据业务系统时间间隔要求进行过滤 diff --git a/src/JiShe.IoT.Application/Workshops/WorkshopAggregationService.cs b/src/JiShe.IoT.Application/Workshops/WorkshopAggregationService.cs index 6632d5a..6361552 100644 --- a/src/JiShe.IoT.Application/Workshops/WorkshopAggregationService.cs +++ b/src/JiShe.IoT.Application/Workshops/WorkshopAggregationService.cs @@ -9,6 +9,7 @@ using JiShe.ServicePro.Enums; using JiShe.ServicePro.OneNETManagement.OneNETProducts; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Volo.Abp.Auditing; namespace JiShe.IoT.Workshops { @@ -18,6 +19,7 @@ namespace JiShe.IoT.Workshops /// 设备聚合服务 /// 服务配置 /// + [DisableAuditing] public class WorkshopAggregationService(IDeviceAggregationService deviceAggregationService, IOptions options, ILogger logger) : IoTAppService, IWorkshopAggregationService { ServerApplicationOptions serverOptions = options.Value;