326 lines
7.4 KiB
Dart
326 lines
7.4 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
import 'package:pj_supermarket_cloud/common/index.dart';
|
|
|
|
part 'database_models.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class SysSetting extends Equatable {
|
|
/// 设备类型
|
|
SysType sysType;
|
|
|
|
/// 当前 APK 运行角色;旧配置默认保持收银终端行为。
|
|
@JsonKey(defaultValue: TerminalRole.cashier)
|
|
TerminalRole terminalRole;
|
|
|
|
/// mac地址
|
|
String? androidId;
|
|
|
|
/// 服务端ID
|
|
String? serviceId;
|
|
|
|
/// 服务单设备名
|
|
String? serviceName;
|
|
|
|
/// 商户id
|
|
String? serviceMerchantId;
|
|
|
|
/// 打印终端所绑定的来源业务终端。
|
|
String? printerSourceHardId;
|
|
|
|
/// 打印终端所绑定的来源业务终端名称。
|
|
String? printerSourceHardName;
|
|
|
|
/// 真机打印机型号与 USB 参数,由服务端启动配置下发。
|
|
String? printerModel;
|
|
int? printerUsbVendorId;
|
|
int? printerUsbProductId;
|
|
|
|
/// 当前纸宽、切刀和图片指令模式。
|
|
int printerPaperWidth;
|
|
bool printerAutoCut;
|
|
String printerImageMode;
|
|
|
|
/// 商户部门id
|
|
String? merchantDeptId;
|
|
|
|
/// 硬件分组id
|
|
String? hardGroupId;
|
|
|
|
/// mq地址
|
|
String? mqSocketAddress;
|
|
|
|
/// mq端口
|
|
String? mqSocketPort;
|
|
|
|
/// mq用户名
|
|
String? mqUsername;
|
|
|
|
/// mq密码
|
|
String? mqPassword;
|
|
|
|
/// 当前设备的topic
|
|
String? mainTopic;
|
|
|
|
/// mq连接id
|
|
String? mqClientId;
|
|
|
|
/// mq状态
|
|
String? mqStatus;
|
|
|
|
/// 外部存储地址
|
|
String? externalPath;
|
|
|
|
/// 数据库地址
|
|
String? sqlAddress;
|
|
|
|
/// 日志地址
|
|
String? logAddress;
|
|
|
|
/// 人脸 appId
|
|
String? faceAppId;
|
|
|
|
/// 人脸 sdkKey
|
|
String? faceSdkKey;
|
|
|
|
/// 人脸 activeKey
|
|
String? faceActiveKey;
|
|
|
|
/// 同步时间
|
|
DateTime? syncTime;
|
|
|
|
/// 菜谱分类同步时间
|
|
DateTime? canteenClassifySyncTime;
|
|
|
|
/// 菜谱商品同步时间
|
|
DateTime? canteenProductSyncTime;
|
|
|
|
/// 超市分类同步时间
|
|
DateTime? supermarketClassifySyncTime;
|
|
|
|
/// 超市商品同步时间
|
|
DateTime? supermarketProductSyncTime;
|
|
|
|
/// 离线订单同步时间
|
|
DateTime? offlineOrderSyncTime;
|
|
|
|
/// 长链接重连
|
|
DateTime? mqSyncTime;
|
|
|
|
/// 商品时间段类型
|
|
ProductHourType? hourType;
|
|
|
|
// 全局字体大小
|
|
SettingGlobalFontSize? globalFontSize;
|
|
|
|
/// 按钮、标签及小型操作控件的圆角。
|
|
@JsonKey(defaultValue: SettingButtonRadius.standard)
|
|
SettingButtonRadius buttonRadius;
|
|
|
|
/// 页面分组、信息卡片及 Forui 卡片的圆角。
|
|
@JsonKey(defaultValue: SettingCardRadius.standard)
|
|
SettingCardRadius cardRadius;
|
|
|
|
/// 按钮和标签的内边距档位,不改变全局字体大小。
|
|
@JsonKey(defaultValue: SettingButtonSize.standard)
|
|
SettingButtonSize buttonSize;
|
|
|
|
// 使用支付方式
|
|
List<OrderPayDisplayType>? usePayDisplayType;
|
|
|
|
// 默认支付方式
|
|
OrderPayDisplayType? defaultPayDisplayType;
|
|
|
|
// 租户列表
|
|
List<ServiceTenant>? tenantList;
|
|
|
|
/// 设置为主控后不访问扫码、饭卡和人脸硬件,改由操作员输入硬件结果。
|
|
@JsonKey(defaultValue: false)
|
|
bool manualHardwareInput;
|
|
|
|
/// Root 最近一次真实命令检查状态;旧配置缺失时按未检查处理。
|
|
@JsonKey(defaultValue: RootAccessStatus.unknown)
|
|
RootAccessStatus rootAccessStatus;
|
|
|
|
/// Root 最近一次检查时间;旧配置或从未检查时为空。
|
|
DateTime? rootAccessCheckedAt;
|
|
|
|
/// Root 检查诊断摘要;可用时说明确认结果,不可用时说明拒绝、超时等原因。
|
|
String? rootAccessDiagnostic;
|
|
|
|
SysSetting({
|
|
required this.sysType,
|
|
this.terminalRole = TerminalRole.cashier,
|
|
this.androidId,
|
|
this.serviceId,
|
|
this.mqSocketAddress,
|
|
this.mqStatus,
|
|
this.sqlAddress,
|
|
this.logAddress,
|
|
this.hardGroupId,
|
|
this.printerPaperWidth = 80,
|
|
this.printerAutoCut = true,
|
|
this.printerImageMode = 'GS_V0',
|
|
this.tenantList,
|
|
this.manualHardwareInput = false,
|
|
this.rootAccessStatus = RootAccessStatus.unknown,
|
|
this.rootAccessCheckedAt,
|
|
this.rootAccessDiagnostic,
|
|
this.buttonRadius = SettingButtonRadius.standard,
|
|
this.cardRadius = SettingCardRadius.standard,
|
|
this.buttonSize = SettingButtonSize.standard,
|
|
});
|
|
|
|
factory SysSetting.fromJson(Map<String, dynamic> json) =>
|
|
_$SysSettingFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$SysSettingToJson(this);
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
sysType,
|
|
terminalRole,
|
|
androidId,
|
|
serviceId,
|
|
serviceName,
|
|
serviceMerchantId,
|
|
printerSourceHardId,
|
|
printerSourceHardName,
|
|
printerModel,
|
|
printerUsbVendorId,
|
|
printerUsbProductId,
|
|
printerPaperWidth,
|
|
printerAutoCut,
|
|
printerImageMode,
|
|
merchantDeptId,
|
|
hardGroupId,
|
|
mqSocketAddress,
|
|
mqSocketPort,
|
|
mqUsername,
|
|
mqPassword,
|
|
mainTopic,
|
|
mqClientId,
|
|
mqStatus,
|
|
externalPath,
|
|
sqlAddress,
|
|
logAddress,
|
|
faceAppId,
|
|
faceSdkKey,
|
|
faceActiveKey,
|
|
syncTime?.millisecondsSinceEpoch,
|
|
canteenClassifySyncTime?.millisecondsSinceEpoch,
|
|
canteenProductSyncTime?.millisecondsSinceEpoch,
|
|
supermarketClassifySyncTime?.millisecondsSinceEpoch,
|
|
supermarketProductSyncTime?.millisecondsSinceEpoch,
|
|
offlineOrderSyncTime?.millisecondsSinceEpoch,
|
|
mqSyncTime?.millisecondsSinceEpoch,
|
|
hourType,
|
|
globalFontSize,
|
|
buttonRadius,
|
|
cardRadius,
|
|
buttonSize,
|
|
usePayDisplayType,
|
|
defaultPayDisplayType,
|
|
tenantList,
|
|
manualHardwareInput,
|
|
rootAccessStatus,
|
|
rootAccessCheckedAt?.millisecondsSinceEpoch,
|
|
rootAccessDiagnostic,
|
|
];
|
|
}
|
|
|
|
/// 用户信息
|
|
@JsonSerializable()
|
|
class UserSetting extends Equatable {
|
|
/// 账号
|
|
String? username;
|
|
|
|
/// 密码
|
|
String? password;
|
|
|
|
/// start 服务端信息 start
|
|
|
|
/// 设备类型
|
|
SysType? sysType;
|
|
|
|
/// 用户编号
|
|
int? userId;
|
|
|
|
/// 访问令牌
|
|
String? accessToken;
|
|
|
|
/// 刷新令牌
|
|
String? refreshToken;
|
|
|
|
/// 过期时间
|
|
int? expiresTime;
|
|
|
|
/// end 服务端信息 end
|
|
|
|
/// 租户id
|
|
String? tenantId;
|
|
|
|
UserSetting({
|
|
this.username,
|
|
this.password,
|
|
});
|
|
|
|
factory UserSetting.fromJson(Map<String, dynamic> json) =>
|
|
_$UserSettingFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$UserSettingToJson(this);
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
username,
|
|
password,
|
|
sysType,
|
|
userId,
|
|
accessToken,
|
|
refreshToken,
|
|
expiresTime,
|
|
tenantId,
|
|
];
|
|
}
|
|
|
|
@JsonSerializable()
|
|
class CanteenExtraPriceSetting extends Equatable {
|
|
/// 是否开启额外金额
|
|
bool payAmountEnable;
|
|
|
|
/// 每一次上限
|
|
int payAmountMealLimit;
|
|
|
|
/// 超过的倍数
|
|
double payAmountMealTimes;
|
|
|
|
/// 售后的退货理由
|
|
String? afterSaleReturnReasons;
|
|
|
|
// 商户支付规则列表
|
|
List<ServiceMchRule>? mchRoleList;
|
|
|
|
CanteenExtraPriceSetting({
|
|
required this.payAmountEnable,
|
|
required this.payAmountMealLimit,
|
|
required this.payAmountMealTimes,
|
|
this.afterSaleReturnReasons,
|
|
this.mchRoleList,
|
|
});
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
payAmountEnable,
|
|
payAmountMealLimit,
|
|
payAmountMealTimes,
|
|
afterSaleReturnReasons,
|
|
mchRoleList,
|
|
];
|
|
|
|
factory CanteenExtraPriceSetting.fromJson(Map<String, dynamic> json) =>
|
|
_$CanteenExtraPriceSettingFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$CanteenExtraPriceSettingToJson(this);
|
|
}
|