1
This commit is contained in:
@@ -36,16 +36,16 @@ func init() {
|
||||
|
||||
func (p PrinterHandler) PrintMsg(ctx *jxcontext.Context, sn, copies, voice, msgContent string) (printerStatus *partner.PrinterStatus, err error) {
|
||||
if sn != "" {
|
||||
if globals.EnableStoreWrite {
|
||||
printOrderID, err1 := api.TrendITAPI.Print(sn, msgContent, voice)
|
||||
if err1 == nil && printOrderID != "" {
|
||||
printerStatus, err = p.GetPrinterStatus(ctx, sn, "")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
printerStatus = &partner.PrinterStatus{
|
||||
PrintResult: partner.PrintResultNoPrinter,
|
||||
//if globals.EnableStoreWrite {
|
||||
printOrderID, err1 := api.TrendITAPI.Print(sn, msgContent, voice)
|
||||
if err1 == nil && printOrderID != "" {
|
||||
printerStatus, err = p.GetPrinterStatus(ctx, sn, "")
|
||||
}
|
||||
// }
|
||||
//} else {
|
||||
// printerStatus = &partner.PrinterStatus{
|
||||
// PrintResult: partner.PrintResultNoPrinter,
|
||||
// }
|
||||
}
|
||||
return printerStatus, err
|
||||
}
|
||||
@@ -57,7 +57,7 @@ func (p PrinterHandler) GetPrinterStatus(ctx *jxcontext.Context, sn, id2 string)
|
||||
}
|
||||
tempOnline := utils.Float64TwoInt(onlineStatus)
|
||||
tempWork := utils.Float64TwoInt(workStatus)
|
||||
if tempOnline == trenditapi.OnlineStatus && tempWork == trenditapi.WorkStatusReady {
|
||||
if tempOnline == trenditapi.OnlineStatus && (tempWork == trenditapi.WorkStatusReady || tempWork == trenditapi.WorkStatusPrinting) {
|
||||
printerStatus.PrinterStatus = partner.PrinterStatusOnlineOK
|
||||
} else if tempOnline == trenditapi.OfflineStatus {
|
||||
printerStatus.PrinterStatus = partner.PrinterStatusOffline
|
||||
|
||||
Reference in New Issue
Block a user