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