feat:机器上可以查询全部订单
This commit is contained in:
1 parent
88ff8988fb
commit
a6fc25ddce
13 files changed
+956
-388
No files matched your search
@@ -660,6 +660,7 @@ class VerificationRecordQueryRequest {
|
||||
required this.startDate,
|
||||
required this.endDate,
|
||||
this.verificationType,
|
||||
this.scope,
|
||||
});
|
||||
|
||||
final int hardId;
|
||||
@@ -667,12 +668,118 @@ class VerificationRecordQueryRequest {
|
||||
final String endDate;
|
||||
final String? verificationType;
|
||||
|
||||
/// 数据范围:留空仅本机,MERCHANT 按终端所属商户查询全部设备。
|
||||
final String? scope;
|
||||
|
||||
factory VerificationRecordQueryRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$VerificationRecordQueryRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$VerificationRecordQueryRequestToJson(this);
|
||||
}
|
||||
|
||||
/// 终端交易记录的服务端查询参数,数据范围由服务端按设备归属解析。
|
||||
@JsonSerializable(includeIfNull: false)
|
||||
class TerminalOrderRecordQueryRequest {
|
||||
const TerminalOrderRecordQueryRequest({
|
||||
required this.hardId,
|
||||
required this.startDate,
|
||||
required this.endDate,
|
||||
this.scope,
|
||||
this.orderStatusCodes,
|
||||
this.hourType,
|
||||
});
|
||||
|
||||
final int hardId;
|
||||
final String startDate;
|
||||
final String endDate;
|
||||
|
||||
/// 数据范围:留空仅本机,MERCHANT 按终端所属商户查询全部设备。
|
||||
final String? scope;
|
||||
|
||||
/// 订单状态编码集合,留空查询全部状态。
|
||||
final List<String>? orderStatusCodes;
|
||||
|
||||
/// 用餐时段编码,留空或 -1 不区分。
|
||||
final String? hourType;
|
||||
|
||||
factory TerminalOrderRecordQueryRequest.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$TerminalOrderRecordQueryRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$TerminalOrderRecordQueryRequestToJson(this);
|
||||
}
|
||||
|
||||
/// 交易记录远端行只承载列表展示字段,金额与时间口径和本地订单一致。
|
||||
@JsonSerializable()
|
||||
class ServiceTerminalOrderRecord {
|
||||
const ServiceTerminalOrderRecord({
|
||||
required this.orderId,
|
||||
required this.orderNo,
|
||||
required this.orderType,
|
||||
required this.orderTypeName,
|
||||
required this.orderStatus,
|
||||
required this.orderStatusName,
|
||||
required this.payType,
|
||||
required this.payTypeName,
|
||||
required this.username,
|
||||
required this.productDesc,
|
||||
required this.totalPrice,
|
||||
required this.extraPrice,
|
||||
required this.payPrice,
|
||||
this.userDeptName,
|
||||
this.hourType,
|
||||
this.hardName,
|
||||
this.createTime,
|
||||
});
|
||||
|
||||
/// 后端 Long 为避免跨端精度丢失可能序列化为字符串,终端同时兼容数字返回。
|
||||
@JsonKey(fromJson: JsonTool.anyToInt)
|
||||
final int orderId;
|
||||
final String orderNo;
|
||||
final String orderType;
|
||||
final String orderTypeName;
|
||||
final String orderStatus;
|
||||
final String orderStatusName;
|
||||
final String payType;
|
||||
final String payTypeName;
|
||||
final String username;
|
||||
final String? userDeptName;
|
||||
final String productDesc;
|
||||
final String? hourType;
|
||||
|
||||
/// 完成交易的设备名称;全部数据范围下用于区分不同机器。
|
||||
final String? hardName;
|
||||
|
||||
/// 金额仍按整数分使用,同时兼容部分环境将数值序列化为字符串。
|
||||
@JsonKey(fromJson: JsonTool.anyToInt)
|
||||
final int totalPrice;
|
||||
@JsonKey(fromJson: JsonTool.anyToInt)
|
||||
final int extraPrice;
|
||||
@JsonKey(fromJson: JsonTool.anyToInt)
|
||||
final int payPrice;
|
||||
final DateTime? createTime;
|
||||
|
||||
factory ServiceTerminalOrderRecord.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceTerminalOrderRecordFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceTerminalOrderRecordToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceTerminalOrderRecordPage extends ServicePageBase {
|
||||
ServiceTerminalOrderRecordPage({this.records});
|
||||
|
||||
final List<ServiceTerminalOrderRecord>? records;
|
||||
|
||||
factory ServiceTerminalOrderRecordPage.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ServiceTerminalOrderRecordPageFromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$ServiceTerminalOrderRecordPageToJson(this);
|
||||
}
|
||||
|
||||
/// 核销记录只承载列表展示字段,不复用本地订单实体,避免混淆远端与本地状态。
|
||||
@JsonSerializable()
|
||||
class ServiceVerificationRecord {
|
||||
|
||||
@@ -368,6 +368,7 @@ VerificationRecordQueryRequest _$VerificationRecordQueryRequestFromJson(
|
||||
startDate: json['startDate'] as String,
|
||||
endDate: json['endDate'] as String,
|
||||
verificationType: json['verificationType'] as String?,
|
||||
scope: json['scope'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$VerificationRecordQueryRequestToJson(
|
||||
@@ -385,9 +386,112 @@ Map<String, dynamic> _$VerificationRecordQueryRequestToJson(
|
||||
}
|
||||
|
||||
writeNotNull('verificationType', instance.verificationType);
|
||||
writeNotNull('scope', instance.scope);
|
||||
return val;
|
||||
}
|
||||
|
||||
TerminalOrderRecordQueryRequest _$TerminalOrderRecordQueryRequestFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
TerminalOrderRecordQueryRequest(
|
||||
hardId: (json['hardId'] as num).toInt(),
|
||||
startDate: json['startDate'] as String,
|
||||
endDate: json['endDate'] as String,
|
||||
scope: json['scope'] as String?,
|
||||
orderStatusCodes: (json['orderStatusCodes'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
hourType: json['hourType'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TerminalOrderRecordQueryRequestToJson(
|
||||
TerminalOrderRecordQueryRequest instance) {
|
||||
final val = <String, dynamic>{
|
||||
'hardId': instance.hardId,
|
||||
'startDate': instance.startDate,
|
||||
'endDate': instance.endDate,
|
||||
};
|
||||
|
||||
void writeNotNull(String key, dynamic value) {
|
||||
if (value != null) {
|
||||
val[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
writeNotNull('scope', instance.scope);
|
||||
writeNotNull('orderStatusCodes', instance.orderStatusCodes);
|
||||
writeNotNull('hourType', instance.hourType);
|
||||
return val;
|
||||
}
|
||||
|
||||
ServiceTerminalOrderRecord _$ServiceTerminalOrderRecordFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceTerminalOrderRecord(
|
||||
orderId: JsonTool.anyToInt(json['orderId']),
|
||||
orderNo: json['orderNo'] as String,
|
||||
orderType: json['orderType'] as String,
|
||||
orderTypeName: json['orderTypeName'] as String,
|
||||
orderStatus: json['orderStatus'] as String,
|
||||
orderStatusName: json['orderStatusName'] as String,
|
||||
payType: json['payType'] as String,
|
||||
payTypeName: json['payTypeName'] as String,
|
||||
username: json['username'] as String,
|
||||
productDesc: json['productDesc'] as String,
|
||||
totalPrice: JsonTool.anyToInt(json['totalPrice']),
|
||||
extraPrice: JsonTool.anyToInt(json['extraPrice']),
|
||||
payPrice: JsonTool.anyToInt(json['payPrice']),
|
||||
userDeptName: json['userDeptName'] as String?,
|
||||
hourType: json['hourType'] as String?,
|
||||
hardName: json['hardName'] as String?,
|
||||
createTime: json['createTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['createTime'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceTerminalOrderRecordToJson(
|
||||
ServiceTerminalOrderRecord instance) =>
|
||||
<String, dynamic>{
|
||||
'orderId': instance.orderId,
|
||||
'orderNo': instance.orderNo,
|
||||
'orderType': instance.orderType,
|
||||
'orderTypeName': instance.orderTypeName,
|
||||
'orderStatus': instance.orderStatus,
|
||||
'orderStatusName': instance.orderStatusName,
|
||||
'payType': instance.payType,
|
||||
'payTypeName': instance.payTypeName,
|
||||
'username': instance.username,
|
||||
'userDeptName': instance.userDeptName,
|
||||
'productDesc': instance.productDesc,
|
||||
'hourType': instance.hourType,
|
||||
'hardName': instance.hardName,
|
||||
'totalPrice': instance.totalPrice,
|
||||
'extraPrice': instance.extraPrice,
|
||||
'payPrice': instance.payPrice,
|
||||
'createTime': instance.createTime?.toIso8601String(),
|
||||
};
|
||||
|
||||
ServiceTerminalOrderRecordPage _$ServiceTerminalOrderRecordPageFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceTerminalOrderRecordPage(
|
||||
records: (json['records'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
ServiceTerminalOrderRecord.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
)
|
||||
..current = (json['current'] as num).toInt()
|
||||
..pages = (json['pages'] as num).toInt()
|
||||
..size = (json['size'] as num).toInt()
|
||||
..total = (json['total'] as num).toInt();
|
||||
|
||||
Map<String, dynamic> _$ServiceTerminalOrderRecordPageToJson(
|
||||
ServiceTerminalOrderRecordPage instance) =>
|
||||
<String, dynamic>{
|
||||
'current': instance.current,
|
||||
'pages': instance.pages,
|
||||
'size': instance.size,
|
||||
'total': instance.total,
|
||||
'records': instance.records,
|
||||
};
|
||||
|
||||
ServiceVerificationRecord _$ServiceVerificationRecordFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceVerificationRecord(
|
||||
|
||||
Reference in new issue
Block a user