1
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user