This commit is contained in:
suyl
2021-07-05 09:54:47 +08:00
parent 53569d3edc
commit 67aada2e62

View File

@@ -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