| | |
| | | if (buyNode >= Integer.parseInt(buyNodeCodeCntDic.getValue())) { |
| | | throw new FebsException("Do not repeat purchase"); |
| | | } |
| | | /** |
| | | * 限购总数200 |
| | | */ |
| | | |
| | | DataDictionaryCustom perKNumDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.PERK_NUM.getType(), |
| | | DataDictionaryEnum.PERK_NUM.getCode() |
| | | ); |
| | | int perKNum = Integer.parseInt(ObjectUtil.isEmpty(perKNumDic) ? "200" : perKNumDic.getValue()); |
| | | |
| | | List<DappMemberEntity> dappMemberEntities = dappMemberDao.selectList(null); |
| | | int sum1 = dappMemberEntities.stream().mapToInt(DappMemberEntity::getBuyNode).sum(); |
| | | if(perKNum < sum1 + 1){ |
| | | throw new FebsException("节点已售完"); |
| | | } |
| | | |
| | | if (ObjectUtil.isEmpty(transferDto.getId())) { |
| | | DappFundFlowEntity fundFlow = new DappFundFlowEntity( |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse agreeWithdraw(Long id) { |
| | | MemberCoinWithdrawEntity memberCoinWithdrawEntity = memberCoinWithdrawDao.selectById(id); |
| | | if(ObjectUtil.isEmpty(memberCoinWithdrawEntity)){ |
| | | throw new FebsException("刷新页面重试"); |
| | | } |
| | | |
| | | if (MemberCoinWithdrawEntity.STATUS_DOING != memberCoinWithdrawEntity.getStatus()) { |
| | | throw new FebsException("非可审核状态"); |
| | | } |
| | | memberCoinWithdrawEntity.setStatus(MemberCoinWithdrawEntity.STATUS_YES); |
| | | memberCoinWithdrawDao.updateById(memberCoinWithdrawEntity); |
| | | |
| | | DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectById(memberCoinWithdrawEntity.getFlowId()); |
| | | dappFundFlowEntity.setStatus(DappFundFlowEntity.WITHDRAW_STATUS_AGREE); |
| | | dappFundFlowDao.updateById(dappFundFlowEntity); |
| | | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse disagreeWithdraw(Long id) { |
| | | MemberCoinWithdrawEntity memberCoinWithdrawEntity = memberCoinWithdrawDao.selectById(id); |
| | | if(ObjectUtil.isEmpty(memberCoinWithdrawEntity)){ |
| | | throw new FebsException("刷新页面重试"); |
| | | } |
| | | |
| | | if (MemberCoinWithdrawEntity.STATUS_DOING != memberCoinWithdrawEntity.getStatus()) { |
| | | throw new FebsException("非可审核状态"); |
| | | } |
| | | |
| | | DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectById(memberCoinWithdrawEntity.getFlowId()); |
| | | if (dappFundFlowEntity == null) { |
| | | throw new FebsException("审核失败,联系管理员"); |
| | | } |
| | | memberCoinWithdrawEntity.setStatus(MemberCoinWithdrawEntity.STATUS_NO); |
| | | memberCoinWithdrawDao.updateById(memberCoinWithdrawEntity); |
| | | |
| | | dappFundFlowEntity.setStatus(DappFundFlowEntity.WITHDRAW_STATUS_DISAGREE); |
| | | dappFundFlowDao.updateById(dappFundFlowEntity); |
| | | |
| | | this.updateWalletCoinWithLock(memberCoinWithdrawEntity.getAmount(), memberCoinWithdrawEntity.getMemberId(), 1); |
| | | this.updateWalletMineWithLock(memberCoinWithdrawEntity.getFeeAmount(), memberCoinWithdrawEntity.getMemberId(), 1); |
| | | |
| | | DappFundFlowEntity feeFlow = new DappFundFlowEntity(memberCoinWithdrawEntity.getMemberId(), memberCoinWithdrawEntity.getFeeAmount(), 22, 2, null, null); |
| | | dappFundFlowDao.insert(feeFlow); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | public MemberNodeVo buildTeamMatrix(DbMemberNode dbMemberNode) { |
| | | Long id = dbMemberNode.getId(); |
| | | |