diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 659086976..136e6579b 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -222,11 +222,12 @@ func (t *TcpClient) doPrint(key string) (err error) { case printerStatusOnline: if c = t.getPrintConn(printMsg.PrintNo); c != nil { data, err = buildMsg(printMsg) - printMsg.ContentEncryption = string(data) - globals.SugarLogger.Debug("================print_msg:", string(data)) - if _, err := dao.UpdateEntity(db, printMsg, "ContentEncryption"); err != nil { - globals.SugarLogger.Debug("================print_msg:", err) + encryption := "" + for _, v := range data { + encryption += fmt.Sprintf("%d", v) } + printMsg.ContentEncryption = encryption + dao.UpdateEntity(db, printMsg, "ContentEncryption") } case printerStatusOffline: err = fmt.Errorf("打印机离线!") diff --git a/business/jxstore/event/print_test.go b/business/jxstore/event/print_test.go index 3498f114b..372411f15 100644 --- a/business/jxstore/event/print_test.go +++ b/business/jxstore/event/print_test.go @@ -24,6 +24,8 @@ func TestPrintMsg(t *testing.T) { } data, err := buildMsg(msg) + + fmt.Println("data=", fmt.Sprintf("%s", string(data...))) fmt.Println("data=", string(data)) fmt.Println("err=", err) }