添加打印机心跳监听,心跳监听成功,表示打印机激活,用户可以绑定!

This commit is contained in:
邹宗楠
2022-08-23 17:22:05 +08:00
parent 8303af4e32
commit 831857418b
2 changed files with 14 additions and 3 deletions

View File

@@ -91,7 +91,9 @@ func (t *TcpClient) handleConn(c net.Conn) {
changePrinterStatus(printNo, status)
t.HandleCheckTcpHeart(printNo)
// todo 证明打印机已经被激活,将激活打印机存入数据库,保证用户不能无限制绑定打印机
if err := dao.NotExistsCreate(printNo); err != nil {
globals.SugarLogger.Debugf("监听打印机心跳,不存在则创建 :[%v]", err)
}
} else {
//在加到连接池中已经更新了时间所以放在else里
t.setPrintStatusTime(printNo)