feat:餐段设置
This commit is contained in:
1 parent
67950343a7
commit
07a3141934
14 files changed
+285
-18
No files matched your search
@@ -35,6 +35,10 @@ abstract class AppSettingTool {
|
||||
static const String _cashierShowHoldActionKey = "cashierShowHoldAction";
|
||||
static const String _cashierShowMoreActionKey = "cashierShowMoreAction";
|
||||
|
||||
/// 收银页是否允许主动修改餐段的稳定存储键;缺失时按允许处理,兼容旧终端。
|
||||
static const String _cashierAllowManualMealPeriodChangeKey =
|
||||
"cashierAllowManualMealPeriodChange";
|
||||
|
||||
/// 顶部隐藏设备编码列表在现有 sysJson 中的稳定存储键;缺失或空列表表示五项全部显示。
|
||||
static const String _hiddenTerminalDeviceStatusesKey =
|
||||
"hiddenTerminalDeviceStatuses";
|
||||
@@ -63,6 +67,10 @@ abstract class AppSettingTool {
|
||||
static const String _reservationQueryQuickVerificationEnabledKey =
|
||||
"reservationQueryQuickVerificationEnabled";
|
||||
|
||||
/// 查询菜单是否允许主动修改餐段的稳定存储键;缺失时按允许处理,兼容旧终端。
|
||||
static const String _reservationQueryAllowManualMealPeriodChangeKey =
|
||||
"reservationQueryAllowManualMealPeriodChange";
|
||||
|
||||
/// 查询菜单最近餐段在现有 sysJson 中的稳定存储键,值使用后端餐段编码且不新增数据库字段。
|
||||
static const String _reservationQuerySelectedMealSlotKey =
|
||||
"reservationQuerySelectedMealSlot";
|
||||
@@ -472,25 +480,34 @@ abstract class AppSettingTool {
|
||||
});
|
||||
}
|
||||
|
||||
/// 读取收银页底部快捷操作显隐;旧终端没有配置时保持两个入口都显示。
|
||||
static Future<({bool showHoldAction, bool showMoreAction})>
|
||||
getCashierPagePreferences() async {
|
||||
/// 读取收银页底部快捷操作显隐及餐段修改权限;旧终端没有配置时保持默认允许。
|
||||
static Future<
|
||||
({
|
||||
bool showHoldAction,
|
||||
bool showMoreAction,
|
||||
bool allowManualMealPeriodChange,
|
||||
})> getCashierPagePreferences() async {
|
||||
final setting = await _getSetting();
|
||||
final sysJson = Map<String, dynamic>.from(json.decode(setting.sysJson));
|
||||
return (
|
||||
showHoldAction: sysJson[_cashierShowHoldActionKey] != false,
|
||||
showMoreAction: sysJson[_cashierShowMoreActionKey] != false,
|
||||
allowManualMealPeriodChange:
|
||||
sysJson[_cashierAllowManualMealPeriodChangeKey] != false,
|
||||
);
|
||||
}
|
||||
|
||||
/// 收银快捷操作属于本机页面布局配置,继续复用 sysJson,避免增加数据库字段。
|
||||
/// 收银快捷操作与餐段修改权限属于本机页面布局配置,继续复用 sysJson。
|
||||
static Future<void> setCashierPagePreferences({
|
||||
required bool showHoldAction,
|
||||
required bool showMoreAction,
|
||||
required bool allowManualMealPeriodChange,
|
||||
}) =>
|
||||
_updateSysJson((sysJson) {
|
||||
sysJson[_cashierShowHoldActionKey] = showHoldAction;
|
||||
sysJson[_cashierShowMoreActionKey] = showMoreAction;
|
||||
sysJson[_cashierAllowManualMealPeriodChangeKey] =
|
||||
allowManualMealPeriodChange;
|
||||
});
|
||||
|
||||
/// 读取商品餐段时间;旧终端无配置或持久化值损坏时返回产品默认时间。
|
||||
@@ -627,6 +644,9 @@ abstract class AppSettingTool {
|
||||
// 快速核销从属于核销入口,旧设置缺键或核销关闭时均不得隐式生效。
|
||||
quickVerificationEnabled: verificationEnabled &&
|
||||
sysJson[_reservationQueryQuickVerificationEnabledKey] == true,
|
||||
// 旧设置没有该键时保持允许手动修改,避免升级后收银流程被意外锁死。
|
||||
allowManualMealPeriodChange:
|
||||
sysJson[_reservationQueryAllowManualMealPeriodChangeKey] != false,
|
||||
selectedMealSlot: selectedMealSlot,
|
||||
verificationDateScope: verificationDateScope,
|
||||
);
|
||||
@@ -641,6 +661,7 @@ abstract class AppSettingTool {
|
||||
required bool nameMaskEnabled,
|
||||
required bool verificationEnabled,
|
||||
required bool quickVerificationEnabled,
|
||||
required bool allowManualMealPeriodChange,
|
||||
required ReservationVerificationDateScope verificationDateScope,
|
||||
}) {
|
||||
final normalized = <ReservationRecognitionMethod>[];
|
||||
@@ -664,6 +685,8 @@ abstract class AppSettingTool {
|
||||
sysJson[_reservationQueryVerificationEnabledKey] = verificationEnabled;
|
||||
sysJson[_reservationQueryQuickVerificationEnabledKey] =
|
||||
verificationEnabled && quickVerificationEnabled;
|
||||
sysJson[_reservationQueryAllowManualMealPeriodChangeKey] =
|
||||
allowManualMealPeriodChange;
|
||||
sysJson[_reservationQueryVerificationDateScopeKey] =
|
||||
verificationDateScope.code;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user