|
@ -4,6 +4,7 @@ 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; |
|
|
|
|
|
using System.Reflection.Emit; |
|
|
using static System.Net.WebRequestMethods; |
|
|
using static System.Net.WebRequestMethods; |
|
|
|
|
|
|
|
|
namespace SDKAdapter.OperationPlatform.Client |
|
|
namespace SDKAdapter.OperationPlatform.Client |
|
@ -250,31 +251,25 @@ 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 levels = new List<int>() { 0, 1, 2 }; |
|
|
var qtResponse = supplier_ProductClient.GetProductCategoryList(new QuanTan_Supplier_SearchProductCategoryRequest() |
|
|
var items = new List<OP_ProductCategoryResponse>(); |
|
|
|
|
|
foreach (var level in levels) |
|
|
|
|
|
{ |
|
|
{ |
|
|
var qtResponse = supplier_ProductClient.GetProductCategoryList(new QuanTan_Supplier_SearchProductCategoryRequest() |
|
|
page = request.PageIndex, |
|
|
{ |
|
|
pageSize = request.PageSize, |
|
|
page = request.PageIndex, |
|
|
categoryLevel = request.Level |
|
|
pageSize = request.PageSize, |
|
|
}, request.AppKey, request.AppSecret); |
|
|
categoryLevel = level |
|
|
|
|
|
}, request.AppKey, request.AppSecret); |
|
|
if (qtResponse.Status != 200) |
|
|
if (qtResponse.Data.List != null && qtResponse.Data.List.Count() > 0) |
|
|
throw new BusinessException(qtResponse.Message); |
|
|
{ |
|
|
|
|
|
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 = items.Count, |
|
|
Count = qtResponse.Data?.Count ?? 0, |
|
|
Items = items |
|
|
Items = qtResponse.Data?.List?.Select(x => new OP_ProductCategoryResponse() |
|
|
|
|
|
{ |
|
|
|
|
|
CategoryId = x.CategoryId, |
|
|
|
|
|
CategoryName = x.CategoryName, |
|
|
|
|
|
CategoryPath = x.CategoryPath |
|
|
|
|
|
}).ToList() |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|