From 0de165f7925fc16e566d7780056f097e84e9697c Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Mon, 21 Jun 2021 09:08:13 +0800 Subject: [PATCH] aa --- business/jxcallback/orderman/orderman_ext.go | 2 +- business/partner/purchase/jd/order.go | 56 +++++++++----------- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index a0d9652f4..9f8d51a32 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -1438,7 +1438,7 @@ func GetMatterStoreOrderCount(ctx *jxcontext.Context, storeID int) (result *Orde AND a.from_store_id = ? AND a.status >= ? AND a.status <> ? AND b.status = ? - ORDER BY b.pay_finished_at DESC + ORDER BY b.pay_finished_at DESC LIMIT 1 ` sqlParams := []interface{}{storeID, model.OrderStatusDelivering, model.OrderStatusCanceled, model.PayStatusYes} diff --git a/business/partner/purchase/jd/order.go b/business/partner/purchase/jd/order.go index 9a01f96ab..c626a52ac 100644 --- a/business/partner/purchase/jd/order.go +++ b/business/partner/purchase/jd/order.go @@ -143,36 +143,32 @@ func (c *PurchaseHandler) onOrderInfoChangeMsg(vendorOrgCode string, msg *jdapi. if err == nil { globals.SugarLogger.Debugf("onOrderInfoChangeMsg msg:%v", utils.Format4Output(msg, false)) //任意一项变了 - if msg.BuyerFullAddress != order.ConsigneeAddress || msg.BuyerFullName != order.ConsigneeName || msg.BuyerMobile != order.ConsigneeMobile || - jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLat)) != order.ConsigneeLat || jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLng)) != order.ConsigneeLng || - msg.OrderBuyerRemark != order.BuyerComment { - if msg.BuyerFullAddress != "" { - order.ConsigneeAddress = msg.BuyerFullAddress - } - if msg.BuyerFullName != "" { - order.ConsigneeName = msg.BuyerFullName - } - if msg.BuyerMobile != "" { - order.ConsigneeMobile = msg.BuyerMobile - } - if msg.BuyerLat != "" { - order.ConsigneeLat = jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLat)) - } - if msg.BuyerLng != "" { - order.ConsigneeLng = jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLng)) - } - if msg.OrderBuyerRemark != "" { - order.BuyerComment = msg.OrderBuyerRemark - } - _, err = dao.UpdateEntity(db, order, "ConsigneeAddress", "ConsigneeName", "ConsigneeMobile", "ConsigneeLat", "ConsigneeLng", "BuyerComment") - if order.Status <= model.OrderStatusEndBegin { - if order.BusinessType == model.BusinessTypeImmediate { - if time.Now().Sub(order.OrderCreatedAt).Hours() <= 1 { - weixinmsg.NotifyOrderChanged(order) - } - } else { - if order.ExpectedDeliveredTime.Sub(time.Now()).Hours() >= 1 { - weixinmsg.NotifyOrderChanged(order) + if order.AdjustCount < 3 { + if msg.BuyerFullAddress != order.ConsigneeAddress || msg.BuyerFullName != order.ConsigneeName || msg.BuyerMobile != order.ConsigneeMobile || + jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLat)) != order.ConsigneeLat || jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLng)) != order.ConsigneeLng || + msg.OrderBuyerRemark != order.BuyerComment { + if order.Status <= model.OrderStatusDelivering { + if err = weixinmsg.NotifyOrderChanged(order); err == nil { + if msg.BuyerFullAddress != "" { + order.ConsigneeAddress = msg.BuyerFullAddress + } + if msg.BuyerFullName != "" { + order.ConsigneeName = msg.BuyerFullName + } + if msg.BuyerMobile != "" { + order.ConsigneeMobile = msg.BuyerMobile + } + if msg.BuyerLat != "" { + order.ConsigneeLat = jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLat)) + } + if msg.BuyerLng != "" { + order.ConsigneeLng = jxutils.StandardCoordinate2Int(utils.Str2Float64(msg.BuyerLng)) + } + if msg.OrderBuyerRemark != "" { + order.BuyerComment = msg.OrderBuyerRemark + } + order.AdjustCount++ + _, err = dao.UpdateEntity(db, order, "ConsigneeAddress", "ConsigneeName", "ConsigneeMobile", "ConsigneeLat", "ConsigneeLng", "BuyerComment", "AdjustCount") } } }