fix: 折扣优惠券同时使用detail金额不准确修复
This commit is contained in:
parent
a4edefa252
commit
4a0a46b0b4
|
|
@ -194,6 +194,24 @@ public class TbCashierCart implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据是否会员充值价格
|
||||
*/
|
||||
public void resetTotalAmount(BigDecimal discountRadio) {
|
||||
if ("false".equals(isPack)) {
|
||||
packFee = BigDecimal.ZERO;
|
||||
}
|
||||
if ("true".equals(isGift)) {
|
||||
totalAmount = packFee;
|
||||
} else {
|
||||
if (isMember != null && isMember == 1 && memberPrice != null && memberPrice.compareTo(BigDecimal.ZERO) > 0) {
|
||||
totalAmount = totalNumber.multiply(memberPrice).add(packFee).multiply(discountRadio);
|
||||
} else {
|
||||
totalAmount = totalNumber.multiply(discountSaleAmount != null ? discountSaleAmount : salePrice).add(packFee).multiply(discountRadio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取总价不包含打包费
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1372,6 +1372,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
resetCouponList.add(cashierCart);
|
||||
cashierCart.setUserCouponId(null);
|
||||
}
|
||||
cashierCart.resetTotalAmount(orderInfo.getDiscountRatio());
|
||||
discountAmount = reduceProCoupon(couponMap, cashierCart, usedCouponMap, discountAmount, balanceCartList, outRecords, memberId);
|
||||
}
|
||||
|
||||
|
|
@ -2196,6 +2197,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
BigDecimal finalAmount = orderInfo.getOrderAmount().multiply(BigDecimal.valueOf(payDTO.getDiscount())).setScale(2, RoundingMode.HALF_UP);
|
||||
BigDecimal discountAmount = oldAmount.subtract(finalAmount);
|
||||
orderInfo.setDiscountAmount(discountAmount);
|
||||
orderInfo.setDiscountRatio(BigDecimal.valueOf(payDTO.getDiscount()));
|
||||
orderInfo.setOrderAmount(finalAmount);
|
||||
orderInfo.setAmount(finalAmount);
|
||||
orderInfo.setSettlementAmount(finalAmount);
|
||||
|
|
|
|||
Loading…
Reference in New Issue