From 1f2f6ce981dd164344aa1cf2263387638671bcbe Mon Sep 17 00:00:00 2001 From: ChenYi <296215406@outlook.com> Date: Fri, 31 Oct 2025 14:13:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IBusinessSystemAggregationService.cs | 2 ++ .../IDeviceAggregationService.cs | 5 +++ .../BusinessSystemAggregationService.cs | 20 ++++++++++- .../DeviceAggregationService.cs | 34 +++++++++++++++++++ .../BusinessSystemAggregationController.cs | 10 ++++++ .../DeviceAggregationController.cs | 28 ++++++++++++++- 6 files changed, 97 insertions(+), 2 deletions(-) diff --git a/src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/IBusinessSystemAggregationService.cs b/src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/IBusinessSystemAggregationService.cs index 4cb7c5b..d17add6 100644 --- a/src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/IBusinessSystemAggregationService.cs +++ b/src/JiShe.IoT.Application.Contracts/BusinessSystemAggregation/IBusinessSystemAggregationService.cs @@ -33,5 +33,7 @@ namespace JiShe.IoT.BusinessSystemAggregation /// /// Task BatchCreateDeviceInfoAsync(OpenApiRequest input); + + Task BatchCreateDeviceInfoAsync2(OpenApiRequest input); } } diff --git a/src/JiShe.IoT.Application.Contracts/DeviceAggregation/IDeviceAggregationService.cs b/src/JiShe.IoT.Application.Contracts/DeviceAggregation/IDeviceAggregationService.cs index f51fa15..ca4992f 100644 --- a/src/JiShe.IoT.Application.Contracts/DeviceAggregation/IDeviceAggregationService.cs +++ b/src/JiShe.IoT.Application.Contracts/DeviceAggregation/IDeviceAggregationService.cs @@ -1,4 +1,5 @@ using JiShe.IoT.DeviceAggregation.Dto; +using JiShe.ServicePro; using JiShe.ServicePro.Core; using JiShe.ServicePro.DeviceManagement.DeviceInfos; using Volo.Abp; @@ -75,5 +76,9 @@ namespace JiShe.IoT.DeviceAggregation /// /// Task BatchCreateDeviceBusinessSystemAsync(BatchCreateDeviceAggregationInput input); + + + Task BatchCreateDeviceInfoAsync(); + Task BatchCreateDeviceInfoAsync2(); } } diff --git a/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs b/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs index 9d8556b..54dd0d6 100644 --- a/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs +++ b/src/JiShe.IoT.Application/BusinessSystemAggregation/BusinessSystemAggregationService.cs @@ -220,6 +220,24 @@ namespace JiShe.IoT.BusinessSystemAggregation { return HttpDataResultExtensions.Failed($"查询设备数据失败,发送异常:{ex.Message}", -106); } - } + } + + + /// + /// 业务系统批量新增设备数据,Msg 字段为 BatchCreateDeviceInfoInput 实体 + /// + /// + /// + public async Task BatchCreateDeviceInfoAsync2(OpenApiRequest input) + { + try + { + return "新增设备成功"; + } + catch (Exception ex) + { + return ex.Message; + } + } } } diff --git a/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs b/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs index 45bdabc..e1bfb3c 100644 --- a/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs +++ b/src/JiShe.IoT.Application/DeviceAggregation/DeviceAggregationService.cs @@ -439,6 +439,40 @@ namespace JiShe.IoT.DeviceAggregation } } + /// + /// 业务系统批量新增设备数据,Msg 字段为 BatchCreateDeviceInfoInput 实体 + /// + /// + /// + public async Task BatchCreateDeviceInfoAsync() + { + try + { + return HttpDataResultExtensions.Success("新增设备成功"); + } + catch (Exception ex) + { + return HttpDataResultExtensions.Failed($"查询设备数据失败,发送异常:{ex.Message}", -106); + } + } + + /// + /// 业务系统批量新增设备数据,Msg 字段为 BatchCreateDeviceInfoInput 实体 + /// + /// + /// + public async Task BatchCreateDeviceInfoAsync2() + { + try + { + return "新增设备成功"; + } + catch (Exception ex) + { + return ex.Message; + } + } + /// /// OneNET设备批量创建 /// diff --git a/src/JiShe.IoT.HttpApi/Controllers/BusinessSystemAggregationController.cs b/src/JiShe.IoT.HttpApi/Controllers/BusinessSystemAggregationController.cs index dc8b9ff..7278477 100644 --- a/src/JiShe.IoT.HttpApi/Controllers/BusinessSystemAggregationController.cs +++ b/src/JiShe.IoT.HttpApi/Controllers/BusinessSystemAggregationController.cs @@ -45,5 +45,15 @@ namespace JiShe.IoT.Controllers { return await _businessSystemAggregationService.BatchCreateDeviceInfoAsync(input); } + + /// + /// 业务系统批量新增设备数据 + /// + [HttpPost(nameof(BatchCreateDeviceInfoAsync2))] + [SwaggerOperation(summary: "业务系统批量新增设备数据", Tags = new[] { "AggregationBusiness" })] + public async Task BatchCreateDeviceInfoAsync2(OpenApiRequest input) + { + return await _businessSystemAggregationService.BatchCreateDeviceInfoAsync2(input); + } } } diff --git a/src/JiShe.IoT.HttpApi/Controllers/DeviceAggregationController.cs b/src/JiShe.IoT.HttpApi/Controllers/DeviceAggregationController.cs index 9f49886..861c2ba 100644 --- a/src/JiShe.IoT.HttpApi/Controllers/DeviceAggregationController.cs +++ b/src/JiShe.IoT.HttpApi/Controllers/DeviceAggregationController.cs @@ -1,5 +1,6 @@ using JiShe.IoT.DeviceAggregation; using JiShe.IoT.DeviceAggregation.Dto; +using JiShe.ServicePro; using JiShe.ServicePro.Core; using JiShe.ServicePro.DeviceManagement.DeviceInfos; @@ -85,6 +86,31 @@ namespace JiShe.IoT.Controllers { return _deviceAggregationService.DeviceCommandForApiAsync(input); } - + + + /// + /// 发送设备指令信息 + /// + /// + /// + [HttpPost(nameof(DeviceCommandForApiAsync))] + [SwaggerOperation(summary: "发送设备指令信息", Tags = new[] { "AggregationDevice" })] + public Task BatchCreateDeviceInfoAsync() + { + return _deviceAggregationService.BatchCreateDeviceInfoAsync(); + } + + /// + /// 发送设备指令信息 + /// + /// + /// + [HttpPost(nameof(BatchCreateDeviceInfoAsync2))] + [SwaggerOperation(summary: "发送设备指令信息", Tags = new[] { "AggregationDevice" })] + public Task BatchCreateDeviceInfoAsync2() + { + return _deviceAggregationService.BatchCreateDeviceInfoAsync2(); + } + } }