From e4f059816cb030a841924679676a4f21a2c5aa36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 9 Mar 2020 15:47:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E4=B8=8B=E5=8D=95=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8Bprice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdeclpapi/jdeclpapi.go | 42 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/platformapi/jdeclpapi/jdeclpapi.go b/platformapi/jdeclpapi/jdeclpapi.go index 3e1fd159..71c06af2 100644 --- a/platformapi/jdeclpapi/jdeclpapi.go +++ b/platformapi/jdeclpapi/jdeclpapi.go @@ -8,6 +8,7 @@ import ( "strings" "time" + "git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi/platformapi" "git.rosy.net.cn/baseapi/utils" ) @@ -52,20 +53,20 @@ type QuerySpSourceResult struct { } type AddOrderParam struct { - IsvUUID string `json:"isvUUID"` //isv出库单号(商家出库单号),作为isv出库的唯一性校验码:长度不能超125 - IsvSource string `json:"isvSource"` //ISV来源编号 - ShopNo string `json:"shopNo"` //店铺编号(B2C订单必填,B2B(soType=2)订单非必填) - DepartmentNo string `json:"departmentNo"` //事业部编号,且与pin匹配 - WarehouseNo string `json:"warehouseNo"` //库房编号,事业部开启寻源拆分服务可不填;否则必填; - SalesPlatformOrderNo string `json:"salesPlatformOrderNo"` //销售平台订单号,如果销售平台来源为京东平台,则该字段不能为空,长度不超过200 - SalePlatformSource string `json:"salePlatformSource"` //销售平台来源 - ConsigneeName string `json:"consigneeName"` //收货人姓名,长度不能超20 - ConsigneeMobile string `json:"consigneeMobile"` //收货人手机(收货人电话、手机至少有一个不为空),长度不能超30 - ConsigneeAddress string `json:"consigneeAddress"` //收货人地址 ,长度不能超100 - OrderMark string `json:"orderMark"` //订单标记位,首位为1代表货到付款 - GoodsNo []string `json:"goodsNo"` //ECLP商品编号,与商家商品编号二选一必填(两者都指定,以goodsNo为准) - Price []int `json:"price"` //商品金额,会在订单面单上线上商品单价 - Quantity []int `json:"quantity"` //商品的出库数量,必须>0 + IsvUUID string `json:"isvUUID"` //isv出库单号(商家出库单号),作为isv出库的唯一性校验码:长度不能超125 + IsvSource string `json:"isvSource"` //ISV来源编号 + ShopNo string `json:"shopNo"` //店铺编号(B2C订单必填,B2B(soType=2)订单非必填) + DepartmentNo string `json:"departmentNo"` //事业部编号,且与pin匹配 + WarehouseNo string `json:"warehouseNo"` //库房编号,事业部开启寻源拆分服务可不填;否则必填; + SalesPlatformOrderNo string `json:"salesPlatformOrderNo"` //销售平台订单号,如果销售平台来源为京东平台,则该字段不能为空,长度不超过200 + SalePlatformSource string `json:"salePlatformSource"` //销售平台来源 + ConsigneeName string `json:"consigneeName"` //收货人姓名,长度不能超20 + ConsigneeMobile string `json:"consigneeMobile"` //收货人手机(收货人电话、手机至少有一个不为空),长度不能超30 + ConsigneeAddress string `json:"consigneeAddress"` //收货人地址 ,长度不能超100 + OrderMark string `json:"orderMark"` //订单标记位,首位为1代表货到付款 + GoodsNo []string `json:"goodsNo"` //ECLP商品编号,与商家商品编号二选一必填(两者都指定,以goodsNo为准) + Price []float64 `json:"price"` //商品金额,会在订单面单上线上商品单价 + Quantity []int `json:"quantity"` //商品的出库数量,必须>0 } type AddOrderResult struct { @@ -196,12 +197,11 @@ func (a *API) AccessAPI(action string, url string, bizParams map[string]interfac return platformapi.ErrLevelRecoverableErr, fmt.Errorf("mapData is nil") } if err == nil { - // returnCode := utils.Interface2String(jsonResult1["trxstatus"]) - // if returnCode != TrxStatusSuccess { - // errLevel = platformapi.ErrLevelGeneralFail - // err = utils.NewErrorCode(utils.Interface2String(jsonResult1["errmsg"])+utils.Interface2String(jsonResult1["retmsg"]), returnCode) - // baseapi.SugarLogger.Debugf("tonglianpay AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true)) - // } + if utils.Interface2String(jsonResult1["error_response"]) != "" { + errLevel = platformapi.ErrLevelGeneralFail + err = utils.NewErrorCode(utils.Interface2String(jsonResult1["error_response"]), jsonResult1["error_response"].(map[string]interface{})["code"].(string)) + baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true)) + } retVal = jsonResult1 } return errLevel, err @@ -236,7 +236,7 @@ func (a *API) CancelOrder(eclpSoNo string) (cancelOrderResult *CancelOrderResult "eclpSoNo": eclpSoNo, }) if err == nil { - utils.Map2StructByJson(result, &cancelOrderResult, false) + utils.Map2StructByJson(result["jingdong_eclp_order_cancelOrder_response"].(map[string]interface{})["cancelorder_result"], &cancelOrderResult, false) } return cancelOrderResult, err }