|
@ -1,5 +1,6 @@ |
|
|
using BBWYB.Common.Http; |
|
|
using BBWYB.Common.Http; |
|
|
using BBWYB.Common.Models; |
|
|
using BBWYB.Common.Models; |
|
|
|
|
|
using com.alibaba.openapi.client; |
|
|
using QuanTan.SDK.Client.Supplier; |
|
|
using QuanTan.SDK.Client.Supplier; |
|
|
using QuanTan.SDK.Models.Supplier; |
|
|
using QuanTan.SDK.Models.Supplier; |
|
|
using SDKAdapter.OperationPlatform.Models; |
|
|
using SDKAdapter.OperationPlatform.Models; |
|
@ -249,20 +250,31 @@ namespace SDKAdapter.OperationPlatform.Client |
|
|
|
|
|
|
|
|
public override OP_ListResponse<OP_ProductCategoryResponse> GetProductCategoryList(OP_QueryProductCategoryRequest request) |
|
|
public override OP_ListResponse<OP_ProductCategoryResponse> GetProductCategoryList(OP_QueryProductCategoryRequest request) |
|
|
{ |
|
|
{ |
|
|
var qtResponse = supplier_ProductClient.GetProductCategoryList(new QuanTan_Supplier_SearchProductCategoryRequest() |
|
|
var levels = new List<int>() { 0, 1, 2 }; |
|
|
|
|
|
var items = new List<OP_ProductCategoryResponse>(); |
|
|
|
|
|
foreach (var level in levels) |
|
|
{ |
|
|
{ |
|
|
page = request.PageIndex, |
|
|
var qtResponse = supplier_ProductClient.GetProductCategoryList(new QuanTan_Supplier_SearchProductCategoryRequest() |
|
|
pageSize = request.PageSize |
|
|
{ |
|
|
}, request.AppKey, request.AppSecret); |
|
|
page = request.PageIndex, |
|
|
|
|
|
pageSize = request.PageSize, |
|
|
|
|
|
categoryLevel = level |
|
|
|
|
|
}, request.AppKey, request.AppSecret); |
|
|
|
|
|
if (qtResponse.Data.List != null && qtResponse.Data.List.Count() > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
items.AddRange(qtResponse.Data.List.Select(x => new OP_ProductCategoryResponse() |
|
|
|
|
|
{ |
|
|
|
|
|
CategoryId = x.CategoryId, |
|
|
|
|
|
CategoryName = x.CategoryName, |
|
|
|
|
|
CategoryPath = x.CategoryPath |
|
|
|
|
|
}).ToList()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return new OP_ListResponse<OP_ProductCategoryResponse>() |
|
|
return new OP_ListResponse<OP_ProductCategoryResponse>() |
|
|
{ |
|
|
{ |
|
|
Count = qtResponse.Data.Count, |
|
|
Count = items.Count, |
|
|
Items = qtResponse.Data.List != null && qtResponse.Data.List.Count() > 0 ? qtResponse.Data.List.Select(x => new OP_ProductCategoryResponse() |
|
|
Items = items |
|
|
{ |
|
|
|
|
|
CategoryId = x.CategoryId, |
|
|
|
|
|
CategoryName = x.CategoryName, |
|
|
|
|
|
CategoryPath = x.CategoryPath |
|
|
|
|
|
}).ToList() : null |
|
|
|
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|