1
This commit is contained in:
@@ -211,7 +211,6 @@ func MakePrintMsgOnTempVoice(param map[string]string, setting *model.PrintSettin
|
|||||||
}
|
}
|
||||||
return printMsg, nil
|
return printMsg, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打运单
|
// 打运单
|
||||||
if param[model.WayBillStatusPrint] != "" {
|
if param[model.WayBillStatusPrint] != "" {
|
||||||
switch 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 `<sound>19</sound>`, nil
|
||||||
}
|
}
|
||||||
return "", nil
|
return "", nil
|
||||||
@@ -292,6 +291,22 @@ func PrinterOrderVoice(param map[string]string, setting *model.PrintSettingObj,
|
|||||||
printVoiceValue = append(printVoiceValue, model.ApplyCancelVoice)
|
printVoiceValue = append(printVoiceValue, model.ApplyCancelVoice)
|
||||||
printVoiceMsg, printVoiceValue = SyntheticSpeech(printVoiceMsg, printVoiceValue, param)
|
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):
|
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()))
|
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)
|
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)
|
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]) {
|
switch utils.Str2Int(param[model.StoreStatusPrint]) {
|
||||||
case -9:
|
case -9: // 丢失授权
|
||||||
var voice string
|
var voice string
|
||||||
var msg string
|
|
||||||
if setting.VoiceSetting.LoseAuthorization == model.SettingOpen {
|
if setting.VoiceSetting.LoseAuthorization == model.SettingOpen {
|
||||||
printVoiceMsg += `<sound>%d</sound>`
|
printVoiceMsg += `<sound>%d</sound>`
|
||||||
printVoiceValue = append(printVoiceValue, model.LoseTokenVoice)
|
printVoiceValue = append(printVoiceValue, model.LoseTokenVoice)
|
||||||
@@ -441,18 +487,14 @@ func PrintStoreStatus(param map[string]string, setting *model.PrintSettingObj) s
|
|||||||
return voice + msg
|
return voice + msg
|
||||||
default:
|
default:
|
||||||
// 离线打印文本开启
|
// 离线打印文本开启
|
||||||
if setting.PickingSetting.BusinessOffLine == model.SettingOpen {
|
textMsg += `<center><b>门店下线通知</b></center><br>`
|
||||||
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>`
|
||||||
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()))
|
||||||
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>`
|
||||||
printVoiceMsg += `<sound>%d</sound>`
|
printVoiceValue = append(printVoiceValue, model.StoreOfflineVoice)
|
||||||
printVoiceValue = append(printVoiceValue, model.StoreOfflineVoice)
|
|
||||||
}
|
|
||||||
voice := strings.Replace(fmt.Sprintf(strings.Replace(printVoiceMsg, "\n", "", -1), printVoiceValue...), "\\n", "\r\n", -1)
|
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)
|
msg := strings.Replace(fmt.Sprintf(strings.Replace(textMsg, "\n", "", -1), textMsgValue...), "\\n", "\r\n", -1)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const (
|
|||||||
VendorIDPurchaseEnd = 11
|
VendorIDPurchaseEnd = 11
|
||||||
VendorIDJX = 9 // 这是一个假的京西VendorID
|
VendorIDJX = 9 // 这是一个假的京西VendorID
|
||||||
VendorGoMei = 12 // 国美
|
VendorGoMei = 12 // 国美
|
||||||
VendorIDTT = 13 // 抖音平台小程序
|
VendorIDTT = 14 // 抖音平台小程序
|
||||||
|
|
||||||
VendorIDWXPay = 51 // 微信支付
|
VendorIDWXPay = 51 // 微信支付
|
||||||
|
|
||||||
|
|||||||
@@ -298,8 +298,13 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ApplyOrderCancel = 140 // 申请取消
|
ApplyOrderCancel = 140 // 申请取消
|
||||||
ApplyOrderRefund = 130 // 申请退款
|
ApplyOrderRefund = 130 // 申请退款
|
||||||
|
ApplyOrderRefundGoods = 150 // 申请退款
|
||||||
|
UserInStoreConsultingService = 160 // 进店咨询
|
||||||
|
BusinessCancelOrder = 170 // 商家取消打印
|
||||||
|
CancelOrderSuccess = 170 // 取消成功打印
|
||||||
|
OrderRefundMoneySuccess = 180 // 退款成功打印
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -53,29 +53,29 @@ type VoiceSettingDetail struct {
|
|||||||
RiderTakeOrderVoice int `json:"rider_take_order_voice"` // 骑手接单语音[1打开]
|
RiderTakeOrderVoice int `json:"rider_take_order_voice"` // 骑手接单语音[1打开]
|
||||||
ApplyUserOrderCancelVoice int `json:"apply_user_order_cancel_voice"` // 用户申请取消订单语音提示[1打开]
|
ApplyUserOrderCancelVoice int `json:"apply_user_order_cancel_voice"` // 用户申请取消订单语音提示[1打开]
|
||||||
ApplyRefundOrderVoice int `json:"apply_refund_order_voice"` // 用户申请退款提示语音[1打开]
|
ApplyRefundOrderVoice int `json:"apply_refund_order_voice"` // 用户申请退款提示语音[1打开]
|
||||||
ApplyRefundGoodsVoice int `json:"apply_refund_goods_voice"` // 用户申请退货提示语音[1打开]
|
|
||||||
RefundGoodsVoice int `json:"refund_goods_voice"` // 订单已经取消语音[1打开]
|
RefundGoodsVoice int `json:"refund_goods_voice"` // 订单已经取消语音[1打开]
|
||||||
ConfirmGoodsVoice int `json:"confirm_goods_voice"` // 确认接单语音[1打开]
|
|
||||||
SuccessGoodsVoice int `json:"success_goods_voice"` // 订单完成语音[1打开]
|
|
||||||
ConsultingPrint int `json:"consulting_print"` // 客户进店咨询打印[1打开]
|
|
||||||
ReminderVoice int `json:"reminder_voice"` // 客户催单语音[1打开]
|
|
||||||
CustomerRejectionVoice int `json:"customer_rejection_voice"` // 客户拒收语音[1打开]
|
CustomerRejectionVoice int `json:"customer_rejection_voice"` // 客户拒收语音[1打开]
|
||||||
CusterRefundVoice int `json:"custer_refund_voice"` // 客服(平台)退款语音[1打开]
|
CusterRefundVoice int `json:"custer_refund_voice"` // 客服(平台)退款语音[1打开]
|
||||||
LoseAuthorization int `json:"lose_authorization"` // 失去授权语音提示[1打开]
|
LoseAuthorization int `json:"lose_authorization"` // 失去授权语音提示[1打开]
|
||||||
|
ApplyRefundGoodsVoice int `json:"apply_refund_goods_voice"` // 用户申请退货提示语音[1打开]
|
||||||
|
SuccessGoodsVoice int `json:"success_goods_voice"` // 订单完成语音[1打开](没语音)
|
||||||
|
ReminderVoice int `json:"reminder_voice"` // 客户催单语音[1打开]
|
||||||
|
ConsultingPrint int `json:"consulting_print"` // 客户进店咨询打印[1打开](暂时没有)
|
||||||
|
ConfirmGoodsVoice int `json:"confirm_goods_voice"` // 确认接单语音[1打开](可以不做)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrintSettingDetail 打印设置
|
// PrintSettingDetail 打印设置
|
||||||
type PrintSettingDetail struct {
|
type PrintSettingDetail struct {
|
||||||
UserOrderCancel int `json:"user_order_cancel"` // 用户取消订单打印[1打开]
|
UserOrderCancel int `json:"user_order_cancel"` // 用户取消订单打印[1打开]
|
||||||
RefundOrder int `json:"refund_order"` // 订单退款打印[1打开]
|
|
||||||
BusinessOrderCancel int `json:"business_order_cancel"` // 商家取消打印[1打开]
|
|
||||||
RiderTakeOrder int `json:"rider_take_order"` // 骑手接单打印[1打开]
|
RiderTakeOrder int `json:"rider_take_order"` // 骑手接单打印[1打开]
|
||||||
CusterRefundPrint int `json:"custer_refund_print"` // 客服退款打印[1打开]
|
CusterRefundPrint int `json:"custer_refund_print"` // 客服退款打印[1打开]
|
||||||
WaitOrderPrint int `json:"wait_order_print"` // 待接单打印[1打开]
|
WaitOrderPrint int `json:"wait_order_print"` // 待接单打印[1打开]
|
||||||
ApplyUserCancelOrder int `json:"apply_user_cancel_order"` // 用户申请取消订单打印[1打开]
|
ApplyUserCancelOrder int `json:"apply_user_cancel_order"` // 用户申请取消订单打印[1打开]
|
||||||
ApplyUserRefund int `json:"apply_user_refund"` // 申请部分退款打印[1打开]
|
ApplyUserRefund int `json:"apply_user_refund"` // 申请部分退款打印[1打开]
|
||||||
OrderCancelSuccess int `json:"order_cancel_success"` // 取消成功打印[1打开]
|
|
||||||
CustomerRejectionPrint int `json:"customer_rejection_print"` // 客户拒收打印[1打开]
|
CustomerRejectionPrint int `json:"customer_rejection_print"` // 客户拒收打印[1打开]
|
||||||
|
OrderCancelSuccess int `json:"order_cancel_success"` // 取消成功打印[1打开]
|
||||||
|
BusinessOrderCancel int `json:"business_order_cancel"` // 商家取消打印[1打开]
|
||||||
|
RefundOrder int `json:"refund_order"` // 订单退款打印[1打开]
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnMarshalString2Json 将字符串设置转换为对象设置
|
// UnMarshalString2Json 将字符串设置转换为对象设置
|
||||||
|
|||||||
Reference in New Issue
Block a user