1
This commit is contained in:
@@ -138,8 +138,10 @@ func MakePrintMsgOnTemp(param map[string]string, userId string) (string, error)
|
||||
|
||||
// MakePrintMsgOnTempVoice 制作平台语音
|
||||
func MakePrintMsgOnTempVoice(param map[string]string, setting *PrintSettingObj, userId string) (string, error) {
|
||||
printVoiceMsg := ""
|
||||
printVoiceMsg := "" // 语音信息
|
||||
printVoiceValue := make([]interface{}, 0, 0)
|
||||
textMsg := "" // 文本信息
|
||||
|
||||
// 称谓设置/平台语音设置
|
||||
if (setting.CallNameSetting == 64 || setting.CallNameSetting == 65 || setting.CallNameSetting == 66) && setting.SystemVoice == SettingClose {
|
||||
// 老板
|
||||
@@ -149,7 +151,6 @@ func MakePrintMsgOnTempVoice(param map[string]string, setting *PrintSettingObj,
|
||||
|
||||
// 打印机提示音设置(暂时不做)
|
||||
|
||||
textMsg := ""
|
||||
switch param[OrderStatusPrint] {
|
||||
case "3", "5", "10": // 新订单
|
||||
// 订单设置
|
||||
@@ -160,17 +161,63 @@ func MakePrintMsgOnTempVoice(param map[string]string, setting *PrintSettingObj,
|
||||
}
|
||||
}
|
||||
if setting.OrderVoiceSetting.OrderNotice == SettingOpen { // 订单通知
|
||||
printVoiceMsg += `<sound>%s</sound>` // 你来新订单了
|
||||
switch param[VendOrIDPrint] {
|
||||
case :
|
||||
|
||||
}
|
||||
|
||||
printVoiceMsg += `<sound>%s</sound><sound>%s</sound>` // 你来新订单了
|
||||
printVoiceValue = append(printVoiceValue, NewOrderVoice)
|
||||
switch param[VendOrIDPrint] {
|
||||
case utils.Int2Str(VendorIDJD): // 京东
|
||||
printVoiceValue = append(printVoiceValue, JdVoice)
|
||||
case utils.Int2Str(VendorIDMTWM): // 美团
|
||||
printVoiceValue = append(printVoiceValue, MtVoice)
|
||||
case utils.Int2Str(VendorIDELM): // 饿了么
|
||||
printVoiceValue = append(printVoiceValue, ElmVoice)
|
||||
case utils.Int2Str(VendorIDEBAI): // 饿百
|
||||
printVoiceValue = append(printVoiceValue, ElmVoice)
|
||||
case utils.Int2Str(VendorIDJDShop): // 京东商城
|
||||
printVoiceValue = append(printVoiceValue, JdToHose)
|
||||
case utils.Int2Str(VendorIDTT): // 抖音
|
||||
// 暂无
|
||||
}
|
||||
if param[VendorOrderNoPrint] != "" {
|
||||
switch len(param[VendorOrderNoPrint]) {
|
||||
case 1:
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, NumberVoiceMap[param[VendorOrderNoPrint]])
|
||||
case 2:
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, NumberVoiceMap[param[VendorOrderNoPrint][:1]+"0"])
|
||||
if param[VendorOrderNoPrint][1:] != "0" {
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, NumberVoiceMap[param[VendorOrderNoPrint][1:]])
|
||||
}
|
||||
case 3:
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, NumberVoiceMap[param[VendorOrderNoPrint][0:1]+"00"])
|
||||
if param[VendorOrderNoPrint][1:2] == "0" && param[VendorOrderNoPrint][2:] == "0" {
|
||||
|
||||
} else if param[VendorOrderNoPrint][1:2] == "0" && param[VendorOrderNoPrint][2:] != "0" {
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, NumberVoiceMap[param[VendorOrderNoPrint][1:2]])
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, NumberVoiceMap[param[VendorOrderNoPrint][2:]])
|
||||
} else if param[VendorOrderNoPrint][1:2] != "0" && param[VendorOrderNoPrint][2:] == "0" {
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, NumberVoiceMap[param[VendorOrderNoPrint][1:2]+"0"])
|
||||
} else if param[VendorOrderNoPrint][1:2] != "0" && param[VendorOrderNoPrint][2:] != "0" {
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, NumberVoiceMap[param[VendorOrderNoPrint][1:2]+"0"])
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, NumberVoiceMap[param[VendorOrderNoPrint][2:]])
|
||||
}
|
||||
}
|
||||
}
|
||||
printVoiceMsg += `<sound>%s</sound>`
|
||||
printVoiceValue = append(printVoiceValue, OrderNoVoice)
|
||||
}
|
||||
|
||||
case "15": // 待拣货
|
||||
case "110": // 送达
|
||||
case "":
|
||||
|
||||
case "120": // 收货,好像没有
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,41 @@
|
||||
package model
|
||||
|
||||
var NumberVoiceMap map[string]int
|
||||
|
||||
func init() {
|
||||
NumberVoiceMap = map[string]int{
|
||||
"0": ZeroVoice,
|
||||
"1": OneVoice,
|
||||
"2": TwoVoice,
|
||||
"3": ThreeVoice,
|
||||
"4": FourVoice,
|
||||
"5": FiveVoice,
|
||||
"6": SixVoice,
|
||||
"7": SevenVoice,
|
||||
"8": EightyVoice,
|
||||
"9": NineVoice,
|
||||
"10": TenVoice,
|
||||
"20": TwentyVoice,
|
||||
"30": ThirtyVoice,
|
||||
"40": FortyVoice,
|
||||
"50": FiftyVoice,
|
||||
"60": SixtyVoice,
|
||||
"70": SeventyVoice,
|
||||
"80": EightyVoice,
|
||||
"90": NinetyVoice,
|
||||
"100": OneHundredVoice,
|
||||
"200": TwoHundredVoice,
|
||||
"300": ThereHundredVoice,
|
||||
"400": FourHundredVoice,
|
||||
"500": FiveHundredVoice,
|
||||
"600": SixHundredVoice,
|
||||
"700": SeventyHundredVoice,
|
||||
"800": EightHundredVoice,
|
||||
"900": NineHundredVoice,
|
||||
"1000": OneThousandVoice,
|
||||
}
|
||||
}
|
||||
|
||||
// 语音常量
|
||||
const (
|
||||
WeComeJXPrintVoice = 1 //. 欢迎使用京西云打印机.mp3
|
||||
|
||||
Reference in New Issue
Block a user