1
This commit is contained in:
@@ -222,12 +222,6 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
||||
case printerStatusOnline:
|
||||
if c = t.getPrintConn(printMsg.PrintNo); c != nil {
|
||||
data, err = buildMsg(printMsg)
|
||||
encryption := ""
|
||||
for _, v := range data {
|
||||
encryption += fmt.Sprintf("%d", v)
|
||||
}
|
||||
printMsg.ContentEncryption = encryption
|
||||
dao.UpdateEntity(db, printMsg, "ContentEncryption")
|
||||
}
|
||||
case printerStatusOffline:
|
||||
err = fmt.Errorf("打印机离线!")
|
||||
@@ -246,6 +240,13 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
||||
close(t.TimeoutMap[key])
|
||||
} else {
|
||||
if c != nil {
|
||||
encryption := ""
|
||||
for _, v := range data {
|
||||
encryption += fmt.Sprintf("%d", v)
|
||||
}
|
||||
printMsg.ContentEncryption = encryption
|
||||
|
||||
dao.UpdateEntity(db, printMsg, "ContentEncryption")
|
||||
if _, err = c.Write(data); err != nil {
|
||||
globals.SugarLogger.Debugf("handleTcpMessages err [%v]", err)
|
||||
//t.delConn(printMsg.PrintNo)
|
||||
|
||||
Reference in New Issue
Block a user