From f18ef3a1a9ba8227b1c4bc0b92cd94df6dfa4499 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, 21 Sep 2020 10:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E5=BE=B7page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/callback.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/business/partner/purchase/jdshop/callback.go b/business/partner/purchase/jdshop/callback.go index dc8315258..afeb8e7f5 100644 --- a/business/partner/purchase/jdshop/callback.go +++ b/business/partner/purchase/jdshop/callback.go @@ -114,9 +114,18 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err order.TotalShopMoney = 100 } if order.ConsigneeAddress != "" { - lng, lat, _ := api.AutonaviAPI.GetCoordinateFromAddress(order.ConsigneeAddress, "") - order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng) - order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat) + lng, lat, err2 := api.AutonaviAPI.GetCoordinateFromAddressByPage(order.ConsigneeAddress) + if err = err2; err != nil { + globals.SugarLogger.Infof("高德page err: %v", err) + } + if err == nil && lng != 0 && lat != 0 { + order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng) + order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat) + } else { + lng2, lat2, _ := api.AutonaviAPI.GetCoordinateFromAddress(order.ConsigneeAddress, "") + order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng2) + order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat2) + } order.CoordinateType = model.CoordinateTypeMars } for _, v := range msg.ItemInfoList {