更新业务系统查询接口
This commit is contained in:
parent
fdc98143a5
commit
6461c2ae98
@ -1,3 +1,5 @@
|
|||||||
|
using JiShe.ServicePro.Core;
|
||||||
|
|
||||||
namespace JiShe.IoT;
|
namespace JiShe.IoT;
|
||||||
|
|
||||||
public class Program
|
public class Program
|
||||||
@ -11,6 +13,29 @@ public class Program
|
|||||||
//long nanosecondsFromSnowflakeId = ServicePro.Core.TimestampHelper.NextUnixNanosecondsFromSnowflakeId();
|
//long nanosecondsFromSnowflakeId = ServicePro.Core.TimestampHelper.NextUnixNanosecondsFromSnowflakeId();
|
||||||
//long nanosecondsDateOffset = ServicePro.Core.TimestampHelper.ToUnixTimeNanoseconds(DateTimeOffset.UtcNow);
|
//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"));
|
//string text = Convert.ToBase64String(Encoding.UTF8.GetBytes("admin:admin123"));
|
||||||
Log.Information("JiShe.IoT.HttpApi.Host.");
|
Log.Information("JiShe.IoT.HttpApi.Host.");
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|||||||
@ -10,7 +10,7 @@ namespace JiShe.IoT.BusinessSystemAggregation.Dto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 批量查询设备信息输入
|
/// 批量查询设备信息输入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BatchQueryDeviceInfoInput
|
public class BatchQueryDeviceDataInfoInput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备类型
|
/// 设备类型
|
||||||
@ -16,12 +16,14 @@ using Mapster;
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Volo.Abp.Auditing;
|
||||||
|
|
||||||
namespace JiShe.IoT.BusinessSystemAggregation
|
namespace JiShe.IoT.BusinessSystemAggregation
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 业务系统聚合服务
|
/// 业务系统聚合服务
|
||||||
/// </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
|
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;
|
ServerApplicationOptions serverOptions = options.Value;
|
||||||
@ -88,7 +90,7 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 业务系统批量查询设备数据,Msg 字段为BatchQueryDeviceInfoInput实体
|
/// 业务系统批量查询设备数据,Msg 字段为 BatchQueryDeviceDataInfoInput 实体
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
@ -97,7 +99,7 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var handleResult = HandleOpenApiRequest<BatchQueryDeviceInfoInput>(input, serverOptions);
|
var handleResult = HandleOpenApiRequest<BatchQueryDeviceDataInfoInput>(input, serverOptions);
|
||||||
if (handleResult.Success == false)
|
if (handleResult.Success == false)
|
||||||
{
|
{
|
||||||
return HttpDataResultExtensions.Failed<List<IoTDBDynamicObject>>(null, handleResult.Message, handleResult.LocationCode);
|
return HttpDataResultExtensions.Failed<List<IoTDBDynamicObject>>(null, handleResult.Message, handleResult.LocationCode);
|
||||||
@ -146,12 +148,14 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var pageResult = await treeModelService.DeviceDataInfoPageAsync(new DeviceTreeModelDataInfoInput()
|
var pageResult = await treeModelService.OpenRequestDeviceDataInfoPageAsync(new DeviceTreeModelDataInfoInput()
|
||||||
{
|
{
|
||||||
DeviceAddress = deviceAddress,
|
DeviceAddress = deviceAddress,
|
||||||
DeviceType = messageBody.DeviceType,
|
DeviceType = messageBody.DeviceType,
|
||||||
IoTDataType = messageBody.IoTDataType,
|
IoTDataType = messageBody.IoTDataType,
|
||||||
IsNeedPaging = false,
|
IsNeedPaging = false,
|
||||||
|
StartCreationTime = messageBody.BeginTime,
|
||||||
|
EndCreationTime = messageBody.EndTime
|
||||||
});
|
});
|
||||||
|
|
||||||
//todo 根据业务系统时间间隔要求进行过滤
|
//todo 根据业务系统时间间隔要求进行过滤
|
||||||
|
|||||||
@ -9,6 +9,7 @@ using JiShe.ServicePro.Enums;
|
|||||||
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
|
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using Volo.Abp.Auditing;
|
||||||
|
|
||||||
namespace JiShe.IoT.Workshops
|
namespace JiShe.IoT.Workshops
|
||||||
{
|
{
|
||||||
@ -18,6 +19,7 @@ namespace JiShe.IoT.Workshops
|
|||||||
/// <param name="deviceAggregationService">设备聚合服务</param>
|
/// <param name="deviceAggregationService">设备聚合服务</param>
|
||||||
/// <param name="options">服务配置</param>
|
/// <param name="options">服务配置</param>
|
||||||
/// <param name="logger"></param>
|
/// <param name="logger"></param>
|
||||||
|
[DisableAuditing]
|
||||||
public class WorkshopAggregationService(IDeviceAggregationService deviceAggregationService, IOptions<ServerApplicationOptions> options, ILogger<WorkshopAggregationService> logger) : IoTAppService, IWorkshopAggregationService
|
public class WorkshopAggregationService(IDeviceAggregationService deviceAggregationService, IOptions<ServerApplicationOptions> options, ILogger<WorkshopAggregationService> logger) : IoTAppService, IWorkshopAggregationService
|
||||||
{
|
{
|
||||||
ServerApplicationOptions serverOptions = options.Value;
|
ServerApplicationOptions serverOptions = options.Value;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user