aa
This commit is contained in:
@@ -267,9 +267,11 @@ func printFail() (err error) {
|
||||
if err = checkPrintMsg(printMsg); err == nil {
|
||||
tcpClient.s.RLock()
|
||||
if tcpClient.Clients[printMsg.PrintNo] != nil {
|
||||
if tcpClient.Clients[printMsg.PrintNo].C != nil {
|
||||
c = tcpClient.Clients[printMsg.PrintNo].C
|
||||
data, err = buildMsg(printMsg)
|
||||
if tcpClient.Clients[printMsg.PrintNo].Status == printerStatusOnline {
|
||||
if tcpClient.Clients[printMsg.PrintNo].C != nil {
|
||||
c = tcpClient.Clients[printMsg.PrintNo].C
|
||||
data, err = buildMsg(printMsg)
|
||||
}
|
||||
}
|
||||
}
|
||||
tcpClient.s.RUnlock()
|
||||
@@ -417,7 +419,7 @@ func HandleCheckTcpHeart() {
|
||||
}
|
||||
}
|
||||
|
||||
func buildMsg(printMsg *model.PrintMsg) (data []byte, err error) {
|
||||
func buildMsg(printMsg *dao.GetPrintMsgsResult) (data []byte, err error) {
|
||||
var (
|
||||
content = printMsg.Content
|
||||
orderNo = printMsg.OrderNo
|
||||
@@ -452,7 +454,7 @@ func getCheckSum(str string) (check string) {
|
||||
}
|
||||
|
||||
//内容中的标签替换成指令
|
||||
func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
func replaceContent(content string, printMsg *dao.GetPrintMsgsResult) (result string) {
|
||||
var (
|
||||
lenqr int
|
||||
hexLenqr string
|
||||
@@ -550,7 +552,10 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
return result
|
||||
}
|
||||
|
||||
func checkPrintMsg(printMsg *model.PrintMsg) (err error) {
|
||||
func checkPrintMsg(printMsg *dao.GetPrintMsgsResult) (err error) {
|
||||
if printMsg.FlowFlag == 1 {
|
||||
return fmt.Errorf("打印机当月流量已经超过30MB,请及时充值!printNo:[%v]", printMsg.PrintNo)
|
||||
}
|
||||
if printMsg.Content == "" {
|
||||
return fmt.Errorf("此打印信息内容为空!printMsg printNo:[%v], orderNo :[%v]", printMsg.PrintNo, printMsg.OrderNo)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user