From d5b6651e5670a86365fd7e902093b0ccc409d48c Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Thu, 26 Feb 2026 17:12:50 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E6=A0=91=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=AD=98=E5=82=A8=E8=B7=AF=E5=BE=84=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84=EF=BC=8C=E4=BB=A5=E9=80=82?= =?UTF-8?q?=E9=85=8D=E4=B8=9A=E5=8A=A1=E7=B3=BB=E7=BB=9F=E5=85=B7=E4=BD=93?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E3=80=82?= =?UTF-8?q?=202=E3=80=81=E5=AE=8C=E5=96=84=E6=A0=91=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E6=A8=A1=E5=BC=8F=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=9F=A5=E8=AF=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configs/appsettings.Development.json | 2 +- .../BusinessSystemAggregationService.cs | 2 ++ src/JiShe.IoT.Application/IoTApplicationModule.cs | 2 ++ src/JiShe.IoT.Application/IoTDeviceBasicAppService.cs | 10 +++------- .../Controllers/BusinessSystemAggregationController.cs | 10 ++++++++++ 5 files changed, 18 insertions(+), 8 deletions(-) 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); + } + /// /// 业务系统批量新增设备数据