From 60b9a5f215715d3a0c2a60f4cc147238b30833c1 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Wed, 21 Jul 2021 18:45:03 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index db77d8c08..fbf04c602 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -226,8 +226,8 @@ func handleConn(c net.Conn) { tcpClient.s.Unlock() } } else if strings.Contains(data, printText) { - globals.SugarLogger.Debugf("handleConn print callback: %v", data) - changePrintMsg(data) + //globals.SugarLogger.Debugf("handleConn print callback: %v", data) + //changePrintMsg(data) } } } @@ -304,6 +304,14 @@ func doPrint(printMsgChanFail chan *model.PrintMsg) (err error) { globals.SugarLogger.Debugf("handleTcpMessages success, data: %v", hex.EncodeToString(data)) printMsg.Status = printMsgAlreadySend dao.UpdateEntity(db, printMsg, "Status", "Comment") + + buffer := make([]byte, 1024) + n, _ := c.Read(buffer) + data := hex.EncodeToString(buffer[:n]) + if strings.Contains(data, printText) { + globals.SugarLogger.Debugf("handleConn print callback: %v", data) + changePrintMsg(data) + } } } }