From e5ba31d37e2b641b587d1aa135a9cea6a9d6acfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 5 Aug 2024 11:32:53 +0800 Subject: [PATCH] 1 --- business/jxcallback/orderman/order_comment.go | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/business/jxcallback/orderman/order_comment.go b/business/jxcallback/orderman/order_comment.go index ca7ce778b..26d1c1909 100644 --- a/business/jxcallback/orderman/order_comment.go +++ b/business/jxcallback/orderman/order_comment.go @@ -77,7 +77,6 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) ( OrderId: orderComment.VendorOrderID, } err = dao.GetEntity(db, comment2, "OrderId") - globals.SugarLogger.Debugf("==============comment2 := %s", utils.Format4Output(comment2, false)) if err == nil || dao.IsNoRowsError(err) { isNewComment := false if dao.IsNoRowsError(err) { @@ -171,23 +170,20 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) ( //} } - //if err == nil { - // if isNewComment { - // err = dao.CreateEntity(db, comment2) - // } else if comment2 != nil { - // _, err = dao.UpdateEntity(db, comment2) - // } - //} - } - if err == nil { - if isNewComment { - err = dao.CreateEntity(db, comment2) - } else if comment2 != nil { + if err == nil { + if isNewComment { + err = dao.CreateEntity(db, comment2) + } else if comment2 != nil { + _, err = dao.UpdateEntity(db, comment2) + } + } + } else { + if orderComment.VendorOrderID2 != "" { + comment2.VendorOrderId = orderComment.VendorOrderID2 _, err = dao.UpdateEntity(db, comment2) } } } else { - globals.SugarLogger.Debugf("=comment2Update========== %s", utils.Format4Output(comment2, false)) comment2.VendorOrderId = orderComment.VendorOrderID2 _, err = dao.UpdateEntity(db, comment2, "VendorOrderId") }