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;