shanji 3 years ago
parent
commit
e71402d3a4
  1. 2
      BBWY.Server.Business/PlatformSDK/JDBusiness.cs
  2. 59
      BBWY.Test/Program.cs

2
BBWY.Server.Business/PlatformSDK/JDBusiness.cs

@ -80,7 +80,7 @@ namespace BBWY.Server.Business
var jdClient = GetJdClient(searchProductRequest.AppKey, searchProductRequest.AppSecret); var jdClient = GetJdClient(searchProductRequest.AppKey, searchProductRequest.AppSecret);
var req_productList = new WareReadSearchWare4ValidRequest() var req_productList = new WareReadSearchWare4ValidRequest()
{ {
orderField = "modified,wareStatus", orderField = "modified",
orderType = "desc", orderType = "desc",
pageSize = searchProductRequest.PageSize, pageSize = searchProductRequest.PageSize,
pageNo = searchProductRequest.PageIndex pageNo = searchProductRequest.PageIndex

59
BBWY.Test/Program.cs

@ -30,40 +30,41 @@ namespace BBWY.Test
var token = "2ace3023200c4ea9aa682bbf8bffee18jztm"; var token = "2ace3023200c4ea9aa682bbf8bffee18jztm";
var jdClient = GetJdClient(appKey, appSecret); var jdClient = GetJdClient(appKey, appSecret);
SearchProductSkuRequest searchProductRequest = new SearchProductSkuRequest()
{
AppKey = appKey,
AppSecret = appSecret,
AppToken = token,
Platform = Server.Model.Enums.Platform.,
Spu = "10022849663452"
};
AscQueryListRequest req = new AscQueryListRequest(); //var jdClient = GetJdClient(searchProductRequest.AppKey, searchProductRequest.AppSecret);
var req_skuList = new SkuReadSearchSkuListRequest()
{
pageSize = 50,//50
field = "logo,saleAttrs,status"
};
req.buId = "10598776"; if (!string.IsNullOrEmpty(searchProductRequest.Spu))
req.operatePin = "开发测试"; req_skuList.wareId = searchProductRequest.Spu;
req.operateNick = "开发测试"; else if (!string.IsNullOrEmpty(searchProductRequest.Sku))
req.orderId = 239918499544; req_skuList.skuId = searchProductRequest.Sku;
//req.finishTimeBegin = DateTime.Now.AddDays(-30); var rep_skuList = jdClient.Execute(req_skuList, searchProductRequest.AppToken, DateTime.Now.ToLocalTime());
//req.finishTimeEnd = DateTime.Now; if (rep_skuList.IsError)
//req.pageNumber = "1"; throw new BusinessException(string.IsNullOrEmpty(rep_skuList.ErrorMsg) ? rep_skuList.ErrMsg : rep_skuList.ErrorMsg);
//req.pageSize = "20"; var response = ((JArray)rep_skuList.Json["jingdong_sku_read_searchSkuList_responce"]["page"]["data"]).Select(s => new ProductSkuResponse()
//req.orderId = 164569571399; {
//req.serviceId = 123L; Id = s.Value<string>("skuId"),
//req.orderId = 123L; ProductId = s.Value<string>("wareId"),
//req.applyTimeBegin = new Date(); Price = s.Value<decimal>("jdPrice"),
//req.applyTimeEnd = new Date(); Title = string.Join("-", s["saleAttrs"].Select(a => a["attrValueAlias"][0].ToString())),
//req.finishTimeBegin = new Date(); Logo = $"https://img13.360buyimg.com/n9/s80x80_{s.Value<string>("logo")}",
//req.finishTimeEnd = new Date(); State = s.Value<int>("status")
//req.verificationCode = "abc"; }).ToList();
//req.expressCode = "abc";
//req.orderType = 123;
//req.processResult = 123;
//req.customerPin = "abc";
//req.customerName = "abc";
//req.customerTel = "abc";
//req.approveTimeBegin = new Date();
//req.approveTimeEnd = new Date();
//req.pageNumber = 123;
//req.pageSize = 123;
//req.extJsonStr = "abc";
AscQueryListResponse response = jdClient.Execute(req, token, DateTime.Now.ToLocalTime());
Console.WriteLine(JsonConvert.SerializeObject(response)); Console.WriteLine(JsonConvert.SerializeObject(response));
Console.ReadKey(); Console.ReadKey();
} }

Loading…
Cancel
Save