Files
cashier_reserve_app/lib/data_model/reserve/table_model.dart
2024-11-26 13:44:06 +08:00

548 lines
14 KiB
Dart

import 'dart:convert';
/// amount : 0.00
/// areaId : 20
/// autoClear : 0
/// bookingInfo : {"arrivedTime":null,"bookingDate":"2024-11-22","bookingPerson":"王","bookingTableNum":0,"bookingTime":"2024-11-22 18:30:00","bookingType":"dinner","createTime":"2024-11-22 16:16:17","createUserName":"双屿pirse(测77)","delFlag":0,"dinerNum":6,"diningStandardPrice":0.00,"diningStandardUnit":"table","diningType":"普通用餐","focus":1,"gender":1,"id":1,"orderNo":"BK241122161617-cwba","phoneNumber":"13011223344","receiveMarketingSms":1,"remark":"今个高兴,和哥几个一醉方休","shopId":11,"shopTableId":151,"status":20,"timeoutMinute":60,"updateTime":"2024-11-22 16:27:47"}
/// createdAt : 1726283309239
/// endTime : "2024-11-06 18:03:33"
/// id : 151
/// isPredate : 1
/// maxCapacity : 4
/// name : "A1"
/// perhour : null
/// predateAmount : 0.00
/// productNum : 6
/// qrcode : "3000101848"
/// realAmount : 33.70
/// shopId : 11
/// sort : 0
/// status : "using"
/// totalAmount : 33.70
/// type : 0
/// updatedAt : 1728720069117
/// useNum : 1
/// useTime : "2024-11-22 16:28:59"
/// view : null
TableModel tableModelFromJson(String str) =>
TableModel.fromJson(json.decode(str));
String tableModelToJson(TableModel data) => json.encode(data.toJson());
class TableModel {
TableModel({
num? amount,
num? areaId,
num? autoClear,
BookingInfo? bookingInfo,
num? createdAt,
String? endTime,
num? id,
num? isPredate,
num? maxCapacity,
String? name,
dynamic perhour,
num? predateAmount,
num? productNum,
String? qrcode,
num? realAmount,
num? shopId,
num? sort,
String? status,
num? totalAmount,
num? type,
num? updatedAt,
num? useNum,
String? useTime,
dynamic view,
}) {
_amount = amount;
_areaId = areaId;
_autoClear = autoClear;
_bookingInfo = bookingInfo;
_createdAt = createdAt;
_endTime = endTime;
_id = id;
_isPredate = isPredate;
_maxCapacity = maxCapacity;
_name = name;
_perhour = perhour;
_predateAmount = predateAmount;
_productNum = productNum;
_qrcode = qrcode;
_realAmount = realAmount;
_shopId = shopId;
_sort = sort;
_status = status;
_totalAmount = totalAmount;
_type = type;
_updatedAt = updatedAt;
_useNum = useNum;
_useTime = useTime;
_view = view;
}
TableModel.fromJson(dynamic json) {
_amount = json['amount'];
_areaId = json['areaId'];
_autoClear = json['autoClear'];
_bookingInfo = json['bookingInfo'] != null
? BookingInfo.fromJson(json['bookingInfo'])
: null;
_createdAt = json['createdAt'];
_endTime = json['endTime'];
_id = json['id'];
_isPredate = json['isPredate'];
_maxCapacity = json['maxCapacity'];
_name = json['name'];
_perhour = json['perhour'];
_predateAmount = json['predateAmount'];
_productNum = json['productNum'];
_qrcode = json['qrcode'];
_realAmount = json['realAmount'];
_shopId = json['shopId'];
_sort = json['sort'];
_status = json['status'];
_totalAmount = json['totalAmount'];
_type = json['type'];
_updatedAt = json['updatedAt'];
_useNum = json['useNum'];
_useTime = json['useTime'];
_view = json['view'];
}
num? _amount;
num? _areaId;
num? _autoClear;
BookingInfo? _bookingInfo;
num? _createdAt;
String? _endTime;
num? _id;
num? _isPredate;
num? _maxCapacity;
String? _name;
dynamic _perhour;
num? _predateAmount;
num? _productNum;
String? _qrcode;
num? _realAmount;
num? _shopId;
num? _sort;
String? _status;
num? _totalAmount;
num? _type;
num? _updatedAt;
num? _useNum;
String? _useTime;
dynamic _view;
TableModel copyWith({
num? amount,
num? areaId,
num? autoClear,
BookingInfo? bookingInfo,
num? createdAt,
String? endTime,
num? id,
num? isPredate,
num? maxCapacity,
String? name,
dynamic perhour,
num? predateAmount,
num? productNum,
String? qrcode,
num? realAmount,
num? shopId,
num? sort,
String? status,
num? totalAmount,
num? type,
num? updatedAt,
num? useNum,
String? useTime,
dynamic view,
}) =>
TableModel(
amount: amount ?? _amount,
areaId: areaId ?? _areaId,
autoClear: autoClear ?? _autoClear,
bookingInfo: bookingInfo ?? _bookingInfo,
createdAt: createdAt ?? _createdAt,
endTime: endTime ?? _endTime,
id: id ?? _id,
isPredate: isPredate ?? _isPredate,
maxCapacity: maxCapacity ?? _maxCapacity,
name: name ?? _name,
perhour: perhour ?? _perhour,
predateAmount: predateAmount ?? _predateAmount,
productNum: productNum ?? _productNum,
qrcode: qrcode ?? _qrcode,
realAmount: realAmount ?? _realAmount,
shopId: shopId ?? _shopId,
sort: sort ?? _sort,
status: status ?? _status,
totalAmount: totalAmount ?? _totalAmount,
type: type ?? _type,
updatedAt: updatedAt ?? _updatedAt,
useNum: useNum ?? _useNum,
useTime: useTime ?? _useTime,
view: view ?? _view,
);
num? get amount => _amount;
num? get areaId => _areaId;
num? get autoClear => _autoClear;
BookingInfo? get bookingInfo => _bookingInfo;
num? get createdAt => _createdAt;
String? get endTime => _endTime;
num? get id => _id;
num? get isPredate => _isPredate;
num? get maxCapacity => _maxCapacity;
String? get name => _name;
dynamic get perhour => _perhour;
num? get predateAmount => _predateAmount;
num? get productNum => _productNum;
String? get qrcode => _qrcode;
num? get realAmount => _realAmount;
num? get shopId => _shopId;
num? get sort => _sort;
String? get status => _status;
num? get totalAmount => _totalAmount;
num? get type => _type;
num? get updatedAt => _updatedAt;
num? get useNum => _useNum;
String? get useTime => _useTime;
dynamic get view => _view;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['amount'] = _amount;
map['areaId'] = _areaId;
map['autoClear'] = _autoClear;
if (_bookingInfo != null) {
map['bookingInfo'] = _bookingInfo?.toJson();
}
map['createdAt'] = _createdAt;
map['endTime'] = _endTime;
map['id'] = _id;
map['isPredate'] = _isPredate;
map['maxCapacity'] = _maxCapacity;
map['name'] = _name;
map['perhour'] = _perhour;
map['predateAmount'] = _predateAmount;
map['productNum'] = _productNum;
map['qrcode'] = _qrcode;
map['realAmount'] = _realAmount;
map['shopId'] = _shopId;
map['sort'] = _sort;
map['status'] = _status;
map['totalAmount'] = _totalAmount;
map['type'] = _type;
map['updatedAt'] = _updatedAt;
map['useNum'] = _useNum;
map['useTime'] = _useTime;
map['view'] = _view;
return map;
}
}
/// arrivedTime : null
/// bookingDate : "2024-11-22"
/// bookingPerson : "王"
/// bookingTableNum : 0
/// bookingTime : "2024-11-22 18:30:00"
/// bookingType : "dinner"
/// createTime : "2024-11-22 16:16:17"
/// createUserName : "双屿pirse(测77)"
/// delFlag : 0
/// dinerNum : 6
/// diningStandardPrice : 0.00
/// diningStandardUnit : "table"
/// diningType : "普通用餐"
/// focus : 1
/// gender : 1
/// id : 1
/// orderNo : "BK241122161617-cwba"
/// phoneNumber : "13011223344"
/// receiveMarketingSms : 1
/// remark : "今个高兴,和哥几个一醉方休"
/// shopId : 11
/// shopTableId : 151
/// status : 20
/// timeoutMinute : 60
/// updateTime : "2024-11-22 16:27:47"
BookingInfo bookingInfoFromJson(String str) =>
BookingInfo.fromJson(json.decode(str));
String bookingInfoToJson(BookingInfo data) => json.encode(data.toJson());
class BookingInfo {
BookingInfo({
dynamic arrivedTime,
String? bookingDate,
String? bookingPerson,
num? bookingTableNum,
String? bookingTime,
String? bookingType,
String? createTime,
String? createUserName,
num? delFlag,
num? dinerNum,
num? diningStandardPrice,
String? diningStandardUnit,
String? diningType,
num? focus,
num? gender,
num? id,
String? orderNo,
String? phoneNumber,
num? receiveMarketingSms,
String? remark,
num? shopId,
num? shopTableId,
num? status,
num? timeoutMinute,
String? updateTime,
}) {
_arrivedTime = arrivedTime;
_bookingDate = bookingDate;
_bookingPerson = bookingPerson;
_bookingTableNum = bookingTableNum;
_bookingTime = bookingTime;
_bookingType = bookingType;
_createTime = createTime;
_createUserName = createUserName;
_delFlag = delFlag;
_dinerNum = dinerNum;
_diningStandardPrice = diningStandardPrice;
_diningStandardUnit = diningStandardUnit;
_diningType = diningType;
_focus = focus;
_gender = gender;
_id = id;
_orderNo = orderNo;
_phoneNumber = phoneNumber;
_receiveMarketingSms = receiveMarketingSms;
_remark = remark;
_shopId = shopId;
_shopTableId = shopTableId;
_status = status;
_timeoutMinute = timeoutMinute;
_updateTime = updateTime;
}
BookingInfo.fromJson(dynamic json) {
_arrivedTime = json['arrivedTime'];
_bookingDate = json['bookingDate'];
_bookingPerson = json['bookingPerson'];
_bookingTableNum = json['bookingTableNum'];
_bookingTime = json['bookingTime'];
_bookingType = json['bookingType'];
_createTime = json['createTime'];
_createUserName = json['createUserName'];
_delFlag = json['delFlag'];
_dinerNum = json['dinerNum'];
_diningStandardPrice = json['diningStandardPrice'];
_diningStandardUnit = json['diningStandardUnit'];
_diningType = json['diningType'];
_focus = json['focus'];
_gender = json['gender'];
_id = json['id'];
_orderNo = json['orderNo'];
_phoneNumber = json['phoneNumber'];
_receiveMarketingSms = json['receiveMarketingSms'];
_remark = json['remark'];
_shopId = json['shopId'];
_shopTableId = json['shopTableId'];
_status = json['status'];
_timeoutMinute = json['timeoutMinute'];
_updateTime = json['updateTime'];
}
dynamic _arrivedTime;
String? _bookingDate;
String? _bookingPerson;
num? _bookingTableNum;
String? _bookingTime;
String? _bookingType;
String? _createTime;
String? _createUserName;
num? _delFlag;
num? _dinerNum;
num? _diningStandardPrice;
String? _diningStandardUnit;
String? _diningType;
num? _focus;
num? _gender;
num? _id;
String? _orderNo;
String? _phoneNumber;
num? _receiveMarketingSms;
String? _remark;
num? _shopId;
num? _shopTableId;
num? _status;
num? _timeoutMinute;
String? _updateTime;
BookingInfo copyWith({
dynamic arrivedTime,
String? bookingDate,
String? bookingPerson,
num? bookingTableNum,
String? bookingTime,
String? bookingType,
String? createTime,
String? createUserName,
num? delFlag,
num? dinerNum,
num? diningStandardPrice,
String? diningStandardUnit,
String? diningType,
num? focus,
num? gender,
num? id,
String? orderNo,
String? phoneNumber,
num? receiveMarketingSms,
String? remark,
num? shopId,
num? shopTableId,
num? status,
num? timeoutMinute,
String? updateTime,
}) =>
BookingInfo(
arrivedTime: arrivedTime ?? _arrivedTime,
bookingDate: bookingDate ?? _bookingDate,
bookingPerson: bookingPerson ?? _bookingPerson,
bookingTableNum: bookingTableNum ?? _bookingTableNum,
bookingTime: bookingTime ?? _bookingTime,
bookingType: bookingType ?? _bookingType,
createTime: createTime ?? _createTime,
createUserName: createUserName ?? _createUserName,
delFlag: delFlag ?? _delFlag,
dinerNum: dinerNum ?? _dinerNum,
diningStandardPrice: diningStandardPrice ?? _diningStandardPrice,
diningStandardUnit: diningStandardUnit ?? _diningStandardUnit,
diningType: diningType ?? _diningType,
focus: focus ?? _focus,
gender: gender ?? _gender,
id: id ?? _id,
orderNo: orderNo ?? _orderNo,
phoneNumber: phoneNumber ?? _phoneNumber,
receiveMarketingSms: receiveMarketingSms ?? _receiveMarketingSms,
remark: remark ?? _remark,
shopId: shopId ?? _shopId,
shopTableId: shopTableId ?? _shopTableId,
status: status ?? _status,
timeoutMinute: timeoutMinute ?? _timeoutMinute,
updateTime: updateTime ?? _updateTime,
);
dynamic get arrivedTime => _arrivedTime;
String? get bookingDate => _bookingDate;
String? get bookingPerson => _bookingPerson;
num? get bookingTableNum => _bookingTableNum;
String? get bookingTime => _bookingTime;
String? get bookingType => _bookingType;
String? get createTime => _createTime;
String? get createUserName => _createUserName;
num? get delFlag => _delFlag;
num? get dinerNum => _dinerNum;
num? get diningStandardPrice => _diningStandardPrice;
String? get diningStandardUnit => _diningStandardUnit;
String? get diningType => _diningType;
num? get focus => _focus;
num? get gender => _gender;
num? get id => _id;
String? get orderNo => _orderNo;
String? get phoneNumber => _phoneNumber;
num? get receiveMarketingSms => _receiveMarketingSms;
String? get remark => _remark;
num? get shopId => _shopId;
num? get shopTableId => _shopTableId;
num? get status => _status;
num? get timeoutMinute => _timeoutMinute;
String? get updateTime => _updateTime;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['arrivedTime'] = _arrivedTime;
map['bookingDate'] = _bookingDate;
map['bookingPerson'] = _bookingPerson;
map['bookingTableNum'] = _bookingTableNum;
map['bookingTime'] = _bookingTime;
map['bookingType'] = _bookingType;
map['createTime'] = _createTime;
map['createUserName'] = _createUserName;
map['delFlag'] = _delFlag;
map['dinerNum'] = _dinerNum;
map['diningStandardPrice'] = _diningStandardPrice;
map['diningStandardUnit'] = _diningStandardUnit;
map['diningType'] = _diningType;
map['focus'] = _focus;
map['gender'] = _gender;
map['id'] = _id;
map['orderNo'] = _orderNo;
map['phoneNumber'] = _phoneNumber;
map['receiveMarketingSms'] = _receiveMarketingSms;
map['remark'] = _remark;
map['shopId'] = _shopId;
map['shopTableId'] = _shopTableId;
map['status'] = _status;
map['timeoutMinute'] = _timeoutMinute;
map['updateTime'] = _updateTime;
return map;
}
}