|
|
|
|
@@ -138,8 +138,6 @@ func MakePrintMsgOnTemp(param map[string]string, userId string) (string, error)
|
|
|
|
|
|
|
|
|
|
// MakePrintMsgOnTempVoice 制作平台语音
|
|
|
|
|
func MakePrintMsgOnTempVoice(param map[string]string, setting *PrintSettingObj, userId string) (string, error) {
|
|
|
|
|
// 打印机提示音设置(暂时不做)
|
|
|
|
|
|
|
|
|
|
// 打订单
|
|
|
|
|
if param[OrderStatusPrint] != "" {
|
|
|
|
|
// 订单提示设置
|
|
|
|
|
@@ -153,9 +151,24 @@ func MakePrintMsgOnTempVoice(param map[string]string, setting *PrintSettingObj,
|
|
|
|
|
// 打运单
|
|
|
|
|
if param[WayBillStatusPrint] != "" {
|
|
|
|
|
switch param[WayBillStatusPrint] {
|
|
|
|
|
case "15":
|
|
|
|
|
|
|
|
|
|
case utils.Int2Str(WaybillStatusCourierAssigned): // 分配骑手
|
|
|
|
|
return PrintWayBillOrderStatus(param, setting), nil
|
|
|
|
|
case utils.Int2Str(WaybillStatusDeliverReminder): // 催单
|
|
|
|
|
printVoiceMsg := ``
|
|
|
|
|
printVoiceValue := make([]interface{}, 0, 0)
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound>`
|
|
|
|
|
printVoiceValue = append(printVoiceValue, ReminderOrderVoice)
|
|
|
|
|
return strings.Replace(fmt.Sprintf(strings.Replace(printVoiceMsg, "\n", "", -1), printVoiceValue...), "\\n", "\r\n", -1), nil
|
|
|
|
|
case utils.Int2Str(WaybillStatusDelivered): // 送达
|
|
|
|
|
printVoiceMsg := ``
|
|
|
|
|
printVoiceValue := make([]interface{}, 0, 0)
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound>`
|
|
|
|
|
printVoiceValue = append(printVoiceValue, FinialsOrderVoice)
|
|
|
|
|
return strings.Replace(fmt.Sprintf(strings.Replace(printVoiceMsg, "\n", "", -1), printVoiceValue...), "\\n", "\r\n", -1), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 门店状态
|
|
|
|
|
@@ -163,6 +176,11 @@ func MakePrintMsgOnTempVoice(param map[string]string, setting *PrintSettingObj,
|
|
|
|
|
return PrintStoreStatus(param, setting), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 进店咨询
|
|
|
|
|
if param[EnterTheStorePrint] != "" {
|
|
|
|
|
return `<sound>19</sound>`, nil
|
|
|
|
|
}
|
|
|
|
|
return "", nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PrinterOrderVoice 打印机订单提示设置
|
|
|
|
|
@@ -174,7 +192,7 @@ func PrinterOrderVoice(param map[string]string, setting *PrintSettingObj, userId
|
|
|
|
|
err error
|
|
|
|
|
)
|
|
|
|
|
// 称谓设置/平台语音设置
|
|
|
|
|
if (setting.CallNameSetting == 64 || setting.CallNameSetting == 65 || setting.CallNameSetting == 66) && setting.SystemVoice == SettingClose {
|
|
|
|
|
if (setting.CallNameSetting == 64 || setting.CallNameSetting == 65 || setting.CallNameSetting == 66) && setting.SystemVoice == SettingOpen {
|
|
|
|
|
// 老板
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound>`
|
|
|
|
|
printVoiceValue = append(printVoiceValue, setting.CallNameSetting)
|
|
|
|
|
@@ -191,7 +209,7 @@ func PrinterOrderVoice(param map[string]string, setting *PrintSettingObj, userId
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if setting.OrderVoiceSetting.OrderNotice == SettingOpen && setting.SystemVoice == SettingClose { // 订单通知
|
|
|
|
|
if setting.OrderVoiceSetting.OrderNotice == SettingOpen && setting.SystemVoice == SettingOpen { // 订单通知
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound><sound>%s</sound>` // 你来新订单了
|
|
|
|
|
printVoiceValue = append(printVoiceValue, NewOrderVoice)
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
@@ -205,7 +223,7 @@ func PrinterOrderVoice(param map[string]string, setting *PrintSettingObj, userId
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if setting.OrderVoiceSetting.UserOrderCancelVoice == SettingOpen && setting.SystemVoice == SettingClose { // 申请取消语音
|
|
|
|
|
if setting.OrderVoiceSetting.UserOrderCancelVoice == SettingOpen && setting.SystemVoice == SettingOpen { // 申请取消语音
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound><sound>%s</sound>` // 你来新订单了
|
|
|
|
|
printVoiceValue = append(printVoiceValue, ApplyCancelVoice)
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
@@ -219,8 +237,8 @@ func PrinterOrderVoice(param map[string]string, setting *PrintSettingObj, userId
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if setting.OrderVoiceSetting.RefundOrderVoice == SettingOpen && setting.SystemVoice == SettingClose {
|
|
|
|
|
if setting.OrderVoiceSetting.OrderNotice == SettingOpen && setting.SystemVoice == SettingClose {
|
|
|
|
|
if setting.OrderVoiceSetting.RefundOrderVoice == SettingOpen && setting.SystemVoice == SettingOpen {
|
|
|
|
|
if setting.OrderVoiceSetting.OrderNotice == SettingOpen && setting.SystemVoice == SettingOpen {
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound>`
|
|
|
|
|
printVoiceValue = append(printVoiceValue, ApplyRefundVoice)
|
|
|
|
|
@@ -235,8 +253,8 @@ func PrinterOrderVoice(param map[string]string, setting *PrintSettingObj, userId
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if setting.OrderVoiceSetting.BusinessOrderCancelVoice == SettingOpen && setting.SystemVoice == SettingClose {
|
|
|
|
|
if setting.OrderVoiceSetting.OrderNotice == SettingOpen && setting.SystemVoice == SettingClose { // 订单取消语音通知
|
|
|
|
|
if setting.OrderVoiceSetting.BusinessOrderCancelVoice == SettingOpen && setting.SystemVoice == SettingOpen {
|
|
|
|
|
if setting.OrderVoiceSetting.OrderNotice == SettingOpen && setting.SystemVoice == SettingOpen { // 订单取消语音通知
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound>` // 你来新订单了
|
|
|
|
|
printVoiceValue = append(printVoiceValue, CancelOrderVoice)
|
|
|
|
|
@@ -250,7 +268,7 @@ func PrinterOrderVoice(param map[string]string, setting *PrintSettingObj, userId
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if setting.PickingSetting.WaitPickingVoice == SettingOpen && setting.SystemVoice == SettingClose { // 订单通知
|
|
|
|
|
if setting.PickingSetting.WaitPickingVoice == SettingOpen && setting.SystemVoice == SettingOpen { // 订单通知
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound><sound>%s</sound>` // 你有订单未拣货
|
|
|
|
|
printVoiceValue = append(printVoiceValue, WaitPickUpOrderVoice)
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
@@ -262,14 +280,42 @@ func PrinterOrderVoice(param map[string]string, setting *PrintSettingObj, userId
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if setting.PickingSetting.WaitPickingVoice == SettingOpen && setting.SystemVoice == SettingClose { // 订单通知
|
|
|
|
|
if setting.PickingSetting.WaitPickingVoice == SettingOpen && setting.SystemVoice == SettingOpen { // 订单通知
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound><sound>%s</sound>` // 你有订单未接单(订单未处理)
|
|
|
|
|
printVoiceValue = append(printVoiceValue, WaitOrderVoice)
|
|
|
|
|
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
|
|
|
|
}
|
|
|
|
|
case "110": // 送达
|
|
|
|
|
case utils.Int2Str(OrderStatusRejection): // 拒收
|
|
|
|
|
if setting.CustomerVoiceSetting.CustomerRejectionVoice == SettingOpen && setting.SystemVoice == SettingOpen {
|
|
|
|
|
// 暂无语音打印
|
|
|
|
|
}
|
|
|
|
|
if setting.CustomerVoiceSetting.CustomerRejectionPrint == 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>`
|
|
|
|
|
rejectionValue = append(rejectionValue, param[OrderNoPrint], param[VendorNamePrint], param[VendorOrderNoPrint], param[RejectionReasonPrint])
|
|
|
|
|
textMsg = strings.Replace(fmt.Sprintf(strings.Replace(rejection, "\n", "", -1), rejectionValue...), "\\n", "\r\n", -1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case "120": // 收货,好像没有
|
|
|
|
|
case utils.Int2Str(OrderStatusCustomerService): // 客服退款
|
|
|
|
|
if setting.CustomerVoiceSetting.CustcareRefundVoice == SettingOpen && setting.SystemVoice == SettingOpen {
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound>`
|
|
|
|
|
printVoiceValue = append(printVoiceValue, BusinessResponsibilityVoice)
|
|
|
|
|
}
|
|
|
|
|
if setting.CustomerVoiceSetting.CustcareRefundPrint == 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[OrderNoPrint], param[VendorNamePrint], param[VendorOrderNoPrint], param[CustcareRefundReasonPrint], utils.Time2DateStr(time.Now()))
|
|
|
|
|
textMsg = strings.Replace(fmt.Sprintf(strings.Replace(rejection, "\n", "", -1), rejectionValue...), "\\n", "\r\n", -1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -295,10 +341,10 @@ func PrintWayBillOrderStatus(param map[string]string, setting *PrintSettingObj)
|
|
|
|
|
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[RiderNamePrint], param[RiderNamePrint], utils.Time2DateStr(time.Now()), param[VendorNamePrint], param[VendorOrderNoPrint])
|
|
|
|
|
textMsgValue = append(textMsgValue, param[RiderNamePrint], param[RiderPhonePrint], utils.Time2DateStr(time.Now()), param[VendorNamePrint], param[VendorOrderNoPrint])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if setting.RiderVoiceSetting.RiderTakeOrderVoice == SettingOpen && setting.SystemVoice == SettingClose { // 骑手接单语音通知
|
|
|
|
|
if setting.RiderVoiceSetting.RiderTakeOrderVoice == SettingOpen && setting.SystemVoice == SettingOpen { // 骑手接单语音通知
|
|
|
|
|
printVoiceMsg += `<sound>%s</sound><sound>%s</sound>` // 骑手已经接单了
|
|
|
|
|
printVoiceValue = append(printVoiceValue, RiderGetOrderVoice)
|
|
|
|
|
}
|
|
|
|
|
|