物模型管理功能

This commit is contained in:
ChenYi 2025-10-17 17:25:33 +08:00
parent 21dd36de64
commit 38ac4477e9
17 changed files with 231 additions and 466 deletions

@ -1 +1 @@
Subproject commit 5eee6ae6ecdae8325f89c8a1bff2007062388dd8
Subproject commit 87668ccc6f5fea1111470327fa7da683b9756430

View File

@ -1,46 +0,0 @@
using JiShe.ServicePro;
using Swashbuckle.AspNetCore.Annotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.CTWingAggregation.Dto
{
/// <summary>
/// 生产车间获取CTWing产品列表
/// </summary>
public class CTWingWorkshopProductListOutput : OpenApiRequest
{
/// <summary>
/// 产品数据Id
/// </summary>
[SwaggerSchema("产品数据Id")]
public Guid ProductDataId { get; set; }
/// <summary>
/// 产品名称
/// </summary>
[SwaggerSchema("产品名称")]
public string ProductName { get; set; }
/// <summary>
/// 设备访问密钥
/// </summary>
[SwaggerSchema("设备访问密钥")]
public string ProductAccesskey { get; set; }
/// <summary>
/// 通讯服务地址
/// </summary>
[SwaggerSchema("通讯服务地址")]
public string CommunicationAddress { get; set; }
/// <summary>
/// TLS通讯服务地址
/// </summary>
[SwaggerSchema("TLS通讯服务地址")]
public string CommunicationAddressTLS { get; set; }
}
}

View File

@ -1,26 +0,0 @@
using JiShe.IoT.CTWingAggregation.Dto;
using JiShe.IoT.OneNETAggregation.Dto;
using JiShe.ServicePro;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.CTWingAggregation
{
public interface ICTWingAggregationService : IApplicationService
{
/// <summary>
/// 接收车间生产信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<HttpDataResult> ReceiveWorkshopProductionInfoAsync(OpenApiRequest input);
/// <summary>
/// 获取CTWing产品列表
/// </summary>
Task<HttpDataResult> GetProductListAsync(OpenApiRequest input);
}
}

View File

