- push jd bad comment.

This commit is contained in:
gazebo
2018-09-29 18:45:38 +08:00
parent 390312ef82
commit 5b3b53932c
2 changed files with 70 additions and 18 deletions

View File

@@ -7,6 +7,7 @@ import (
"git.rosy.net.cn/baseapi/platformapi/jdapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg"
"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"
@@ -86,12 +87,8 @@ func (c *PurchaseHandler) onOrderComment(msg *jdapi.CallbackOrderMsg) (err error
isNewComment = true
err = c.replyOrderComment(intOrderID, utils.Int64ToStr(utils.MustInterface2Int64(result["storeId"])), score)
}
if !(score > JX_BAD_COMMENTS_MAX_LEVEL && isNewComment) { // 如果是直接非差评,忽略
if score <= JX_BAD_COMMENTS_MAX_LEVEL || !isNewComment { // 如果是直接非差评,忽略
comment.Createtime = utils.Timestamp2Str(utils.MustInterface2Int64(result["createTime"].(map[string]interface{})["time"]) / 1000)
comment.OrderFlag = "0"
comment.LastPushTime = utils.Time2Str(time.Now())
comment.PushNo = 1
comment.Maxmodifytime = JDDJ_BAD_COMMENTS_MAX_MODIFY_TIME
if isNewComment || score <= JX_BAD_COMMENTS_MAX_LEVEL {
comment.Msg = string(utils.MustMarshal(result))
comment.Score = score
@@ -99,6 +96,11 @@ func (c *PurchaseHandler) onOrderComment(msg *jdapi.CallbackOrderMsg) (err error
comment.Vendertags = string(utils.MustMarshal(result["venderTags"]))
comment.Status = COMMENT_NOT_RESOLVED
if isNewComment {
comment.OrderFlag = "0"
comment.LastPushTime = utils.Time2Str(time.Now())
comment.PushNo = 1
comment.Maxmodifytime = JDDJ_BAD_COMMENTS_MAX_MODIFY_TIME
order, err2 := partner.CurOrderManager.LoadOrder(msg.BillID, model.VendorIDJD)
if err = err2; err == nil {
comment.Jxstoreid = utils.Int2Str(jxutils.GetJxStoreIDFromOrder(order))
@@ -112,6 +114,11 @@ func (c *PurchaseHandler) onOrderComment(msg *jdapi.CallbackOrderMsg) (err error
comment.UpdatedVendertags = string(utils.MustMarshal(result["venderTags"]))
comment.Status = COMMENT_RESOLVED
}
if score <= JX_BAD_COMMENTS_MAX_LEVEL {
if globals.ReallyCallPlatformAPI {
weixinmsg.PushJDBadCommentToWeiXin(comment)
}
}
if err == nil {
if isNewComment {
globals.SugarLogger.Debug("fuck1")