完成设备属性标识符特殊结构体参数下发
This commit is contained in:
parent
c1423d549f
commit
7dcc470018
1
.gitignore
vendored
1
.gitignore
vendored
@ -60,3 +60,4 @@
|
||||
/gateways/JiShe.IoT.WebGateway/bin/Debug/net10.0
|
||||
/host/JiShe.IoT.HttpApi.Host/bin/Debug/net10.0
|
||||
/src/JiShe.IoT.Application/bin/Debug/net10.0
|
||||
/host/JiShe.IoT.HttpApi.Host/UploadFile/20251210/host/abp-file-management
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
"DefaultPartitions": 16,
|
||||
"DefaultBundles": 16,
|
||||
"EnableAutoCreation": true, //开启自动创建Topic
|
||||
"TopicMode": "Static", //Dynamic 主题模式
|
||||
"TopicMode": "Static", //Dynamic、Static 主题模式
|
||||
"EnableTopicTypeFilter": true, //允许Topic类型过滤
|
||||
"AllowedTopicTypes": [ "Static" ], //允许的Topic类型
|
||||
"AllowedClusters": [ "pulsar-cluster-1" ], //允许的集群
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
"DefaultPartitions": 16,
|
||||
"DefaultBundles": 16,
|
||||
"EnableAutoCreation": false, //开启自动创建Topic
|
||||
"TopicMode": "Dynamic", //Dynamic 主题模式
|
||||
"TopicMode": "Dynamic", //Dynamic、Static 主题模式
|
||||
"EnableTopicTypeFilter": true, //允许Topic类型过滤
|
||||
"AllowedTopicTypes": [ "Dynamic" ], //允许的Topic类型
|
||||
"AllowedClusters": [ "pulsar-cluster-1" ], //允许的集群
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
"TaskThreadCount": -1
|
||||
},
|
||||
"Pulsar": {
|
||||
"ServiceUrl": "pulsar+ssl://iot-north-mq.heclouds.com:6651", //pulsar+ssl://iot-north-mq.heclouds.com:6651 ,pulsar://192.168.111.174:26974
|
||||
"ServiceUrl": "pulsar://192.168.111.174:26974", //pulsar+ssl://iot-north-mq.heclouds.com:6651 ,pulsar://192.168.111.174:26974
|
||||
"WebUrl": "http://192.168.111.174:9094",
|
||||
"UserName": "admin",
|
||||
"TenantName": "1YMVZZkAkRArjxSD8457",
|
||||
@ -39,14 +39,14 @@
|
||||
"ConnectionTimeout": 30,
|
||||
"OperationTimeout": 30,
|
||||
"KeepAliveInterval": 30,
|
||||
"TaskThreadCount": 8,
|
||||
"TaskThreadCount": 1,
|
||||
"IsSubscriber": true,
|
||||
"DefaultPartitions": 16,
|
||||
"DefaultBundles": 16,
|
||||
"EnableAutoCreation": false, //开启自动创建Topic
|
||||
"TopicMode": "Dynamic", //Dynamic 主题模式
|
||||
"EnableAutoCreation": true, //开启自动创建Topic
|
||||
"TopicMode": "Static", //Dynamic、Static 主题模式
|
||||
"EnableTopicTypeFilter": true, //允许Topic类型过滤
|
||||
"AllowedTopicTypes": [ "Dynamic" ], //允许的Topic类型
|
||||
"AllowedTopicTypes": [ "Static" ], //允许的Topic类型
|
||||
"AllowedClusters": [ "pulsar-cluster-1" ], //允许的集群
|
||||
"AdminRoles": [ "admin" ],
|
||||
"EnableConsumerIdleCleanup": true,
|
||||
|
||||
@ -45,7 +45,10 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
||||
return handleResult;
|
||||
}
|
||||
var messageBody = handleResult.Data;
|
||||
string tempMessageBody = null;
|
||||
if(messageBody== null || messageBody.Commands == null || messageBody.Commands.Count <= 0)
|
||||
{
|
||||
return HttpDataResultExtensions.Failed("设备指令不能为空", -103, ResponeResultEnum.Fail);
|
||||
}
|
||||
|
||||
//限定来源类型必须为业务系统
|
||||
if (messageBody.SourceType != DeviceTelemetrySourceTypeEnum.BusinessSystem)
|
||||
@ -60,7 +63,7 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
||||
return HttpDataResultExtensions.Failed("设备不存在", -1041, ResponeResultEnum.Fail);
|
||||
}
|
||||
|
||||
var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, input, deviceInfo.Adapt<DeviceCacheInfos>(), tempMessageBody);
|
||||
var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, input, deviceInfo.Adapt<DeviceCacheInfos>(), messageBody.Commands.Serialize());
|
||||
|
||||
//将指令存储IoTDB数据库和Redis发布通道
|
||||
if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.OneNET)
|
||||
|
||||
@ -647,7 +647,7 @@ namespace JiShe.IoT.DeviceAggregation
|
||||
{
|
||||
Message = input.Serialize(),
|
||||
};
|
||||
var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, commandRequest, deviceInfo.Adapt<DeviceCacheInfos>(), commandRequest.Message);
|
||||
var packetTaskInfo = GetDeviceTelemetryPacketTaskInfo(ioTDBOptions, commandRequest, deviceInfo.Adapt<DeviceCacheInfos>(), input.Commands.Serialize());
|
||||
|
||||
await ioTDBDataChannelManageService.DeviceTelemetryTaskWriterAsync(DataChannelManage.DeviceTelemetryTaskDataChannel.Writer, (DistributedMessageCenterConst.OneNETCommandIssuedEventName, packetTaskInfo));
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ namespace JiShe.IoT
|
||||
DeviceType = $"{commandIssueInfo.DeviceType}",
|
||||
DeviceAddress = commandIssueInfo.DeviceAddress,
|
||||
IssueRawMessage = input.Serialize(),
|
||||
IssuePayload = messageBody,
|
||||
IoTDataType = IoTDBDataTypeConst.Command,
|
||||
TelemetrySource = (int)commandIssueInfo.SourceType,
|
||||
IoTPlatform = (int)commandIssueInfo.IoTPlatform,
|
||||
@ -60,7 +61,6 @@ namespace JiShe.IoT
|
||||
IoTPlatformAccountId = deviceInfo.IoTPlatformAccountId,
|
||||
AccountPhoneNumber = deviceInfo.AccountPhoneNumber,
|
||||
IoTPlatformProductName = deviceInfo.IoTPlatformProductName,
|
||||
IssuePayload = messageBody,
|
||||
RetryCount = 0,
|
||||
IssueStatus = (int)DeviceCommandIssueStatusEnum.Unprocessed,
|
||||
LastIssueTime = DateTime.Now
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user