shanji 3 years ago
parent
commit
1710301c6f
  1. 62
      BBWY.JDSDK/Request/AdsDspRtbKuaicheAccountCampaignReportRequest.cs
  2. 102
      BBWY.JDSDK/Request/SkuReadSearchSkuListRequest.cs
  3. 9
      BBWY.JDSDK/Response/ActyEnqueryRegistrationDataCountResponse.cs
  4. 15
      BBWY.JDSDK/Response/AdsDspRtbKuaicheAccountCampaignReportResponse.cs
  5. 9
      BBWY.JDSDK/Response/AfsserviceAlltaskGetResponse.cs
  6. 4
      BBWY.Test/BBWY.Test.csproj
  7. 43
      BBWY.Test/Program.cs

62
BBWY.JDSDK/Request/AdsDspRtbKuaicheAccountCampaignReportRequest.cs

@ -0,0 +1,62 @@
using BBWY.JDSDK.Response;
using Jd.Api;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.JDSDK.Request
{
public class AdsDspRtbKuaicheAccountCampaignReportRequest : JdRequestBase<AdsDspRtbKuaicheAccountCampaignReportResponse>
{
public int pageSize { get; set; }
public int page { get; set; }
/// <summary>
/// 当天:0;昨天:1;最近15天:15
/// </summary>
public int clickOrOrderDay { get; set; }
/// <summary>
/// 赠品筛选 0 非赠品 1 赠品
/// </summary>
public int giftFlag { get; set; }
/// <summary>
/// 空:全部订单 1:成交订单
/// </summary>
public Nullable<int> orderStatusCategory { get; set; }
public DateTime endDay { get; set; }
public DateTime startDay { get; set; }
/// <summary>
/// 是否分日 true: 分日 false:不分日
/// </summary>
public bool isDaily { get; set; }
public string platform { get; set; }
/// <summary>
/// 点击口径:0 订单口径:1
/// </summary>
public int clickOrOrderCaliber { get; set; }
public override string ApiName => "jingdong.ads.dsp.rtb.kuaiche.accountCampaignReport";
protected override void PrepareParam(IDictionary<string, object> paramters)
{
paramters.Add("pageSize", pageSize);
paramters.Add("page", page);
paramters.Add("clickOrOrderDay", clickOrOrderDay);
paramters.Add("giftFlag", giftFlag);
paramters.Add("orderStatusCategory", orderStatusCategory);
paramters.Add("endDay", endDay);
paramters.Add("startDay", startDay);
paramters.Add("isDaily", isDaily);
paramters.Add("platform", platform);
paramters.Add("clickOrOrderCaliber", clickOrOrderCaliber);
}
}
}

102
BBWY.JDSDK/Request/SkuReadSearchSkuListRequest.cs

@ -7,106 +7,112 @@ namespace Jd.Api.Request
public class SkuReadSearchSkuListRequest : JdRequestBase<SkuReadSearchSkuListResponse> public class SkuReadSearchSkuListRequest : JdRequestBase<SkuReadSearchSkuListResponse>
{ {
public string public string
wareId {get; set; } wareId
{ get; set; }
public string public string
skuId {get; set; } skuId
{ get; set; }
public string public string
skuStatuValue {get; set; } skuStatuValue
{ get; set; }
public Nullable<long> public Nullable<long>
maxStockNum maxStockNum
{get; set;} { get; set; }
public Nullable<long> public Nullable<long>
minStockNum minStockNum
{get; set;} { get; set; }
public Nullable<DateTime> public Nullable<DateTime>
endCreatedTime endCreatedTime
{get; set;} { get; set; }
public Nullable<DateTime> public Nullable<DateTime>
endModifiedTime endModifiedTime
{get; set;} { get; set; }
public Nullable<DateTime> public Nullable<DateTime>
startCreatedTime startCreatedTime
{get; set;} { get; set; }
public Nullable<DateTime> public Nullable<DateTime>
startModifiedTime startModifiedTime
{get; set;} { get; set; }
public string public string
outId {get; set; } outId
{ get; set; }
public Nullable<int> public Nullable<int>
colType colType
{get; set;} { get; set; }
public string public string
itemNum itemNum
{get; set;} { get; set; }
public string public string
wareTitle wareTitle
{get; set;} { get; set; }
public string public string
orderFiled {get; set; } orderFiled
{ get; set; }
public string public string
orderType {get; set; } orderType
{ get; set; }
public Nullable<int> public Nullable<int>
pageNo pageNo
{get; set;} { get; set; }
public Nullable<int> public Nullable<int>
pageSize pageSize
{get; set;} { get; set; }
public string public string
field field
{get; set;} { get; set; }
public override string ApiName public override string ApiName
{ {
get{return "jingdong.sku.read.searchSkuList";} get { return "jingdong.sku.read.searchSkuList"; }
} }
protected override void PrepareParam(IDictionary<String, Object> parameters) protected override void PrepareParam(IDictionary<String, Object> parameters)
{ {
parameters.Add("wareId", this. wareId parameters.Add("wareId", this.wareId
); );
parameters.Add("skuId", this. skuId parameters.Add("skuId", this.skuId
); );
parameters.Add("skuStatuValue", this. skuStatuValue parameters.Add("skuStatuValue", this.skuStatuValue
); );
parameters.Add("maxStockNum", this. maxStockNum parameters.Add("maxStockNum", this.maxStockNum
); );
parameters.Add("minStockNum", this. minStockNum parameters.Add("minStockNum", this.minStockNum
); );
parameters.Add("endCreatedTime", this. endCreatedTime parameters.Add("endCreatedTime", this.endCreatedTime
); );
parameters.Add("endModifiedTime", this. endModifiedTime parameters.Add("endModifiedTime", this.endModifiedTime
); );
parameters.Add("startCreatedTime", this. startCreatedTime parameters.Add("startCreatedTime", this.startCreatedTime
); );
parameters.Add("startModifiedTime", this. startModifiedTime parameters.Add("startModifiedTime", this.startModifiedTime
); );
parameters.Add("outId", this. outId parameters.Add("outId", this.outId
); );
parameters.Add("colType", this. colType parameters.Add("colType", this.colType
); );
parameters.Add("itemNum", this. itemNum parameters.Add("itemNum", this.itemNum
); );
parameters.Add("wareTitle", this. wareTitle parameters.Add("wareTitle", this.wareTitle
); );
parameters.Add("orderFiled", this. orderFiled parameters.Add("orderFiled", this.orderFiled
); );
parameters.Add("orderType", this. orderType parameters.Add("orderType", this.orderType
); );
parameters.Add("pageNo", this. pageNo parameters.Add("pageNo", this.pageNo
); );
parameters.Add("page_size", this. pageSize parameters.Add("page_size", this.pageSize
); );
parameters.Add("field", this. field parameters.Add("field", this.field
); );
} }
} }

