fix: 折扣金额修复

This commit is contained in:
张松 2024-11-21 18:19:12 +08:00
parent 9549aef3bd
commit c3409461c8
2 changed files with 4 additions and 1 deletions

View File

@ -204,6 +204,9 @@ public class TbCashierCart implements Serializable {
* 根据是否会员充值价格
*/
public void resetTotalAmount(BigDecimal discountRadio) {
if (discountRadio == null) {
discountRadio = BigDecimal.ONE;
}
if ("false".equals(isPack)) {
packFee = BigDecimal.ZERO;
}

View File

@ -1582,7 +1582,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
if (orderInfo != null && shopEatTypeInfoDTO != null) {
cashierCart.setIsMember(StrUtil.isBlank(orderInfo.getMemberId()) ? 0 : shopEatTypeInfoDTO.isMemberPrice() ? 1 : 0);
}
cashierCart.resetTotalAmount();
cashierCart.resetTotalAmount(orderInfo == null ? null : orderInfo.getDiscountRatio());
// 已经退款和使用优惠券的商品不进行统计金额
if (!"return".equals(cashierCart.getStatus()) && cashierCart.getUserCouponId() == null) {