京东物流
This commit is contained in:
@@ -189,14 +189,14 @@ type WaybillReceiveParam struct {
|
||||
// VloumLong int `json:"vloumLong"` //否 无 包裹长(单位:cm,保留小数点后两位)
|
||||
// VloumWidth int `json:"vloumWidth"` //否 无 包裹宽(单位:cm,保留小数点后两位)
|
||||
// VloumHeight int `json:"vloumHeight"` //否 无 包裹高(单位:cm,保留小数点后两位)
|
||||
Vloumn int `json:"vloumn"` //是 10000 体积(单位:cm3,保留小数点后两位)
|
||||
// Description string `json:"description"` //否 无 商品描述
|
||||
Vloumn int `json:"vloumn"` //是 10000 体积(单位:cm3,保留小数点后两位)
|
||||
Description string `json:"description"` //否 无 商品描述
|
||||
// CollectionValue int `json:"collectionValue"` //否 1 是否代收货款(是:1,否:0。不填或者超出范围,默认是0)
|
||||
// CollectionMoney int `json:"collectionMoney"` //否 98.00 代收货款金额(保留小数点后两位)
|
||||
// GuaranteeValue int `json:"guaranteeValue"` //否 1 是否保价(是:1,否:0。不填或者超出范围,默认是0)
|
||||
// GuaranteeValueAmount int `json:"guaranteeValueAmount"` //否 100.00 保价金额(保留小数点后两位)
|
||||
// SignReturn int `json:"signReturn"` //否 1 签单返还(签单返还类型:0 不返单,1 普通返单,2 校验身份返单,3 电子签返单,4 电子返单+普通返单)
|
||||
// Aging int `json:"aging"` //否 1 时效(普通:1,工作日:2,非工作日:3,晚间:4。O2O一小时达:5。O2O定时达:6。不填或者超出范围,默认是1)
|
||||
Aging int `json:"aging"` //否 1 时效(普通:1,工作日:2,非工作日:3,晚间:4。O2O一小时达:5。O2O定时达:6。不填或者超出范围,默认是1)
|
||||
// TransType int `json:"transType"` //否 1 运输类型(陆运:1,航空:2。不填或者超出范围,默认是1)
|
||||
// Remark string `json:"remark"` //否 无 运单备注,长度:20,说明:打印面单时备注内容也会显示在快递面单上
|
||||
// GoodsType int `json:"goodsType"` //否 无 配送业务类型( 1:普通,3:填仓,4:特配,6:控温,7:冷藏,8:冷冻,9:深冷)默认是1
|
||||
@@ -413,9 +413,12 @@ func (a *API) QueryStock(goodsNo string) (queryStockResult []*QueryStockResult,
|
||||
|
||||
//京东物流接单接口
|
||||
//https://open.jd.com/home/home#/doc/api?apiCateId=64&apiId=2122&apiName=jingdong.ldop.waybill.receive
|
||||
func (a *API) WaybillReceive(waybillReceiveParam *WaybillReceiveParam) (err error) {
|
||||
_, err = a.AccessAPI("jingdong.ldop.waybill.receive", prodURL, utils.Struct2FlatMap(waybillReceiveParam))
|
||||
return err
|
||||
func (a *API) WaybillReceive(waybillReceiveParam *WaybillReceiveParam) (deliveryId string, err error) {
|
||||
result, err := a.AccessAPI("jingdong.ldop.waybill.receive", prodURL, utils.Struct2FlatMap(waybillReceiveParam))
|
||||
if err == nil {
|
||||
deliveryId = result["jingdong_ldop_waybill_receive_responce"].(map[string]map[string]string)["receiveorderinfo_result"]["deliveryId"]
|
||||
}
|
||||
return deliveryId, err
|
||||
}
|
||||
|
||||
//京东物流取消接口
|
||||
|
||||
@@ -97,14 +97,18 @@ func TestWaybillReceive(t *testing.T) {
|
||||
err := api.WaybillReceive(&WaybillReceiveParam{
|
||||
SalePlat: SalePlatSourceDelivery,
|
||||
CustomerCode: CustomerCode,
|
||||
OrderID: utils.GetUUID(),
|
||||
SenderName: "测试",
|
||||
SenderAddress: "测试地址1",
|
||||
ReceiveName: "测试",
|
||||
ReceiveAddress: "测试地址1",
|
||||
OrderID: "883289609977992",
|
||||
SenderName: "金牛店",
|
||||
SenderAddress: "四川省成都市金牛区加州湾v派",
|
||||
SenderTel: "18160030913",
|
||||
ReceiveName: "明珠怡园",
|
||||
ReceiveAddress: "四川省成都市天府大道",
|
||||
ReceiveTel: "18160030913",
|
||||
PackageCount: 1,
|
||||
Weight: 1,
|
||||
Weight: 100,
|
||||
Vloumn: 10000,
|
||||
Description: "测试",
|
||||
Aging: 5,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -114,7 +118,7 @@ func TestWaybillReceive(t *testing.T) {
|
||||
|
||||
func TestCancelWayBill(t *testing.T) {
|
||||
err := api.CancelWayBill(&CancelWayBillParam{
|
||||
WaybillCode: "11",
|
||||
WaybillCode: "JDVD00717018403",
|
||||
CustomerCode: CustomerCode,
|
||||
Source: "JOS",
|
||||
CancelReason: "测试",
|
||||
|
||||
Reference in New Issue
Block a user