This commit is contained in:
suyl
2021-08-31 10:26:27 +08:00
parent 03e255519f
commit 2e2a636228
5 changed files with 94 additions and 9 deletions

View File

@@ -126,23 +126,33 @@ func NotifyPickOrder(order *model.GoodsOrder) (err error) {
mobileList = append(mobileList, store.Tel2)
}
if order.NotifyType == 0 && store.SMSNotify != 0 && store.IsOrder == model.NO && store.ID != model.MatterStoreID && store.ID != model.JdShopMainStoreID && len(mobileList) > 0 {
globals.SugarLogger.Debugf("NotifyPickOrder orderID: %s , smsNotify :%d", order.VendorOrderID, store.SMSNotify)
switch store.SMSNotify {
case model.NotifyTypeSMS:
err = SendSMSMsg(mobileList, globals.SMSSignName, globals.SMSPickOrderTemplate, nil, order)
if store.BrandIsOpen&model.BrandOpenSMS != 0 {
if err = SendSMSMsg(mobileList, globals.SMSSignName, globals.SMSPickOrderTemplate, nil, order); err == nil {
order.NotifyType = int(store.SMSNotify)
partner.CurOrderManager.UpdateOrderFields(order, []string{"NotifyType"})
}
} else {
globals.SugarLogger.Debugf("NotifyPickOrder sms brand is close , orderID: %s ,isOpen %d", order.VendorOrderID, store.BrandIsOpen)
}
case model.NotifyTypeVoice:
globals.SugarLogger.Debugf("NotifyPickOrder orderID: %s , smsNotify :%d", order.VendorOrderID, store.SMSNotify)
if store.MarketManPhone == "" {
store.MarketManPhone = "18048531223"
}
err = SendVoiceMsg(mobileList, map[string]interface{}{
"tel": store.MarketManPhone,
})
if store.BrandIsOpen&model.BrandOpenVoice != 0 {
if err = SendVoiceMsg(mobileList, map[string]interface{}{
"tel": store.MarketManPhone,
}); err == nil {
order.NotifyType = int(store.SMSNotify)
partner.CurOrderManager.UpdateOrderFields(order, []string{"NotifyType"})
}
} else {
globals.SugarLogger.Debugf("NotifyPickOrder voice brand is close , orderID: %s ,isOpen %d", order.VendorOrderID, store.BrandIsOpen)
}
}
}
if err == nil {
order.NotifyType = int(store.SMSNotify)
partner.CurOrderManager.UpdateOrderFields(order, []string{"NotifyType"})
}
//}
return err
}