This commit is contained in:
suyl
2021-07-22 14:00:58 +08:00
parent fa0a934737
commit 18e6a0f6be

View File

@@ -144,7 +144,7 @@ func ListenTcp() {
globals.SugarLogger.Debugf("begin listenTcp port 8000......")
go HandleTcpMessages()
go HandleCheckTcpHeart()
//go doPrint2(printMsgChan)
go doPrint2(printMsgChan)
//go doPrint(printMsgChanFail)
for {
c, err := l.Accept()
@@ -212,7 +212,7 @@ func handleConn(c net.Conn) {
tcpClient.s.Unlock()
changePrinterStatus(printNo, status)
if status > 0 {
//printFail()
printFail()
}
} else {
//改变打印机状态
@@ -267,7 +267,7 @@ 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
//printMsgChanFail <- printMsg
printMsg.Status = printMsgAlreadyLoad
dao.UpdateEntity(db, printMsg, "Status")
}