|
|
|
|
@@ -211,7 +211,6 @@ func MakePrintMsgOnTempVoice(param map[string]string, setting *model.PrintSettin
|
|
|
|
|
}
|
|
|
|
|
return printMsg, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 打运单
|
|
|
|
|
if param[model.WayBillStatusPrint] != "" {
|
|
|
|
|
switch param[model.WayBillStatusPrint] {
|
|
|
|
|
@@ -241,7 +240,7 @@ func MakePrintMsgOnTempVoice(param map[string]string, setting *model.PrintSettin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 进店咨询
|
|
|
|
|
if param[model.EnterTheStorePrint] != "" {
|
|
|
|
|
if param[model.EnterTheStorePrint] != "" && setting.VoiceSetting.ConsultingPrint == model.SettingOpen {
|
|
|
|
|
return `<sound>19</sound>`, nil
|
|
|
|
|
}
|
|
|
|
|
return "", nil
|
|
|
|
|
@@ -292,6 +291,22 @@ func PrinterOrderVoice(param map[string]string, setting *model.PrintSettingObj,
|
|
|
|
|
printVoiceValue = append(printVoiceValue, model.ApplyCancelVoice)
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
}
|
|
|
|
|
// 申请退货
|
|
|
|
|
case utils.Int2Str(model.ApplyOrderRefundGoods):
|
|
|
|
|
rejection := ``
|
|
|
|
|
rejectionValue := make([]interface{}, 0, 0)
|
|
|
|
|
rejection += `<center><b>客户申请退货:</b></center><br>`
|
|
|
|
|
rejection += `<center><b>订单号: %s</b></center><br>`
|
|
|
|
|
rejection += `<center><b>订单来源: %s # %s</b></center><br>`
|
|
|
|
|
rejection += `<center><b>原因: %s</b></center><br>`
|
|
|
|
|
rejectionValue = append(rejectionValue, param[model.OrderNoPrint], param[model.VendorNamePrint], param[model.VendorOrderNoPrint], param[model.RejectionReasonPrint])
|
|
|
|
|
textMsg = strings.Replace(fmt.Sprintf(strings.Replace(rejection, "\n", "", -1), rejectionValue...), "\\n", "\r\n", -1)
|
|
|
|
|
|
|
|
|
|
if setting.VoiceSetting.ApplyRefundGoodsVoice == model.SettingOpen { // 申请退货语音
|
|
|
|
|
printVoiceMsg += `<sound>%d</sound>`
|
|
|
|
|
printVoiceValue = append(printVoiceValue, model.ApplyReturnGoodsVoice)
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
}
|
|
|
|
|
// 申请退款
|
|
|
|
|
case utils.Int2Str(model.ApplyOrderRefund):
|
|
|
|
|
// 订单设置
|
|
|
|
|
@@ -373,8 +388,40 @@ func PrinterOrderVoice(param map[string]string, setting *model.PrintSettingObj,
|
|
|
|
|
rejectionValue = append(rejectionValue, param[model.OrderNoPrint], param[model.VendorNamePrint], param[model.VendorOrderNoPrint], param[model.CustcareRefundReasonPrint], utils.Time2DateStr(time.Now()))
|
|
|
|
|
textMsg = strings.Replace(fmt.Sprintf(strings.Replace(rejection, "\n", "", -1), rejectionValue...), "\\n", "\r\n", -1)
|
|
|
|
|
}
|
|
|
|
|
//case :OrderCancelSuccess // 取消订单成功
|
|
|
|
|
|
|
|
|
|
case utils.Int2Str(model.OrderStatusCanceled), utils.Int2Str(model.CancelOrderSuccess): // 取消订单成功
|
|
|
|
|
if setting.PrintSetting.CusterRefundPrint == model.SettingOpen {
|
|
|
|
|
rejection := ``
|
|
|
|
|
rejectionValue := make([]interface{}, 0, 0)
|
|
|
|
|
rejection += `<center><b>订单取消成功:</b></center><br>`
|
|
|
|
|
rejection += `<center><b>订单号: %s</b></center><br>`
|
|
|
|
|
rejection += `<center><b>订单来源: %s # %s</b></center><br>`
|
|
|
|
|
rejection += `<center><b>取消原因: %s</b></center><br>`
|
|
|
|
|
rejection += `<center><b>取消成功时间: %s</b></center><br>`
|
|
|
|
|
rejectionValue = append(rejectionValue, param[model.OrderNoPrint], param[model.VendorNamePrint], param[model.VendorOrderNoPrint], param[model.CustcareRefundReasonPrint], utils.Time2DateStr(time.Now()))
|
|
|
|
|
textMsg = strings.Replace(fmt.Sprintf(strings.Replace(rejection, "\n", "", -1), rejectionValue...), "\\n", "\r\n", -1)
|
|
|
|
|
}
|
|
|
|
|
case utils.Int2Str(model.BusinessCancelOrder): // 商家取消打印
|
|
|
|
|
if setting.PrintSetting.BusinessOrderCancel == model.SettingOpen {
|
|
|
|
|
rejection := ``
|
|
|
|
|
rejectionValue := make([]interface{}, 0, 0)
|
|
|
|
|
rejection += `<center><b>商家侧取消订单:</b></center><br>`
|
|
|
|
|
rejection += `<center><b>订单号: %s</b></center><br>`
|
|
|
|
|
rejection += `<center><b>订单来源: %s # %s</b></center><br>`
|
|
|
|
|
rejection += `<center><b>取消原因: %s</b></center><br>`
|
|
|
|
|
rejection += `<center><b>取消成功时间: %s</b></center><br>`
|
|
|
|
|
rejectionValue = append(rejectionValue, param[model.OrderNoPrint], param[model.VendorNamePrint], param[model.VendorOrderNoPrint], param[model.CustcareRefundReasonPrint], utils.Time2DateStr(time.Now()))
|
|
|
|
|
textMsg = strings.Replace(fmt.Sprintf(strings.Replace(rejection, "\n", "", -1), rejectionValue...), "\\n", "\r\n", -1)
|
|
|
|
|
}
|
|
|
|
|
case utils.Int2Str(model.OrderRefundMoneySuccess): // 订单退款成功打印
|
|
|
|
|
if setting.PrintSetting.OrderCancelSuccess == model.SettingOpen {
|
|
|
|
|
rejection := ``
|
|
|
|
|
rejectionValue := make([]interface{}, 0, 0)
|
|
|
|
|
rejection += `<center><b>退款成功:</b></center><br>`
|
|
|
|
|
rejection += `<center><b>订单号: %s</b></center><br>`
|
|
|
|
|
rejection += `<center><b>订单来源: %s # %s</b></center><br>`
|
|
|
|
|
rejectionValue = append(rejectionValue, param[model.OrderNoPrint], param[model.VendorNamePrint], param[model.VendorOrderNoPrint])
|
|
|
|
|
textMsg = strings.Replace(fmt.Sprintf(strings.Replace(rejection, "\n", "", -1), rejectionValue...), "\\n", "\r\n", -1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
voice := strings.Replace(fmt.Sprintf(strings.Replace(printVoiceMsg, "\n", "", -1), printVoiceValue...), "\\n", "\r\n", -1)
|
|
|
|
|
@@ -422,9 +469,8 @@ func PrintStoreStatus(param map[string]string, setting *model.PrintSettingObj) s
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
switch utils.Str2Int(param[model.StoreStatusPrint]) {
|
|
|
|
|
case -9:
|
|
|
|
|
case -9: // 丢失授权
|
|
|
|
|
var voice string
|
|
|
|
|
var msg string
|
|
|
|
|
if setting.VoiceSetting.LoseAuthorization == model.SettingOpen {
|
|
|
|
|
printVoiceMsg += `<sound>%d</sound>`
|
|
|
|
|
printVoiceValue = append(printVoiceValue, model.LoseTokenVoice)
|
|
|
|
|
@@ -441,18 +487,14 @@ func PrintStoreStatus(param map[string]string, setting *model.PrintSettingObj) s
|
|
|
|
|
return voice + msg
|
|
|
|
|
default:
|
|
|
|
|
// 离线打印文本开启
|
|
|
|
|
if setting.PickingSetting.BusinessOffLine == model.SettingOpen {
|
|
|
|
|
textMsg += `<center><b>门店下线通知</b></center><br>`
|
|
|
|
|
textMsg += `<center><b>门店:%s</b></center><br>`
|
|
|
|
|
textMsg += `<center><b>平台:%s</b></center><br>`
|
|
|
|
|
textMsg += `<center><b>下线时间:%s</b></center><br>`
|
|
|
|
|
textMsgValue = append(textMsgValue, param[model.StoreNamePrint], param[model.VendorNamePrint], utils.Time2DateStr(time.Now()))
|
|
|
|
|
}
|
|
|
|
|
textMsg += `<center><b>门店下线通知</b></center><br>`
|
|
|
|
|
textMsg += `<center><b>门店:%s</b></center><br>`
|
|
|
|
|
textMsg += `<center><b>平台:%s</b></center><br>`
|
|
|
|
|
textMsg += `<center><b>下线时间:%s</b></center><br>`
|
|
|
|
|
textMsgValue = append(textMsgValue, param[model.StoreNamePrint], param[model.VendorNamePrint], utils.Time2DateStr(time.Now()))
|
|
|
|
|
// 离线打印语音开启
|
|
|
|
|
if setting.SystemVoice == model.SettingOpen && setting.PickingSetting.BusinessOffLineVoice == model.SettingOpen {
|
|
|
|
|
printVoiceMsg += `<sound>%d</sound>`
|
|
|
|
|
printVoiceValue = append(printVoiceValue, model.StoreOfflineVoice)
|
|
|
|
|
}
|
|
|
|
|
printVoiceMsg += `<sound>%d</sound>`
|
|
|
|
|
printVoiceValue = append(printVoiceValue, model.StoreOfflineVoice)
|
|
|
|
|
voice := strings.Replace(fmt.Sprintf(strings.Replace(printVoiceMsg, "\n", "", -1), printVoiceValue...), "\\n", "\r\n", -1)
|
|
|
|
|
msg := strings.Replace(fmt.Sprintf(strings.Replace(textMsg, "\n", "", -1), textMsgValue...), "\\n", "\r\n", -1)
|
|
|
|
|
|
|
|
|
|
|