diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go index 22144b725..7846bd193 100644 --- a/business/jxstore/event/event_tcp_utils.go +++ b/business/jxstore/event/event_tcp_utils.go @@ -524,30 +524,30 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) { } } // 自动合成语音功能 - if strings.Contains(result, byteSignSound) && strings.Contains(result, byteSignSoundE) { - if sounds := regexpSound.FindStringSubmatch(result); len(sounds) > 0 { - sound := sounds[1] - if printer, _ := dao.GetPrinter(dao.GetDB(), printMsg.PrintNo); printer != nil { - //先把结束标签消了 - result = strings.ReplaceAll(result, byteSignSoundE, "") - soundPrefix := "" - if printer.Sound != "" { - soundPrefix = "[v" + utils.Int2Str(printer.Volume*2) + "]" + printer.Sound - } else { - soundPrefix = "[v" + utils.Int2Str(printer.Volume*2) + "]" - } - hexPrefix, _ := jxutils.Utf8ToGbk([]byte(soundPrefix)) - hexPrefixStr := hex.EncodeToString(hexPrefix) - realSound := hexPrefixStr + sound - allLen := fmt.Sprintf("%x", (len("fd001a0101")+len(realSound))/2) - if len(allLen) < 2 { - allLen = "0" + allLen - } - soundLenH, soundLenX := int2h8l8(int64((len(realSound) + len("0101")) / 2)) - result = strings.ReplaceAll(result, byteSignSound, hexSignSound+allLen+"fd"+soundLenH+soundLenX+"0100"+hexPrefixStr) - } - } - } + //if strings.Contains(result, byteSignSound) && strings.Contains(result, byteSignSoundE) { + // if sounds := regexpSound.FindStringSubmatch(result); len(sounds) > 0 { + // sound := sounds[1] + // if printer, _ := dao.GetPrinter(dao.GetDB(), printMsg.PrintNo); printer != nil { + // //先把结束标签消了 + // result = strings.ReplaceAll(result, byteSignSoundE, "") + // soundPrefix := "" + // if printer.Sound != "" { + // soundPrefix = "[v" + utils.Int2Str(printer.Volume*2) + "]" + printer.Sound + // } else { + // soundPrefix = "[v" + utils.Int2Str(printer.Volume*2) + "]" + // } + // hexPrefix, _ := jxutils.Utf8ToGbk([]byte(soundPrefix)) + // hexPrefixStr := hex.EncodeToString(hexPrefix) + // realSound := hexPrefixStr + sound + // allLen := fmt.Sprintf("%x", (len("fd001a0101")+len(realSound))/2) + // if len(allLen) < 2 { + // allLen = "0" + allLen + // } + // soundLenH, soundLenX := int2h8l8(int64((len(realSound) + len("0101")) / 2)) + // result = strings.ReplaceAll(result, byteSignSound, hexSignSound+allLen+"fd"+soundLenH+soundLenX+"0100"+hexPrefixStr) + // } + // } + //} return result }