| | |
| | | * 用户的等级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("请先升级会员"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void withdrawal(WithdrawalDto withdrawalDto) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | MallMember loginMember = this.baseMapper.selectById(memberId); |
| | |
| | | /** |
| | | * 减少碳币,增加进行中提现记录 |
| | | */ |
| | | 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); |
| | |
| | | withdraw.setAmountFee(fee); |
| | | withdraw.setName(mallMemberPayment.getBank()); |
| | | withdraw.setType(mallMemberPayment.getBankNo()); |
| | | withdraw.setWithdrawTimes(withdrawalDto.getAmount()); |
| | | mallMemberWithdrawMapper.insert(withdraw); |
| | | |
| | | walletService.reduceBalance(withdrawalDto.getAmount(), loginMember.getId()); |
| | | this.runVipMoneyFlowAdd( |
| | | loginMember.getId(), |
| | | loginMember.getId(), |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void commissionChange(CommissionChangeDto commissionChange) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | BigDecimal minScore = new BigDecimal( |
| | |
| | | |
| | | |
| | | public static String hidePhoneNumber(String phoneNumber) { |
| | | //判断字符串的长度小于4就直接返回 |
| | | if (phoneNumber.length() < 4) { |
| | | return phoneNumber; |
| | | } |
| | | // 获取前3位和后4位 |
| | | String prefix = phoneNumber.substring(0, 3); |
| | | // 生成隐藏的电话号码 |