京东商城尝试订单
This commit is contained in:
@@ -16,6 +16,6 @@ func init() {
|
||||
baseapi.Init(sugarLogger)
|
||||
api = New("de8157b447584885910f429011e49cb93yjq", "E1D746D42474D5F1F1A10CECE75D99F6", "efa7e1d1a22640fa990e6cf164b28608")
|
||||
api.SetCookieWithStr(`
|
||||
thor=80FAF09E9A09B6E618A68057BDFCFCB8C86E8252DC9F7D3B34572625904FBA0A74B88873C7657CFD518E07B0319B489D0282895A6DF7C0E1C67590D2864D06769657402E80191AB425B126C59F29522AE1C00344E2CF8D60E007F25BB4C1DE11431856BF15070B700ACB33124EA2661AE6D93D1E1A2A4D18A838CB5664BD7DFE61C73899267AC2D01237897F6D808568;
|
||||
thor=80FAF09E9A09B6E618A68057BDFCFCB83C345398FC0EA96BB93E21F628E09F69ABC4812E3C973FC424A9790F0EFBB575F0B38D3D40ED8C7FE094307204922296A626E5E990526A84EEA9E1F52BE923D06899DA48B400EBFCDB1F7934C84EAE4AA0D9454C7173B79CE6780DC12463FF8101D2D81F1975356E1E062C3B7A5EA9CF6DB6EFEF59F75691F88E2E044ADA79EF;
|
||||
`)
|
||||
}
|
||||
|
||||
@@ -181,3 +181,13 @@ func (a *API) QueryEntityStore(storeId int64) (queryEntityStoreResult *QueryEnti
|
||||
}
|
||||
return queryEntityStoreResult, err
|
||||
}
|
||||
|
||||
//获取门店信息2
|
||||
//https://open.jd.com/home/home#/doc/api?apiCateId=351&apiId=4972&apiName=jingdong.findStoreInfoByExtStoreId
|
||||
func (a *API) FindStoreInfoByExtStoreId(storeID int) (queryEntityStoreResult *QueryEntityStoreResult, err error) {
|
||||
_, err = a.AccessAPI("jingdong.findStoreInfoByExtStoreId", prodURL, map[string]interface{}{
|
||||
"extStoreId": storeID,
|
||||
})
|
||||
|
||||
return queryEntityStoreResult, err
|
||||
}
|
||||
|
||||
@@ -193,3 +193,170 @@ func (a *API) NewInfoList(storeID int64) (newInfoListResult *NewInfoListResult,
|
||||
newInfoListResult = newInfoListResult2[0]
|
||||
return newInfoListResult, err
|
||||
}
|
||||
|
||||
type AllOrdersParam struct {
|
||||
Current int `json:"current"`
|
||||
PageSize int `json:"pageSize"`
|
||||
SortName string `json:"sortName"`
|
||||
OrderID string `json:"orderId"`
|
||||
SkuName string `json:"skuName"`
|
||||
OrderCreateDateRange []string `json:"orderCreateDateRange"`
|
||||
OrderCompleteDateRange []interface{} `json:"orderCompleteDateRange"`
|
||||
ReceiverName string `json:"receiverName"`
|
||||
ReceiverTel string `json:"receiverTel"`
|
||||
UserPin string `json:"userPin"`
|
||||
SkuID string `json:"skuId"`
|
||||
LogiNo string `json:"logiNo"`
|
||||
PaymentType string `json:"paymentType"`
|
||||
OrderType string `json:"orderType"`
|
||||
OrderSource string `json:"orderSource"`
|
||||
DeliveryType string `json:"deliveryType"`
|
||||
StoreID string `json:"storeId"`
|
||||
HuoHao string `json:"huoHao"`
|
||||
OrderStatusArray []interface{} `json:"orderStatusArray"`
|
||||
SelectedTabName string `json:"selectedTabName"`
|
||||
}
|
||||
|
||||
type AllOrdersResult struct {
|
||||
TotalCount int `json:"totalCount"`
|
||||
Current int `json:"current"`
|
||||
OrderList []struct {
|
||||
XiaDanTime interface{} `json:"xiaDanTime"`
|
||||
ModifiedTime interface{} `json:"modifiedTime"`
|
||||
CustomsName interface{} `json:"customsName"`
|
||||
MerchantName interface{} `json:"merchantName"`
|
||||
CustomsModelName interface{} `json:"customsModelName"`
|
||||
ProcessStatus interface{} `json:"processStatus"`
|
||||
StorageAndShipStatus interface{} `json:"storageAndShipStatus"`
|
||||
ProcessStatusMsg interface{} `json:"processStatusMsg"`
|
||||
OrderID int64 `json:"orderId"`
|
||||
SelectedTabName interface{} `json:"selectedTabName"`
|
||||
VenderID int `json:"venderId"`
|
||||
OrderCreateTime string `json:"orderCreateTime"`
|
||||
PaymentConfirmTime string `json:"paymentConfirmTime"`
|
||||
OrderCompleteTime interface{} `json:"orderCompleteTime"`
|
||||
OrderItems []struct {
|
||||
WareID interface{} `json:"wareId"`
|
||||
SkuID int64 `json:"skuId"`
|
||||
SkuName string `json:"skuName"`
|
||||
HuoHao interface{} `json:"huoHao"`
|
||||
JdPrice float64 `json:"jdPrice"`
|
||||
SkuNum int `json:"skuNum"`
|
||||
SkuImg interface{} `json:"skuImg"`
|
||||
URL string `json:"url"`
|
||||
ServiceName string `json:"serviceName"`
|
||||
Imei interface{} `json:"imei"`
|
||||
SequenceFlag bool `json:"sequenceFlag"`
|
||||
SequenceInfoList interface{} `json:"sequenceInfoList"`
|
||||
UpdateCount interface{} `json:"updateCount"`
|
||||
CertificateFlag bool `json:"certificateFlag"`
|
||||
CertificateInfoList interface{} `json:"certificateInfoList"`
|
||||
MedicalInfoFlag bool `json:"medicalInfoFlag"`
|
||||
MedicalInfoParamVos interface{} `json:"medicalInfoParamVos"`
|
||||
UniqueCode interface{} `json:"uniqueCode"`
|
||||
InspectReportID interface{} `json:"inspectReportId"`
|
||||
} `json:"orderItems"`
|
||||
PaymentTypeName string `json:"paymentTypeName"`
|
||||
ShouldPay float64 `json:"shouldPay"`
|
||||
Freight float64 `json:"freight"`
|
||||
ServiceFee interface{} `json:"serviceFee"`
|
||||
Commission float64 `json:"commission"`
|
||||
CouponFlag bool `json:"couponFlag"`
|
||||
UserPin string `json:"userPin"`
|
||||
UserRemark string `json:"userRemark"`
|
||||
ConsigneeInfo interface{} `json:"consigneeInfo"`
|
||||
LogiFlag bool `json:"logiFlag"`
|
||||
LogisticsInfos []interface{} `json:"logisticsInfos"`
|
||||
StoreName interface{} `json:"storeName"`
|
||||
CodDT interface{} `json:"codDT"`
|
||||
ScDT interface{} `json:"scDT"`
|
||||
OrderStatusStrCN string `json:"orderStatusStrCN"`
|
||||
OrderStatus int `json:"orderStatus"`
|
||||
InvalidOrderFlag bool `json:"invalidOrderFlag"`
|
||||
OrderType int `json:"orderType"`
|
||||
CustomsModel interface{} `json:"customsModel"`
|
||||
SalesPin interface{} `json:"salesPin"`
|
||||
MdbStoreID interface{} `json:"mdbStoreId"`
|
||||
SuspendType interface{} `json:"suspendType"`
|
||||
SuspendReason interface{} `json:"suspendReason"`
|
||||
SuspendReasonDesc interface{} `json:"suspendReasonDesc"`
|
||||
SuspendDetailReasonFlag interface{} `json:"suspendDetailReasonFlag"`
|
||||
StoreInfo interface{} `json:"storeInfo"`
|
||||
IsDivShow bool `json:"isDivShow"`
|
||||
IsMenDianOrder bool `json:"isMenDianOrder"`
|
||||
IsMenDianBangOrder bool `json:"isMenDianBangOrder"`
|
||||
IsMenDianZiTiOrder bool `json:"isMenDianZiTiOrder"`
|
||||
IsPhoneOrder bool `json:"isPhoneOrder"`
|
||||
IsReturnOrder bool `json:"isReturnOrder"`
|
||||
IsPreSaleOrder bool `json:"isPreSaleOrder"`
|
||||
IsVenderSplitOrder bool `json:"isVenderSplitOrder"`
|
||||
IsAuctionOrder bool `json:"isAuctionOrder"`
|
||||
IsLargeAmountOrder bool `json:"isLargeAmountOrder"`
|
||||
IsMicroShopOrder bool `json:"isMicroShopOrder"`
|
||||
IsRuralPromotionOrder bool `json:"isRuralPromotionOrder"`
|
||||
IsHkMacaoOrder bool `json:"isHkMacaoOrder"`
|
||||
IsTaiWanOrder bool `json:"isTaiWanOrder"`
|
||||
IsOverseasOrder bool `json:"isOverseasOrder"`
|
||||
IsDistributionOrder bool `json:"isDistributionOrder"`
|
||||
IsJdDeliveryOrder bool `json:"isJdDeliveryOrder"`
|
||||
IsEclpOrder bool `json:"isEclpOrder"`
|
||||
IsYiPanHuoOrder bool `json:"isYiPanHuoOrder"`
|
||||
IsJingZunDaOrder bool `json:"isJingZunDaOrder"`
|
||||
IsBrandMall bool `json:"isBrandMall"`
|
||||
IsPinGou bool `json:"isPinGou"`
|
||||
IsYhd bool `json:"isYhd"`
|
||||
IsXtl bool `json:"isXtl"`
|
||||
IsSplitOrder bool `json:"isSplitOrder"`
|
||||
IsCloudWarehouseOrder bool `json:"isCloudWarehouseOrder"`
|
||||
IsTopLifeOrder bool `json:"isTopLifeOrder"`
|
||||
IsTuanGou bool `json:"isTuanGou"`
|
||||
IsDuoBaoDao bool `json:"isDuoBaoDao"`
|
||||
IsJingPinShi bool `json:"isJingPinShi"`
|
||||
BizLinkVo struct {
|
||||
ShowModifyFee bool `json:"showModifyFee"`
|
||||
ShowSingleOut bool `json:"showSingleOut"`
|
||||
ShowModifyAddr bool `json:"showModifyAddr"`
|
||||
ShowDelayDeliveryRemind bool `json:"showDelayDeliveryRemind"`
|
||||
ShowSplitOrder bool `json:"showSplitOrder"`
|
||||
ShowMoreLogisticsDelivery bool `json:"showMoreLogisticsDelivery"`
|
||||
ShowMergeDelivery bool `json:"showMergeDelivery"`
|
||||
ShowInfoCheck bool `json:"showInfoCheck"`
|
||||
ShowLivingAuth bool `json:"showLivingAuth"`
|
||||
ShowModifyWaybill bool `json:"showModifyWaybill"`
|
||||
} `json:"bizLinkVo"`
|
||||
IsOut bool `json:"isOut"`
|
||||
IsMultiLogisticsOutShow bool `json:"isMultiLogisticsOutShow"`
|
||||
PaimaiOrder int `json:"paimaiOrder"`
|
||||
CannotModifyProvinceAndCity bool `json:"cannotModifyProvinceAndCity"`
|
||||
CanWaitInnerShip bool `json:"canWaitInnerShip"`
|
||||
ShowShangChuanHeTong bool `json:"showShangChuanHeTong"`
|
||||
ShowManageCertificate bool `json:"showManageCertificate"`
|
||||
OrderSeqFlag bool `json:"orderSeqFlag"`
|
||||
CustomInfoFlag bool `json:"customInfoFlag"`
|
||||
OrderDaYangFlag bool `json:"orderDaYangFlag"`
|
||||
ShowMedicalInfo bool `json:"showMedicalInfo"`
|
||||
Card3CFlag bool `json:"card3cFlag"`
|
||||
ShowOrderPackage bool `json:"showOrderPackage"`
|
||||
ShowWaybill bool `json:"showWaybill"`
|
||||
IsGlobalZhiYouOrder bool `json:"isGlobalZhiYouOrder"`
|
||||
IsGlobalBaoShuiOrder bool `json:"isGlobalBaoShuiOrder"`
|
||||
ManageImeiFlag bool `json:"manageImeiFlag"`
|
||||
SpecialViewOrder []interface{} `json:"specialViewOrder"`
|
||||
} `json:"orderList"`
|
||||
Cluster interface{} `json:"cluster"`
|
||||
}
|
||||
|
||||
//尝试扒订单
|
||||
//https://porder.shop.jd.com/order/orderlist/allOrders
|
||||
func (a *API) AllOrders(allOrdersParam *AllOrdersParam) (allOrdersResult *AllOrdersResult, err error) {
|
||||
result, err := a.AccessStorePage2("https://porder.shop.jd.com/order/orderlist", map[string]interface{}{
|
||||
"current": allOrdersParam.Current,
|
||||
"pageSize": allOrdersParam.PageSize,
|
||||
"selectedTabName": "allOrders",
|
||||
"sortName": "desc",
|
||||
})
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result, &allOrdersResult, false)
|
||||
}
|
||||
return allOrdersResult, err
|
||||
}
|
||||
|
||||
@@ -53,3 +53,14 @@ func Test11(t *testing.T) {
|
||||
bodyData, _ := ioutil.ReadAll(response.Body)
|
||||
fmt.Println("test1", string(bodyData))
|
||||
}
|
||||
|
||||
func TestAllOrders(t *testing.T) {
|
||||
result, err := api.AllOrders(&AllOrdersParam{
|
||||
Current: 1,
|
||||
PageSize: 10,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ func TestGetCounty(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFindSkuSiteStock(t *testing.T) {
|
||||
result, err := api.FindSkuSiteStock(24337902, 69353673334)
|
||||
result, err := api.FindSkuSiteStock(24340329, 69353633443)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -71,7 +71,7 @@ func TestFindSkuSiteStock(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateSkuSiteStock(t *testing.T) {
|
||||
err := api.UpdateSkuSiteStock(69353673334, 0, 24337902)
|
||||
err := api.UpdateSkuSiteStock(69353633443, 0, 24340329)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -85,3 +85,11 @@ func TestQueryEntityStore(t *testing.T) {
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestFindStoreInfoByExtStoreId(t *testing.T) {
|
||||
result, err := api.FindStoreInfoByExtStoreId(666854)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user