1
This commit is contained in:
@@ -36,19 +36,15 @@ func (c *PrinterHandler) GetVendorID() int {
|
|||||||
|
|
||||||
func (c *PrinterHandler) PrintMsg(ctx *jxcontext.Context, id1, id2, msgTitle, msgContent string) (printerStatus *partner.PrinterStatus, err error) {
|
func (c *PrinterHandler) PrintMsg(ctx *jxcontext.Context, id1, id2, msgTitle, msgContent string) (printerStatus *partner.PrinterStatus, err error) {
|
||||||
globals.SugarLogger.Debugf("PrintMsg id1:%s", id1)
|
globals.SugarLogger.Debugf("PrintMsg id1:%s", id1)
|
||||||
if id1 != "" {
|
if id1 != "" && globals.EnableStoreWrite {
|
||||||
if globals.EnableStoreWrite {
|
if _, err := api.JxPrintAPI.DoPrint(id1, msgContent, utils.Str2Int(id2)); err == nil {
|
||||||
_, err = api.JxPrintAPI.DoPrint(id1, msgContent, utils.Str2Int(id2))
|
return c.GetPrinterStatus(ctx, id1, "")
|
||||||
}
|
|
||||||
if err == nil {
|
|
||||||
printerStatus, err = c.GetPrinterStatus(ctx, id1, "")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
printerStatus = &partner.PrinterStatus{
|
|
||||||
PrintResult: partner.PrintResultNoPrinter,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil, err
|
printerStatus = &partner.PrinterStatus{
|
||||||
|
PrintResult: partner.PrintResultNoPrinter,
|
||||||
|
}
|
||||||
|
return printerStatus, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *PrinterHandler) GetPrinterStatus(ctx *jxcontext.Context, id1, id2 string) (printerStatus *partner.PrinterStatus, err error) {
|
func (c *PrinterHandler) GetPrinterStatus(ctx *jxcontext.Context, id1, id2 string) (printerStatus *partner.PrinterStatus, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user