From 5cdd58c5dc7ad3074af4243458c80fb02dcb36d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 5 Nov 2020 15:26:37 +0800 Subject: [PATCH] waybilljd --- platformapi/jdeclpapi/jdeclpapi.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platformapi/jdeclpapi/jdeclpapi.go b/platformapi/jdeclpapi/jdeclpapi.go index 8cdfdba6..1df1adce 100644 --- a/platformapi/jdeclpapi/jdeclpapi.go +++ b/platformapi/jdeclpapi/jdeclpapi.go @@ -417,7 +417,11 @@ func (a *API) QueryStock(goodsNo string) (queryStockResult []*QueryStockResult, 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]interface{})["receiveorderinfo_result"].(map[string]interface{})["deliveryId"].(string) + if utils.MustInterface2Int64(result["jingdong_ldop_waybill_receive_responce"].(map[string]interface{})["receiveorderinfo_result"].(map[string]interface{})["resultCode"]) != 0 { + return deliveryId, fmt.Errorf(result["jingdong_ldop_waybill_receive_responce"].(map[string]interface{})["receiveorderinfo_result"].(map[string]interface{})["resultMessage"].(string)) + } else { + deliveryId = result["jingdong_ldop_waybill_receive_responce"].(map[string]interface{})["receiveorderinfo_result"].(map[string]interface{})["deliveryId"].(string) + } } return deliveryId, err }