- enable auto reply order comment

This commit is contained in:
gazebo
2019-03-15 09:49:32 +08:00
parent f0fa933196
commit e5bf25bd04

View File

@@ -6,6 +6,7 @@ import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"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"
@@ -165,9 +166,13 @@ func (c *OrderManager) replyOrderComment(orderComment *model.OrderComment) (err
globals.SugarLogger.Debugf("replyOrderComment orderID:%s, delaySeconds:%d, content:%s", orderComment.VendorOrderID, delaySeconds, content)
time.AfterFunc(time.Duration(delaySeconds)*time.Second, func() {
if globals.ReallySendWeixinMsg {
// err = partner.GetPurchasePlatformFromVendorID(orderComment.VendorID).ReplyOrderComment(nil, orderComment, content)
if err != nil {
globals.SugarLogger.Debugf("replyOrderComment orderID:%s, error:%v", orderComment.VendorOrderID, err)
if handler := partner.GetPurchasePlatformFromVendorID(orderComment.VendorID); handler != nil {
err = handler.ReplyOrderComment(jxcontext.AdminCtx, orderComment, content)
if err != nil {
globals.SugarLogger.Debugf("replyOrderComment orderID:%s, error:%v", orderComment.VendorOrderID, err)
}
} else {
globals.SugarLogger.Warnf("replyOrderComment can not find handler orderID:%s", orderComment.VendorOrderID)
}
}
})