This commit is contained in:
suyl
2021-07-30 18:42:17 +08:00
parent 472508634a
commit e55d4dfd4f
2 changed files with 3 additions and 5 deletions

View File

@@ -230,8 +230,9 @@ func (t *TcpClient) setPrintStatus(key string, status int) {
func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) { func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) {
t.Lock() t.Lock()
defer t.Unlock() defer t.Unlock()
if !t.isExistMsg(printMsg.PrintNo) { if t.MsgMap[printMsg.PrintNo] == nil {
t.buildMsgMap(printMsg.PrintNo) dataChan := make(chan *model.PrintMsg, 1024)
t.MsgMap[printMsg.PrintNo] = dataChan
} }
globals.SugarLogger.Debugf("addMsgChan msgID: %s", printMsg.MsgID) globals.SugarLogger.Debugf("addMsgChan msgID: %s", printMsg.MsgID)
t.MsgMap[printMsg.PrintNo] <- printMsg t.MsgMap[printMsg.PrintNo] <- printMsg

View File

@@ -1,7 +1,6 @@
package dao package dao
import ( import (
"fmt"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"time" "time"
@@ -51,8 +50,6 @@ func GetPrintMsgs(db *DaoDB, printNo string, statuss []int, beginAt, endAt time.
} }
sql += " ORDER BY a.created_at LIMIT ? OFFSET ?" sql += " ORDER BY a.created_at LIMIT ? OFFSET ?"
sqlParams = append(sqlParams, pageSize, offset) sqlParams = append(sqlParams, pageSize, offset)
fmt.Println(sql)
fmt.Println(sqlParams)
err = GetRows(db, &prints, sql, sqlParams) err = GetRows(db, &prints, sql, sqlParams)
return prints, err return prints, err
} }