From 4bf6896a3a6d816e07ffedd8a2bc9114f07db4a5 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 29 Jan 2020 10:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=94=AE=E5=90=8E=E6=88=96=E5=B7=AE=E8=AF=84?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E9=9A=90?= =?UTF-8?q?=E7=A7=81=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order_afs.go | 13 +++++++++++++ business/jxcallback/orderman/order_comment.go | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/business/jxcallback/orderman/order_afs.go b/business/jxcallback/orderman/order_afs.go index 166057e0c..dbb58cae3 100644 --- a/business/jxcallback/orderman/order_afs.go +++ b/business/jxcallback/orderman/order_afs.go @@ -8,6 +8,7 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/business/partner" "git.rosy.net.cn/jx-callback/globals" "github.com/astaxie/beego/orm" ) @@ -49,6 +50,18 @@ func (c *OrderManager) onAfsOrderNew(afsOrder *model.AfsOrder, orderStatus *mode afsOrder.Status = orderStatus.Status } globals.SugarLogger.Debugf("onAfsOrderNew2 orderID:%s", afsOrder.VendorOrderID) + // + if order, _ := c.LoadOrder(afsOrder.VendorOrderID, afsOrder.VendorID); order != nil { + if order.ConsigneeMobile2 == "" { + if handler := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID); handler != nil { + if order2, _ := handler.GetOrder(order.VendorOrgCode, order.VendorOrderID); order2 != nil && order.ConsigneeMobile != order2.ConsigneeMobile { + order.ConsigneeMobile = order2.ConsigneeMobile + c.UpdateOrderFields(order, []string{"ConsigneeMobile"}) + } + } + } + } + // dao.Begin(db) defer func() { if r := recover(); r != nil || err != nil { diff --git a/business/jxcallback/orderman/order_comment.go b/business/jxcallback/orderman/order_comment.go index 079ed953d..a5b4ffa87 100644 --- a/business/jxcallback/orderman/order_comment.go +++ b/business/jxcallback/orderman/order_comment.go @@ -110,6 +110,12 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) ( if order.ConsigneeMobile2 != "" { orderComment.ConsigneeMobile = order.ConsigneeMobile2 } else { + if handler := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID); handler != nil { + if order2, _ := handler.GetOrder(order.VendorOrgCode, order.VendorOrderID); order2 != nil && order.ConsigneeMobile != order2.ConsigneeMobile { + order.ConsigneeMobile = order2.ConsigneeMobile + partner.CurOrderManager.UpdateOrderFields(order, []string{"ConsigneeMobile"}) + } + } orderComment.ConsigneeMobile = order.ConsigneeMobile } } else {