feat:消费机更新
feat:人员调用钱包部门不调动的bug
This commit is contained in:
1 parent
842402e364
commit
60d9380a65
144 files changed
+27832
-1666
No files matched your search
@@ -4,6 +4,340 @@ import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
|
||||
part 'hard_api_models.g.dart';
|
||||
|
||||
/// 终端提交订单识别证据元数据和现场图片时共用的强类型请求。
|
||||
@JsonSerializable(includeIfNull: false)
|
||||
class OrderEvidenceRequest {
|
||||
/// 创建一条与服务端证据位置协议一致的请求。
|
||||
const OrderEvidenceRequest({
|
||||
this.androidOrderCode,
|
||||
this.orderId,
|
||||
required this.evidenceType,
|
||||
required this.evidenceRole,
|
||||
required this.sequenceNo,
|
||||
required this.userId,
|
||||
this.faceSampleId,
|
||||
this.referenceImageUrl,
|
||||
this.referenceImageVersion,
|
||||
this.similarity,
|
||||
this.similarityThreshold,
|
||||
required this.capturedAt,
|
||||
this.imageHash,
|
||||
this.imageSize,
|
||||
this.imageWidth,
|
||||
this.imageHeight,
|
||||
this.status,
|
||||
this.failureReason,
|
||||
required this.appVersion,
|
||||
});
|
||||
|
||||
/// 终端稳定订单号,用于服务端按设备对账现场创建的订单;预约核销证据允许为空。
|
||||
final String? androidOrderCode;
|
||||
|
||||
/// 已由当前设备核销的服务端预约订单 ID;现场创建的订单证据允许为空。
|
||||
final String? orderId;
|
||||
|
||||
/// 证据业务类型,使用 `OrderEvidenceType.code`。
|
||||
final String evidenceType;
|
||||
|
||||
/// 图片角色,使用 `OrderEvidenceRole.code`。
|
||||
final String evidenceRole;
|
||||
|
||||
/// 同一订单、类型和角色下从 0 开始的序号。
|
||||
final int sequenceNo;
|
||||
|
||||
/// 识别用户主键,服务端会再次校验与订单用户一致。
|
||||
final String userId;
|
||||
|
||||
/// 虹软样本编号;人脸证据必填,其他类型允许为空。
|
||||
final String? faceSampleId;
|
||||
|
||||
/// 识别时记录的后台参考人脸地址,仅参考图角色提交。
|
||||
final String? referenceImageUrl;
|
||||
|
||||
/// 识别时本地人脸快照对应的后台更新时间,用于识别相同地址上的内容替换。
|
||||
final DateTime? referenceImageVersion;
|
||||
|
||||
/// 人脸比对相似度快照,范围 0 到 1。
|
||||
final double? similarity;
|
||||
|
||||
/// 人脸比对成功阈值快照,范围 0 到 1。
|
||||
final double? similarityThreshold;
|
||||
|
||||
/// 真正比对成功帧的终端采集时间。
|
||||
final DateTime capturedAt;
|
||||
|
||||
/// 图片 SHA-256;现场图片必填,参考图内容未知时允许为空。
|
||||
final String? imageHash;
|
||||
|
||||
/// 图片大小,单位字节。
|
||||
final int? imageSize;
|
||||
|
||||
/// 图片宽度,单位像素。
|
||||
final int? imageWidth;
|
||||
|
||||
/// 图片高度,单位像素。
|
||||
final int? imageHeight;
|
||||
|
||||
/// 元数据提交目标状态,仅允许服务端协议的 PENDING 或 UNAVAILABLE。
|
||||
final String? status;
|
||||
|
||||
/// 永久缺失的单行摘要,不得包含终端完整文件路径。
|
||||
final String? failureReason;
|
||||
|
||||
/// 产生证据的终端应用版本快照。
|
||||
final String appVersion;
|
||||
|
||||
/// 从 JSON 响应或测试夹具恢复请求对象。
|
||||
factory OrderEvidenceRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$OrderEvidenceRequestFromJson(json);
|
||||
|
||||
/// 转换为统一 Dio 可提交的 JSON 或 multipart 字段 Map。
|
||||
Map<String, dynamic> toJson() => _$OrderEvidenceRequestToJson(this);
|
||||
}
|
||||
|
||||
/// 服务端单条订单识别证据状态,用于终端对账和幂等恢复。
|
||||
@JsonSerializable()
|
||||
class ServiceOrderEvidenceImage {
|
||||
/// 创建一条服务端证据状态快照。
|
||||
const ServiceOrderEvidenceImage({
|
||||
required this.id,
|
||||
required this.evidenceType,
|
||||
this.evidenceTypeName,
|
||||
required this.evidenceRole,
|
||||
this.evidenceRoleName,
|
||||
required this.sequenceNo,
|
||||
required this.status,
|
||||
this.statusName,
|
||||
this.similarity,
|
||||
this.similarityThreshold,
|
||||
this.hardId,
|
||||
this.capturedAt,
|
||||
this.imageHash,
|
||||
this.imageUrl,
|
||||
this.failureReason,
|
||||
});
|
||||
|
||||
/// 服务端证据记录主键。
|
||||
@JsonKey(fromJson: JsonTool.anyToRequiredString)
|
||||
final String id;
|
||||
|
||||
/// 服务端稳定证据类型编码。
|
||||
final String evidenceType;
|
||||
|
||||
/// 服务端按稳定编码转换的证据类型中文名称。
|
||||
final String? evidenceTypeName;
|
||||
|
||||
/// 服务端稳定图片角色编码。
|
||||
final String evidenceRole;
|
||||
|
||||
/// 服务端按稳定编码转换的图片角色中文名称。
|
||||
final String? evidenceRoleName;
|
||||
|
||||
/// 同一角色下的图片序号。
|
||||
final int sequenceNo;
|
||||
|
||||
/// 服务端证据状态,取 PENDING、AVAILABLE 或 UNAVAILABLE。
|
||||
final String status;
|
||||
|
||||
/// 服务端按稳定编码转换的证据状态中文名称。
|
||||
final String? statusName;
|
||||
|
||||
/// 人脸识别相似度快照,范围为 0 到 1,非人脸凭证允许为空。
|
||||
@JsonKey(fromJson: JsonTool.anyToNullableDouble)
|
||||
final double? similarity;
|
||||
|
||||
/// 人脸识别采用的阈值快照,范围为 0 到 1。
|
||||
@JsonKey(fromJson: JsonTool.anyToNullableDouble)
|
||||
final double? similarityThreshold;
|
||||
|
||||
/// 采集该凭证的服务端设备 ID。
|
||||
@JsonKey(fromJson: JsonTool.anyToString)
|
||||
final String? hardId;
|
||||
|
||||
/// 终端真正完成识别的本地采集时间。
|
||||
final DateTime? capturedAt;
|
||||
|
||||
/// 服务端已登记的图片 SHA-256。
|
||||
final String? imageHash;
|
||||
|
||||
/// PC 可访问的服务端证据图片地址。
|
||||
final String? imageUrl;
|
||||
|
||||
/// 永久缺失或复制失败摘要。
|
||||
final String? failureReason;
|
||||
|
||||
/// 从服务端 JSON 解析证据状态。
|
||||
factory ServiceOrderEvidenceImage.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceOrderEvidenceImageFromJson(json);
|
||||
|
||||
/// 转换为测试或诊断使用的 JSON。
|
||||
Map<String, dynamic> toJson() => _$ServiceOrderEvidenceImageToJson(this);
|
||||
}
|
||||
|
||||
/// 服务端打印任务的只读快照,用于核销完整详情展示和兑换券重打定位。
|
||||
@JsonSerializable()
|
||||
class ServicePrintRecord {
|
||||
/// 创建一条不写入终端本地数据库的服务端打印任务快照。
|
||||
const ServicePrintRecord({
|
||||
required this.id,
|
||||
required this.orderId,
|
||||
this.hardId,
|
||||
this.hardName,
|
||||
this.printerHardId,
|
||||
this.printerHardName,
|
||||
required this.printType,
|
||||
required this.printNo,
|
||||
required this.retryVersion,
|
||||
required this.attemptCount,
|
||||
required this.status,
|
||||
this.failureStage,
|
||||
this.lastError,
|
||||
this.printedAt,
|
||||
this.reprintReason,
|
||||
this.pic,
|
||||
this.createTime,
|
||||
});
|
||||
|
||||
/// 服务端 hard_invoice 打印任务主键。
|
||||
@JsonKey(fromJson: JsonTool.anyToRequiredString)
|
||||
final String id;
|
||||
|
||||
/// 打印凭证所属的服务端订单主键。
|
||||
@JsonKey(fromJson: JsonTool.anyToRequiredString)
|
||||
final String orderId;
|
||||
|
||||
/// 产生该任务的食堂或超市业务终端 ID。
|
||||
@JsonKey(fromJson: JsonTool.anyToString)
|
||||
final String? hardId;
|
||||
|
||||
/// 产生该任务的食堂或超市业务终端名称。
|
||||
final String? hardName;
|
||||
|
||||
/// 服务端绑定的逻辑打印机资产 ID。
|
||||
@JsonKey(fromJson: JsonTool.anyToString)
|
||||
final String? printerHardId;
|
||||
|
||||
/// 服务端绑定的逻辑打印机资产名称。
|
||||
final String? printerHardName;
|
||||
|
||||
/// 凭证类型编码,1 为发票,2 为核销兑换券。
|
||||
@JsonKey(defaultValue: '1')
|
||||
final String printType;
|
||||
|
||||
/// 同一订单和凭证类型下从 1 开始的打印序号。
|
||||
@JsonKey(defaultValue: 1)
|
||||
final int printNo;
|
||||
|
||||
/// 失败任务的人工重试版本,用于终端过滤过期 MQTT 消息。
|
||||
@JsonKey(defaultValue: 0)
|
||||
final int retryVersion;
|
||||
|
||||
/// 终端已经执行的 USB 打印尝试次数。
|
||||
@JsonKey(defaultValue: 0)
|
||||
final int attemptCount;
|
||||
|
||||
/// 服务端打印任务状态编码,取 0 到 4。
|
||||
@JsonKey(defaultValue: '')
|
||||
final String status;
|
||||
|
||||
/// 最近一次失败阶段的稳定编码,成功和未处理任务允许为空。
|
||||
final String? failureStage;
|
||||
|
||||
/// 最近一次可展示的失败摘要,不包含认证或支付凭证。
|
||||
final String? lastError;
|
||||
|
||||
/// 终端确认完整写入 USB 打印机的服务端记录时间。
|
||||
final DateTime? printedAt;
|
||||
|
||||
/// 人工重新打印时填写的原因,首次打印允许为空。
|
||||
final String? reprintReason;
|
||||
|
||||
/// 后端生成的打印凭证图片地址,生成前或生成失败时允许为空。
|
||||
final String? pic;
|
||||
|
||||
/// 服务端打印任务创建时间。
|
||||
final DateTime? createTime;
|
||||
|
||||
/// 从终端专用在线接口解析打印任务。
|
||||
factory ServicePrintRecord.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServicePrintRecordFromJson(json);
|
||||
|
||||
/// 转换为测试和诊断使用的 JSON。
|
||||
Map<String, dynamic> toJson() => _$ServicePrintRecordToJson(this);
|
||||
}
|
||||
|
||||
/// 按终端订单号对账返回的服务端订单和全部证据位置。
|
||||
@JsonSerializable()
|
||||
class ServiceOrderEvidenceResolve {
|
||||
/// 创建一份服务端订单对账结果。
|
||||
const ServiceOrderEvidenceResolve({
|
||||
required this.orderId,
|
||||
required this.orderStatus,
|
||||
this.evidenceImages = const [],
|
||||
});
|
||||
|
||||
/// 服务端订单主键。
|
||||
@JsonKey(fromJson: JsonTool.anyToRequiredString)
|
||||
final String orderId;
|
||||
|
||||
/// 服务端订单状态编码,只有已支付、已核销或退款订单允许继续补传。
|
||||
final String orderStatus;
|
||||
|
||||
/// 服务端当前已登记的证据位置及状态。
|
||||
final List<ServiceOrderEvidenceImage> evidenceImages;
|
||||
|
||||
/// 从统一响应中的 data 对象解析订单对账结果。
|
||||
factory ServiceOrderEvidenceResolve.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceOrderEvidenceResolveFromJson(json);
|
||||
|
||||
/// 转换为测试或诊断使用的 JSON。
|
||||
Map<String, dynamic> toJson() => _$ServiceOrderEvidenceResolveToJson(this);
|
||||
}
|
||||
|
||||
/// 服务端提交元数据或上传现场图片后的幂等结果。
|
||||
@JsonSerializable()
|
||||
class ServiceOrderEvidenceUploadResult {
|
||||
/// 创建一份服务端证据写入结果。
|
||||
const ServiceOrderEvidenceUploadResult({
|
||||
required this.evidenceId,
|
||||
required this.orderId,
|
||||
required this.status,
|
||||
required this.uploaded,
|
||||
required this.message,
|
||||
this.imageUrl,
|
||||
});
|
||||
|
||||
/// 服务端证据记录主键。
|
||||
@JsonKey(fromJson: JsonTool.anyToRequiredString)
|
||||
final String evidenceId;
|
||||
|
||||
/// 服务端订单主键。
|
||||
@JsonKey(fromJson: JsonTool.anyToRequiredString)
|
||||
final String orderId;
|
||||
|
||||
/// 服务端证据状态。
|
||||
final String status;
|
||||
|
||||
/// 本次请求是否实际新写入文件;幂等重复成功时为 false。
|
||||
final bool uploaded;
|
||||
|
||||
/// 面向任务日志的简短服务端处理结果。
|
||||
final String message;
|
||||
|
||||
/// AVAILABLE 时的服务端证据图片地址。
|
||||
final String? imageUrl;
|
||||
|
||||
/// 从统一响应中的 data 对象解析上传结果。
|
||||
factory ServiceOrderEvidenceUploadResult.fromJson(
|
||||
Map<String, dynamic> json,
|
||||
) =>
|
||||
_$ServiceOrderEvidenceUploadResultFromJson(json);
|
||||
|
||||
/// 转换为测试或诊断使用的 JSON。
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$ServiceOrderEvidenceUploadResultToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceHardware extends ServiceBase {
|
||||
/// 编号
|
||||
@@ -95,9 +429,11 @@ class ServiceHardware extends ServiceBase {
|
||||
@JsonSerializable()
|
||||
class ServiceCar {
|
||||
/// 编号
|
||||
@JsonKey(fromJson: JsonTool.anyToString)
|
||||
final String? id;
|
||||
|
||||
/// 父购物车id
|
||||
@JsonKey(fromJson: JsonTool.anyToString)
|
||||
final String? parentCarId;
|
||||
|
||||
/// 商品名
|
||||
@@ -107,13 +443,24 @@ class ServiceCar {
|
||||
final int? productPrice;
|
||||
|
||||
/// 商品id
|
||||
@JsonKey(fromJson: JsonTool.anyToString)
|
||||
final String? productId;
|
||||
|
||||
/// 数量
|
||||
final int? productCount;
|
||||
|
||||
/// 总价(分)
|
||||
@JsonKey(fromJson: JsonTool.stringToInt, toJson: JsonTool.intToString)
|
||||
/// 商品性质,1 为按件商品,2 为称重商品。
|
||||
final String? productNature;
|
||||
|
||||
/// 称重商品重量,单位沿用服务端购物车快照。
|
||||
@JsonKey(fromJson: JsonTool.anyToNullableDouble)
|
||||
final double? productWeight;
|
||||
|
||||
/// 总价(分),兼容服务端 Long 返回数字或字符串。
|
||||
@JsonKey(
|
||||
fromJson: JsonTool.anyToNullableInt,
|
||||
toJson: JsonTool.intToString,
|
||||
)
|
||||
final int? totalPrice;
|
||||
|
||||
/// 商品图片
|
||||
@@ -126,6 +473,8 @@ class ServiceCar {
|
||||
this.productPrice,
|
||||
this.productId,
|
||||
this.productCount,
|
||||
this.productNature,
|
||||
this.productWeight,
|
||||
this.totalPrice,
|
||||
this.productPic,
|
||||
});
|
||||
@@ -212,7 +561,15 @@ class ServiceQRCode {
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceHardOrder {
|
||||
/// 服务端订单主键。
|
||||
@JsonKey(fromJson: JsonTool.anyToString)
|
||||
final String? id;
|
||||
|
||||
/// 业务订单号。
|
||||
final String? orderNo;
|
||||
|
||||
/// 用户id
|
||||
@JsonKey(fromJson: JsonTool.anyToString)
|
||||
final String? userId;
|
||||
|
||||
/// 用户名
|
||||
@@ -233,10 +590,43 @@ class ServiceHardOrder {
|
||||
/// 支付方式
|
||||
final String? payType;
|
||||
|
||||
/// 支付方式
|
||||
/// 钱包id
|
||||
@JsonKey(fromJson: JsonTool.anyToString)
|
||||
final String? walletId;
|
||||
|
||||
/// 用餐时段。
|
||||
final String? hourType;
|
||||
|
||||
/// 预约用餐时段,旧预约订单可能只返回该字段。
|
||||
final String? apptHourType;
|
||||
|
||||
/// 商品摘要。
|
||||
final String? productDesc;
|
||||
|
||||
/// 用户所属部门。
|
||||
final String? userDeptName;
|
||||
|
||||
/// 商品总价(分)。
|
||||
@JsonKey(fromJson: JsonTool.anyToNullableInt)
|
||||
final int? totalPrice;
|
||||
|
||||
/// 额外支付(分)。
|
||||
@JsonKey(fromJson: JsonTool.anyToNullableInt)
|
||||
final int? extraPrice;
|
||||
|
||||
/// 实际支付(分)。
|
||||
@JsonKey(fromJson: JsonTool.anyToNullableInt)
|
||||
final int? payPrice;
|
||||
|
||||
/// 终端订单号。
|
||||
final String? androidOrderCode;
|
||||
|
||||
/// 下单时间。
|
||||
final DateTime? createTime;
|
||||
|
||||
ServiceHardOrder({
|
||||
this.id,
|
||||
this.orderNo,
|
||||
this.userId,
|
||||
this.username,
|
||||
this.userMobile,
|
||||
@@ -245,6 +635,15 @@ class ServiceHardOrder {
|
||||
this.orderStatus,
|
||||
this.payType,
|
||||
this.walletId,
|
||||
this.hourType,
|
||||
this.apptHourType,
|
||||
this.productDesc,
|
||||
this.userDeptName,
|
||||
this.totalPrice,
|
||||
this.extraPrice,
|
||||
this.payPrice,
|
||||
this.androidOrderCode,
|
||||
this.createTime,
|
||||
});
|
||||
|
||||
factory ServiceHardOrder.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -253,6 +652,185 @@ class ServiceHardOrder {
|
||||
Map<String, dynamic> toJson() => _$ServiceHardOrderToJson(this);
|
||||
}
|
||||
|
||||
/// 当前终端预约核销记录的服务端查询参数。
|
||||
@JsonSerializable(includeIfNull: false)
|
||||
class VerificationRecordQueryRequest {
|
||||
const VerificationRecordQueryRequest({
|
||||
required this.hardId,
|
||||
required this.startDate,
|
||||
required this.endDate,
|
||||
this.verificationType,
|
||||
this.scope,
|
||||
});
|
||||
|
||||
final int hardId;
|
||||
final String startDate;
|
||||
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 {
|
||||
const ServiceVerificationRecord({
|
||||
required this.orderId,
|
||||
required this.orderNo,
|
||||
required this.verificationType,
|
||||
required this.verificationTypeName,
|
||||
required this.username,
|
||||
required this.productDesc,
|
||||
required this.payTypeName,
|
||||
required this.totalPrice,
|
||||
required this.verificationTime,
|
||||
this.userDeptName,
|
||||
});
|
||||
|
||||
/// 后端 Long 为避免跨端精度丢失可能序列化为字符串,终端同时兼容数字返回。
|
||||
@JsonKey(fromJson: JsonTool.anyToInt)
|
||||
final int orderId;
|
||||
final String orderNo;
|
||||
final String verificationType;
|
||||
final String verificationTypeName;
|
||||
final String username;
|
||||
final String? userDeptName;
|
||||
final String productDesc;
|
||||
final String payTypeName;
|
||||
|
||||
/// 金额仍按整数分使用,同时兼容部分环境将数值序列化为字符串。
|
||||
@JsonKey(fromJson: JsonTool.anyToInt)
|
||||
final int totalPrice;
|
||||
final DateTime verificationTime;
|
||||
|
||||
factory ServiceVerificationRecord.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceVerificationRecordFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceVerificationRecordToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceVerificationRecordPage extends ServicePageBase {
|
||||
ServiceVerificationRecordPage({this.records});
|
||||
|
||||
final List<ServiceVerificationRecord>? records;
|
||||
|
||||
factory ServiceVerificationRecordPage.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceVerificationRecordPageFromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$ServiceVerificationRecordPageToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceOpenCard {
|
||||
/// 用户名
|
||||
@@ -520,3 +1098,319 @@ class ServiceHardCreateHardQrCodeScanOrder {
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$ServiceHardCreateHardQrCodeScanOrderToJson(this);
|
||||
}
|
||||
|
||||
/// 收银终端支付宝、微信聚合订单码创建结果。
|
||||
///
|
||||
/// 该模型只接收 `AGGREGATE_ORDER_PAY` HTTPS 收银地址,不承载自有钱包码或平台原生码。
|
||||
@JsonSerializable()
|
||||
class ServiceHardAggregateOrderCodePay {
|
||||
/// Hardware 业务订单 ID,状态查询必须与 [aggregateNo] 一起提交。
|
||||
final String orderId;
|
||||
|
||||
/// 当前终端绑定的收款商户 ID。
|
||||
final String mchId;
|
||||
|
||||
/// Thirdparty 服务生成并持久化绑定到 Hardware 订单的聚合会话编号。
|
||||
final String aggregateNo;
|
||||
|
||||
/// 支付宝和微信均可扫码访问的 HTTPS 聚合收银地址。
|
||||
final String qrCode;
|
||||
|
||||
/// 二维码协议类型,服务端固定返回 `AGGREGATE_ORDER_PAY`。
|
||||
final String qrCodeType;
|
||||
|
||||
/// 服务端确定的聚合二维码失效时间。
|
||||
final DateTime expireTime;
|
||||
|
||||
/// 创建不可变的聚合订单码结果。
|
||||
const ServiceHardAggregateOrderCodePay({
|
||||
required this.orderId,
|
||||
required this.mchId,
|
||||
required this.aggregateNo,
|
||||
required this.qrCode,
|
||||
required this.qrCodeType,
|
||||
required this.expireTime,
|
||||
});
|
||||
|
||||
/// 将 Hardware 接口 JSON 转换为聚合订单码结果。
|
||||
factory ServiceHardAggregateOrderCodePay.fromJson(
|
||||
Map<String, dynamic> json,
|
||||
) =>
|
||||
_$ServiceHardAggregateOrderCodePayFromJson(json);
|
||||
|
||||
/// 将聚合订单码结果转换为 JSON,供测试和跨 Engine 消息核对使用。
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$ServiceHardAggregateOrderCodePayToJson(this);
|
||||
}
|
||||
|
||||
/// Hardware 聚合订单码状态查询结果。
|
||||
///
|
||||
/// [paySuccess] 为 `true` 时,服务端已在订单锁内完成 Hardware 订单和库存更新。
|
||||
@JsonSerializable()
|
||||
class ServiceHardAggregateOrderCodePayStatus {
|
||||
/// Hardware 业务订单 ID。
|
||||
final String orderId;
|
||||
|
||||
/// 与 Hardware 订单持久化绑定的聚合会话编号。
|
||||
final String aggregateNo;
|
||||
|
||||
/// 聚合会话状态编码:10 等待、15 创建中、20 支付中、30 成功、40 关闭、50 过期、60 创建失败。
|
||||
final String status;
|
||||
|
||||
/// 首个有效扫码选定的平台,尚未扫码时为空。
|
||||
final String? selectedPlatform;
|
||||
|
||||
/// 支付宝或微信实际子订单号,尚未创建时为空。
|
||||
final String? payNo;
|
||||
|
||||
/// 是否已经由支付平台确认成功并同步 Hardware 业务订单。
|
||||
final bool paySuccess;
|
||||
|
||||
/// 聚合二维码服务端失效时间;已由本地成功态短路返回时允许为空。
|
||||
final DateTime? expireTime;
|
||||
|
||||
/// Hardware 业务订单当前状态编码。
|
||||
final String orderStatus;
|
||||
|
||||
/// 创建不可变的聚合支付状态。
|
||||
const ServiceHardAggregateOrderCodePayStatus({
|
||||
required this.orderId,
|
||||
required this.aggregateNo,
|
||||
required this.status,
|
||||
this.selectedPlatform,
|
||||
this.payNo,
|
||||
required this.paySuccess,
|
||||
this.expireTime,
|
||||
required this.orderStatus,
|
||||
});
|
||||
|
||||
/// 将 Hardware 接口 JSON 转换为聚合支付状态。
|
||||
factory ServiceHardAggregateOrderCodePayStatus.fromJson(
|
||||
Map<String, dynamic> json,
|
||||
) =>
|
||||
_$ServiceHardAggregateOrderCodePayStatusFromJson(json);
|
||||
|
||||
/// 将聚合支付状态转换为 JSON,供日志脱敏筛选和测试使用。
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$ServiceHardAggregateOrderCodePayStatusToJson(this);
|
||||
}
|
||||
|
||||
/// 终端本人预约菜单查询参数。
|
||||
@JsonSerializable(includeIfNull: false)
|
||||
class ReservationMenuQueryRequest {
|
||||
const ReservationMenuQueryRequest({
|
||||
required this.hardId,
|
||||
required this.recognitionType,
|
||||
required this.maskName,
|
||||
this.cardNumber,
|
||||
this.faceUserId,
|
||||
});
|
||||
|
||||
/// 当前终端设备 ID。
|
||||
final int hardId;
|
||||
|
||||
/// 本人识别方式,沿用后端 CARD、FACE 契约。
|
||||
final String recognitionType;
|
||||
|
||||
/// 是否由服务端脱敏用户姓名。
|
||||
final bool maskName;
|
||||
|
||||
/// 饭卡卡号,仅 CARD 识别时传递。
|
||||
final String? cardNumber;
|
||||
|
||||
/// 人脸插件识别出的用户 ID,仅 FACE 识别时传递。
|
||||
final int? faceUserId;
|
||||
|
||||
factory ReservationMenuQueryRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$ReservationMenuQueryRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ReservationMenuQueryRequestToJson(this);
|
||||
}
|
||||
|
||||
/// 终端识别本人后返回的预约菜单,姓名由服务端按终端配置决定是否脱敏。
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class ServiceReservationMenuQuery {
|
||||
/// 服务端按终端配置返回的用户姓名;字段名保留用于兼容既有协议。
|
||||
final String maskedName;
|
||||
|
||||
/// 用户所属部门名称。
|
||||
final String? deptName;
|
||||
|
||||
/// 当前终端绑定的食堂名称。
|
||||
final String merchantName;
|
||||
|
||||
/// 查询结果中包含预约的日期数量。
|
||||
final int totalDayCount;
|
||||
|
||||
/// 查询结果中包含预约的餐段数量。
|
||||
final int totalMealCount;
|
||||
|
||||
/// 按预约日期升序排列的菜单列表。
|
||||
final List<ServiceReservationDay> days;
|
||||
|
||||
const ServiceReservationMenuQuery({
|
||||
required this.maskedName,
|
||||
this.deptName,
|
||||
required this.merchantName,
|
||||
required this.totalDayCount,
|
||||
required this.totalMealCount,
|
||||
required this.days,
|
||||
});
|
||||
|
||||
factory ServiceReservationMenuQuery.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceReservationMenuQueryFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceReservationMenuQueryToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class ServiceReservationDay {
|
||||
/// 预约用餐日期,格式为 yyyy-MM-dd。
|
||||
final String date;
|
||||
|
||||
/// 当天按餐段顺序排列的预约菜单。
|
||||
final List<ServiceReservationMeal> meals;
|
||||
|
||||
const ServiceReservationDay({
|
||||
required this.date,
|
||||
required this.meals,
|
||||
});
|
||||
|
||||
factory ServiceReservationDay.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceReservationDayFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceReservationDayToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class ServiceReservationMeal {
|
||||
/// 预约餐段编码,沿用硬件订单餐段契约。
|
||||
final String hourType;
|
||||
|
||||
/// 预约餐段显示名称。
|
||||
final String mealTitle;
|
||||
|
||||
/// 当前餐段所有预约订单的去重餐品汇总,用于兼容旧服务端和旧终端。
|
||||
final List<String> items;
|
||||
|
||||
/// 当前餐段可核销的预约订单 ID 列表。
|
||||
@JsonKey(fromJson: JsonTool.anyListToIntList)
|
||||
final List<int> orderIds;
|
||||
|
||||
/// 当前餐段内每笔预约订单与餐品的明确对应关系。
|
||||
final List<ServiceReservationOrder> orders;
|
||||
|
||||
const ServiceReservationMeal({
|
||||
required this.hourType,
|
||||
required this.mealTitle,
|
||||
required this.items,
|
||||
this.orderIds = const [],
|
||||
this.orders = const [],
|
||||
});
|
||||
|
||||
factory ServiceReservationMeal.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceReservationMealFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceReservationMealToJson(this);
|
||||
}
|
||||
|
||||
/// 同一餐段内单笔预约与餐品的对应关系;旧服务端没有该字段时保持空列表。
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class ServiceReservationOrder {
|
||||
/// 可核销的预约订单 ID。
|
||||
@JsonKey(fromJson: JsonTool.anyToInt)
|
||||
final int orderId;
|
||||
|
||||
/// 该笔预约订单实际购买的商品与数量明细。
|
||||
final List<ServiceReservationOrderItem> items;
|
||||
|
||||
const ServiceReservationOrder({
|
||||
required this.orderId,
|
||||
required this.items,
|
||||
});
|
||||
|
||||
factory ServiceReservationOrder.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceReservationOrderFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceReservationOrderToJson(this);
|
||||
}
|
||||
|
||||
/// 单笔预约订单中的商品与购买数量。
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class ServiceReservationOrderItem {
|
||||
/// 订单中的菜品库商品 SPU ID;旧服务端未返回时为空。
|
||||
@JsonKey(fromJson: JsonTool.anyToNullableInt)
|
||||
final int? productId;
|
||||
|
||||
/// 订单中的商品名称。
|
||||
final String productName;
|
||||
|
||||
/// 订单中的商品图片地址。
|
||||
final String? productPic;
|
||||
|
||||
/// 订单中的商品购买数量;历史异常数据缺失时允许为空。
|
||||
final int? productCount;
|
||||
|
||||
/// 商品类型:1 为单品,2 为套餐;旧服务端缺失时按单品处理。
|
||||
final int spuType;
|
||||
|
||||
/// 套餐内的组成菜品;单品或旧服务端返回时为空列表。
|
||||
final List<ServiceReservationComboItem> comboItems;
|
||||
|
||||
/// 创建服务端预约订单商品;新字段均提供兼容旧服务端的默认值。
|
||||
const ServiceReservationOrderItem({
|
||||
this.productId,
|
||||
required this.productName,
|
||||
this.productPic,
|
||||
this.productCount,
|
||||
this.spuType = 1,
|
||||
this.comboItems = const [],
|
||||
});
|
||||
|
||||
/// 从预约菜单接口 JSON 创建订单商品。
|
||||
factory ServiceReservationOrderItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceReservationOrderItemFromJson(json);
|
||||
|
||||
/// 将订单商品转换为可传输 JSON。
|
||||
Map<String, dynamic> toJson() => _$ServiceReservationOrderItemToJson(this);
|
||||
}
|
||||
|
||||
/// 预约订单中的套餐组成菜品,只承担服务端 JSON 与终端展示模型之间的传输。
|
||||
@JsonSerializable()
|
||||
class ServiceReservationComboItem {
|
||||
/// 组成菜品 SPU ID;菜品已删除或历史数据缺失时为空。
|
||||
@JsonKey(fromJson: JsonTool.anyToNullableInt)
|
||||
final int? childSpuId;
|
||||
|
||||
/// 组成菜品名称;关联菜品缺失时为空。
|
||||
final String? name;
|
||||
|
||||
/// 组成菜品封面地址;未配置时为空。
|
||||
final String? picUrl;
|
||||
|
||||
/// 套餐内组成菜品的份数;异常或缺失时由页面兜底为 1。
|
||||
final int? quantity;
|
||||
|
||||
/// 套餐组成显示顺序;缺失时按接口返回顺序保留。
|
||||
final int? sortOrder;
|
||||
|
||||
/// 组成菜品展示单价,单位为分;缺失时不展示价格。
|
||||
final int? price;
|
||||
|
||||
/// 创建服务端套餐组成传输模型,缺失字段保持为空并交由页面模型规范化。
|
||||
const ServiceReservationComboItem({
|
||||
this.childSpuId,
|
||||
this.name,
|
||||
this.picUrl,
|
||||
this.quantity,
|
||||
this.sortOrder,
|
||||
this.price,
|
||||
});
|
||||
|
||||
/// 从预约菜单接口 JSON 创建套餐组成。
|
||||
factory ServiceReservationComboItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceReservationComboItemFromJson(json);
|
||||
|
||||
/// 将套餐组成转换为可传输 JSON。
|
||||
Map<String, dynamic> toJson() => _$ServiceReservationComboItemToJson(this);
|
||||
}
|
||||
@@ -6,6 +6,196 @@ part of 'hard_api_models.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
OrderEvidenceRequest _$OrderEvidenceRequestFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
OrderEvidenceRequest(
|
||||
androidOrderCode: json['androidOrderCode'] as String?,
|
||||
orderId: json['orderId'] as String?,
|
||||
evidenceType: json['evidenceType'] as String,
|
||||
evidenceRole: json['evidenceRole'] as String,
|
||||
sequenceNo: (json['sequenceNo'] as num).toInt(),
|
||||
userId: json['userId'] as String,
|
||||
faceSampleId: json['faceSampleId'] as String?,
|
||||
referenceImageUrl: json['referenceImageUrl'] as String?,
|
||||
referenceImageVersion: json['referenceImageVersion'] == null
|
||||
? null
|
||||
: DateTime.parse(json['referenceImageVersion'] as String),
|
||||
similarity: (json['similarity'] as num?)?.toDouble(),
|
||||
similarityThreshold: (json['similarityThreshold'] as num?)?.toDouble(),
|
||||
capturedAt: DateTime.parse(json['capturedAt'] as String),
|
||||
imageHash: json['imageHash'] as String?,
|
||||
imageSize: (json['imageSize'] as num?)?.toInt(),
|
||||
imageWidth: (json['imageWidth'] as num?)?.toInt(),
|
||||
imageHeight: (json['imageHeight'] as num?)?.toInt(),
|
||||
status: json['status'] as String?,
|
||||
failureReason: json['failureReason'] as String?,
|
||||
appVersion: json['appVersion'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$OrderEvidenceRequestToJson(
|
||||
OrderEvidenceRequest instance) {
|
||||
final val = <String, dynamic>{};
|
||||
|
||||
void writeNotNull(String key, dynamic value) {
|
||||
if (value != null) {
|
||||
val[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
writeNotNull('androidOrderCode', instance.androidOrderCode);
|
||||
writeNotNull('orderId', instance.orderId);
|
||||
val['evidenceType'] = instance.evidenceType;
|
||||
val['evidenceRole'] = instance.evidenceRole;
|
||||
val['sequenceNo'] = instance.sequenceNo;
|
||||
val['userId'] = instance.userId;
|
||||
writeNotNull('faceSampleId', instance.faceSampleId);
|
||||
writeNotNull('referenceImageUrl', instance.referenceImageUrl);
|
||||
writeNotNull('referenceImageVersion',
|
||||
instance.referenceImageVersion?.toIso8601String());
|
||||
writeNotNull('similarity', instance.similarity);
|
||||
writeNotNull('similarityThreshold', instance.similarityThreshold);
|
||||
val['capturedAt'] = instance.capturedAt.toIso8601String();
|
||||
writeNotNull('imageHash', instance.imageHash);
|
||||
writeNotNull('imageSize', instance.imageSize);
|
||||
writeNotNull('imageWidth', instance.imageWidth);
|
||||
writeNotNull('imageHeight', instance.imageHeight);
|
||||
writeNotNull('status', instance.status);
|
||||
writeNotNull('failureReason', instance.failureReason);
|
||||
val['appVersion'] = instance.appVersion;
|
||||
return val;
|
||||
}
|
||||
|
||||
ServiceOrderEvidenceImage _$ServiceOrderEvidenceImageFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceOrderEvidenceImage(
|
||||
id: JsonTool.anyToRequiredString(json['id']),
|
||||
evidenceType: json['evidenceType'] as String,
|
||||
evidenceTypeName: json['evidenceTypeName'] as String?,
|
||||
evidenceRole: json['evidenceRole'] as String,
|
||||
evidenceRoleName: json['evidenceRoleName'] as String?,
|
||||
sequenceNo: (json['sequenceNo'] as num).toInt(),
|
||||
status: json['status'] as String,
|
||||
statusName: json['statusName'] as String?,
|
||||
similarity: JsonTool.anyToNullableDouble(json['similarity']),
|
||||
similarityThreshold:
|
||||
JsonTool.anyToNullableDouble(json['similarityThreshold']),
|
||||
hardId: JsonTool.anyToString(json['hardId']),
|
||||
capturedAt: json['capturedAt'] == null
|
||||
? null
|
||||
: DateTime.parse(json['capturedAt'] as String),
|
||||
imageHash: json['imageHash'] as String?,
|
||||
imageUrl: json['imageUrl'] as String?,
|
||||
failureReason: json['failureReason'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceOrderEvidenceImageToJson(
|
||||
ServiceOrderEvidenceImage instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'evidenceType': instance.evidenceType,
|
||||
'evidenceTypeName': instance.evidenceTypeName,
|
||||
'evidenceRole': instance.evidenceRole,
|
||||
'evidenceRoleName': instance.evidenceRoleName,
|
||||
'sequenceNo': instance.sequenceNo,
|
||||
'status': instance.status,
|
||||
'statusName': instance.statusName,
|
||||
'similarity': instance.similarity,
|
||||
'similarityThreshold': instance.similarityThreshold,
|
||||
'hardId': instance.hardId,
|
||||
'capturedAt': instance.capturedAt?.toIso8601String(),
|
||||
'imageHash': instance.imageHash,
|
||||
'imageUrl': instance.imageUrl,
|
||||
'failureReason': instance.failureReason,
|
||||
};
|
||||
|
||||
ServicePrintRecord _$ServicePrintRecordFromJson(Map<String, dynamic> json) =>
|
||||
ServicePrintRecord(
|
||||
id: JsonTool.anyToRequiredString(json['id']),
|
||||
orderId: JsonTool.anyToRequiredString(json['orderId']),
|
||||
hardId: JsonTool.anyToString(json['hardId']),
|
||||
hardName: json['hardName'] as String?,
|
||||
printerHardId: JsonTool.anyToString(json['printerHardId']),
|
||||
printerHardName: json['printerHardName'] as String?,
|
||||
printType: json['printType'] as String? ?? '1',
|
||||
printNo: (json['printNo'] as num?)?.toInt() ?? 1,
|
||||
retryVersion: (json['retryVersion'] as num?)?.toInt() ?? 0,
|
||||
attemptCount: (json['attemptCount'] as num?)?.toInt() ?? 0,
|
||||
status: json['status'] as String? ?? '',
|
||||
failureStage: json['failureStage'] as String?,
|
||||
lastError: json['lastError'] as String?,
|
||||
printedAt: json['printedAt'] == null
|
||||
? null
|
||||
: DateTime.parse(json['printedAt'] as String),
|
||||
reprintReason: json['reprintReason'] as String?,
|
||||
pic: json['pic'] as String?,
|
||||
createTime: json['createTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['createTime'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServicePrintRecordToJson(ServicePrintRecord instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'orderId': instance.orderId,
|
||||
'hardId': instance.hardId,
|
||||
'hardName': instance.hardName,
|
||||
'printerHardId': instance.printerHardId,
|
||||
'printerHardName': instance.printerHardName,
|
||||
'printType': instance.printType,
|
||||
'printNo': instance.printNo,
|
||||
'retryVersion': instance.retryVersion,
|
||||
'attemptCount': instance.attemptCount,
|
||||
'status': instance.status,
|
||||
'failureStage': instance.failureStage,
|
||||
'lastError': instance.lastError,
|
||||
'printedAt': instance.printedAt?.toIso8601String(),
|
||||
'reprintReason': instance.reprintReason,
|
||||
'pic': instance.pic,
|
||||
'createTime': instance.createTime?.toIso8601String(),
|
||||
};
|
||||
|
||||
ServiceOrderEvidenceResolve _$ServiceOrderEvidenceResolveFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceOrderEvidenceResolve(
|
||||
orderId: JsonTool.anyToRequiredString(json['orderId']),
|
||||
orderStatus: json['orderStatus'] as String,
|
||||
evidenceImages: (json['evidenceImages'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
ServiceOrderEvidenceImage.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceOrderEvidenceResolveToJson(
|
||||
ServiceOrderEvidenceResolve instance) =>
|
||||
<String, dynamic>{
|
||||
'orderId': instance.orderId,
|
||||
'orderStatus': instance.orderStatus,
|
||||
'evidenceImages': instance.evidenceImages,
|
||||
};
|
||||
|
||||
ServiceOrderEvidenceUploadResult _$ServiceOrderEvidenceUploadResultFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceOrderEvidenceUploadResult(
|
||||
evidenceId: JsonTool.anyToRequiredString(json['evidenceId']),
|
||||
orderId: JsonTool.anyToRequiredString(json['orderId']),
|
||||
status: json['status'] as String,
|
||||
uploaded: json['uploaded'] as bool,
|
||||
message: json['message'] as String,
|
||||
imageUrl: json['imageUrl'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceOrderEvidenceUploadResultToJson(
|
||||
ServiceOrderEvidenceUploadResult instance) =>
|
||||
<String, dynamic>{
|
||||
'evidenceId': instance.evidenceId,
|
||||
'orderId': instance.orderId,
|
||||
'status': instance.status,
|
||||
'uploaded': instance.uploaded,
|
||||
'message': instance.message,
|
||||
'imageUrl': instance.imageUrl,
|
||||
};
|
||||
|
||||
ServiceHardware _$ServiceHardwareFromJson(Map<String, dynamic> json) =>
|
||||
ServiceHardware(
|
||||
id: json['id'] as String?,
|
||||
@@ -59,13 +249,15 @@ Map<String, dynamic> _$ServiceHardwareToJson(ServiceHardware instance) =>
|
||||
};
|
||||
|
||||
ServiceCar _$ServiceCarFromJson(Map<String, dynamic> json) => ServiceCar(
|
||||
id: json['id'] as String?,
|
||||
parentCarId: json['parentCarId'] as String?,
|
||||
id: JsonTool.anyToString(json['id']),
|
||||
parentCarId: JsonTool.anyToString(json['parentCarId']),
|
||||
productName: json['productName'] as String?,
|
||||
productPrice: (json['productPrice'] as num?)?.toInt(),
|
||||
productId: json['productId'] as String?,
|
||||
productId: JsonTool.anyToString(json['productId']),
|
||||
productCount: (json['productCount'] as num?)?.toInt(),
|
||||
totalPrice: JsonTool.stringToInt(json['totalPrice'] as String?),
|
||||
productNature: json['productNature'] as String?,
|
||||
productWeight: JsonTool.anyToNullableDouble(json['productWeight']),
|
||||
totalPrice: JsonTool.anyToNullableInt(json['totalPrice']),
|
||||
productPic: json['productPic'] as String?,
|
||||
);
|
||||
|
||||
@@ -77,6 +269,8 @@ Map<String, dynamic> _$ServiceCarToJson(ServiceCar instance) =>
|
||||
'productPrice': instance.productPrice,
|
||||
'productId': instance.productId,
|
||||
'productCount': instance.productCount,
|
||||
'productNature': instance.productNature,
|
||||
'productWeight': instance.productWeight,
|
||||
'totalPrice': JsonTool.intToString(instance.totalPrice),
|
||||
'productPic': instance.productPic,
|
||||
};
|
||||
@@ -121,18 +315,33 @@ Map<String, dynamic> _$ServiceQRCodeToJson(ServiceQRCode instance) =>
|
||||
|
||||
ServiceHardOrder _$ServiceHardOrderFromJson(Map<String, dynamic> json) =>
|
||||
ServiceHardOrder(
|
||||
userId: json['userId'] as String?,
|
||||
id: JsonTool.anyToString(json['id']),
|
||||
orderNo: json['orderNo'] as String?,
|
||||
userId: JsonTool.anyToString(json['userId']),
|
||||
username: json['username'] as String?,
|
||||
userMobile: json['userMobile'] as String?,
|
||||
userAvatar: json['userAvatar'] as String?,
|
||||
orderType: json['orderType'] as String?,
|
||||
orderStatus: json['orderStatus'] as String?,
|
||||
payType: json['payType'] as String?,
|
||||
walletId: json['walletId'] as String?,
|
||||
walletId: JsonTool.anyToString(json['walletId']),
|
||||
hourType: json['hourType'] as String?,
|
||||
apptHourType: json['apptHourType'] as String?,
|
||||
productDesc: json['productDesc'] as String?,
|
||||
userDeptName: json['userDeptName'] as String?,
|
||||
totalPrice: JsonTool.anyToNullableInt(json['totalPrice']),
|
||||
extraPrice: JsonTool.anyToNullableInt(json['extraPrice']),
|
||||
payPrice: JsonTool.anyToNullableInt(json['payPrice']),
|
||||
androidOrderCode: json['androidOrderCode'] as String?,
|
||||
createTime: json['createTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['createTime'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceHardOrderToJson(ServiceHardOrder instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'orderNo': instance.orderNo,
|
||||
'userId': instance.userId,
|
||||
'username': instance.username,
|
||||
'userMobile': instance.userMobile,
|
||||
@@ -141,6 +350,199 @@ Map<String, dynamic> _$ServiceHardOrderToJson(ServiceHardOrder instance) =>
|
||||
'orderStatus': instance.orderStatus,
|
||||
'payType': instance.payType,
|
||||
'walletId': instance.walletId,
|
||||
'hourType': instance.hourType,
|
||||
'apptHourType': instance.apptHourType,
|
||||
'productDesc': instance.productDesc,
|
||||
'userDeptName': instance.userDeptName,
|
||||
'totalPrice': instance.totalPrice,
|
||||
'extraPrice': instance.extraPrice,
|
||||
'payPrice': instance.payPrice,
|
||||
'androidOrderCode': instance.androidOrderCode,
|
||||
'createTime': instance.createTime?.toIso8601String(),
|
||||
};
|
||||
|
||||
VerificationRecordQueryRequest _$VerificationRecordQueryRequestFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
VerificationRecordQueryRequest(
|
||||
hardId: (json['hardId'] as num).toInt(),
|
||||
startDate: json['startDate'] as String,
|
||||
endDate: json['endDate'] as String,
|
||||
verificationType: json['verificationType'] as String?,
|
||||
scope: json['scope'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$VerificationRecordQueryRequestToJson(
|
||||
VerificationRecordQueryRequest 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('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(
|
||||
orderId: JsonTool.anyToInt(json['orderId']),
|
||||
orderNo: json['orderNo'] as String,
|
||||
verificationType: json['verificationType'] as String,
|
||||
verificationTypeName: json['verificationTypeName'] as String,
|
||||
username: json['username'] as String,
|
||||
productDesc: json['productDesc'] as String,
|
||||
payTypeName: json['payTypeName'] as String,
|
||||
totalPrice: JsonTool.anyToInt(json['totalPrice']),
|
||||
verificationTime: DateTime.parse(json['verificationTime'] as String),
|
||||
userDeptName: json['userDeptName'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceVerificationRecordToJson(
|
||||
ServiceVerificationRecord instance) =>
|
||||
<String, dynamic>{
|
||||
'orderId': instance.orderId,
|
||||
'orderNo': instance.orderNo,
|
||||
'verificationType': instance.verificationType,
|
||||
'verificationTypeName': instance.verificationTypeName,
|
||||
'username': instance.username,
|
||||
'userDeptName': instance.userDeptName,
|
||||
'productDesc': instance.productDesc,
|
||||
'payTypeName': instance.payTypeName,
|
||||
'totalPrice': instance.totalPrice,
|
||||
'verificationTime': instance.verificationTime.toIso8601String(),
|
||||
};
|
||||
|
||||
ServiceVerificationRecordPage _$ServiceVerificationRecordPageFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceVerificationRecordPage(
|
||||
records: (json['records'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
ServiceVerificationRecord.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> _$ServiceVerificationRecordPageToJson(
|
||||
ServiceVerificationRecordPage instance) =>
|
||||
<String, dynamic>{
|
||||
'current': instance.current,
|
||||
'pages': instance.pages,
|
||||
'size': instance.size,
|
||||
'total': instance.total,
|
||||
'records': instance.records,
|
||||
};
|
||||
|
||||
ServiceOpenCard _$ServiceOpenCardFromJson(Map<String, dynamic> json) =>
|
||||
@@ -336,3 +738,215 @@ Map<String, dynamic> _$ServiceHardCreateHardQrCodeScanOrderToJson(
|
||||
'mchId': instance.mchId,
|
||||
'qrCodeData': instance.qrCodeData,
|
||||
};
|
||||
|
||||
ServiceHardAggregateOrderCodePay _$ServiceHardAggregateOrderCodePayFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceHardAggregateOrderCodePay(
|
||||
orderId: json['orderId'] as String,
|
||||
mchId: json['mchId'] as String,
|
||||
aggregateNo: json['aggregateNo'] as String,
|
||||
qrCode: json['qrCode'] as String,
|
||||
qrCodeType: json['qrCodeType'] as String,
|
||||
expireTime: DateTime.parse(json['expireTime'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceHardAggregateOrderCodePayToJson(
|
||||
ServiceHardAggregateOrderCodePay instance) =>
|
||||
<String, dynamic>{
|
||||
'orderId': instance.orderId,
|
||||
'mchId': instance.mchId,
|
||||
'aggregateNo': instance.aggregateNo,
|
||||
'qrCode': instance.qrCode,
|
||||
'qrCodeType': instance.qrCodeType,
|
||||
'expireTime': instance.expireTime.toIso8601String(),
|
||||
};
|
||||
|
||||
ServiceHardAggregateOrderCodePayStatus
|
||||
_$ServiceHardAggregateOrderCodePayStatusFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceHardAggregateOrderCodePayStatus(
|
||||
orderId: json['orderId'] as String,
|
||||
aggregateNo: json['aggregateNo'] as String,
|
||||
status: json['status'] as String,
|
||||
selectedPlatform: json['selectedPlatform'] as String?,
|
||||
payNo: json['payNo'] as String?,
|
||||
paySuccess: json['paySuccess'] as bool,
|
||||
expireTime: json['expireTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['expireTime'] as String),
|
||||
orderStatus: json['orderStatus'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceHardAggregateOrderCodePayStatusToJson(
|
||||
ServiceHardAggregateOrderCodePayStatus instance) =>
|
||||
<String, dynamic>{
|
||||
'orderId': instance.orderId,
|
||||
'aggregateNo': instance.aggregateNo,
|
||||
'status': instance.status,
|
||||
'selectedPlatform': instance.selectedPlatform,
|
||||
'payNo': instance.payNo,
|
||||
'paySuccess': instance.paySuccess,
|
||||
'expireTime': instance.expireTime?.toIso8601String(),
|
||||
'orderStatus': instance.orderStatus,
|
||||
};
|
||||
|
||||
ReservationMenuQueryRequest _$ReservationMenuQueryRequestFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ReservationMenuQueryRequest(
|
||||
hardId: (json['hardId'] as num).toInt(),
|
||||
recognitionType: json['recognitionType'] as String,
|
||||
maskName: json['maskName'] as bool,
|
||||
cardNumber: json['cardNumber'] as String?,
|
||||
faceUserId: (json['faceUserId'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ReservationMenuQueryRequestToJson(
|
||||
ReservationMenuQueryRequest instance) {
|
||||
final val = <String, dynamic>{
|
||||
'hardId': instance.hardId,
|
||||
'recognitionType': instance.recognitionType,
|
||||
'maskName': instance.maskName,
|
||||
};
|
||||
|
||||
void writeNotNull(String key, dynamic value) {
|
||||
if (value != null) {
|
||||
val[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
writeNotNull('cardNumber', instance.cardNumber);
|
||||
writeNotNull('faceUserId', instance.faceUserId);
|
||||
return val;
|
||||
}
|
||||
|
||||
ServiceReservationMenuQuery _$ServiceReservationMenuQueryFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceReservationMenuQuery(
|
||||
maskedName: json['maskedName'] as String,
|
||||
deptName: json['deptName'] as String?,
|
||||
merchantName: json['merchantName'] as String,
|
||||
totalDayCount: (json['totalDayCount'] as num).toInt(),
|
||||
totalMealCount: (json['totalMealCount'] as num).toInt(),
|
||||
days: (json['days'] as List<dynamic>)
|
||||
.map((e) => ServiceReservationDay.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceReservationMenuQueryToJson(
|
||||
ServiceReservationMenuQuery instance) =>
|
||||
<String, dynamic>{
|
||||
'maskedName': instance.maskedName,
|
||||
'deptName': instance.deptName,
|
||||
'merchantName': instance.merchantName,
|
||||
'totalDayCount': instance.totalDayCount,
|
||||
'totalMealCount': instance.totalMealCount,
|
||||
'days': instance.days.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
ServiceReservationDay _$ServiceReservationDayFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceReservationDay(
|
||||
date: json['date'] as String,
|
||||
meals: (json['meals'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => ServiceReservationMeal.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceReservationDayToJson(
|
||||
ServiceReservationDay instance) =>
|
||||
<String, dynamic>{
|
||||
'date': instance.date,
|
||||
'meals': instance.meals.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
ServiceReservationMeal _$ServiceReservationMealFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceReservationMeal(
|
||||
hourType: json['hourType'] as String,
|
||||
mealTitle: json['mealTitle'] as String,
|
||||
items: (json['items'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
orderIds: json['orderIds'] == null
|
||||
? const []
|
||||
: JsonTool.anyListToIntList(json['orderIds']),
|
||||
orders: (json['orders'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
ServiceReservationOrder.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceReservationMealToJson(
|
||||
ServiceReservationMeal instance) =>
|
||||
<String, dynamic>{
|
||||
'hourType': instance.hourType,
|
||||
'mealTitle': instance.mealTitle,
|
||||
'items': instance.items,
|
||||
'orderIds': instance.orderIds,
|
||||
'orders': instance.orders.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
ServiceReservationOrder _$ServiceReservationOrderFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceReservationOrder(
|
||||
orderId: JsonTool.anyToInt(json['orderId']),
|
||||
items: (json['items'] as List<dynamic>)
|
||||
.map((e) =>
|
||||
ServiceReservationOrderItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceReservationOrderToJson(
|
||||
ServiceReservationOrder instance) =>
|
||||
<String, dynamic>{
|
||||
'orderId': instance.orderId,
|
||||
'items': instance.items.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
ServiceReservationOrderItem _$ServiceReservationOrderItemFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceReservationOrderItem(
|
||||
productId: JsonTool.anyToNullableInt(json['productId']),
|
||||
productName: json['productName'] as String,
|
||||
productPic: json['productPic'] as String?,
|
||||
productCount: (json['productCount'] as num?)?.toInt(),
|
||||
spuType: (json['spuType'] as num?)?.toInt() ?? 1,
|
||||
comboItems: (json['comboItems'] as List<dynamic>?)
|
||||
?.map((e) => ServiceReservationComboItem.fromJson(
|
||||
e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceReservationOrderItemToJson(
|
||||
ServiceReservationOrderItem instance) =>
|
||||
<String, dynamic>{
|
||||
'productId': instance.productId,
|
||||
'productName': instance.productName,
|
||||
'productPic': instance.productPic,
|
||||
'productCount': instance.productCount,
|
||||
'spuType': instance.spuType,
|
||||
'comboItems': instance.comboItems.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
ServiceReservationComboItem _$ServiceReservationComboItemFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceReservationComboItem(
|
||||
childSpuId: JsonTool.anyToNullableInt(json['childSpuId']),
|
||||
name: json['name'] as String?,
|
||||
picUrl: json['picUrl'] as String?,
|
||||
quantity: (json['quantity'] as num?)?.toInt(),
|
||||
sortOrder: (json['sortOrder'] as num?)?.toInt(),
|
||||
price: (json['price'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceReservationComboItemToJson(
|
||||
ServiceReservationComboItem instance) =>
|
||||
<String, dynamic>{
|
||||
'childSpuId': instance.childSpuId,
|
||||
'name': instance.name,
|
||||
'picUrl': instance.picUrl,
|
||||
'quantity': instance.quantity,
|
||||
'sortOrder': instance.sortOrder,
|
||||
'price': instance.price,
|
||||
};
|
||||
@@ -136,6 +136,225 @@ class ServiceAsyncFace {
|
||||
Map<String, dynamic> toJson() => _$ServiceAsyncFaceToJson(this);
|
||||
}
|
||||
|
||||
/// V3 部门人脸快照中的单条服务端权威记录。
|
||||
@JsonSerializable()
|
||||
class ServiceFaceSyncRecord {
|
||||
/// 人脸记录数据库主键,作为分页顺序和快照范围的稳定标识。
|
||||
@JsonKey(
|
||||
fromJson: JsonTool.anyToRequiredString,
|
||||
toJson: JsonTool.stringToInt,
|
||||
)
|
||||
final String id;
|
||||
|
||||
/// 虹软 32 位搜索标识,来源于服务端 autoCode。
|
||||
@JsonKey(
|
||||
fromJson: JsonTool.anyToRequiredString,
|
||||
toJson: JsonTool.stringToInt,
|
||||
)
|
||||
final String sampleId;
|
||||
|
||||
/// 人脸所属用户主键,MQ 增量按该字段回查同一用户的全部人脸。
|
||||
@JsonKey(
|
||||
fromJson: JsonTool.anyToRequiredString,
|
||||
toJson: JsonTool.stringToInt,
|
||||
)
|
||||
final String userId;
|
||||
|
||||
/// 用户姓名,用于本地识别结果和设置页展示。
|
||||
final String? username;
|
||||
|
||||
/// 用户当前部门主键,保证终端只维护绑定部门及其子部门人脸。
|
||||
@JsonKey(
|
||||
fromJson: JsonTool.anyToRequiredString,
|
||||
toJson: JsonTool.stringToInt,
|
||||
)
|
||||
final String deptId;
|
||||
|
||||
/// 用户当前部门名称,用于本地展示。
|
||||
final String? deptName;
|
||||
|
||||
/// 服务端人脸图片地址,地址变化会触发重新下载与特征提取。
|
||||
final String? faceImg;
|
||||
|
||||
/// 服务端人脸图片版本时间;未修改的历史记录由服务端回退为创建时间。
|
||||
final DateTime? sourceUpdatedAt;
|
||||
|
||||
/// 创建一条 V3 人脸快照记录。
|
||||
const ServiceFaceSyncRecord({
|
||||
required this.id,
|
||||
required this.sampleId,
|
||||
required this.userId,
|
||||
this.username,
|
||||
required this.deptId,
|
||||
this.deptName,
|
||||
this.faceImg,
|
||||
this.sourceUpdatedAt,
|
||||
});
|
||||
|
||||
/// 从统一网络层返回的 JSON 创建快照记录。
|
||||
factory ServiceFaceSyncRecord.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceFaceSyncRecordFromJson(json);
|
||||
|
||||
/// 将快照记录转换为 JSON,主要供模型测试和诊断使用。
|
||||
Map<String, dynamic> toJson() => _$ServiceFaceSyncRecordToJson(this);
|
||||
}
|
||||
|
||||
/// V3 部门人脸同步的固定上界游标页面。
|
||||
@JsonSerializable()
|
||||
class ServiceFaceSyncSnapshot {
|
||||
/// 当前页面记录,服务端保证按数据库主键严格升序返回。
|
||||
final List<ServiceFaceSyncRecord> records;
|
||||
|
||||
/// 下一页排他游标;末页仅用于终端完成连续性校验。
|
||||
@JsonKey(
|
||||
fromJson: JsonTool.anyToRequiredString,
|
||||
toJson: JsonTool.stringToInt,
|
||||
)
|
||||
final String nextAfterId;
|
||||
|
||||
/// 是否还有位于固定快照上界内的下一页。
|
||||
final bool hasMore;
|
||||
|
||||
/// 首次请求固定的人脸数据库主键上界,后续请求必须原样携带。
|
||||
@JsonKey(
|
||||
fromJson: JsonTool.anyToRequiredString,
|
||||
toJson: JsonTool.stringToInt,
|
||||
)
|
||||
final String snapshotMaxId;
|
||||
|
||||
/// 创建一个固定上界游标页面。
|
||||
const ServiceFaceSyncSnapshot({
|
||||
required this.records,
|
||||
required this.nextAfterId,
|
||||
required this.hasMore,
|
||||
required this.snapshotMaxId,
|
||||
});
|
||||
|
||||
/// 从统一网络层返回的 JSON 创建快照页面。
|
||||
factory ServiceFaceSyncSnapshot.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceFaceSyncSnapshotFromJson(json);
|
||||
|
||||
/// 将快照页面转换为 JSON,主要供模型测试使用。
|
||||
Map<String, dynamic> toJson() => _$ServiceFaceSyncSnapshotToJson(this);
|
||||
}
|
||||
|
||||
/// 终端批量删除服务端人脸后的幂等确认结果。
|
||||
@JsonSerializable()
|
||||
class ServiceTerminalFaceDeleteResult {
|
||||
/// 本次实际逻辑删除的人脸样本编号。
|
||||
final List<String> deletedSampleIds;
|
||||
|
||||
/// 请求前已经不存在的样本编号,本机可继续执行本地清理。
|
||||
final List<String> alreadyAbsentSampleIds;
|
||||
|
||||
/// 创建一份服务端删除确认结果。
|
||||
const ServiceTerminalFaceDeleteResult({
|
||||
required this.deletedSampleIds,
|
||||
required this.alreadyAbsentSampleIds,
|
||||
});
|
||||
|
||||
/// 从统一网络层返回的 JSON 创建删除结果。
|
||||
factory ServiceTerminalFaceDeleteResult.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceTerminalFaceDeleteResultFromJson(json);
|
||||
|
||||
/// 将删除结果转换为 JSON,主要供协议测试使用。
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$ServiceTerminalFaceDeleteResultToJson(this);
|
||||
|
||||
/// 服务端允许本机清理的全部样本编号。
|
||||
Set<String> get confirmedSampleIds => {
|
||||
...deletedSampleIds,
|
||||
...alreadyAbsentSampleIds,
|
||||
};
|
||||
}
|
||||
|
||||
/// 终端提交给服务端的一条在库人脸静态图片质量结果。
|
||||
@JsonSerializable(createFactory: false)
|
||||
class ServiceFaceQualityReportItem {
|
||||
/// 创建一条符合 Hardware 批量上报协议的质量结果。
|
||||
const ServiceFaceQualityReportItem({
|
||||
required this.sampleId,
|
||||
required this.status,
|
||||
required this.sourceUpdatedAt,
|
||||
required this.checkedAt,
|
||||
this.score,
|
||||
this.errorCode,
|
||||
});
|
||||
|
||||
/// 虹软 32 位搜索样本编号,对应服务端人脸记录的 autoCode。
|
||||
final String sampleId;
|
||||
|
||||
/// 检测状态,跨端协议值仅使用 detected 或 failed。
|
||||
final String status;
|
||||
|
||||
/// 虹软静态图片质量分,detected 时范围为 0 到 1,failed 时为空。
|
||||
final double? score;
|
||||
|
||||
/// 本次检测所依据的服务端人脸图片版本,来自 V3 快照 sourceUpdatedAt。
|
||||
@JsonKey(toJson: JsonTool.dateTimeToServiceString)
|
||||
final DateTime sourceUpdatedAt;
|
||||
|
||||
/// 终端完成本次检测的本地时间,用于阻止旧结果覆盖服务端新结果。
|
||||
@JsonKey(toJson: JsonTool.dateTimeToServiceString)
|
||||
final DateTime checkedAt;
|
||||
|
||||
/// 虹软 SDK 或终端插件错误码,检测成功时为空。
|
||||
final int? errorCode;
|
||||
|
||||
/// 转换为统一 Dio 可直接发送的 JSON 请求条目。
|
||||
Map<String, dynamic> toJson() => _$ServiceFaceQualityReportItemToJson(this);
|
||||
}
|
||||
|
||||
/// 当前设备竞争商户部门人脸质量上报资格的结果。
|
||||
@JsonSerializable()
|
||||
class ServiceFaceQualityLease {
|
||||
/// 创建一份租约竞争结果。
|
||||
const ServiceFaceQualityLease({
|
||||
required this.granted,
|
||||
required this.remainingSeconds,
|
||||
});
|
||||
|
||||
/// 当前设备是否取得租约;为 false 时本轮不发送质量批次。
|
||||
final bool granted;
|
||||
|
||||
/// 当前租约剩余秒数,仅用于终端诊断日志。
|
||||
final int remainingSeconds;
|
||||
|
||||
/// 从 Hardware 返回的 JSON 创建租约结果。
|
||||
factory ServiceFaceQualityLease.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceFaceQualityLeaseFromJson(json);
|
||||
|
||||
/// 将租约结果转换为 JSON,主要供协议测试使用。
|
||||
Map<String, dynamic> toJson() => _$ServiceFaceQualityLeaseToJson(this);
|
||||
}
|
||||
|
||||
/// 服务端批量接收终端人脸质量后的幂等处理结果。
|
||||
@JsonSerializable()
|
||||
class ServiceFaceQualityReportResult {
|
||||
/// 创建一份服务端质量上报确认结果。
|
||||
const ServiceFaceQualityReportResult({
|
||||
required this.updatedSampleIds,
|
||||
required this.ignoredStaleSampleIds,
|
||||
required this.alreadyAbsentSampleIds,
|
||||
});
|
||||
|
||||
/// 本次成功写入服务端的样本编号。
|
||||
final List<String> updatedSampleIds;
|
||||
|
||||
/// 因图片版本不一致、已有 detected 或检测时间较旧而忽略的样本编号。
|
||||
final List<String> ignoredStaleSampleIds;
|
||||
|
||||
/// 请求时服务端已经不存在的样本编号。
|
||||
final List<String> alreadyAbsentSampleIds;
|
||||
|
||||
/// 从统一网络层返回的 JSON 创建上报确认结果。
|
||||
factory ServiceFaceQualityReportResult.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceFaceQualityReportResultFromJson(json);
|
||||
|
||||
/// 将确认结果转换为 JSON,主要供协议测试使用。
|
||||
Map<String, dynamic> toJson() => _$ServiceFaceQualityReportResultToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceTenant {
|
||||
/// id
|
||||
|
||||
@@ -77,6 +77,120 @@ Map<String, dynamic> _$ServiceAsyncFaceToJson(ServiceAsyncFace instance) =>
|
||||
'delFlag': JsonTool.booleanToString(instance.delFlag),
|
||||
};
|
||||
|
||||
ServiceFaceSyncRecord _$ServiceFaceSyncRecordFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceFaceSyncRecord(
|
||||
id: JsonTool.anyToRequiredString(json['id']),
|
||||
sampleId: JsonTool.anyToRequiredString(json['sampleId']),
|
||||
userId: JsonTool.anyToRequiredString(json['userId']),
|
||||
username: json['username'] as String?,
|
||||
deptId: JsonTool.anyToRequiredString(json['deptId']),
|
||||
deptName: json['deptName'] as String?,
|
||||
faceImg: json['faceImg'] as String?,
|
||||
sourceUpdatedAt: json['sourceUpdatedAt'] == null
|
||||
? null
|
||||
: DateTime.parse(json['sourceUpdatedAt'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceFaceSyncRecordToJson(
|
||||
ServiceFaceSyncRecord instance) =>
|
||||
<String, dynamic>{
|
||||
'id': JsonTool.stringToInt(instance.id),
|
||||
'sampleId': JsonTool.stringToInt(instance.sampleId),
|
||||
'userId': JsonTool.stringToInt(instance.userId),
|
||||
'username': instance.username,
|
||||
'deptId': JsonTool.stringToInt(instance.deptId),
|
||||
'deptName': instance.deptName,
|
||||
'faceImg': instance.faceImg,
|
||||
'sourceUpdatedAt': instance.sourceUpdatedAt?.toIso8601String(),
|
||||
};
|
||||
|
||||
ServiceFaceSyncSnapshot _$ServiceFaceSyncSnapshotFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceFaceSyncSnapshot(
|
||||
records: (json['records'] as List<dynamic>)
|
||||
.map((e) => ServiceFaceSyncRecord.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
nextAfterId: JsonTool.anyToRequiredString(json['nextAfterId']),
|
||||
hasMore: json['hasMore'] as bool,
|
||||
snapshotMaxId: JsonTool.anyToRequiredString(json['snapshotMaxId']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceFaceSyncSnapshotToJson(
|
||||
ServiceFaceSyncSnapshot instance) =>
|
||||
<String, dynamic>{
|
||||
'records': instance.records,
|
||||
'nextAfterId': JsonTool.stringToInt(instance.nextAfterId),
|
||||
'hasMore': instance.hasMore,
|
||||
'snapshotMaxId': JsonTool.stringToInt(instance.snapshotMaxId),
|
||||
};
|
||||
|
||||
ServiceTerminalFaceDeleteResult _$ServiceTerminalFaceDeleteResultFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceTerminalFaceDeleteResult(
|
||||
deletedSampleIds: (json['deletedSampleIds'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList(),
|
||||
alreadyAbsentSampleIds: (json['alreadyAbsentSampleIds'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceTerminalFaceDeleteResultToJson(
|
||||
ServiceTerminalFaceDeleteResult instance) =>
|
||||
<String, dynamic>{
|
||||
'deletedSampleIds': instance.deletedSampleIds,
|
||||
'alreadyAbsentSampleIds': instance.alreadyAbsentSampleIds,
|
||||
};
|
||||
|
||||
Map<String, dynamic> _$ServiceFaceQualityReportItemToJson(
|
||||
ServiceFaceQualityReportItem instance) =>
|
||||
<String, dynamic>{
|
||||
'sampleId': instance.sampleId,
|
||||
'status': instance.status,
|
||||
'score': instance.score,
|
||||
'sourceUpdatedAt':
|
||||
JsonTool.dateTimeToServiceString(instance.sourceUpdatedAt),
|
||||
'checkedAt': JsonTool.dateTimeToServiceString(instance.checkedAt),
|
||||
'errorCode': instance.errorCode,
|
||||
};
|
||||
|
||||
ServiceFaceQualityLease _$ServiceFaceQualityLeaseFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceFaceQualityLease(
|
||||
granted: json['granted'] as bool,
|
||||
remainingSeconds: (json['remainingSeconds'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceFaceQualityLeaseToJson(
|
||||
ServiceFaceQualityLease instance) =>
|
||||
<String, dynamic>{
|
||||
'granted': instance.granted,
|
||||
'remainingSeconds': instance.remainingSeconds,
|
||||
};
|
||||
|
||||
ServiceFaceQualityReportResult _$ServiceFaceQualityReportResultFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceFaceQualityReportResult(
|
||||
updatedSampleIds: (json['updatedSampleIds'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList(),
|
||||
ignoredStaleSampleIds: (json['ignoredStaleSampleIds'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList(),
|
||||
alreadyAbsentSampleIds: (json['alreadyAbsentSampleIds'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceFaceQualityReportResultToJson(
|
||||
ServiceFaceQualityReportResult instance) =>
|
||||
<String, dynamic>{
|
||||
'updatedSampleIds': instance.updatedSampleIds,
|
||||
'ignoredStaleSampleIds': instance.ignoredStaleSampleIds,
|
||||
'alreadyAbsentSampleIds': instance.alreadyAbsentSampleIds,
|
||||
};
|
||||
|
||||
ServiceTenant _$ServiceTenantFromJson(Map<String, dynamic> json) =>
|
||||
ServiceTenant(
|
||||
id: json['id'] as String?,
|
||||
|
||||
Reference in new issue
Block a user