|
|
@ -7,6 +7,7 @@ using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Threading; |
|
|
|
using BBWY.Common.Extensions; |
|
|
|
|
|
|
|
namespace BBWY.Test |
|
|
|
{ |
|
|
@ -296,12 +297,12 @@ namespace BBWY.Test |
|
|
|
/// <param name="client"></param>
|
|
|
|
/// <param name="token"></param>
|
|
|
|
/// <param name="accessPin"></param>
|
|
|
|
public void Test1(IJdClient client, string token, string accessPin) |
|
|
|
public void Test1(IJdClient client, string token) |
|
|
|
{ |
|
|
|
var pageIndex = 1; |
|
|
|
while (true) |
|
|
|
{ |
|
|
|
SyncShopPopularizeReportFormSkuLevel(client, token, accessPin, pageIndex, out int count); |
|
|
|
SyncShopPopularizeReportFormSkuLevel(client, token, pageIndex, out int count); |
|
|
|
if (count < 100) |
|
|
|
break; |
|
|
|
pageIndex++; |
|
|
@ -309,7 +310,7 @@ namespace BBWY.Test |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void SyncShopPopularizeReportFormSkuLevel(IJdClient client, string token, string accessPin, int pageIndex, out int currentCount) |
|
|
|
private void SyncShopPopularizeReportFormSkuLevel(IJdClient client, string token, int pageIndex, out int currentCount) |
|
|
|
{ |
|
|
|
currentCount = 0; |
|
|
|
|
|
|
@ -323,12 +324,16 @@ namespace BBWY.Test |
|
|
|
req12.endDay = "2022-10-16"; |
|
|
|
req12.giftFlag = "0"; |
|
|
|
req12.page = pageIndex.ToString(); |
|
|
|
req12.accessPin = accessPin; |
|
|
|
var res12 = client.Execute(req12, token, DateTime.Now.ToLocalTime()); |
|
|
|
|
|
|
|
|
|
|
|
if (res12.Json == null) |
|
|
|
res12.Json = JsonConvert.DeserializeObject<JObject>(res12.Body); |
|
|
|
|
|
|
|
Console.WriteLine($"----page {pageIndex}----"); |
|
|
|
Console.WriteLine(res12.Body); |
|
|
|
|
|
|
|
|
|
|
|
var j = (JArray)res12.Json["jingdong_ads_ibg_UniversalJosService_sku_query_responce"]["returnType"]["data"]["datas"]; |
|
|
|
currentCount = j.Count(); |
|
|
|
var sum = j.Select(j => new |
|
|
@ -336,12 +341,27 @@ namespace BBWY.Test |
|
|
|
Cost = j.Value<decimal>("cost"), |
|
|
|
}).Sum(x => x.Cost); |
|
|
|
|
|
|
|
Console.WriteLine($"{accessPin} page {pageIndex} sum {sum}"); |
|
|
|
Console.WriteLine($"page {pageIndex} sum {sum}"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void Test2(IJdClient client, string token) |
|
|
|
{ |
|
|
|
var req = new DspPlatformFinanceOpenapiQuerycostdetailsRequest(); |
|
|
|
req.beginDate = "2022-10-16"; |
|
|
|
req.endDate = "2022-10-16"; |
|
|
|
req.pageNo = 1; |
|
|
|
req.pageSize = 100; |
|
|
|
req.moneyType = 1; |
|
|
|
|
|
|
|
var response = client.Execute(req, token, DateTime.Now.ToLocalTime()); |
|
|
|
if (response.Json == null) |
|
|
|
response.Json = JsonConvert.DeserializeObject<JObject>(response.Body); |
|
|
|
Console.WriteLine(response.Body); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// SKU维度-京速推业务线-指定pin请求报表
|
|
|
|
/// </summary>
|
|
|
|