@ -23,5 +23,10 @@ namespace JiShe.IoT.Workshops
/// 物联网平台对应的产品Id
/// </summary>
public string IoTPlatformProductId { get; set; }
/// <summary>
/// 平台类型
/// </summary>
public IoTPlatformTypeEnum IoTPlatform { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using JiShe.ServicePro.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.Workshops
{
/// <summary>
/// 车间产品列表请求参数
/// </summary>
public class WorkshopProductListInput
{
/// <summary>
/// 平台类型
/// </summary>
public IoTPlatformTypeEnum IoTPlatform { get; set; }
}
}

View File

@ -6,12 +6,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.OneNETAggregation.Dto
namespace JiShe.IoT.Workshops
{
/// <summary>
/// 生产车间获取OneNET产品列表
/// 生产车间获取产品列表
/// </summary>
public class OneNetWorkshopProductListOutput
public class WorkshopProductListOutput
{
/// <summary>
/// 产品数据Id

View File

@ -1,4 +1,4 @@
using JiShe.IoT.OneNETAggregation.Dto;
using JiShe.IoT.Workshops;
using JiShe.ServicePro;
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
using System;
@ -7,12 +7,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.OneNETAggregation
namespace JiShe.IoT.Workshops
{
/// <summary>
/// OneNET聚合服务
/// 生产车间聚合服务
/// </summary>
public interface IOneNETAggregationService : IApplicationService
public interface IWorkshopAggregationService : IApplicationService
{
/// <summary>
/// 接收车间生产信息
@ -22,8 +22,8 @@ namespace JiShe.IoT.OneNETAggregation
Task<HttpDataResult> ReceiveWorkshopProductionInfoAsync(OpenApiRequest input);
/// <summary>
/// 获取OneNET产品列表
/// 获取物联网产品列表
/// </summary>
Task<HttpDataResult> GetProductListAsync(OpenApiRequest input);
Task<HttpDataResult<List<WorkshopProductListOutput>>> GetProductListAsync(OpenApiRequest input);
}
}

View File

@ -45,36 +45,6 @@ namespace JiShe.IoT.BusinessSystemAggregation
var messageBody = handleResult.Data;
string tempMessageBody = null;
//bool verifySignatureReult = EncryptUtil.OpenApiVerifySignature(input.Message, input.Nonce, input.Timestamp, input.Signature, srverOptions.SignatureToken);
//if (verifySignatureReult == false)//签名校验失败
//{
// return HttpDataResultExtensions.Failed("签名校验失败", -101, ResponeResultEnum.NotAllowed);
//}
//if (string.IsNullOrWhiteSpace(input.Message))
//{
// return HttpDataResultExtensions.Failed("指令下发内容不能为空", -102, ResponeResultEnum.Fail);
//}
////判断是否需要解密
//ReceiveCommandInfoDto messageBody = null;
//string tempMessageBody = null;
//if (srverOptions.IsAesEncrypted && !string.IsNullOrWhiteSpace(srverOptions.AesSecurityKey))
//{
// tempMessageBody = EncryptUtil.OpenApiDecrypto(input.Message, srverOptions.AesSecurityKey);
// messageBody = tempMessageBody.Deserialize<ReceiveCommandInfoDto>();
//}
//else
//{
// tempMessageBody = input.Message;
// messageBody = input.Message.Deserialize<ReceiveCommandInfoDto>();
//}
//if (messageBody == null)
//{
// return HttpDataResultExtensions.Failed("指令下发内容不能为空", -103, ResponeResultEnum.Fail);
//}
//限定来源类型必须为业务系统
if (messageBody.SourceType != DeviceTelemetrySourceTypeEnum.BusinessSystem)
{

View File

@ -1,120 +0,0 @@
using JiShe.IoT.CTWingAggregation.Dto;
using JiShe.IoT.DeviceAggregation;
using JiShe.IoT.DeviceAggregation.Dto;
using JiShe.IoT.Workshops;
using JiShe.ServicePro;
using JiShe.ServicePro.Core;
using JiShe.ServicePro.CTWingManagement.CTWingProduct;
using JiShe.ServicePro.Encrypt;
using JiShe.ServicePro.Enums;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace JiShe.IoT.CTWingAggregation
{
/// <summary>
/// CTWing聚合服务
/// </summary>
/// <param name="deviceAggregationService">设备聚合服务</param>
/// <param name="options"></param>
/// <param name="logger"></param>
public class CTWingAggregationService(IDeviceAggregationService deviceAggregationService, IOptions<ServerApplicationOptions> options, ILogger<CTWingAggregationService> logger) : IoTAppService, ICTWingAggregationService
{
ServerApplicationOptions srverOptions = options.Value;
/// <summary>
/// 接收车间生产信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[AllowAnonymous]
public async Task<HttpDataResult> ReceiveWorkshopProductionInfoAsync(OpenApiRequest input)
{
try
{
bool verifySignatureReult = EncryptUtil.OpenApiVerifySignature(input.Message, input.Nonce, input.Timestamp, input.Signature, srverOptions.SignatureToken);
if (verifySignatureReult == false)//签名校验失败
{
return HttpDataResultExtensions.Failed("签名校验失败", -101, ResponeResultEnum.NotAllowed);
}
ProductionEquipmentMessageBody productionEquipmentMessageBody = input.Message.Deserialize<ProductionEquipmentMessageBody>();
if (string.IsNullOrWhiteSpace(productionEquipmentMessageBody.IoTPlatformProductId))
{
return HttpDataResultExtensions.Failed("CTWing平台产品Id不能为空", -102, ResponeResultEnum.Fail);
}
if (string.IsNullOrWhiteSpace(productionEquipmentMessageBody.DeviceAddress))
{
return HttpDataResultExtensions.Failed("设备地址不能为空", -103, ResponeResultEnum.Fail);
}
CreateDeviceAggregationInput deviceInsertInput = new CreateDeviceAggregationInput()
{
DeviceAddress = productionEquipmentMessageBody.DeviceAddress,
IoTPlatformProductId = productionEquipmentMessageBody.IoTPlatformProductId,
IoTPlatform = IoTPlatformTypeEnum.CTWing,
};
//创建设备信息
var insertResult = await deviceAggregationService.CreateDeviceWorkshopAsync(deviceInsertInput);
if (!insertResult)
{
logger.LogError($"{nameof(ReceiveWorkshopProductionInfoAsync)} 创建设备信息失败:{insertResult.Serialize()}");
return HttpDataResultExtensions.Failed("CTWing推送设备失败", -105);
}
return HttpDataResultExtensions.Success("CTWing推送设备成功");
}
catch (Exception ex)
{
logger.LogError($"{nameof(ReceiveWorkshopProductionInfoAsync)} 生产车间数据推送发生异常:{ex.Serialize()}");
return HttpDataResultExtensions.Failed("生产车间推送CTWing数据发生异常", -107, ResponeResultEnum.Exception);
}
}
/// <summary>
/// 获取CTWing产品列表
/// </summary>
[AllowAnonymous]
public async Task<HttpDataResult> GetProductListAsync(OpenApiRequest input)
{
try
{
bool verifySignatureReult = EncryptUtil.OpenApiVerifySignature(input.Message, input.Nonce, input.Timestamp, input.Signature, srverOptions.SignatureToken);
if (verifySignatureReult == false)//签名校验失败
{
return HttpDataResultExtensions.Failed("签名校验失败", -101, ResponeResultEnum.NotAllowed);
}
var pageListQuery = FreeSqlDbContext.Instance.Select<CTWingPrivateProductInfo>()
.Where(e => e.IsEnabled == true)
.OrderByDescending(e => e.CreationTime);
var pageList = await pageListQuery.ToListAsync(d => new CTWingWorkshopProductListOutput
{
ProductDataId = d.Id,
ProductName = d.ProductName,
CommunicationAddress = d.CommunicationAddress,
ProductAccesskey = d.FeatureAccesskey,
});
if (pageList == null || pageList.Count <= 0)
{
return HttpDataResultExtensions.Failed("获取CTWing产品失败", -102, ResponeResultEnum.NotAllowed);
}
var rawMessage = pageList.Serialize();
var signatureResult = EncryptUtil.OpenApiSignature(rawMessage, DateTimeOffset.UtcNow.AddSeconds(3).ToUnixTimeMilliseconds(), srverOptions.SignatureToken);
return HttpDataResultExtensions.Success(rawMessage, signatureResult.Item1, signatureResult.Item2);
}
catch (Exception)
{
throw;
}
}
}
}

View File

@ -69,6 +69,7 @@ namespace JiShe.IoT.DeviceAggregation
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[Authorize(DeviceManagementPermissions.DeviceInfoManagement.Create)]
public async Task<bool> BatchCreateDeviceForApiAsync(BatchCreateDeviceAggregationInput input)
{
try

View File

@ -103,6 +103,12 @@ namespace JiShe.IoT
//判断是否需要解密
T messageBody = default;
string tempMessageBody = null;
if (string.IsNullOrWhiteSpace(input.Message))
{
return HttpDataResultExtensions.Success(messageBody, "签名校验成功,没有请求体");
}
if (serverOptions.IsAesEncrypted && !string.IsNullOrWhiteSpace(serverOptions.AesSecurityKey))
{
tempMessageBody = EncryptUtil.OpenApiDecrypto(input.Message, serverOptions.AesSecurityKey);

View File

@ -1,142 +0,0 @@
using JiShe.IoT.DeviceAggregation;
using JiShe.IoT.DeviceAggregation.Dto;
using JiShe.IoT.OneNETAggregation.Dto;
using JiShe.IoT.Workshops;
using JiShe.ServicePro;
using JiShe.ServicePro.Core;
using JiShe.ServicePro.Encrypt;
using JiShe.ServicePro.Enums;
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace JiShe.IoT.OneNETAggregation
{
/// <summary>
/// OneNET聚合服务
/// </summary>
/// <param name="deviceAggregationService">设备聚合服务</param>
/// <param name="options">服务配置</param>
/// <param name="logger"></param>
public class OneNETAggregationService(IDeviceAggregationService deviceAggregationService, IOptions<ServerApplicationOptions> options, ILogger<OneNETAggregationService> logger) : IoTAppService, IOneNETAggregationService
{
ServerApplicationOptions serverOptions = options.Value;
/// <summary>
/// 接收车间生产信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[AllowAnonymous]
public async Task<HttpDataResult> ReceiveWorkshopProductionInfoAsync(OpenApiRequest input)
{
try
{
bool verifySignatureReult = EncryptUtil.OpenApiVerifySignature(input.Message, input.Nonce, input.Timestamp, input.Signature, serverOptions.SignatureToken);
if (verifySignatureReult == false)//签名校验失败
{
return HttpDataResultExtensions.Failed("签名校验失败", -101, ResponeResultEnum.NotAllowed);
}
ProductionEquipmentMessageBody productionEquipmentMessageBody = null;
if (serverOptions.IsAesEncrypted && !string.IsNullOrWhiteSpace(serverOptions.AesSecurityKey))
{
string tempRaw = EncryptUtil.OpenApiDecrypto(input.Message, serverOptions.AesSecurityKey);
productionEquipmentMessageBody = tempRaw.Deserialize<ProductionEquipmentMessageBody>();
}
else
{
productionEquipmentMessageBody = input.Message.Deserialize<ProductionEquipmentMessageBody>();
}
if (string.IsNullOrWhiteSpace(productionEquipmentMessageBody.IoTPlatformProductId))
{
return HttpDataResultExtensions.Failed("物联网平台产品Id不能为空", -102, ResponeResultEnum.Fail);
}
if (string.IsNullOrWhiteSpace(productionEquipmentMessageBody.DeviceAddress))
{
return HttpDataResultExtensions.Failed("设备地址不能为空", -103, ResponeResultEnum.Fail);
}
CreateDeviceAggregationInput deviceInsertInput = new CreateDeviceAggregationInput()
{
DeviceAddress = productionEquipmentMessageBody.DeviceAddress,
IoTPlatform = IoTPlatformTypeEnum.OneNET,
IoTPlatformProductId = productionEquipmentMessageBody.IoTPlatformProductId,
};
//创建设备信息
var insertResult = await deviceAggregationService.CreateDeviceWorkshopAsync(deviceInsertInput);
if (!insertResult)
{
logger.LogError($"{nameof(ReceiveWorkshopProductionInfoAsync)} OneNET创建设备信息失败{insertResult.Serialize()}");
return HttpDataResultExtensions.Failed("OneNET推送设备失败", -105);
}
return HttpDataResultExtensions.Success("OneNET推送设备成功");
}
catch (Exception ex)
{
logger.LogError($"{nameof(ReceiveWorkshopProductionInfoAsync)} 生产车间数据推送发生异常:{ex.Serialize()}");
return HttpDataResultExtensions.Failed("生产车间推送OneNET数据发生异常", -107, ResponeResultEnum.Exception);
}
}
/// <summary>
/// 获取OneNET产品列表
/// </summary>
[AllowAnonymous]
public async Task<HttpDataResult> GetProductListAsync(OpenApiRequest input)
{
try
{
bool verifySignatureReult = EncryptUtil.OpenApiVerifySignature(input.Message, input.Nonce, input.Timestamp, input.Signature, serverOptions.SignatureToken);
if (verifySignatureReult == false)//签名校验失败
{
return HttpDataResultExtensions.Failed("签名校验失败", -101, ResponeResultEnum.NotAllowed);
}
if (serverOptions.IsAesEncrypted && !string.IsNullOrWhiteSpace(serverOptions.AesSecurityKey))
{
string tempRaw = EncryptUtil.OpenApiDecrypto(input.Message, serverOptions.AesSecurityKey);
}
var pageListQuery = FreeSqlDbContext.Instance.Select<OneNETProductInfos>()
.Where(e => e.IsEnabled == true)
.OrderByDescending(e => e.CreationTime);
var pageList = await pageListQuery.ToListAsync(d => new OneNetWorkshopProductListOutput
{
ProductDataId = d.Id,
ProductName = d.ProductName,
CommunicationAddress = d.CommunicationAddress,
ProductAccesskey = d.ProductAccesskey,
CommunicationAddressTLS = d.CommunicationAddressTLS
});
if (pageList == null || pageList.Count <= 0)
{
return HttpDataResultExtensions.Failed("获取OneNET产品失败", -102, ResponeResultEnum.NotAllowed);
}
var rawMessage = pageList.Serialize();
long timestamp = serverOptions.GetOpenApiSignatureTimeStamp();
var signatureResult = EncryptUtil.OpenApiSignature(rawMessage, timestamp, serverOptions.SignatureToken);
return HttpDataResultExtensions.Success(rawMessage, signatureResult.Item1, signatureResult.Item2);
}
catch (Exception)
{
throw;
}
}
}
}

View File

@ -0,0 +1,147 @@
using JiShe.IoT.DeviceAggregation;
using JiShe.IoT.DeviceAggregation.Dto;
using JiShe.IoT.Workshops;
using JiShe.ServicePro;
using JiShe.ServicePro.Core;
using JiShe.ServicePro.CTWingManagement.CTWingProduct;
using JiShe.ServicePro.Encrypt;
using JiShe.ServicePro.Enums;
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace JiShe.IoT.Workshops
{
/// <summary>
/// 生产车间聚合服务
/// </summary>
/// <param name="deviceAggregationService">设备聚合服务</param>
/// <param name="options">服务配置</param>
/// <param name="logger"></param>
public class WorkshopAggregationService(IDeviceAggregationService deviceAggregationService, IOptions<ServerApplicationOptions> options, ILogger<WorkshopAggregationService> logger) : IoTAppService, IWorkshopAggregationService
{
ServerApplicationOptions serverOptions = options.Value;
/// <summary>
/// 接收车间生产信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[AllowAnonymous]
public async Task<HttpDataResult> ReceiveWorkshopProductionInfoAsync(OpenApiRequest input)
{
try
{
var handleResult = HandleOpenApiRequest<ProductionEquipmentMessageBody>(input, serverOptions);
if (handleResult.Success == false)
{
return HttpDataResultExtensions.Failed("签名校验失败", -101, ResponeResultEnum.NotAllowed);
}
var productionEquipmentMessageBody = handleResult.Data;
if (string.IsNullOrWhiteSpace(productionEquipmentMessageBody.IoTPlatformProductId))
{
return HttpDataResultExtensions.Failed("物联网平台产品Id不能为空", -102, ResponeResultEnum.Fail);
}
if (string.IsNullOrWhiteSpace(productionEquipmentMessageBody.DeviceAddress))
{
return HttpDataResultExtensions.Failed("设备地址不能为空", -103, ResponeResultEnum.Fail);
}
CreateDeviceAggregationInput deviceInsertInput = new CreateDeviceAggregationInput()
{
DeviceAddress = productionEquipmentMessageBody.DeviceAddress,
IoTPlatform = productionEquipmentMessageBody.IoTPlatform,
IoTPlatformProductId = productionEquipmentMessageBody.IoTPlatformProductId,
};
//创建设备信息
var insertResult = await deviceAggregationService.CreateDeviceWorkshopAsync(deviceInsertInput);
if (!insertResult)
{
logger.LogError($"{nameof(ReceiveWorkshopProductionInfoAsync)} {productionEquipmentMessageBody.IoTPlatform}创建设备信息失败:{insertResult.Serialize()}");
return HttpDataResultExtensions.Failed($"{productionEquipmentMessageBody.IoTPlatform}推送设备失败!", -105);
}
return HttpDataResultExtensions.Success($"{productionEquipmentMessageBody.IoTPlatform}推送设备成功!");
}
catch (Exception ex)
{
logger.LogError($"{nameof(ReceiveWorkshopProductionInfoAsync)} 生产车间数据推送发生异常:{ex.Serialize()}");
return HttpDataResultExtensions.Failed($"生产车间推送数据发生异常", -107, ResponeResultEnum.Exception);
}
}
/// <summary>
/// 获取物联网产品列表
/// </summary>
[AllowAnonymous]
public async Task<HttpDataResult<List<WorkshopProductListOutput>>> GetProductListAsync(OpenApiRequest input)
{
try
{
var handleResult = HandleOpenApiRequest<WorkshopProductListInput>(input, serverOptions);
if (handleResult.Success == false)
{
return HttpDataResultExtensions.Failed<List<WorkshopProductListOutput>>("签名校验失败", -101, ResponeResultEnum.NotAllowed);
}
var messageBody = handleResult.Data;
List<WorkshopProductListOutput> workshopProductListOutputs = new List<WorkshopProductListOutput>();
if (messageBody.IoTPlatform == IoTPlatformTypeEnum.CTWing)
{
workshopProductListOutputs = await FreeSqlDbContext.Instance.Select<CTWingPrivateProductInfo>()
.Where(e => e.IsEnabled == true)
.OrderByDescending(e => e.CreationTime)
.ToListAsync(d => new WorkshopProductListOutput
{
ProductDataId = d.Id,
ProductName = d.ProductName,
CommunicationAddress = d.CommunicationAddress,
ProductAccesskey = d.FeatureAccesskey,
});
}
else if (messageBody.IoTPlatform == IoTPlatformTypeEnum.CTWing)
{
workshopProductListOutputs = await FreeSqlDbContext.Instance.Select<OneNETProductInfos>()
.Where(e => e.IsEnabled == true)
.OrderByDescending(e => e.CreationTime)
.ToListAsync(d => new WorkshopProductListOutput
{
ProductDataId = d.Id,
ProductName = d.ProductName,
CommunicationAddress = d.CommunicationAddress,
ProductAccesskey = d.ProductAccesskey,
CommunicationAddressTLS = d.CommunicationAddressTLS
});
}
else
{
logger.LogError($"{nameof(GetProductListAsync)} 未知物联网平台:{messageBody.IoTPlatform}");
return HttpDataResultExtensions.Failed<List<WorkshopProductListOutput>>("获取物联网产品失败,未知的平台", -102, ResponeResultEnum.NotAllowed);
}
if (workshopProductListOutputs == null || workshopProductListOutputs.Count <= 0)
{
return HttpDataResultExtensions.Failed<List<WorkshopProductListOutput>>("获取物联网产品失败", -102, ResponeResultEnum.NotAllowed);
}
return HttpDataResultExtensions.Success<List<WorkshopProductListOutput>>(workshopProductListOutputs, "获取物联网产品成功");
}
catch (Exception)
{
throw;
}
}
}
}

View File

@ -4,6 +4,7 @@ using JiShe.ServicePro.CTWingManagement.CTWingProduct;
using JiShe.ServicePro.CTWingManagement.EntityFrameworkCore;
using JiShe.ServicePro.DeviceManagement.DeviceInfos;
using JiShe.ServicePro.DeviceManagement.EntityFrameworkCore;
using JiShe.ServicePro.DeviceManagement.ThingModelInfos;
using JiShe.ServicePro.DynamicMenuManagement.EntityFrameworkCore;
using JiShe.ServicePro.DynamicMenuManagement.Menus;
using JiShe.ServicePro.FileManagement.EntityFrameworkCore;

View File

@ -1,41 +0,0 @@
using JiShe.IoT.CTWingAggregation;
using JiShe.IoT.CTWingAggregation.Dto;
using JiShe.ServicePro;
namespace JiShe.IoT.Controllers
{
/// <summary>
/// CTWing聚合服务
/// </summary>
[Route("/Aggregation/CTWing")]
public class CTWingAggregationController : IoTController
{
private readonly ICTWingAggregationService _ctwingAggregationServiceService;
public CTWingAggregationController(ICTWingAggregationService ctwingAggregationServiceService)
{
_ctwingAggregationServiceService = ctwingAggregationServiceService;
}
/// <summary>
/// 接收车间生产信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost(nameof(ReceiveWorkshopProductionInfoAsync))]
[SwaggerOperation(summary: "接收车间生产信息", Tags = new[] { "AggregationCTWing" })]
public async Task ReceiveWorkshopProductionInfoAsync(OpenApiRequest input)
{
await _ctwingAggregationServiceService.ReceiveWorkshopProductionInfoAsync(input);
}
/// <summary>
/// 获取CTWing产品列表
/// </summary>
[HttpPost(nameof(GetProductListAsync))]
[SwaggerOperation(summary: "获取CTWing产品列表", Tags = new[] { "AggregationCTWing" })]
public async Task<HttpDataResult> GetProductListAsync(OpenApiRequest input)
{
return await _ctwingAggregationServiceService.GetProductListAsync(input);
}
}
}

View File

@ -1,50 +0,0 @@
using JiShe.IoT.CommonServices;
using JiShe.IoT.CommonServices.Dto;
using JiShe.IoT.OneNETAggregation;
using JiShe.IoT.OneNETAggregation.Dto;
using JiShe.ServicePro;
using JiShe.ServicePro.Commons;
using JiShe.ServicePro.OneNETManagement.OneNETProducts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.Controllers
{
/// <summary>
/// OneNET聚合服务
/// </summary>
[Route("/Aggregation/OneNET")]
public class OneNETAggregationController : IoTController
{
private readonly IOneNETAggregationService _oneNETAggregationServiceService;
public OneNETAggregationController(IOneNETAggregationService oneNETAggregationServiceService)
{
_oneNETAggregationServiceService = oneNETAggregationServiceService;
}
/// <summary>
/// 接收车间生产信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost(nameof(ReceiveWorkshopProductionInfoAsync))]
[SwaggerOperation(summary: "接收车间生产信息", Tags = new[] { "AggregationOneNET" })]
public async Task<HttpDataResult> ReceiveWorkshopProductionInfoAsync(OpenApiRequest input)
{
return await _oneNETAggregationServiceService.ReceiveWorkshopProductionInfoAsync(input);
}
/// <summary>
/// 获取OneNET产品列表
/// </summary>
[HttpPost(nameof(GetProductListAsync))]
[SwaggerOperation(summary: "获取OneNET产品列表", Tags = new[] { "AggregationOneNET" })]
public async Task<HttpDataResult> GetProductListAsync(OpenApiRequest input)
{
return await _oneNETAggregationServiceService.GetProductListAsync(input);
}
}
}

View File

@ -0,0 +1,40 @@
using JiShe.IoT.Workshops;
using JiShe.ServicePro;
namespace JiShe.IoT.Controllers
{
/// <summary>
/// 生产车间聚合服务
/// </summary>
[Route("/Aggregation/Workshop")]
public class WorkshopAggregationController : IoTController
{
private readonly IWorkshopAggregationService _workshopAggregationService;
public WorkshopAggregationController(IWorkshopAggregationService workshopAggregationService)
{
_workshopAggregationService = workshopAggregationService;
}
/// <summary>
/// 接收车间生产信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost(nameof(ReceiveWorkshopProductionInfoAsync))]
[SwaggerOperation(summary: "接收车间生产信息", Tags = new[] { "Workshop" })]
public async Task<HttpDataResult> ReceiveWorkshopProductionInfoAsync(OpenApiRequest input)
{
return await _workshopAggregationService.ReceiveWorkshopProductionInfoAsync(input);
}
/// <summary>
/// 获取物联网产品列表
/// </summary>
[HttpPost(nameof(GetProductListAsync))]
[SwaggerOperation(summary: "获取物联网产品列表", Tags = new[] { "Workshop" })]
public async Task<HttpDataResult> GetProductListAsync(OpenApiRequest input)
{
return await _workshopAggregationService.GetProductListAsync(input);
}
}
}