diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go
index a2dc57352..efe4a599c 100644
--- a/business/jxstore/event/event_tcp_utils.go
+++ b/business/jxstore/event/event_tcp_utils.go
@@ -479,23 +479,23 @@ 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]
- printer := model.Printer{}
- printer.Volume = 4
- printer.Sound = "sounda"
+ //printer := model.Printer{}
+ //printer.Volume = 4
+ //printer.Sound = "sounda"
//if printer, _ := dao.GetPrinter(dao.GetDB(), printMsg.PrintNo); printer != nil {
//先把结束标签消了
result = strings.ReplaceAll(result, byteSignSoundE, "")
//fd 固定
//001a (声音数据长度高八位低八位)
//0101 固定
- 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)
+ //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)
// 将语音包转换为十六进制
voice := ""
@@ -509,16 +509,16 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
voiceData := hex.EncodeToString(voiceDataGBK)
//[8]sounda14 ->5b385d736f756e64613134
- realSound := hexPrefixStr + voiceData
- allLen := fmt.Sprintf("%x", (len("fd001a0101")+len(realSound))/2)
+ //realSound := hexPrefixStr + voiceData
+ realSound := voiceData
+ allLen := fmt.Sprintf("%x", (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)
- result = strings.ReplaceAll(result, byteSignSound, hexSignSoundOld+hexPrefixStr)
- result = strings.ReplaceAll(result, byteSignSoundE, "")
+ result = strings.ReplaceAll(result, byteSignSound, hexSignSoundOld+realSound)
//}
}
}
diff --git a/business/jxstore/event/print_test.go b/business/jxstore/event/print_test.go
index 9c35f1f55..51a223899 100644
--- a/business/jxstore/event/print_test.go
+++ b/business/jxstore/event/print_test.go
@@ -13,7 +13,7 @@ func TestPrintMsg(t *testing.T) {
msg := &model.PrintMsg{
ModelIDCULD: model.ModelIDCULD{},
PrintNo: "20220707000002",
- Content: "\t