- 门店网络打印机设置修改,只有在成功绑定后才执行可能的解绑(之前是先解绑,可能有问题)

- 所有网络打印机适配层写入性API添加EnableStoreWrite控制
This commit is contained in:
gazebo
2019-08-06 21:58:06 +08:00
parent 447237f252
commit e3e900cd10
6 changed files with 84 additions and 46 deletions

View File

@@ -104,7 +104,9 @@ func (c *PrinterHandler) PrintMsg(ctx *jxcontext.Context, deviceID, deviceSecret
globals.SugarLogger.Debugf("PrintMsg deviceID:%s", deviceID)
if deviceID != "" {
var status int
_, status, err = api.ZhongwuAPI.PrintMsg(deviceID, deviceSecret, msgContent)
if globals.EnableStoreWrite {
_, status, err = api.ZhongwuAPI.PrintMsg(deviceID, deviceSecret, msgContent)
}
if err == nil {
printerStatus = c.translateStatus(status)
}
@@ -166,7 +168,9 @@ func (c *PrinterHandler) RebindPrinter(ctx *jxcontext.Context, lastBindResult *p
}
func (c *PrinterHandler) EmptyPrintList(ctx *jxcontext.Context, id1, id2 string) (err error) {
_, err = api.ZhongwuAPI.EmptyPrintQueue(id1, id2)
if globals.EnableStoreWrite {
_, err = api.ZhongwuAPI.EmptyPrintQueue(id1, id2)
}
return err
}