diff --git a/BBWY.Server.API/Controllers/ProductController.cs b/BBWY.Server.API/Controllers/ProductController.cs
index 28c67212..57bd4f25 100644
--- a/BBWY.Server.API/Controllers/ProductController.cs
+++ b/BBWY.Server.API/Controllers/ProductController.cs
@@ -28,5 +28,16 @@ namespace BBWY.Server.API.Controllers
{
return productBusiness.GetProductSkuList(searchProductSkuRequest);
}
+
+ ///
+ /// 从本地查询SKU列表
+ ///
+ ///
+ ///
+ [HttpPost]
+ public IList GetProductSkuListFromLocal([FromBody] SearchProductSkuFromLocalRequest request)
+ {
+ return productBusiness.GetProductSkuListFromLocal(request);
+ }
}
}
diff --git a/BBWY.Server.Business/Product/ProductBusiness.cs b/BBWY.Server.Business/Product/ProductBusiness.cs
index 763d7690..96afa3d5 100644
--- a/BBWY.Server.Business/Product/ProductBusiness.cs
+++ b/BBWY.Server.Business/Product/ProductBusiness.cs
@@ -1,6 +1,7 @@
using BBWY.Common.Http;
using BBWY.Common.Models;
using BBWY.Server.Model;
+using BBWY.Server.Model.Db;
using BBWY.Server.Model.Dto;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
@@ -12,9 +13,10 @@ namespace BBWY.Server.Business
{
public class ProductBusiness : BasePlatformRelayBusiness, IDenpendency
{
- public ProductBusiness(RestApiService restApiService, IConfiguration configuration, IOptions options, YunDingBusiness yunDingBusiness) : base(restApiService, options, yunDingBusiness)
+ private IFreeSql fsql;
+ public ProductBusiness(RestApiService restApiService, IConfiguration configuration, IOptions options, YunDingBusiness yunDingBusiness, IFreeSql fsql) : base(restApiService, options, yunDingBusiness)
{
-
+ this.fsql = fsql;
}
public ProductListResponse GetProductList(SearchProductRequest searchProductRequest)
@@ -41,6 +43,11 @@ namespace BBWY.Server.Business
return response.Data;
}
+ public IList GetProductSkuListFromLocal(SearchProductSkuFromLocalRequest request)
+ {
+ return fsql.Select(request.SkuList).Where(ps => ps.ShopId == request.ShopId).ToList();
+ }
+
public ProductCategoryResponse GetCategoyrInfo(JDQueryCategoryRequest request)
{
var relayAPIHost = GetPlatformRelayAPIHost(request.Platform);
diff --git a/BBWY.Server.Model/Dto/Request/Product/SearchProductSkuFromLocalRequest.cs b/BBWY.Server.Model/Dto/Request/Product/SearchProductSkuFromLocalRequest.cs
new file mode 100644
index 00000000..c651bd03
--- /dev/null
+++ b/BBWY.Server.Model/Dto/Request/Product/SearchProductSkuFromLocalRequest.cs
@@ -0,0 +1,11 @@
+using System.Collections.Generic;
+
+namespace BBWY.Server.Model.Dto
+{
+ public class SearchProductSkuFromLocalRequest
+ {
+ public List SkuList { get; set; }
+
+ public long ShopId { get; set; }
+ }
+}