门店增加可调节打印机声音
This commit is contained in:
@@ -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"] = ""
|
||||
|
||||
Reference in New Issue
Block a user