京东商城尝试订单

This commit is contained in:
苏尹岚
2020-05-26 18:33:21 +08:00
parent d011e53203
commit 153b64ef9e
5 changed files with 199 additions and 3 deletions

View File

@@ -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
}