This commit is contained in:
邹宗楠
2024-07-10 13:31:27 +08:00
parent 10b7aa3bc7
commit 3bbd241264
2 changed files with 13 additions and 0 deletions

View File

@@ -383,6 +383,15 @@ func DoPrintMsg(appID int, msgID, printNo, content string, orderNo string) (err
t, ok := event.PrintObject[printNo]
if ok {
t.Lock()
defer t.Unlock()
t.MsgMap[printNo] <- printMsg
printMsg.Status = event.PrintMsgAlreadyLoad
} else {
t = event.NewTcpClient()
event.BuildAllMap(t, printNo)
event.PrintObject[printNo] = t
t.Lock()
defer t.Unlock()
t.MsgMap[printNo] <- printMsg

View File

@@ -202,6 +202,10 @@ func buildAllMap(t *TcpClient, key string) {
t.TimeoutMap[key] = true
}
func BuildAllMap(t *TcpClient, key string) {
buildAllMap(t, key)
}
func (t *TcpClient) getPrintStatus(key string) int {
t.RLock()
defer t.RUnlock()