KKSU
2024-12-30 95c54326a4e93c4084ad424a6edd3eb93195328d
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -495,7 +495,7 @@
         * 用户的等级level是否允许兑换碳币
         */
        RunVip runVip = runVipMapper.selectOne(new LambdaQueryWrapper<RunVip>().eq(RunVip::getVipCode, loginMember.getLevel()));
        if(ObjectUtil.isEmpty(runVip) || runVip.getWithdrawState() != YesOrNoEnum.YES.getValue()){
        if(ObjectUtil.isEmpty(runVip) || runVip.getInsideState() != YesOrNoEnum.YES.getValue()){
            throw new FebsException("请先升级会员");
        }
@@ -581,14 +581,20 @@
                        RunVipDataDictionaryEnum.RUN_VIP_BALANCE_TO_COIN_PERCENT.getType(),
                        RunVipDataDictionaryEnum.RUN_VIP_BALANCE_TO_COIN_PERCENT.getCode()).getValue()
        ).setScale(4, BigDecimal.ROUND_DOWN);
        BigDecimal withdrawalAmount = withdrawalDto.getAmount().multiply(balanceToCoin).setScale(2, BigDecimal.ROUND_DOWN);
        BigDecimal fee = balanceToCoinPercent;
//        BigDecimal fee = balanceToCoinPercent.multiply(withdrawalAmount).setScale(2, BigDecimal.ROUND_DOWN);
        BigDecimal withdrawalAmountReal = withdrawalAmount.subtract(fee);
        if(BigDecimal.ZERO.compareTo(withdrawalAmountReal) >= 0){
            throw new FebsException(minCnt+"手续费不足");
        }
        /**
         *  减少碳币,增加进行中提现记录
         */
        walletService.reduceBalance(withdrawalDto.getAmount(), loginMember.getId());
        BigDecimal withdrawalAmount = withdrawalDto.getAmount().multiply(balanceToCoin).setScale(2, BigDecimal.ROUND_DOWN);
        BigDecimal fee = balanceToCoinPercent.multiply(withdrawalAmount).setScale(2, BigDecimal.ROUND_DOWN);
        BigDecimal withdrawalAmountReal = withdrawalAmount.subtract(fee);
        String orderNo = MallUtils.getOrderNum("TX");
        MallMemberWithdraw withdraw = new MallMemberWithdraw();
        withdraw.setWithdrawNo(orderNo);
@@ -640,6 +646,11 @@
        RunVip runVip = runVipMapper.selectOne(new LambdaQueryWrapper<RunVip>().eq(RunVip::getVipCode, loginMember.getLevel()));
        if(ObjectUtil.isEmpty(runVip) || runVip.getChangeState() != YesOrNoEnum.YES.getValue()){
            throw new FebsException("请先升级会员");
        }
        MallMemberWallet mallMemberWallet = mallMemberWalletMapper.selectWalletByMemberId(memberId);
        if(minScore.compareTo(mallMemberWallet.getScore()) > 0){
            throw new FebsException("碳积分不足");
        }
        BigDecimal scoreBalancePercent = new BigDecimal(
@@ -1555,6 +1566,10 @@
    public static String hidePhoneNumber(String phoneNumber) {
        //判断字符串的长度小于4就直接返回
        if (phoneNumber.length() < 4) {
            return phoneNumber;
        }
        // 获取前3位和后4位
        String prefix = phoneNumber.substring(0, 3);
        // 生成隐藏的电话号码