diff --git a/BPA.SAAS.Manage.Application/Device/Interface/IProductService.cs b/BPA.SAAS.Manage.Application/Device/Interface/IProductService.cs index e8d2391..eb3202e 100644 --- a/BPA.SAAS.Manage.Application/Device/Interface/IProductService.cs +++ b/BPA.SAAS.Manage.Application/Device/Interface/IProductService.cs @@ -1,5 +1,6 @@ using BPA.SAAS.Manage.Application.Device.Dtos.Device; using BPA.SAAS.Manage.Core.Base; +using BPA.SAAS.Manage.Core.Device; using BPA.SAAS.Manage.Core.Product; using System; using System.Collections.Generic; @@ -13,6 +14,7 @@ namespace BPA.SAAS.Manage.Application.Device.Interface { Task GetProductPage(ProductQueryInputDto inputDto); Task> GetProductList(); + Task GetDevice(string productId); Task AddProduct(ProductBaseDto inputDto); Task DeProduct(List inputList); Task UpdateProduct(ProductBaseDto inputDto); diff --git a/BPA.SAAS.Manage.Application/Device/ProductServices.cs b/BPA.SAAS.Manage.Application/Device/ProductServices.cs index fe65278..e9fa0b9 100644 --- a/BPA.SAAS.Manage.Application/Device/ProductServices.cs +++ b/BPA.SAAS.Manage.Application/Device/ProductServices.cs @@ -1,6 +1,7 @@ using BPA.SAAS.Manage.Application.Device.Dtos.Device; using BPA.SAAS.Manage.Application.Device.Interface; using BPA.SAAS.Manage.Core.Base; +using BPA.SAAS.Manage.Core.Device; using BPA.SAAS.Manage.Core.Product; using Microsoft.AspNetCore.Components.Forms; using System; @@ -39,6 +40,16 @@ namespace BPA.SAAS.Manage.Application.Device return await _productService.GetProductList(); } /// + /// 根据产品id查询产品信息 + /// + /// + /// + [HttpGet("/api/product/getdevice")] + public async Task GetDevice(string productId) + { + return await _productService.GetDevice(productId); + } + /// /// 添加 /// /// diff --git a/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs b/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs index a417aac..6651d01 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs @@ -74,6 +74,11 @@ namespace BPA.SAAS.Manage.Application.Device.Services }) .ToListAsync(); return data; } + public async Task GetDevice(string productId) + { + var data = await _db.Queryable().Where(x => x.Id == productId).FirstAsync(); + return data; + } /// /// 添加 ///