From 67aada2e62e3c5faa9a57b789ab6e6473caaace7 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Mon, 5 Jul 2021 09:54:47 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 5d9e08278..8b2a030c5 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -282,7 +282,9 @@ func HandleTcpMessages() { printMsg.Comment = err.Error() dao.UpdateEntity(db, printMsg, "Status", "Comment") delete(tcpClient.Clients, printMsg.PrintNo) - c.Close() + if c != nil { + c.Close() + } } else { if c != nil { if _, err = c.Write(data); err != nil { @@ -325,8 +327,8 @@ func buildMsg(printMsg *model.PrintMsg) (data []byte, err error) { orderNo = printMsg.OrderNo str = "1e" const1 = "0200ff50" - printInit = "1b40" //打印机初始化 - voice = "1d6b4009fd00060101d6d0b9fa" //语音,中国 + printInit = "1b40" //打印机初始化 + voice = "1b594155011d6b4009fd00060101d6d0b9fa" //语音,中国 check = "ff" //qr = "1d58021b5a0001061600747470733a2f2f7777772e62616964752e636f6d2f1b000A0A0A1B40" orderNoHexH, orderNoHexL, printData string