From fe3595128700ed515631653a1c3cba2b0096e811 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 10 Oct 2019 16:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96OnOrderComments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order_comment.go | 64 +++++++++---------- .../partner/purchase/ebai/order_comment.go | 2 +- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/business/jxcallback/orderman/order_comment.go b/business/jxcallback/orderman/order_comment.go index 1c8d71141..a3cf21d21 100644 --- a/business/jxcallback/orderman/order_comment.go +++ b/business/jxcallback/orderman/order_comment.go @@ -86,43 +86,39 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) ( c.replyOrderComment(orderComment) } } - if orderComment.Score <= JX_BAD_COMMENTS_MAX_LEVEL || !isNewComment { // 如果是直接非差评,忽略 - if isNewComment || orderComment.Score <= JX_BAD_COMMENTS_MAX_LEVEL { - if isNewComment { - comment2.Createtime = utils.Time2Str(orderComment.CommentCreatedAt) - comment2.Msg = orderComment.OriginalMsg - comment2.Score = int(orderComment.Score) - comment2.Scorecontent = orderComment.Content - comment2.Vendertags = orderComment.TagList - comment2.Status = COMMENT_NOT_RESOLVED - comment2.OrderFlag = utils.Int2Str(orderComment.VendorID) + if isNewComment && orderComment.Score <= JX_BAD_COMMENTS_MAX_LEVEL || !isNewComment && orderComment.Score > JX_BAD_COMMENTS_MAX_LEVEL { // 如果是直接非差评,或补评仍然是差评,忽略 + if isNewComment { + comment2.Createtime = utils.Time2Str(orderComment.CommentCreatedAt) + comment2.Msg = orderComment.OriginalMsg + comment2.Score = int(orderComment.Score) + comment2.Scorecontent = orderComment.Content + comment2.Vendertags = orderComment.TagList + comment2.Status = COMMENT_NOT_RESOLVED + comment2.OrderFlag = utils.Int2Str(orderComment.VendorID) - comment2.LastPushTime = utils.Time2Str(time.Now()) - comment2.PushNo = 1 - comment2.Maxmodifytime = int(orderComment.ModifyDuration) - if orderComment.VendorID != model.VendorIDELM { - var order *model.GoodsOrder - if true /*orderComment.VendorID != model.VendorIDEBAI*/ { - order, _ = partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID, orderComment.VendorID) - } - if order != nil { - orderComment.StoreID = jxutils.GetSaleStoreIDFromOrder(order) - if order.ConsigneeMobile2 != "" { - orderComment.ConsigneeMobile = order.ConsigneeMobile2 - } else { - orderComment.ConsigneeMobile = order.ConsigneeMobile - } - } - if orderComment.StoreID > 0 { - comment2.Jxstoreid = utils.Int2Str(orderComment.StoreID) - } - comment2.Userphone = orderComment.ConsigneeMobile - if orderComment.StoreID > 0 && orderComment.Score <= JX_BAD_COMMENTS_MAX_LEVEL && time.Now().Sub(orderComment.CommentCreatedAt) < MAX_REAPLY_TIME { - weixinmsg.PushJDBadCommentToWeiXin(comment2) + comment2.LastPushTime = utils.Time2Str(time.Now()) + comment2.PushNo = 1 + comment2.Maxmodifytime = int(orderComment.ModifyDuration) + if orderComment.VendorID != model.VendorIDELM { + var order *model.GoodsOrder + if true /*orderComment.VendorID != model.VendorIDEBAI*/ { + order, _ = partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID, orderComment.VendorID) + } + if order != nil { + orderComment.StoreID = jxutils.GetSaleStoreIDFromOrder(order) + if order.ConsigneeMobile2 != "" { + orderComment.ConsigneeMobile = order.ConsigneeMobile2 + } else { + orderComment.ConsigneeMobile = order.ConsigneeMobile } } - } else { // 修改评价,但是仍然低于或等于JX_BAD_COMMENTS_MAX_LEVEL - comment2 = nil + if orderComment.StoreID > 0 { + comment2.Jxstoreid = utils.Int2Str(orderComment.StoreID) + } + comment2.Userphone = orderComment.ConsigneeMobile + if orderComment.StoreID > 0 && orderComment.Score <= JX_BAD_COMMENTS_MAX_LEVEL && time.Now().Sub(orderComment.CommentCreatedAt) < MAX_REAPLY_TIME { + weixinmsg.PushJDBadCommentToWeiXin(comment2) + } } } else { // 修改评价,高于JX_BAD_COMMENTS_MAX_LEVEL if orderComment.CommentCreatedAt.Sub(str2Time(comment2.Createtime)) == 0 || diff --git a/business/partner/purchase/ebai/order_comment.go b/business/partner/purchase/ebai/order_comment.go index 6a62af4df..28a76014c 100644 --- a/business/partner/purchase/ebai/order_comment.go +++ b/business/partner/purchase/ebai/order_comment.go @@ -16,7 +16,7 @@ import ( // 饿百的评价不是一点一点出来的,而是一下把前一天的全部崩出来。。。 const ( - RefreshCommentTime = 36 * time.Hour + RefreshCommentTime = 84 * time.Hour RefreshCommentTimeInterval = 60 * time.Minute EBAI_BAD_COMMENTS_MAX_MODIFY_TIME = 24 // 小时 )