From ee7b9cce088aaf551e5ffedbd637943dc3ba5b16 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Wed, 30 Jun 2021 16:22:11 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index fd268e9dc..3262beaea 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -59,7 +59,7 @@ const ( hexSignQrLeft = "1d5800" hexSignQrRight = "1d5804" hexSignQr = "1b5a0001061600" - hexSignQrEnd = "1b61000a0a0a1b40" + hexSignQrEnd = "000a0a0a1b40" byteSignBR = "3c62723e" //换行 byteSignCenter = "3c63656e7465723e" //居中 @@ -274,6 +274,7 @@ func buildMsg(printMsg *model.PrintMsg) (data []byte, err error) { printInit = "1b40" //打印机初始化 voice = "1b59415501" //语音响一次 check = "ff" + qr = "1b5a0001061600747470733a2f2f7777772e62616964752e636f6d2f1b61000A0A0A1B40" orderNoHexH, orderNoHexL, printData string ) //写入数据 @@ -281,9 +282,9 @@ func buildMsg(printMsg *model.PrintMsg) (data []byte, err error) { printDataGBK, _ := jxutils.Utf8ToGbk([]byte(content)) printData = hex.EncodeToString(printDataGBK) printData = replaceContent(printData) - lenData := int64(len(str) + len(const1) + len(orderNoHexH) + len(orderNoHexL) + len(printInit) + len(voice) + len(check) + 4 + len(printData)) + lenData := int64(len(str) + len(const1) + len(orderNoHexH) + len(orderNoHexL) + len(printInit) + len(voice) + len(check) + 4 + len(printData) + len(qr)) x1, x2 := int2h8l8(lenData / 2) - dataStr := str + x1 + x2 + const1 + orderNoHexH + orderNoHexL + printInit + voice + printData + check + dataStr := str + x1 + x2 + const1 + orderNoHexH + orderNoHexL + printInit + voice + printData + qr + check return jxutils.Hextob(dataStr), err }