| | |
| | | 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(); |
| | |
| | | 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(), |