9
BBWY.JDSDK/Response/ActyEnqueryRegistrationDataCountResponse.cs

@ -2,13 +2,14 @@ using System;
using System.Xml.Serialization; using System.Xml.Serialization;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json; using Newtonsoft.Json;
using Jd.Api.Domain; using Jd.Api.Domain;
namespace Jd.Api.Response namespace Jd.Api.Response
{ {
public class ActyEnqueryRegistrationDataCountResponse:JdResponse{ public class ActyEnqueryRegistrationDataCountResponse : JdResponse
{
[JsonProperty("queryregistrationdatacount_result")] [JsonProperty("queryregistrationdatacount_result")]
public ActyResult public ActyResult
queryregistrationdatacountResult queryregistrationdatacountResult
{ get; set; } { get; set; }

15
BBWY.JDSDK/Response/AdsDspRtbKuaicheAccountCampaignReportResponse.cs

@ -0,0 +1,15 @@
using Jd.Api;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.JDSDK.Response
{
public class AdsDspRtbKuaicheAccountCampaignReportResponse : JdResponse
{
[JsonProperty("returnType")]
public JObject returnType { get; set; }
}
}

9
BBWY.JDSDK/Response/AfsserviceAlltaskGetResponse.cs

@ -2,13 +2,14 @@ using System;
using System.Xml.Serialization; using System.Xml.Serialization;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json; using Newtonsoft.Json;
using Jd.Api.Domain; using Jd.Api.Domain;
namespace Jd.Api.Response namespace Jd.Api.Response
{ {
public class AfsserviceAlltaskGetResponse:JdResponse{ public class AfsserviceAlltaskGetResponse : JdResponse
{
[JsonProperty("publicResultObject5")] [JsonProperty("publicResultObject5")]
public PublicResultObject5 public PublicResultObject5
publicResultObject5 publicResultObject5
{ get; set; } { get; set; }

4
BBWY.Test/BBWY.Test.csproj

@ -9,4 +9,8 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BBWY.JDSDK\BBWY.JDSDK.csproj" />
</ItemGroup>
</Project> </Project>

43
BBWY.Test/Program.cs

@ -1,4 +1,7 @@
using Newtonsoft.Json.Linq; using BBWY.JDSDK.Request;
using Jd.Api;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -13,29 +16,25 @@ namespace BBWY.Test
static void Main(string[] args) static void Main(string[] args)
{ {
var rootPath = @"C:\Users\pengcong001\Desktop"; IJdClient client = new DefaultJdClient("https://api.jd.com/routerjson", "120EA9EC65AB017567D78CC1139EEEA5", "866a9877f5f24b03b537483b4defe75d");
var resultList = new List<string>();
var minDate = 11; var maxDate = 25;
rootPath = @"C:\Users\pengcong001\Desktop\test";
for (var i = minDate; i <= maxDate; i++) var req = new AdsDspRtbKuaicheAccountCampaignReportRequest();
{
var content = io.File.ReadAllText(io.Path.Combine(rootPath, $"2022-05-{i}.txt"), Encoding.UTF8); req.pageSize = 20;
var matches = Regex.Matches(content, @"""logisticsCompanyName"":\s*""(.+)"","); req.clickOrOrderDay = 1;
foreach (Match match in matches) //req.obys = "abc";
{ req.giftFlag = 0;
if (match.Success) req.orderStatusCategory = 1;
{ req.endDay = DateTime.Now.Date.AddDays(-1);
var _1688logisticsCompanyName = match.Groups[1].Value; req.isDaily = true;
if (!resultList.Any(s => s.Equals(_1688logisticsCompanyName))) req.startDay = DateTime.Now.Date;
resultList.Add(_1688logisticsCompanyName); req.page = 1;
} //req.platform = "abc";
} req.clickOrOrderCaliber = 0;
}
Console.WriteLine(resultList.Count()); var response = client.Execute(req, "ebd15797ff344a8da8e74879cb2acd13mtu3", DateTime.Now.ToLocalTime());
Console.WriteLine(JsonConvert.SerializeObject(response));
foreach (var s in resultList)
Console.WriteLine(s);
Console.ReadKey(); Console.ReadKey();
} }
} }

Loading…
Cancel
Save