From 05f6b0cf20ea02a02f98a96d1e367f02d363016f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 17 Apr 2020 09:18:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E7=89=A9=E6=96=99=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=A2=9E=E5=8A=A0=E9=80=86=E5=90=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdapi/store_page.go | 16 +++++++++------- platformapi/jdeclpapi/jdeclpapi.go | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/platformapi/jdapi/store_page.go b/platformapi/jdapi/store_page.go index 4e9d7f81..b0308cbd 100644 --- a/platformapi/jdapi/store_page.go +++ b/platformapi/jdapi/store_page.go @@ -828,13 +828,15 @@ func (a *API) GetJdSkuDirectPrice(skuID int) (price int64, err error) { "pageSize": 1, } body, err := a.AccessStorePage2("https://stock-store.jddj.com/storeproduct/query", jdParams, true, "") - bodyStr := body.(map[string]interface{})["fakeData"].(string) - result := regexpJDSkuDirectPrice.FindAllStringSubmatch(bodyStr, -1) - if len(result) > 0 { - if result[3][1] != "" { - return utils.Float64TwoInt64(utils.Str2Float64(result[3][1]) * 100), err - } else { - return 0, err + if body != nil { + bodyStr := body.(map[string]interface{})["fakeData"].(string) + result := regexpJDSkuDirectPrice.FindAllStringSubmatch(bodyStr, -1) + if len(result) > 0 { + if result[3][1] != "" { + return utils.Float64TwoInt64(utils.Str2Float64(result[3][1]) * 100), err + } else { + return 0, err + } } } return price, err diff --git a/platformapi/jdeclpapi/jdeclpapi.go b/platformapi/jdeclpapi/jdeclpapi.go index 5cd0ea03..47035dba 100644 --- a/platformapi/jdeclpapi/jdeclpapi.go +++ b/platformapi/jdeclpapi/jdeclpapi.go @@ -43,6 +43,7 @@ const ( SoStatusCode10054 = "10054" //分拣中心发货 SoStatusCode10033 = "10033" //站点验收 SoStatusCode10034 = "10034" //妥投 + SoStatusCode10038 = "10038" //逆向完成 ) type API struct {