xiaoyong931011
2023-04-13 fb7ceea5c8c116c955be4b4ff58b56e410da1940
src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java
@@ -81,9 +81,14 @@
        if(withdrawalDto.getAmount().compareTo(wallet.getBalance()) > 0) {
            throw new FebsException("金额不足");
        }
        BigDecimal commission = wallet.getCommission();
        if(withdrawalDto.getAmount().compareTo(commission) > 0){
            throw new FebsException("金额不足");
        }
        BigDecimal serviceFee = cashOutSettingVo.getServiceFee().multiply(BigDecimal.valueOf(0.01));
        walletService.reduce(withdrawalDto.getAmount(), memberId, "balance");
        walletService.reduce(withdrawalDto.getAmount(), memberId, "commission");
        String orderNo = MallUtils.getOrderNum("W");
        MallMemberWithdraw withdraw = new MallMemberWithdraw();
@@ -166,6 +171,16 @@
                1,
                FlowTypeEnum.SCORE.getValue());
        mallMemberService.addMoneyFlow(memberId,
                scoreAmount,
                MoneyFlowTypeEnum.SCORE_TO_CASH.getValue(),
                orderNo,
                null,
                null,
                null,
                1,
                FlowTypeEnum.BALANCE.getValue());
        //卖出规则:卖出即销毁减少,70%现金到帐.30%回流底池,意味卖出后全网积分变少了,回流的30%到池子后.积分的价格变高了
        DataDictionaryCustom poolCashDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                PerkEnum.POOL_CASH.getType(),