From 4dd08d525510b015578e7186978395c8a5d94e9d Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Wed, 21 Jul 2021 18:37:20 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index ba7ae9522..db77d8c08 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -30,6 +30,7 @@ const ( printMsgWait = 0 //待打印 printMsgFail = -1 //打印失败(打印机报出) printMsgErr = -2 //京西报出 + printMsgAlreadyLoad = 3 //已放入队列 heartErrNormal = "00" //正常 heartErrWithoutPaper = "04" //心跳错,缺纸 @@ -142,7 +143,7 @@ func ListenTcp() { globals.SugarLogger.Debugf("begin listenTcp port 8000......") go HandleTcpMessages() go HandleCheckTcpHeart() - //go doPrint(printMsgChanFail) + go doPrint(printMsgChanFail) go doPrint2(printMsgChan) for { c, err := l.Accept() @@ -265,6 +266,8 @@ func printFail() (err error) { prints, _ := dao.GetPrintMsgs(db, []int{printMsgWait, printMsgFail, printMsgErr}, time.Now().Add(-time.Hour*3), time.Now(), 0, 999) for _, printMsg := range prints { printMsgChanFail <- printMsg + printMsg.Status = printMsgAlreadyLoad + dao.UpdateEntity(db, printMsg, "Status") } return err } @@ -366,6 +369,8 @@ func HandleTcpMessages() { prints, _ := dao.GetPrintMsgs(db, []int{printMsgWait}, time.Now().Add(-time.Hour*3), time.Now(), offset, pageSize) for _, printMsg := range prints { printMsgChan <- printMsg + printMsg.Status = printMsgAlreadyLoad + dao.UpdateEntity(db, printMsg, "Status") } } }