|
@ -1,5 +1,8 @@ |
|
|
using BBWY.JDSDK.Request; |
|
|
using BBWY.Common.Models; |
|
|
|
|
|
using BBWY.JDSDK.Request; |
|
|
|
|
|
using BBWY.Server.Model.Dto; |
|
|
using Jd.Api; |
|
|
using Jd.Api; |
|
|
|
|
|
using Jd.Api.Request; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using System; |
|
|
using System; |
|
@ -16,25 +19,45 @@ namespace BBWY.Test |
|
|
|
|
|
|
|
|
static void Main(string[] args) |
|
|
static void Main(string[] args) |
|
|
{ |
|
|
{ |
|
|
IJdClient client = new DefaultJdClient("https://api.jd.com/routerjson", "120EA9EC65AB017567D78CC1139EEEA5", "866a9877f5f24b03b537483b4defe75d"); |
|
|
string searchFields = "orderId,venderId,orderType,payType,orderTotalPrice,orderSellerPrice,orderPayment,freightPrice,orderState,orderStateRemark,orderRemark,orderStartTime,orderEndTime,modified,consigneeInfo,itemInfoList,couponDetailList,taxFee,venderRemark,pin,waybill,storeOrder,storeId,sellerDiscount"; |
|
|
|
|
|
|
|
|
var req = new AdsDspRtbKuaicheAccountCampaignReportRequest(); |
|
|
|
|
|
|
|
|
|
|
|
req.pageSize = 20; |
|
|
IJdClient jdClient = new DefaultJdClient("https://api.jd.com/routerjson", "120EA9EC65AB017567D78CC1139EEEA5", "866a9877f5f24b03b537483b4defe75d"); |
|
|
req.clickOrOrderDay = 1; |
|
|
|
|
|
//req.obys = "abc";
|
|
|
|
|
|
req.giftFlag = 0; |
|
|
|
|
|
req.orderStatusCategory = 1; |
|
|
|
|
|
req.endDay = DateTime.Now.Date.AddDays(-1); |
|
|
|
|
|
req.isDaily = true; |
|
|
|
|
|
req.startDay = DateTime.Now.Date; |
|
|
|
|
|
req.page = 1; |
|
|
|
|
|
//req.platform = "abc";
|
|
|
|
|
|
req.clickOrOrderCaliber = 0; |
|
|
|
|
|
|
|
|
|
|
|
var response = client.Execute(req, "ebd15797ff344a8da8e74879cb2acd13mtu3", DateTime.Now.ToLocalTime()); |
|
|
var str = "{\"StartDate\":\"2022-05-31 19:11:26\",\"EndDate\":\"2022-05-31 22:11:26\",\"PageIndex\":1,\"PageSize\":100,\"OrderId\":\"\",\"JDColType\":\"0\",\"OrderState\":null,\"Platform\":1,\"AppKey\":\"120EA9EC65AB017567D78CC1139EEEA5\",\"AppSecret\":\"866a9877f5f24b03b537483b4defe75d\",\"AppToken\":\"c638226881394594baed9dfc24d33c28diyn\",\"SaveResponseLog\":true}"; |
|
|
Console.WriteLine(JsonConvert.SerializeObject(response)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var searchOrderRequest = JsonConvert.DeserializeObject<SearchPlatformOrderRequest>(str); |
|
|
|
|
|
|
|
|
|
|
|
var sopReq = new PopOrderEnSearchRequest(); |
|
|
|
|
|
if (searchOrderRequest.StartDate != null) |
|
|
|
|
|
sopReq.startDate = searchOrderRequest.StartDate.Value.ToString("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
if (searchOrderRequest.EndDate != null) |
|
|
|
|
|
sopReq.endDate = searchOrderRequest.EndDate.Value.ToString("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
if (string.IsNullOrEmpty(searchOrderRequest.OrderState)) |
|
|
|
|
|
{ |
|
|
|
|
|
//WAIT_SELLER_STOCK_OUT,WAIT_GOODS_RECEIVE_CONFIRM,WAIT_SELLER_DELIVER,PAUSE,FINISHED_L,TRADE_CANCELED,LOCKED
|
|
|
|
|
|
sopReq.orderState = "WAIT_SELLER_STOCK_OUT,WAIT_GOODS_RECEIVE_CONFIRM,PAUSE,FINISHED_L,TRADE_CANCELED,LOCKED,NOT_PAY"; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
sopReq.orderState = searchOrderRequest.OrderState; //待转换
|
|
|
|
|
|
} |
|
|
|
|
|
sopReq.optionalFields = searchFields; |
|
|
|
|
|
sopReq.page = searchOrderRequest.PageIndex.ToString(); |
|
|
|
|
|
sopReq.pageSize = searchOrderRequest.PageSize.ToString(); |
|
|
|
|
|
sopReq.sortType = "1"; |
|
|
|
|
|
//sopReq.dateType = "";
|
|
|
|
|
|
|
|
|
|
|
|
var sopResponse = jdClient.Execute(sopReq, searchOrderRequest.AppToken, DateTime.Now.ToLocalTime()); |
|
|
|
|
|
|
|
|
|
|
|
if (sopResponse.IsError) |
|
|
|
|
|
throw new BusinessException($"获取SOP订单失败 {(string.IsNullOrEmpty(sopResponse.ErrorMsg) ? sopResponse.ErrMsg : sopResponse.ErrorMsg)}"); |
|
|
|
|
|
|
|
|
|
|
|
if (sopResponse.Json == null) |
|
|
|
|
|
sopResponse.Json = JObject.Parse(sopResponse.Body); |
|
|
|
|
|
Console.WriteLine(JsonConvert.SerializeObject(sopResponse)); |
|
|
|
|
|
//orderCount = sopResponse.Json["jingdong_pop_order_enSearch_responce"]["searchorderinfo_result"].Value<int>("orderTotal");
|
|
|
|
|
|
//orderJtokens.AddRange((JArray)sopResponse.Json["jingdong_pop_order_enSearch_responce"]["searchorderinfo_result"]["orderInfoList"]);
|
|
|
Console.ReadKey(); |
|
|
Console.ReadKey(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|