mall:调整 trade 订单的设计

This commit is contained in:
YunaiV 2022-08-12 00:04:05 +08:00
parent face9cae76
commit 00863fdbac
2 changed files with 85 additions and 60 deletions

View File

@ -109,26 +109,43 @@ public class TradeOrderDO extends BaseDO {
private Date payTime;
// ========== 价格 + 支付基本信息 ==========
// 价格文档 - 淘宝https://open.taobao.com/docV3.htm?docId=108471&docType=1
// TODO promotion_details(订单优惠信息明细商品和订单级优惠一般都在里面)
/**
* 购买商品总金额单位
* 商品原价单位
*
* 基于 {@link TradeOrderItemDO#getTotalOriginalPrice()} 求和
*/
private Integer buyPrice; // niu - goods_money
private Integer skuOriginalPrice; // niu - goods_money
/**
* 商品优惠单位
*
* 基于 {@link TradeOrderItemDO#getTotalPromotionPrice()} 求和
*/
private Integer skuPromotionPrice;
/**
* 订单优惠单位
*
* 例如说满减折扣不包括优惠劵商品优惠
*/
private Integer orderPromotionPrice; // niu - promotion_moneytaobao - discount_fee主订单优惠
/**
* 运费金额单位
*/
private Integer deliveryPrice; // niu - delivery_money
private Integer deliveryPrice; // niu - delivery_moneytaobao - post_fee订单邮费
// TODO 芋艿taobao trade.adjust_fee/order.adjust_fee调整金额卖家手动修改订单价格官方数据修复等等
/**
* 最终金额单位
* 应付金额单位
*
* presentPrice = buyPrice + deliveryPrice - couponPrice - integralPrice - marketPrice
* = {@link #skuOriginalPrice}
* + {@link #deliveryPrice}
* - {@link #skuPromotionPrice}
* - {@link #orderPromotionPrice}
* - {@link #couponPrice}
*/
private Integer presentPrice; // niu - order_money
/**
* 实际已支付金额单位
*
* 初始时金额为 0 等到支付成功后会进行更新
*/
private Integer payPrice; // niu - pay_money
private Integer payPrice; // niu - pay_moneytaobao - payment主订单实付金额 | trade.total_fee主订单应付金额参考使用
/**
* 支付订单编号
*
@ -137,8 +154,10 @@ public class TradeOrderDO extends BaseDO {
private Long payOrderId;
/**
* 支付成功的支付渠道
*
* 对应 PayChannelEnum 枚举
*/
private Integer payType;
private Integer payChannel;
// ========== 收件 + 物流基本信息 ==========
/**
@ -226,20 +245,14 @@ public class TradeOrderDO extends BaseDO {
* 优惠劵减免金额单位
*/
private Integer couponPrice; // niu - coupon_money
/**
* 营销减免金额单位
*
* 例如说满减折扣
*/
private Integer marketPrice; // niu - promotion_money
/**
* 积分抵扣的金额单位
*/
private Integer integralPrice;
/**
* 使用的积分
*/
private Integer useIntegral;
// /**
// * 积分抵扣的金额单位
// */
// private Integer integralPrice;
// /**
// * 使用的积分
// */
// private Integer useIntegral;
// TODO ========== 待定字段yv =========
// TODO cart_id购物车 id

View File

@ -41,12 +41,18 @@ public class TradeOrderItemDO extends BaseDO {
private Long orderId;
// ========== 商品基本信息 ==========
/**
* 商品 SPU 编号
*
* 关联 ProductSkuDO spuId 编号
*/
private Long spuId;
/**
* 商品 SKU 编号
*
* 关联 ProductSkuDO id 编号
*/
private Integer skuId;
private Long skuId;
/**
* 规格值数组JSON 格式
*/
@ -74,46 +80,51 @@ public class TradeOrderItemDO extends BaseDO {
// ========== 价格 + 支付基本信息 ==========
/**
* 购买单价单位
* 商品原价单位
*
* 对应 ProductSkuDO price 字段
*/
private Integer buyPrice; // like - original_priceniu - costPrice
private Integer originalPrice; // like - original_priceniu - costPrice
/**
* 最终单价单位
*/
private Integer presentPrice; // like - goods_priceniu - price
/**
* 购买总金额单位
*/
private Integer buyTotal; // like - total_priceniu - 暂无
/**
* 最终总金额单位
* 商品原价单位
*
* 注意presentPrice * count 不一定等于 presentTotal
* 因为存在无法整除的情况
* 举个例子presentPrice = 8.33 stock = 3 的情况presentTotal 有可能是 24.99 也可能是 25
* 所以需要存储一个该字段
* = {@link #originalPrice} * {@link #count}
*/
private Integer presentTotal; // like - total_pay_priceniu - goods_money
private Integer totalOriginalPrice; // like - total_priceniu - 暂无
/**
* 商品级优惠单位
*
* 例如说限时折扣商品原价的 8 商品原价的减 50
*/
private Integer totalPromotionPrice; // taobao - order.discount_fee子订单商品优惠
/**
* 最终购买金额单位
*
* = {@link #totalPresentPrice} / {@link #count}
*/
private Integer presentPrice;
/**
* 最终购买金额单位
*
* = {@link #totalOriginalPrice}
* - {@link #totalPromotionPrice}
*/
private Integer totalPresentPrice; // like - total_pay_priceniu - goods_money; taobao - order.payment子订单实付金额不算主订单分摊金额 | order.total_fee子订单应付金额参考使用
// TODO 芋艿part_mjz_discount(子订单分摊金额)本质上totalOriginalPrice - totalPayPrice
/**
* 应付金额单位
*/
private Integer totalPayPrice; // taobao - divide_order_fee 分摊后子订单实付金额
// ========== 营销基本信息 ==========
/**
* 优惠劵满减金额单位
*/
private Integer couponTotal; // like - discount_priceniu - coupon_money
/**
* 营销减免金额单位
*/
private Integer marketTotal; // like - discount_priceniu - promotion_money
/**
* 积分抵扣的金额单位
*/
private Integer integralTotal; // like - integral_priceniu - point_money
/**
* 使用的积分
*/
private Integer useIntegral; // niu - use_point
// /**
// * 积分抵扣的金额单位
// */
// private Integer integralTotal; // like - integral_priceniu - point_money
// /**
// * 使用的积分
// */
// private Integer useIntegral; // niu - use_point
// ========== 退款基本信息 ==========
/**
@ -193,5 +204,6 @@ public class TradeOrderItemDO extends BaseDO {
// TODO refund_status '退款状态'
// TODO refund_type '退款状态'
// TODO 一堆退款字段
}