Browse Source

查询产品信息

master
zhaoy 11 months ago
parent
commit
aeeb397915
3 changed files with 18 additions and 0 deletions
  1. +2
    -0
      BPA.SAAS.Manage.Application/Device/Interface/IProductService.cs
  2. +11
    -0
      BPA.SAAS.Manage.Application/Device/ProductServices.cs
  3. +5
    -0
      BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs

+ 2
- 0
BPA.SAAS.Manage.Application/Device/Interface/IProductService.cs View File

@@ -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<PageUtil> GetProductPage(ProductQueryInputDto inputDto);
Task<List<BPA_Product>> GetProductList();
Task<BPA_DeviceInfo> GetDevice(string productId);
Task<bool> AddProduct(ProductBaseDto inputDto);
Task<bool> DeProduct(List<string> inputList);
Task<bool> UpdateProduct(ProductBaseDto inputDto);


+ 11
- 0
BPA.SAAS.Manage.Application/Device/ProductServices.cs View File

@@ -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();
}
/// <summary>
/// 根据产品id查询产品信息
/// </summary>
/// <param name="productId"></param>
/// <returns></returns>
[HttpGet("/api/product/getdevice")]
public async Task<BPA_DeviceInfo> GetDevice(string productId)
{
return await _productService.GetDevice(productId);
}
/// <summary>
/// 添加
/// </summary>
/// <param name="inputDto"></param>


+ 5
- 0
BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs View File

@@ -74,6 +74,11 @@ namespace BPA.SAAS.Manage.Application.Device.Services
}) .ToListAsync();
return data;
}
public async Task<BPA_DeviceInfo> GetDevice(string productId)
{
var data = await _db.Queryable<BPA_DeviceInfo>().Where(x => x.Id == productId).FirstAsync();
return data;
}
/// <summary>
/// 添加
/// </summary>


Loading…
Cancel
Save