This commit is contained in:
suyl
2021-07-22 10:38:30 +08:00
parent 8060bc5c85
commit 468b238555

View File

@@ -372,6 +372,18 @@ func HandleTcpMessages() {
printMsgChan <- printMsg printMsgChan <- printMsg
printMsg.Status = printMsgAlreadyLoad printMsg.Status = printMsgAlreadyLoad
dao.UpdateEntity(db, printMsg, "Status") dao.UpdateEntity(db, printMsg, "Status")
for {
select {
case obj, _ := <-printMsgChan:
if _, ok := obj.(*model.PrintMsg); !ok {
if data, ok2 := obj.(string); ok2 {
changePrintMsg(data)
break
}
continue
}
}
}
} }
} }
} }
@@ -383,7 +395,6 @@ func doPrint2(printMsgChan chan interface{}) (err error) {
for { for {
select { select {
case obj, _ := <-printMsgChan: case obj, _ := <-printMsgChan:
fmt.Println("qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", utils.Format4Output(obj, true))
printMsg, ok := obj.(*model.PrintMsg) printMsg, ok := obj.(*model.PrintMsg)
if ok { if ok {
var ( var (
@@ -431,10 +442,6 @@ func doPrint2(printMsgChan chan interface{}) (err error) {
} }
} }
} }
} else {
data, _ := <-printMsgChan
dataStr := data.(string)
changePrintMsg(dataStr)
} }
} }
} }