From aeeb397915e1f03e1c4c66a857d777bb5c6cfbea Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Thu, 1 Feb 2024 16:02:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BA=A7=E5=93=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Device/Interface/IProductService.cs | 2 ++ BPA.SAAS.Manage.Application/Device/ProductServices.cs | 11 +++++++++++ .../Device/Services/DeviceService.cs | 5 +++++ 3 files changed, 18 insertions(+) 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; + } /// /// 添加 ///