From 5a2505c4e3ccb73db22d49dd26cfd0a2aabb9712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 26 Jul 2022 15:06:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=AD=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/event/event_tcp_utils.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go index b93566232..8539f4ecc 100644 --- a/business/jxstore/event/event_tcp_utils.go +++ b/business/jxstore/event/event_tcp_utils.go @@ -484,7 +484,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) { //printer.Sound = "sounda" //if printer, _ := dao.GetPrinter(dao.GetDB(), printMsg.PrintNo); printer != nil { //先把结束标签消了 - result = strings.ReplaceAll(result, byteSignSoundE, "") + result = strings.ReplaceAll(result, byteSignSoundE, "") // 3c736f756e643e 3230 3c736f756e643e //fd 固定 //001a (声音数据长度高八位低八位) //0101 固定 @@ -505,6 +505,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) { int16Sound := strconv.FormatInt(intSound, 16) voice += int16Sound } + fmt.Println("voice=========", voice) //voiceDataGBK, _ := jxutils.Utf8ToGbk([]byte(voice)) //voiceData := hex.EncodeToString(voiceDataGBK) @@ -518,6 +519,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) { //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, sound, "") result = strings.ReplaceAll(result, byteSignSound, hexSignSoundOld+voice) //} }