diff --git a/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Development.json b/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Development.json index 2058fd5..c9e0026 100644 --- a/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Development.json +++ b/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Development.json @@ -83,7 +83,7 @@ "DistributedMessage": 2, "SnowflakeWorkerId": 1, "DownloadDeviceFirmwareBasicUrl": "http://121.42.175.177:32580/Aggregation/Device/DownloadFirmware?Id=", - "MQTTServerType": 2 + "MQTTServerType": 1 }, "Jwt": { "Audience": "JiShe.IoT", diff --git a/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs b/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs index b09099b..e10d0df 100644 --- a/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs +++ b/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs @@ -458,6 +458,8 @@ namespace JiShe.IoT.BusinessSystemAggregation return HttpDataResultExtensions.Failed>(null, $"设备地址格式不正确: {messageBody.DeviceAddress}", -107); } + logger.LogWarning($"{nameof(QueryDeviceDataInfoAsync)} 业务系统查询单个设备数据调用数据查询接口,集中器地址为:{messageBody.DeviceAddress}"); + //执行脚本 var result = await FreeRedisProvider.Instance.EvalAsync ( diff --git a/src/JiShe.IoT.Application/IoTApplicationModule.cs b/src/JiShe.IoT.Application/IoTApplicationModule.cs index 492d9c6..8b76d8a 100644 --- a/src/JiShe.IoT.Application/IoTApplicationModule.cs +++ b/src/JiShe.IoT.Application/IoTApplicationModule.cs @@ -3,6 +3,7 @@ using JiShe.IoT.Jobs; using JiShe.ServicePro.CTWingManagement; using JiShe.ServicePro.DeviceManagement; using JiShe.ServicePro.DynamicMenuManagement; +using JiShe.ServicePro.EMQXProvider; using JiShe.ServicePro.FileManagement; using JiShe.ServicePro.FreeRedisProvider; using JiShe.ServicePro.FreeSqlProvider; @@ -29,6 +30,7 @@ namespace JiShe.IoT typeof(ServiceProFreeRedisProviderModule), typeof(CTWingManagementApplicationModule), typeof(OneNETManagementApplicationModule), + typeof(JiSheServiceProEMQXProviderModule), typeof(DeviceManagementApplicationModule) )] public class IoTApplicationModule : AbpModule diff --git a/src/JiShe.IoT.Application/IoTDeviceBasicAppService.cs b/src/JiShe.IoT.Application/IoTDeviceBasicAppService.cs index 3788110..d711828 100644 --- a/src/JiShe.IoT.Application/IoTDeviceBasicAppService.cs +++ b/src/JiShe.IoT.Application/IoTDeviceBasicAppService.cs @@ -123,6 +123,8 @@ namespace JiShe.IoT createDeviceInput.PlatformPassword = productInfo.ProductAccesskey; createDeviceInput.IoTPlatformProductName = productInfo.ProductName; createDeviceInput.AccountPhoneNumber = productInfo.AccountPhoneNumber; + createDeviceInput.ReadingMode = DeviceReadingModeEnum.StandardMode; + createDeviceInput.FirmwareVersion = "default"; if (input.DeviceType.HasValue) { createDeviceInput.DeviceType = input.DeviceType.Value; @@ -228,13 +230,7 @@ namespace JiShe.IoT if (input.DeviceType.HasValue) { createDeviceInput.DeviceType = input.DeviceType.Value; - } - - if (item.BusinessSystemDeviceDataId.HasValue) - { - createDeviceInput.BusinessSystemDeviceDataId = item.BusinessSystemDeviceDataId.Value; - } - + } batchCreateDeviceInput.DeviceInputs.Add(createDeviceInput); } diff --git a/src/JiShe.IoT.HttpApi/Controllers/BusinessSystemAggregationController.cs b/src/JiShe.IoT.HttpApi/Controllers/BusinessSystemAggregationController.cs index 863687e..d9bcb11 100644 --- a/src/JiShe.IoT.HttpApi/Controllers/BusinessSystemAggregationController.cs +++ b/src/JiShe.IoT.HttpApi/Controllers/BusinessSystemAggregationController.cs @@ -35,6 +35,16 @@ namespace JiShe.IoT.Controllers return await _businessSystemAggregationService.BatchQueryDeviceDataInfoAsync(input); } + /// + /// 业务系统查询单个设备数据 + /// + [HttpPost(nameof(QueryDeviceDataInfoAsync))] + [SwaggerOperation(summary: "业务系统查询单个设备数据", Tags = new[] { "AggregationBusiness" })] + public async Task QueryDeviceDataInfoAsync(OpenApiRequest input) + { + return await _businessSystemAggregationService.QueryDeviceDataInfoAsync(input); + } + /// /// 业务系统批量新增设备数据