Compare commits
3 Commits
1068c0832a
...
d43457941c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d43457941c | ||
|
|
2fcf9d854a | ||
|
|
f349e8a9bd |
@ -1 +1 @@
|
|||||||
Subproject commit d8e8f7ca8e93f8c45cad02cf7e646a0d1d9e9e53
|
Subproject commit db713eb791b60bff2b85f12aaf0ceb3fa685b7ee
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using JiShe.ServicePro.ServerOptions;
|
using JiShe.ServicePro.Core;
|
||||||
using JiShe.ServicePro.SwaggerConfigs;
|
using JiShe.ServicePro.SwaggerConfigs;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Volo.Abp.BlobStoring.FileSystem;
|
using Volo.Abp.BlobStoring.FileSystem;
|
||||||
@ -51,6 +51,11 @@ namespace JiShe.IoT
|
|||||||
{
|
{
|
||||||
configuration.GetSection(nameof(ServerApplicationOptions)).Bind(options);
|
configuration.GetSection(nameof(ServerApplicationOptions)).Bind(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Configure<DataChannelOptions>(options =>
|
||||||
|
{
|
||||||
|
configuration.GetSection(nameof(DataChannelOptions)).Bind(options);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
<RootNamespace>JiShe.IoT</RootNamespace>
|
<RootNamespace>JiShe.IoT</RootNamespace>
|
||||||
<PreserveCompilationReferences>true</PreserveCompilationReferences>
|
<PreserveCompilationReferences>true</PreserveCompilationReferences>
|
||||||
<UserSecretsId>JiShe.IoT-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
|
<UserSecretsId>JiShe.IoT-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
|
||||||
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -1,22 +1,11 @@
|
|||||||
using JiShe.IoT.OneNETAggregation.Dto;
|
using JiShe.ServicePro;
|
||||||
using JiShe.IoT.Workshops;
|
|
||||||
using JiShe.ServicePro;
|
|
||||||
using JiShe.ServicePro.Core;
|
using JiShe.ServicePro.Core;
|
||||||
using JiShe.ServicePro.DeviceManagement.DeviceInfos;
|
using JiShe.ServicePro.DeviceManagement.DeviceInfos;
|
||||||
using JiShe.ServicePro.Dto;
|
using JiShe.ServicePro.Dto;
|
||||||
using JiShe.ServicePro.Encrypt;
|
using JiShe.ServicePro.Encrypt;
|
||||||
using JiShe.ServicePro.Enums;
|
using JiShe.ServicePro.Enums;
|
||||||
using JiShe.ServicePro.FreeRedisProvider;
|
using JiShe.ServicePro.FreeRedisProvider;
|
||||||
using JiShe.ServicePro.Kafka.Consts;
|
|
||||||
using JiShe.ServicePro.Kafka.Producer;
|
|
||||||
using JiShe.ServicePro.ServerOptions;
|
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace JiShe.IoT.BusinessSystemAggregation
|
namespace JiShe.IoT.BusinessSystemAggregation
|
||||||
{
|
{
|
||||||
@ -75,11 +64,11 @@ namespace JiShe.IoT.BusinessSystemAggregation
|
|||||||
//将指令存储Kafka的OneNET主题中
|
//将指令存储Kafka的OneNET主题中
|
||||||
if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.OneNET)
|
if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.OneNET)
|
||||||
{
|
{
|
||||||
await redisPubSubService.PublishReliableAsync(KafkaTopicConsts.OneNETCommandIssuedEventName, input);
|
await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.OneNETCommandIssuedEventName, input);
|
||||||
}
|
}
|
||||||
else if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.CTWing)
|
else if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.CTWing)
|
||||||
{
|
{
|
||||||
await redisPubSubService.PublishReliableAsync(KafkaTopicConsts.CTWingAepCommandIssuedEventName, input);
|
await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.CTWingAepCommandIssuedEventName, input);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,19 +1,12 @@
|
|||||||
using JiShe.IoT.CTWingAggregation.Dto;
|
using JiShe.IoT.CTWingAggregation.Dto;
|
||||||
using JiShe.IoT.DeviceAggregation;
|
using JiShe.IoT.DeviceAggregation;
|
||||||
using JiShe.IoT.DeviceAggregation.Dto;
|
using JiShe.IoT.DeviceAggregation.Dto;
|
||||||
using JiShe.IoT.OneNETAggregation.Dto;
|
|
||||||
using JiShe.IoT.Workshops;
|
using JiShe.IoT.Workshops;
|
||||||
using JiShe.ServicePro;
|
using JiShe.ServicePro;
|
||||||
using JiShe.ServicePro.Core;
|
using JiShe.ServicePro.Core;
|
||||||
using JiShe.ServicePro.CTWingManagement.CTWingDevices;
|
|
||||||
using JiShe.ServicePro.CTWingManagement.CTWingProduct;
|
using JiShe.ServicePro.CTWingManagement.CTWingProduct;
|
||||||
using JiShe.ServicePro.DeviceManagement.DeviceInfos;
|
|
||||||
using JiShe.ServicePro.DeviceManagement.DeviceInfos.Dto;
|
|
||||||
using JiShe.ServicePro.Encrypt;
|
using JiShe.ServicePro.Encrypt;
|
||||||
using JiShe.ServicePro.Enums;
|
using JiShe.ServicePro.Enums;
|
||||||
using JiShe.ServicePro.FreeRedisProvider;
|
|
||||||
using JiShe.ServicePro.ServerOptions;
|
|
||||||
using Mapster;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,6 @@ using JiShe.ServicePro.DeviceManagement.Permissions;
|
|||||||
using JiShe.ServicePro.Dto;
|
using JiShe.ServicePro.Dto;
|
||||||
using JiShe.ServicePro.Enums;
|
using JiShe.ServicePro.Enums;
|
||||||
using JiShe.ServicePro.FreeRedisProvider;
|
using JiShe.ServicePro.FreeRedisProvider;
|
||||||
using JiShe.ServicePro.Kafka.Consts;
|
|
||||||
using JiShe.ServicePro.Kafka.Producer;
|
|
||||||
using JiShe.ServicePro.OneNET.Provider.OpenApiModels.Devices;
|
|
||||||
using JiShe.ServicePro.OneNETManagement.OneNETDevices;
|
using JiShe.ServicePro.OneNETManagement.OneNETDevices;
|
||||||
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
|
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
@ -300,7 +297,7 @@ namespace JiShe.IoT.DeviceAggregation
|
|||||||
}
|
}
|
||||||
else if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.CTWing)
|
else if (deviceInfo.IoTPlatform == IoTPlatformTypeEnum.CTWing)
|
||||||
{
|
{
|
||||||
await redisPubSubService.PublishReliableAsync(KafkaTopicConsts.CTWingAepCommandIssuedEventName,commandRequest);
|
await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.CTWingAepCommandIssuedEventName,commandRequest);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -599,7 +596,7 @@ namespace JiShe.IoT.DeviceAggregation
|
|||||||
throw new UserFriendlyException("设备不在线");
|
throw new UserFriendlyException("设备不在线");
|
||||||
}
|
}
|
||||||
|
|
||||||
await redisPubSubService.PublishReliableAsync(KafkaTopicConsts.OneNETCommandIssuedEventName, commandRequest);
|
await redisPubSubService.PublishReliableAsync(DistributedMessageCenterConst.OneNETCommandIssuedEventName, commandRequest);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|||||||
@ -60,8 +60,8 @@ namespace JiShe.IoT
|
|||||||
var commonService = context.ServiceProvider.GetRequiredService<ICommonService>();
|
var commonService = context.ServiceProvider.GetRequiredService<ICommonService>();
|
||||||
commonService.InitSelectTypetList();
|
commonService.InitSelectTypetList();
|
||||||
|
|
||||||
var issueSubscriberService = context.ServiceProvider.GetRequiredService<IOneNetIssueSubscriberService>();
|
var serviceCommunicationChannelSubscriberService = context.ServiceProvider.GetRequiredService<IServiceCommunicationChannelSubscriberService>();
|
||||||
issueSubscriberService.IssueCommandRedisSubscriber();
|
serviceCommunicationChannelSubscriberService.ServiceCommunicationDeviceStatusSubscriber();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,9 +6,7 @@ using JiShe.ServicePro;
|
|||||||
using JiShe.ServicePro.Core;
|
using JiShe.ServicePro.Core;
|
||||||
using JiShe.ServicePro.Encrypt;
|
using JiShe.ServicePro.Encrypt;
|
||||||
using JiShe.ServicePro.Enums;
|
using JiShe.ServicePro.Enums;
|
||||||
using JiShe.ServicePro.OneNETManagement.OneNETDevices;
|
|
||||||
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
|
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
|
||||||
using JiShe.ServicePro.ServerOptions;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
|
|||||||
@ -45,21 +45,10 @@ namespace JiShe.ServicePro.OneNETManagement.Subscribers
|
|||||||
|
|
||||||
|
|
||||||
// 订阅频道
|
// 订阅频道
|
||||||
await _redisPubSubService.SubscribeReliableAsync<DeviceStatusMessage>(RedisConst.ServiceCommunicationDeviceStatusEventName, async (message) =>
|
await _redisPubSubService.SubscribeReliableAsync<DeviceStatusMessage>(DistributedMessageCenterConst.ServiceCommunicationDeviceStatusEventName, async (message) =>
|
||||||
{
|
{
|
||||||
try
|
await HandDeviceStatus(message, callbackFreeSqlDbContext, callbackFreeSql);
|
||||||
{
|
|
||||||
//_logger.LogWarning($"Redis订阅收到设备状态消息: {message.Serialize()}");
|
|
||||||
|
|
||||||
HandDeviceStatus(message, callbackFreeSqlDbContext, callbackFreeSql).ConfigureAwait(false).GetAwaiter().GetResult();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError($"处理Redis订阅设备状态消息发生异常:{ex.Message},数据写入死信队列,消息体: {message.Serialize()}");
|
|
||||||
await _redisPubSubService.PublishReliableAsync(RedisConst.ServiceCommunicationDeviceStatusDLQ, message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user