aa
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package orderman
|
package orderman
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"encoding/json"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -40,34 +40,34 @@ type tReplyConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
replyConfig = map[int]*tReplyConfig{
|
//replyConfig = map[int]*tReplyConfig{
|
||||||
1: &tReplyConfig{
|
// 1: &tReplyConfig{
|
||||||
delayGapBegin: COMMENTS_SCORE_ONE_ORTWO_BEGIN_DELAY_TIME,
|
// delayGapBegin: COMMENTS_SCORE_ONE_ORTWO_BEGIN_DELAY_TIME,
|
||||||
delayGapEnd: COMMENTS_SCORE_ONE_ORTWO_END_DELAY_TIME,
|
// delayGapEnd: COMMENTS_SCORE_ONE_ORTWO_END_DELAY_TIME,
|
||||||
comments: []string{
|
// comments: []string{
|
||||||
"非常抱歉让您没有得到十分满意的购物体验,我们会及时与您联系进行确认并解决问题!",
|
// "非常抱歉让您没有得到十分满意的购物体验,我们会及时与您联系进行确认并解决问题!",
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
3: &tReplyConfig{
|
// 3: &tReplyConfig{
|
||||||
delayGapBegin: COMMENTS_SCORE_THREE_BEGIN_DELAY_TIME,
|
// delayGapBegin: COMMENTS_SCORE_THREE_BEGIN_DELAY_TIME,
|
||||||
delayGapEnd: COMMENTS_SCORE_THREE_END_DELAY_TIME,
|
// delayGapEnd: COMMENTS_SCORE_THREE_END_DELAY_TIME,
|
||||||
comments: []string{
|
// comments: []string{
|
||||||
"感谢您对我们的肯定,祝您生活愉快!欢迎再次光临,谢谢!",
|
// "感谢您对我们的肯定,祝您生活愉快!欢迎再次光临,谢谢!",
|
||||||
fmt.Sprintf("感谢您对%s的关照,我们会更加精益求精。", globals.StoreName),
|
// fmt.Sprintf("感谢您对%s的关照,我们会更加精益求精。", globals.StoreName),
|
||||||
"感谢您的光临,您的支持是我们前进的动力!",
|
// "感谢您的光临,您的支持是我们前进的动力!",
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
4: &tReplyConfig{
|
// 4: &tReplyConfig{
|
||||||
delayGapBegin: COMMENTS_SCORE_FOUR_ORFIVE_BEGIN_DELAY_TIME,
|
// delayGapBegin: COMMENTS_SCORE_FOUR_ORFIVE_BEGIN_DELAY_TIME,
|
||||||
delayGapEnd: COMMENTS_SCORE_FOUR_ORFIVE_END_DELAY_TIME,
|
// delayGapEnd: COMMENTS_SCORE_FOUR_ORFIVE_END_DELAY_TIME,
|
||||||
comments: []string{
|
// comments: []string{
|
||||||
"感谢您的信赖!我们会不断提升菜品质量以及优质的服务,期待与您的再次相遇!",
|
// "感谢您的信赖!我们会不断提升菜品质量以及优质的服务,期待与您的再次相遇!",
|
||||||
"感谢您的支持,愿您天天好心情!",
|
// "感谢您的支持,愿您天天好心情!",
|
||||||
"感谢您的认可!您的支持是我们前进的动力。",
|
// "感谢您的认可!您的支持是我们前进的动力。",
|
||||||
"感谢您的肯定与支持!我们会坚持把最好的服务带给您,期待和您的再次相遇!",
|
// "感谢您的肯定与支持!我们会坚持把最好的服务带给您,期待和您的再次相遇!",
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
}
|
//}
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (err error) {
|
func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (err error) {
|
||||||
@@ -183,7 +183,14 @@ func (c *OrderManager) replyOrderComment(vendorOrgCode string, orderComment *mod
|
|||||||
} else if score >= 5 {
|
} else if score >= 5 {
|
||||||
score = 4
|
score = 4
|
||||||
}
|
}
|
||||||
config := replyConfig[score]
|
var config *tReplyConfig
|
||||||
|
if configs, err := dao.QueryConfigs(dao.GetDB(), utils.Int2Str(score), model.ConfigTypeSys, ""); err == nil {
|
||||||
|
json.Unmarshal([]byte(configs[0].Value), &config)
|
||||||
|
}
|
||||||
|
if config == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//config := replyConfig[score]
|
||||||
delaySeconds := config.delayGapBegin + rand.Intn(config.delayGapEnd-config.delayGapBegin)
|
delaySeconds := config.delayGapBegin + rand.Intn(config.delayGapEnd-config.delayGapBegin)
|
||||||
content := config.comments[rand.Intn(len(config.comments))]
|
content := config.comments[rand.Intn(len(config.comments))]
|
||||||
globals.SugarLogger.Debugf("replyOrderComment orderID:%s, delaySeconds:%d, content:%s", orderComment.VendorOrderID, delaySeconds, content)
|
globals.SugarLogger.Debugf("replyOrderComment orderID:%s, delaySeconds:%d, content:%s", orderComment.VendorOrderID, delaySeconds, content)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const (
|
|||||||
ConfigTypeJxStore = "JxStore"
|
ConfigTypeJxStore = "JxStore"
|
||||||
ConfigTypeCookie = "Cookie"
|
ConfigTypeCookie = "Cookie"
|
||||||
ConfigTypeDiscountCard = "DiscountCard"
|
ConfigTypeDiscountCard = "DiscountCard"
|
||||||
|
ConfigTypeReply = "Reply"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -28,6 +29,7 @@ var (
|
|||||||
ConfigTypeJxStore: "京西商城",
|
ConfigTypeJxStore: "京西商城",
|
||||||
ConfigTypeCookie: "Cookie",
|
ConfigTypeCookie: "Cookie",
|
||||||
ConfigTypeDiscountCard: "会员折扣卡",
|
ConfigTypeDiscountCard: "会员折扣卡",
|
||||||
|
ConfigTypeReply: "评论回复模板",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user