feat:超市实体
This commit is contained in:
1 parent
321ae3378a
commit
c0fbf652fb
16 files changed
+640
-80
No files matched your search
@@ -92,3 +92,251 @@ class ServiceProduct {
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceProductToJson(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// 超市 spu start
|
||||
// **************************************************************************
|
||||
@JsonSerializable()
|
||||
class ServiceSupermarketSpu {
|
||||
/// id
|
||||
String? id;
|
||||
|
||||
/// 货号
|
||||
String? productCode;
|
||||
|
||||
/// 商品名称
|
||||
String? productName;
|
||||
|
||||
/// 单位
|
||||
String? unit;
|
||||
|
||||
/// 规格
|
||||
String? spec;
|
||||
|
||||
/// 商品分类编号
|
||||
String? categoryId;
|
||||
|
||||
/// 商品封面图
|
||||
String? picUrl;
|
||||
|
||||
/// 剩余库存
|
||||
String? stock;
|
||||
|
||||
/// 商品性质(字典)
|
||||
String? productNature;
|
||||
|
||||
/// 零售价
|
||||
String? retailPrice;
|
||||
|
||||
/// 促销价
|
||||
int? promotionPrice;
|
||||
|
||||
/// 销量
|
||||
int? salesCount;
|
||||
|
||||
ServiceSupermarketSpu({
|
||||
this.id,
|
||||
this.productCode,
|
||||
this.productName,
|
||||
this.unit,
|
||||
this.spec,
|
||||
this.categoryId,
|
||||
this.picUrl,
|
||||
this.stock,
|
||||
this.productNature,
|
||||
this.retailPrice,
|
||||
this.promotionPrice,
|
||||
this.salesCount,
|
||||
});
|
||||
|
||||
factory ServiceSupermarketSpu.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceSupermarketSpuFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceSupermarketSpuToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceSupermarketSpuPage extends ServicePageBase {
|
||||
List<ServiceSupermarketSpu>? records;
|
||||
|
||||
ServiceSupermarketSpuPage({
|
||||
this.records,
|
||||
});
|
||||
|
||||
factory ServiceSupermarketSpuPage.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceSupermarketSpuPageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceSupermarketSpuPageToJson(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// 超市 spu end
|
||||
// **************************************************************************
|
||||
|
||||
// **************************************************************************
|
||||
// 超市 sku start
|
||||
// **************************************************************************
|
||||
@JsonSerializable()
|
||||
class ServiceSupermarketSku {
|
||||
/// 商品 SPU 编号,自增
|
||||
String? id;
|
||||
|
||||
/// 货号
|
||||
String? productCode;
|
||||
|
||||
/// 商品名称
|
||||
String? productName;
|
||||
|
||||
/// 商品分类编号
|
||||
String? categoryId;
|
||||
|
||||
/// 商品封面图
|
||||
String? picUrl;
|
||||
|
||||
/// 剩余库存
|
||||
double? stock;
|
||||
|
||||
/// 商户编号
|
||||
String? merchantId;
|
||||
|
||||
/// 产地
|
||||
String? origin;
|
||||
|
||||
/// 商品性质(字典)
|
||||
String? productNature;
|
||||
|
||||
/// 品牌id
|
||||
String? brandId;
|
||||
|
||||
/// 货商id
|
||||
String? supplierId;
|
||||
|
||||
/// 销量
|
||||
int? salesCount;
|
||||
|
||||
/// 辅助条码集合
|
||||
List<ServiceSupermarketSkuCode>? supermarketAuxiliaryCodeEntityList;
|
||||
|
||||
/// 包装对象集合
|
||||
List<ServiceSupermarketSkuPackage>? supermarketUnitEntityList;
|
||||
|
||||
ServiceSupermarketSku({
|
||||
this.id,
|
||||
this.productCode,
|
||||
this.productName,
|
||||
this.categoryId,
|
||||
this.picUrl,
|
||||
this.stock,
|
||||
this.merchantId,
|
||||
this.origin,
|
||||
this.productNature,
|
||||
this.brandId,
|
||||
this.supplierId,
|
||||
this.salesCount,
|
||||
this.supermarketAuxiliaryCodeEntityList,
|
||||
this.supermarketUnitEntityList,
|
||||
});
|
||||
|
||||
factory ServiceSupermarketSku.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceSupermarketSkuFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceSupermarketSkuToJson(this);
|
||||
}
|
||||
|
||||
// 辅助条码
|
||||
@JsonSerializable()
|
||||
class ServiceSupermarketSkuCode {
|
||||
/// 辅助条码id
|
||||
String? id;
|
||||
|
||||
/// spu Id
|
||||
String? spuId;
|
||||
|
||||
/// 包装单位id
|
||||
String? unitId;
|
||||
|
||||
/// 条码
|
||||
String? barCode;
|
||||
|
||||
ServiceSupermarketSkuCode({
|
||||
this.id,
|
||||
this.spuId,
|
||||
this.unitId,
|
||||
this.barCode,
|
||||
});
|
||||
|
||||
factory ServiceSupermarketSkuCode.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceSupermarketSkuCodeFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceSupermarketSkuCodeToJson(this);
|
||||
}
|
||||
|
||||
// 包装单位
|
||||
@JsonSerializable()
|
||||
class ServiceSupermarketSkuPackage {
|
||||
/// 包装单位id
|
||||
String? id;
|
||||
|
||||
/// spu id
|
||||
String? spuId;
|
||||
|
||||
/// 条码
|
||||
String? barCode;
|
||||
|
||||
/// 规格
|
||||
String? spec;
|
||||
|
||||
/// 单位
|
||||
String? unit;
|
||||
|
||||
/// 状态(0正常,1停销)
|
||||
int? status;
|
||||
|
||||
/// 内装数量
|
||||
int? packageNum;
|
||||
|
||||
/// 进价/单位分
|
||||
int? purchasePrice;
|
||||
|
||||
/// 零售价/单位分
|
||||
int? retailPrice;
|
||||
|
||||
/// 促销价
|
||||
int? promotionPrice;
|
||||
|
||||
ServiceSupermarketSkuPackage({
|
||||
this.id,
|
||||
this.spuId,
|
||||
this.barCode,
|
||||
this.spec,
|
||||
this.unit,
|
||||
this.status,
|
||||
this.packageNum,
|
||||
this.purchasePrice,
|
||||
this.retailPrice,
|
||||
this.promotionPrice,
|
||||
});
|
||||
|
||||
factory ServiceSupermarketSkuPackage.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceSupermarketSkuPackageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceSupermarketSkuPackageToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceSupermarketSkuPage extends ServicePageBase {
|
||||
List<ServiceSupermarketSku>? records;
|
||||
|
||||
ServiceSupermarketSkuPage({
|
||||
this.records,
|
||||
});
|
||||
|
||||
factory ServiceSupermarketSkuPage.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceSupermarketSkuPageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceSupermarketSkuPageToJson(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// 超市 sku end
|
||||
// **************************************************************************
|
||||
@@ -56,3 +56,178 @@ Map<String, dynamic> _$ServiceProductToJson(ServiceProduct instance) =>
|
||||
'categoryType': instance.categoryType,
|
||||
'saleDate': instance.saleDate?.toIso8601String(),
|
||||
};
|
||||
|
||||
ServiceSupermarketSpu _$ServiceSupermarketSpuFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceSupermarketSpu(
|
||||
id: json['id'] as String?,
|
||||
productCode: json['productCode'] as String?,
|
||||
productName: json['productName'] as String?,
|
||||
unit: json['unit'] as String?,
|
||||
spec: json['spec'] as String?,
|
||||
categoryId: json['categoryId'] as String?,
|
||||
picUrl: json['picUrl'] as String?,
|
||||
stock: json['stock'] as String?,
|
||||
productNature: json['productNature'] as String?,
|
||||
retailPrice: json['retailPrice'] as String?,
|
||||
promotionPrice: (json['promotionPrice'] as num?)?.toInt(),
|
||||
salesCount: (json['salesCount'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceSupermarketSpuToJson(
|
||||
ServiceSupermarketSpu instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'productCode': instance.productCode,
|
||||
'productName': instance.productName,
|
||||
'unit': instance.unit,
|
||||
'spec': instance.spec,
|
||||
'categoryId': instance.categoryId,
|
||||
'picUrl': instance.picUrl,
|
||||
'stock': instance.stock,
|
||||
'productNature': instance.productNature,
|
||||
'retailPrice': instance.retailPrice,
|
||||
'promotionPrice': instance.promotionPrice,
|
||||
'salesCount': instance.salesCount,
|
||||
};
|
||||
|
||||
ServiceSupermarketSpuPage _$ServiceSupermarketSpuPageFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceSupermarketSpuPage(
|
||||
records: (json['records'] as List<dynamic>?)
|
||||
?.map(
|
||||
(e) => ServiceSupermarketSpu.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> _$ServiceSupermarketSpuPageToJson(
|
||||
ServiceSupermarketSpuPage instance) =>
|
||||
<String, dynamic>{
|
||||
'current': instance.current,
|
||||
'pages': instance.pages,
|
||||
'size': instance.size,
|
||||
'total': instance.total,
|
||||
'records': instance.records,
|
||||
};
|
||||
|
||||
ServiceSupermarketSku _$ServiceSupermarketSkuFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceSupermarketSku(
|
||||
id: json['id'] as String?,
|
||||
productCode: json['productCode'] as String?,
|
||||
productName: json['productName'] as String?,
|
||||
categoryId: json['categoryId'] as String?,
|
||||
picUrl: json['picUrl'] as String?,
|
||||
stock: (json['stock'] as num?)?.toDouble(),
|
||||
merchantId: json['merchantId'] as String?,
|
||||
origin: json['origin'] as String?,
|
||||
productNature: json['productNature'] as String?,
|
||||
brandId: json['brandId'] as String?,
|
||||
supplierId: json['supplierId'] as String?,
|
||||
salesCount: (json['salesCount'] as num?)?.toInt(),
|
||||
supermarketAuxiliaryCodeEntityList:
|
||||
(json['supermarketAuxiliaryCodeEntityList'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
ServiceSupermarketSkuCode.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
supermarketUnitEntityList: (json['supermarketUnitEntityList']
|
||||
as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
ServiceSupermarketSkuPackage.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceSupermarketSkuToJson(
|
||||
ServiceSupermarketSku instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'productCode': instance.productCode,
|
||||
'productName': instance.productName,
|
||||
'categoryId': instance.categoryId,
|
||||
'picUrl': instance.picUrl,
|
||||
'stock': instance.stock,
|
||||
'merchantId': instance.merchantId,
|
||||
'origin': instance.origin,
|
||||
'productNature': instance.productNature,
|
||||
'brandId': instance.brandId,
|
||||
'supplierId': instance.supplierId,
|
||||
'salesCount': instance.salesCount,
|
||||
'supermarketAuxiliaryCodeEntityList':
|
||||
instance.supermarketAuxiliaryCodeEntityList,
|
||||
'supermarketUnitEntityList': instance.supermarketUnitEntityList,
|
||||
};
|
||||
|
||||
ServiceSupermarketSkuCode _$ServiceSupermarketSkuCodeFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceSupermarketSkuCode(
|
||||
id: json['id'] as String?,
|
||||
spuId: json['spuId'] as String?,
|
||||
unitId: json['unitId'] as String?,
|
||||
barCode: json['barCode'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceSupermarketSkuCodeToJson(
|
||||
ServiceSupermarketSkuCode instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'spuId': instance.spuId,
|
||||
'unitId': instance.unitId,
|
||||
'barCode': instance.barCode,
|
||||
};
|
||||
|
||||
ServiceSupermarketSkuPackage _$ServiceSupermarketSkuPackageFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceSupermarketSkuPackage(
|
||||
id: json['id'] as String?,
|
||||
spuId: json['spuId'] as String?,
|
||||
barCode: json['barCode'] as String?,
|
||||
spec: json['spec'] as String?,
|
||||
unit: json['unit'] as String?,
|
||||
status: (json['status'] as num?)?.toInt(),
|
||||
packageNum: (json['packageNum'] as num?)?.toInt(),
|
||||
purchasePrice: (json['purchasePrice'] as num?)?.toInt(),
|
||||
retailPrice: (json['retailPrice'] as num?)?.toInt(),
|
||||
promotionPrice: (json['promotionPrice'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceSupermarketSkuPackageToJson(
|
||||
ServiceSupermarketSkuPackage instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'spuId': instance.spuId,
|
||||
'barCode': instance.barCode,
|
||||
'spec': instance.spec,
|
||||
'unit': instance.unit,
|
||||
'status': instance.status,
|
||||
'packageNum': instance.packageNum,
|
||||
'purchasePrice': instance.purchasePrice,
|
||||
'retailPrice': instance.retailPrice,
|
||||
'promotionPrice': instance.promotionPrice,
|
||||
};
|
||||
|
||||
ServiceSupermarketSkuPage _$ServiceSupermarketSkuPageFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ServiceSupermarketSkuPage(
|
||||
records: (json['records'] as List<dynamic>?)
|
||||
?.map(
|
||||
(e) => ServiceSupermarketSku.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> _$ServiceSupermarketSkuPageToJson(
|
||||
ServiceSupermarketSkuPage instance) =>
|
||||
<String, dynamic>{
|
||||
'current': instance.current,
|
||||
'pages': instance.pages,
|
||||
'size': instance.size,
|
||||
'total': instance.total,
|
||||
'records': instance.records,
|
||||
};
|
||||
Reference in new issue
Block a user