KKSU
2025-01-14 ebf31962a00aa4b3bb7d17274133821352f1522d
src/main/java/cc/mrbird/febs/mall/service/impl/RunVipServiceImpl.java
@@ -104,10 +104,12 @@
                        .orderByDesc(RunVipGrow::getId)
        ).stream().findFirst().orElse(null);
        if(runVipGrow != null){
            BigDecimal amountNow = runVipGrow.getAmountNow();
            reduceAmount = reduceAmount.add(amountNow);
            reduceAmount = runVipGrow.getAmountNow();
        }
        presentAmount = presentAmount.subtract(reduceAmount);
        if(BigDecimal.ZERO.compareTo(presentAmount) >= 0){
            throw new FebsException("支付异常,请刷新页面重试");
        }
        Long addressId = apiGoChargeDto.getAddressId();
        MallMemberPayment mallMemberPayment = mallMemberPaymentMapper.selectById(addressId);
@@ -201,10 +203,12 @@
                        .orderByDesc(RunVipGrow::getId)
        ).stream().findFirst().orElse(null);
        if(runVipGrow != null){
            BigDecimal amountNow = runVipGrow.getAmountNow();
            reduceAmount = reduceAmount.add(amountNow);
            reduceAmount = runVipGrow.getAmountNow();
        }
        presentAmount = presentAmount.subtract(reduceAmount);
        if(BigDecimal.ZERO.compareTo(presentAmount) >= 0){
            throw new FebsException("支付异常,请刷新页面重试");
        }
        MallMemberWallet mallMemberWallet = mallMemberWalletMapper.selectWalletByMemberId(memberId);
        if(mallMemberWallet.getCommission().compareTo(BigDecimal.ZERO) <= 0){
@@ -545,7 +549,7 @@
            BigDecimal presentPriceNext = runVipNext.getPresentPrice();
            if(presentPriceNext.compareTo(add) <= 0){
                mallCharge.setVipCode(runVipGrow.getLevelNext());
                mallCharge.setVipCode(runVipNext.getVipCode());
            }
        }
        mallChargeMapper.insert(mallCharge);
@@ -693,7 +697,7 @@
        ).stream().findFirst().orElse(null);
        if(runVipGrow != null){
            BigDecimal amountNow = runVipGrow.getAmountNow();
            reduceAmount = reduceAmount.add(amountNow);
            reduceAmount = amountNow;
        }
        apiReduceAmountVo.setReduceAmount(reduceAmount);
        return new FebsResponse().success().data(apiReduceAmountVo);