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......") globals.SugarLogger.Debugf("begin listenTcp port 8000......")
go HandleTcpMessages() go HandleTcpMessages()
go HandleCheckTcpHeart() go HandleCheckTcpHeart()
//go doPrint2(printMsgChan) go doPrint2(printMsgChan)
//go doPrint(printMsgChanFail) //go doPrint(printMsgChanFail)
for { for {
c, err := l.Accept() c, err := l.Accept()
@@ -212,7 +212,7 @@ func handleConn(c net.Conn) {
tcpClient.s.Unlock() tcpClient.s.Unlock()
changePrinterStatus(printNo, status) changePrinterStatus(printNo, status)
if status > 0 { if status > 0 {
//printFail() printFail()
} }
} else { } 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) prints, _ := dao.GetPrintMsgs(db, []int{printMsgWait, printMsgFail, printMsgErr}, time.Now().Add(-time.Hour*3), time.Now(), 0, 999)
for _, printMsg := range prints { for _, printMsg := range prints {
printMsgChanFail <- printMsg //printMsgChanFail <- printMsg
printMsg.Status = printMsgAlreadyLoad printMsg.Status = printMsgAlreadyLoad
dao.UpdateEntity(db, printMsg, "Status") dao.UpdateEntity(db, printMsg, "Status")
} }