【代码评审】商城:满减送订单

This commit is contained in:
YunaiV
2024-08-30 21:37:51 +08:00
parent 69d1a70900
commit 88cc4c987b
8 changed files with 19 additions and 9 deletions

View File

@@ -294,10 +294,13 @@ public class TradeOrderDO extends BaseDO {
*/
private Integer vipPrice;
// TODO @puhui999项了下貌似这里存储 List<Long> giveCouponIds 更合适。因为优惠劵赠送到最后是对应的编号,然后从而进行取消?
/**
* 赠送的优惠劵
*
* key: 优惠劵编号value对应的优惠券数量
* key: 优惠劵编号
* value对应的优惠券数量
*
* 目的:用于后续取消或者售后订单时,需要扣减赠送
*/
@TableField(typeHandler = JacksonTypeHandler.class)

View File

@@ -51,7 +51,7 @@ public class TradeCouponOrderHandler implements TradeOrderHandler {
if (CollUtil.isEmpty(order.getGiveCouponsMap())) {
return;
}
couponApi.takeBackCouponsByAdmin(order.getGiveCouponsMap(), order.getUserId());
couponApi.invalidateCouponsByAdmin(order.getGiveCouponsMap(), order.getUserId());
}
}