From b9f6a0ba299afd4b14df78479afcac816f47667e 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, 14 Sep 2020 15:09:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0=E4=BA=AC=E4=B8=9C=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 22 ++++++++++++++++++---- routers/commentsRouter_controllers.go | 11 ++++++++++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index dce7ad147..5323dafa7 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -1803,14 +1803,28 @@ func GenOrderNo(ctx *jxcontext.Context) (orderNo int64) { } func RefreshJdsOrderConsigneeInfo(ctx *jxcontext.Context, vendorOrderID string) (err error) { - var ( - // db = dao.GetDB() - ) order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, model.VendorIDJDShop) waybill, err := partner.CurOrderManager.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID) if waybill != nil { return fmt.Errorf("已经创建了三方运单不允许修改联系人信息!") } - + jdsOrder, err := jdshop.GetJdsOrder(order.VendorOrderID2) + if err != nil { + return err + } + if jdsOrder == nil { + return fmt.Errorf("未查询到对应的京东商城订单!") + } + order.ConsigneeAddress = jdshop.Decrypt(jdsOrder.ConsigneeInfo.FullAddress) + order.ConsigneeName = jdshop.Decrypt(jdsOrder.ConsigneeInfo.Fullname) + order.ConsigneeMobile = jdshop.Decrypt(jdsOrder.ConsigneeInfo.Mobile) + order.ConsigneeMobile2 = jdshop.Decrypt(jdsOrder.ConsigneeInfo.Telephone) + order.BuyerComment = jdsOrder.OrderRemark + if order.ConsigneeAddress != "" { + lng, lat, _ := api.AutonaviAPI.GetCoordinateFromAddress(order.ConsigneeAddress, "") + order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng) + order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat) + } + partner.CurOrderManager.UpdateOrderFields(order, []string{"ConsigneeAddress", "ConsigneeName", "ConsigneeMobile", "ConsigneeMobile2", "BuyerComment", "ConsigneeLng", "ConsigneeLat"}) return err } diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index 02272a803..52cdbcc15 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -65,7 +65,7 @@ func init() { beego.ControllerComments{ Method: "GetActStoreSkuInfo", Router: `/GetActStoreSkuInfo`, - AllowHTTPMethods: []string{"get"}, + AllowHTTPMethods: []string{"get","post"}, MethodParams: param.Make(), Filters: nil, Params: nil}) @@ -1278,6 +1278,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], + beego.ControllerComments{ + Method: "RefreshJdsOrderConsigneeInfo", + Router: `/RefreshJdsOrderConsigneeInfo`, + AllowHTTPMethods: []string{"put"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"], beego.ControllerComments{ Method: "RefreshOrderFinancial",