mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-13 17:51:53 +08:00
mall + trade:调整价格字段,更易懂
This commit is contained in:
@@ -73,9 +73,6 @@ public class TradeOrderBaseVO {
|
||||
@Schema(description = "商品原价(总)", required = true, example = "1000")
|
||||
private Integer originalPrice;
|
||||
|
||||
@Schema(description = "订单原价(总)", required = true, example = "1000")
|
||||
private Integer orderPrice;
|
||||
|
||||
@Schema(description = "订单优惠(总)", required = true, example = "100")
|
||||
private Integer discountPrice;
|
||||
|
||||
|
@@ -59,10 +59,7 @@ public class AppTradeOrderDetailRespVO {
|
||||
private String payChannelCode;
|
||||
|
||||
@Schema(description = "商品原价(总)", required = true, example = "1000")
|
||||
private Integer originalPrice;
|
||||
|
||||
@Schema(description = "订单原价(总)", required = true, example = "1000")
|
||||
private Integer orderPrice;
|
||||
private Integer totalPrice;
|
||||
|
||||
@Schema(description = "订单优惠(总)", required = true, example = "100")
|
||||
private Integer discountPrice;
|
||||
|
@@ -2,13 +2,8 @@ package cn.iocoder.yudao.module.trade.dal.dataobject.order;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.TerminalEnum;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.promotion.api.price.dto.PriceCalculateRespDTO.OrderItem;
|
||||
import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderCancelTypeEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderRefundStatusEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderDeliveryStatusEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderTypeEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
@@ -134,25 +129,15 @@ public class TradeOrderDO extends BaseDO {
|
||||
private String payChannelCode;
|
||||
|
||||
/**
|
||||
* 商品原价(总),单位:分
|
||||
* 商品原价,单位:分
|
||||
*
|
||||
* totalPrice = {@link TradeOrderItemDO#getPrice()} * {@link TradeOrderItemDO#getCount()} 求和
|
||||
*
|
||||
* 对应 taobao 的 trade.total_fee 字段
|
||||
*/
|
||||
private Integer totalPrice;
|
||||
// TODO 芋艿:是不是要删除这个字段?
|
||||
/**
|
||||
* 订单原价(总),单位:分
|
||||
*
|
||||
* 1. orderPrice = {@link OrderItem#getPayPrice()} 求和
|
||||
* 2. orderPrice = {@link #totalPrice} - 商品级优惠
|
||||
*/
|
||||
private Integer orderPrice;
|
||||
/**
|
||||
* 订单优惠(总),单位:分
|
||||
*
|
||||
* 订单级优惠:对主订单的优惠,常见如:订单满 200 元减 10 元;订单满 80 包邮。
|
||||
* 优惠金额,单位:分
|
||||
*
|
||||
* 对应 taobao 的 order.discount_fee 字段
|
||||
*/
|
||||
@@ -162,7 +147,7 @@ public class TradeOrderDO extends BaseDO {
|
||||
*/
|
||||
private Integer deliveryPrice;
|
||||
/**
|
||||
* 订单调价(总),单位:分
|
||||
* 订单调价,单位:分
|
||||
*
|
||||
* 正数,加价;负数,减价
|
||||
*/
|
||||
@@ -170,11 +155,11 @@ public class TradeOrderDO extends BaseDO {
|
||||
/**
|
||||
* 应付金额(总),单位:分
|
||||
*
|
||||
* = {@link OrderItem#getPayPrice()} 求和
|
||||
* = {@link #totalPrice}
|
||||
* - {@link #couponPrice}
|
||||
* - {@link #pointPrice}
|
||||
* + {@link #deliveryPrice}
|
||||
* - {@link #discountPrice}
|
||||
* + {@link #deliveryPrice}
|
||||
* + {@link #adjustPrice}
|
||||
*/
|
||||
private Integer payPrice;
|
||||
|
@@ -102,44 +102,47 @@ public class TradeOrderItemDO extends BaseDO {
|
||||
*/
|
||||
private Integer price;
|
||||
/**
|
||||
* 商品优惠(总),单位:分
|
||||
*
|
||||
* 商品级优惠:对单个商品的,常见如:商品原价的 8 折;商品原价的减 50 元
|
||||
* 优惠金额(总),单位:分
|
||||
*
|
||||
* 对应 taobao 的 order.discount_fee 字段
|
||||
*/
|
||||
private Integer discountPrice;
|
||||
/**
|
||||
* 子订单实付金额(总),不算主订单分摊金额,单位:分
|
||||
* 运费金额(总),单位:分
|
||||
*/
|
||||
private Integer deliveryPrice;
|
||||
/**
|
||||
* 订单调价(总),单位:分
|
||||
*
|
||||
* 正数,加价;负数,减价
|
||||
*/
|
||||
private Integer adjustPrice;
|
||||
/**
|
||||
* 应付金额(总),单位:分
|
||||
*
|
||||
* = {@link #price} * {@link #count}
|
||||
* - {@link #couponPrice}
|
||||
* - {@link #pointPrice}
|
||||
* - {@link #discountPrice}
|
||||
*
|
||||
* 对应 taobao 的 order.payment 字段
|
||||
* + {@link #deliveryPrice}
|
||||
* + {@link #adjustPrice}
|
||||
*/
|
||||
private Integer payPrice;
|
||||
|
||||
/**
|
||||
* 子订单分摊金额(总),单位:分
|
||||
* 需要分摊 {@link TradeOrderDO#getDiscountPrice()}、{@link TradeOrderDO#getCouponPrice()}、{@link TradeOrderDO#getPointPrice()}
|
||||
*
|
||||
* 对应 taobao 的 order.part_mjz_discount 字段
|
||||
* 淘宝说明:子订单分摊优惠基础逻辑:一般正常优惠券和满减优惠按照子订单的金额进行分摊,特殊情况如果优惠券是指定商品使用的,只会分摊到对应商品子订单上不分摊。
|
||||
*/
|
||||
private Integer orderPartPrice;
|
||||
/**
|
||||
* 分摊后子订单实付金额(总),单位:分
|
||||
*
|
||||
* = {@link #payPrice}
|
||||
* - {@link #orderPartPrice}
|
||||
*
|
||||
* 对应 taobao 的 divide_order_fee 字段
|
||||
*/
|
||||
private Integer orderDividePrice;
|
||||
|
||||
// ========== 营销基本信息 ==========
|
||||
|
||||
// TODO 芋艿:在捉摸一下
|
||||
/**
|
||||
* 优惠劵减免金额,单位:分
|
||||
*
|
||||
* 对应 taobao 的 trade.coupon_fee 字段
|
||||
*/
|
||||
private Integer couponPrice;
|
||||
/**
|
||||
* 积分抵扣的金额,单位:分
|
||||
*
|
||||
* 对应 taobao 的 trade.point_fee 字段
|
||||
*/
|
||||
private Integer pointPrice;
|
||||
|
||||
// ========== 售后基本信息 ==========
|
||||
/**
|
||||
|
@@ -97,7 +97,7 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService {
|
||||
}
|
||||
|
||||
// 申请的退款金额,不能超过商品的价格
|
||||
if (createReqVO.getRefundPrice() > orderItem.getOrderDividePrice()) {
|
||||
if (createReqVO.getRefundPrice() > orderItem.getPayPrice()) {
|
||||
throw exception(AFTER_SALE_CREATE_FAIL_REFUND_PRICE_ERROR);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user