门店增加可调节打印机声音

This commit is contained in:
苏尹岚
2020-04-21 14:08:19 +08:00
parent febda332ad
commit 2a1863c144
5 changed files with 42 additions and 3 deletions

View File

@@ -762,7 +762,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
delete(valid, "printerKey")
}
// 网络打印机处理
if valid["printerVendorID"] != nil || valid["printerSN"] != nil || valid["printerKey"] != nil {
if valid["printerVendorID"] != nil || valid["printerSN"] != nil || valid["printerKey"] != nil || valid["soundPercentage"] != nil {
if valid["printerVendorID"] == nil {
valid["printerVendorID"] = store.PrinterVendorID
}
@@ -788,6 +788,12 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
if newID2 != "" {
valid["printerKey"] = newID2
}
if valid["soundPercentage"] != nil {
err = handler.SetSound(ctx, store.PrinterSN, store.PrinterKey, jxutils.TranslateSoundSize(printerVendorID, valid["soundPercentage"].(int)))
if err != nil {
return 0, err
}
}
} else {
valid["printerVendorID"] = 0
valid["printerSN"] = ""