aa
This commit is contained in:
@@ -34,9 +34,9 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type tReplyConfig struct {
|
type tReplyConfig struct {
|
||||||
delayGapBegin int `json:"delayGapBegin"`
|
DelayGapBegin int `json:"delayGapBegin"`
|
||||||
delayGapEnd int `json:"delayGapEnd"`
|
DelayGapEnd int `json:"delayGapEnd"`
|
||||||
comments []string `json:"comments"`
|
Comments []string `json:"comments"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -187,12 +187,13 @@ func (c *OrderManager) replyOrderComment(vendorOrgCode string, orderComment *mod
|
|||||||
if configs, err := dao.QueryConfigs(dao.GetDB(), utils.Int2Str(score), model.ConfigTypeReply, ""); err == nil {
|
if configs, err := dao.QueryConfigs(dao.GetDB(), utils.Int2Str(score), model.ConfigTypeReply, ""); err == nil {
|
||||||
json.Unmarshal([]byte(configs[0].Value), &config)
|
json.Unmarshal([]byte(configs[0].Value), &config)
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("replyOrderComment config: %v", utils.Format4Output(config, true))
|
||||||
if config == nil {
|
if config == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//config := replyConfig[score]
|
//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)
|
||||||
utils.AfterFuncWithRecover(time.Duration(delaySeconds)*time.Second, func() {
|
utils.AfterFuncWithRecover(time.Duration(delaySeconds)*time.Second, func() {
|
||||||
if handler := partner.GetPurchaseOrderHandlerFromVendorID(orderComment.VendorID); handler != nil {
|
if handler := partner.GetPurchaseOrderHandlerFromVendorID(orderComment.VendorID); handler != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user