KKSU
2024-08-28 57bd5c68e1f71aa9cbd0bf2d561a736db3b0cbbf
src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java
@@ -189,6 +189,14 @@
        if (!mallMember.getTradePassword().equals(SecureUtil.md5(withdrawalBalanceDto.getTradePwd()))) {
            throw new FebsException("支付密码错误");
        }
        DataDictionaryCustom coinWithdrawDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.COIN_WITHDRAW.getType(),
                DataDictionaryEnum.COIN_WITHDRAW.getCode()
        );
        if(!"1".equals(coinWithdrawDic.getValue())){
            throw new FebsException("暂未开放");
        }
        DataDictionaryCustom withdrawAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.WITHDRAW_AMOUNT.getType(),
@@ -200,6 +208,13 @@
            throw new FebsException("至少为"+withdrawAmount);
        }
//        boolean b = Integer.parseInt(amount.toString()) % Integer.parseInt(withdrawAmount.toString()) == 0;
        boolean b = amount.remainder(withdrawAmount).compareTo(BigDecimal.ZERO) == 0;
        if(!b){
            throw new FebsException("金额必须为"+withdrawAmount+"的整数倍");
        }
        MallMemberAmount mallMemberAmount = mallMemberAmountMapper.selectByMemberId(memberId);
        mallMemberAmount.setFcmCntAva(mallMemberAmount.getFcmCntAva().subtract(amount));
        mallMemberAmountMapper.updateFcmCntAvaById(mallMemberAmount);