更新业务系统查询接口
This commit is contained in:
parent
fdc98143a5
commit
6461c2ae98
@ -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<string>()
|
||||
// {
|
||||
// "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);
|
||||
|
||||
@ -10,7 +10,7 @@ namespace JiShe.IoT.BusinessSystemAggregation.Dto
|
||||
/// <summary>
|
||||
/// 批量查询设备信息输入
|
||||
/// </summary>
|
||||
public class BatchQueryDeviceInfoInput
|
||||
public class BatchQueryDeviceDataInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备类型
|
||||
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 业务系统聚合服务
|
||||
/// </summary>
|
||||
[DisableAuditing]
|
||||
public class BusinessSystemAggregationService(IOptions<ServerApplicationOptions> options, IReliableRedisPubSubService redisPubSubService, IDeviceAppService deviceAppService, IIoTDBDataChannelManageService ioTDBDataChannelManageService, IOptions<IoTDBOptions> _ioTDBOptions, ITreeModelService treeModelService, IDeviceAggregationService deviceAggregationService, ILogger<BusinessSystemAggregationService> _logger) : IoTAppService, IBusinessSystemAggregationService
|
||||
{
|
||||
ServerApplicationOptions serverOptions = options.Value;
|
||||
@ -88,7 +90,7 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 业务系统批量查询设备数据,Msg 字段为BatchQueryDeviceInfoInput实体
|
||||
/// 业务系统批量查询设备数据,Msg 字段为 BatchQueryDeviceDataInfoInput 实体
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
@ -97,7 +99,7 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
||||
{
|
||||
try
|
||||
{
|
||||
var handleResult = HandleOpenApiRequest<BatchQueryDeviceInfoInput>(input, serverOptions);
|
||||
var handleResult = HandleOpenApiRequest<BatchQueryDeviceDataInfoInput>(input, serverOptions);
|
||||
if (handleResult.Success == false)
|
||||
{
|
||||
return HttpDataResultExtensions.Failed<List<IoTDBDynamicObject>>(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 根据业务系统时间间隔要求进行过滤
|
||||
|
||||
@ -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
|
||||
/// <param name="deviceAggregationService">设备聚合服务</param>
|
||||
/// <param name="options">服务配置</param>
|
||||
/// <param name="logger"></param>
|
||||
[DisableAuditing]
|
||||
public class WorkshopAggregationService(IDeviceAggregationService deviceAggregationService, IOptions<ServerApplicationOptions> options, ILogger<WorkshopAggregationService> logger) : IoTAppService, IWorkshopAggregationService
|
||||
{
|
||||
ServerApplicationOptions serverOptions = options.Value;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user