|
|
@@ -1962,6 +1962,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
* 使用优惠营销 订单金额抵扣
|
|
|
*/
|
|
|
public void deductOrderMoney(OrderDon orderDon, CouponUser couponUser, BigDecimal balance, User user, BigDecimal skuMoney, Integer goodsType) {
|
|
|
+ BigDecimal first_money = orderDon.getMoney();
|
|
|
//存在优惠券
|
|
|
if (couponUser != null) {
|
|
|
Long couponId = couponUser.getCouponId();
|
|
|
@@ -1981,6 +1982,9 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
orderDon.setMoney(subtractMoney);
|
|
|
couponMoney = orderDon.getRealMoney().subtract(subtractMoney);
|
|
|
}
|
|
|
+ if (couponMoney != null && couponMoney.compareTo(first_money) >= 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("支付金额不能小于优惠金额");
|
|
|
+ }
|
|
|
orderDon.setCouponMoney(couponMoney);
|
|
|
orderDon.setCouponUserId(couponUser.getId());
|
|
|
}
|