|
@@ -497,21 +497,20 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
throw BusinessRuntimeException.getInstance("车位与车队规格不一致");
|
|
throw BusinessRuntimeException.getInstance("车位与车队规格不一致");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //规格补贴id
|
|
|
|
|
+ Long subsidyId = payRequest.getSubsidyId();
|
|
|
|
|
+ if (subsidyId != null) {
|
|
|
|
|
+ //校验百亿补贴规格,并设置参数
|
|
|
|
|
+ setSubsidyOrderDonInfo(subsidyId, user, orderDon);
|
|
|
|
|
+ }
|
|
|
if (sku != null) {
|
|
if (sku != null) {
|
|
|
//扣除使用优惠券、余额的订单金额
|
|
//扣除使用优惠券、余额的订单金额
|
|
|
- deductOrderMoney(orderDon, couponUser, payRequest.getBalance(), user, sku.getPrice(), goodsDon.getType(), payRequest.getGcCash(), payRequest.getGcpIds(), payRequest.getIsAcReduce());
|
|
|
|
|
|
|
+ deductOrderMoney(orderDon, couponUser, payRequest.getBalance(), user, sku.getPrice(), goodsDon.getType(), payRequest.getGcCash(), payRequest.getGcpIds(), payRequest.getIsAcReduce(), subsidyId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (isSpecificPrice && (orderDon.getMoney().compareTo(BigDecimal.ZERO) == 0 || orderDon.getMoney().compareTo(specificPrice) != 0)) {
|
|
if (isSpecificPrice && (orderDon.getMoney().compareTo(BigDecimal.ZERO) == 0 || orderDon.getMoney().compareTo(specificPrice) != 0)) {
|
|
|
throw BusinessRuntimeException.getInstance("专属价格不支持使用其他优惠");
|
|
throw BusinessRuntimeException.getInstance("专属价格不支持使用其他优惠");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //规格补贴id
|
|
|
|
|
- Long subsidyId = payRequest.getSubsidyId();
|
|
|
|
|
- if (subsidyId != null) {
|
|
|
|
|
- //校验百亿补贴规格,并设置参数
|
|
|
|
|
- setSubsidyOrderDonInfo(subsidyId, user, orderDon);
|
|
|
|
|
- }
|
|
|
|
|
orderDon.setPayDesc(goodsDon.getPayDesc());
|
|
orderDon.setPayDesc(goodsDon.getPayDesc());
|
|
|
//设置订单支付商品信息
|
|
//设置订单支付商品信息
|
|
|
setOrderDonPayTile(isGiftCardPay, gcPayInfo, giftCards, orderDon, goodsDon, sku, dpSkuIds);
|
|
setOrderDonPayTile(isGiftCardPay, gcPayInfo, giftCards, orderDon, goodsDon, sku, dpSkuIds);
|
|
@@ -957,7 +956,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
}
|
|
|
orderDon.setRealMoney(orderDon.getMoney());
|
|
orderDon.setRealMoney(orderDon.getMoney());
|
|
|
//扣除使用优惠券、余额的订单金额
|
|
//扣除使用优惠券、余额的订单金额
|
|
|
- deductOrderMoney(orderDon, couponUser, payRequest.getBalance(), user, sku.getPrice(), goodsDon.getType(), payRequest.getGcCash(), payRequest.getGcpIds(), false);
|
|
|
|
|
|
|
+ deductOrderMoney(orderDon, couponUser, payRequest.getBalance(), user, sku.getPrice(), goodsDon.getType(), payRequest.getGcCash(), payRequest.getGcpIds(), false, null);
|
|
|
this.saveOrUpdate(orderDon);
|
|
this.saveOrUpdate(orderDon);
|
|
|
if (orderDon.getStatus() == OrderDon.Status.noPayment) {
|
|
if (orderDon.getStatus() == OrderDon.Status.noPayment) {
|
|
|
jobManager.addJob(EXPIRY_TIME, () -> {
|
|
jobManager.addJob(EXPIRY_TIME, () -> {
|
|
@@ -2045,13 +2044,13 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
/**
|
|
/**
|
|
|
* 使用优惠营销 订单金额抵扣
|
|
* 使用优惠营销 订单金额抵扣
|
|
|
*/
|
|
*/
|
|
|
- public void deductOrderMoney(OrderDon orderDon, CouponUser couponUser, BigDecimal balance, User user, BigDecimal skuMoney, Integer goodsType, BigDecimal gcCash, List<Long> gcpIds, Boolean isAcReduce) {
|
|
|
|
|
|
|
+ public void deductOrderMoney(OrderDon orderDon, CouponUser couponUser, BigDecimal balance, User user, BigDecimal skuMoney, Integer goodsType, BigDecimal gcCash, List<Long> gcpIds, Boolean isAcReduce, Long subsidyId) {
|
|
|
if (gcCash != null && gcCash.compareTo(BigDecimal.ZERO) > 0 && couponUser != null) {
|
|
if (gcCash != null && gcCash.compareTo(BigDecimal.ZERO) > 0 && couponUser != null) {
|
|
|
throw BusinessRuntimeException.getInstance("现金卡不能与其他优惠叠加使用");
|
|
throw BusinessRuntimeException.getInstance("现金卡不能与其他优惠叠加使用");
|
|
|
}
|
|
}
|
|
|
BigDecimal first_money = orderDon.getMoney();
|
|
BigDecimal first_money = orderDon.getMoney();
|
|
|
//礼品卡现金支付 不参与其他优惠
|
|
//礼品卡现金支付 不参与其他优惠
|
|
|
- if (gcCash != null && gcCash.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
|
|
+ if (subsidyId == null && gcCash != null && gcCash.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
if (CollUtil.isEmpty(gcpIds)) {
|
|
if (CollUtil.isEmpty(gcpIds)) {
|
|
|
throw BusinessRuntimeException.getInstance("礼品卡现金支付参数异常");
|
|
throw BusinessRuntimeException.getInstance("礼品卡现金支付参数异常");
|
|
|
}
|
|
}
|
|
@@ -2103,7 +2102,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
//存在优惠券
|
|
//存在优惠券
|
|
|
- if (couponUser != null) {
|
|
|
|
|
|
|
+ if (couponUser != null && subsidyId == null) {
|
|
|
Long couponId = couponUser.getCouponId();
|
|
Long couponId = couponUser.getCouponId();
|
|
|
Coupon coupon = couponMapper.getCouponById(couponId);
|
|
Coupon coupon = couponMapper.getCouponById(couponId);
|
|
|
BigDecimal couponMoney = null;
|
|
BigDecimal couponMoney = null;
|
|
@@ -2143,7 +2142,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
orderDon.setCouponUserId(couponUser.getId());
|
|
orderDon.setCouponUserId(couponUser.getId());
|
|
|
}
|
|
}
|
|
|
//特殊渠道推广优惠. 360
|
|
//特殊渠道推广优惠. 360
|
|
|
- if (orderDon.getPopularizeId() != null && orderDon.getPopularizeId() != 0L) {
|
|
|
|
|
|
|
+ if (subsidyId == null && orderDon.getPopularizeId() != null && orderDon.getPopularizeId() != 0L) {
|
|
|
//使用了优惠券 不再使用360渠道 折扣
|
|
//使用了优惠券 不再使用360渠道 折扣
|
|
|
if (couponUser == null && goodsType == 1) {
|
|
if (couponUser == null && goodsType == 1) {
|
|
|
//百度渠道 专门优惠链接
|
|
//百度渠道 专门优惠链接
|