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]
|
t, ok := event.PrintObject[printNo]
|
||||||
if ok {
|
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()
|
t.Lock()
|
||||||
defer t.Unlock()
|
defer t.Unlock()
|
||||||
t.MsgMap[printNo] <- printMsg
|
t.MsgMap[printNo] <- printMsg
|
||||||
|
|||||||
@@ -202,6 +202,10 @@ func buildAllMap(t *TcpClient, key string) {
|
|||||||
t.TimeoutMap[key] = true
|
t.TimeoutMap[key] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func BuildAllMap(t *TcpClient, key string) {
|
||||||
|
buildAllMap(t, key)
|
||||||
|
}
|
||||||
|
|
||||||
func (t *TcpClient) getPrintStatus(key string) int {
|
func (t *TcpClient) getPrintStatus(key string) int {
|
||||||
t.RLock()
|
t.RLock()
|
||||||
defer t.RUnlock()
|
defer t.RUnlock()
|
||||||
|
|||||||
Reference in New Issue
Block a user