| | |
| | | throw new FebsException("Limit per address 100 USDT"); |
| | | } |
| | | |
| | | BigDecimal amountInLast = dappChargeUsdtMapper.selectByMaxAmountMemberId(member.getId()); |
| | | // BigDecimal amountInLast = dappChargeUsdtMapper.selectByMaxAmountMemberId(member.getId()); |
| | | /** |
| | | * 限制用户买入总额, |
| | | * 目前每人限一单,总金额限制100U |
| | | */ |
| | | BigDecimal amountInLast = dappChargeUsdtMapper.selectBySumAmountMemberId(member.getId()); |
| | | DataDictionaryCustom systemAddressDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PoolEnum.SYSTEM_ADDRESS.getType(), |
| | | PoolEnum.SYSTEM_ADDRESS.getCode() |
| | | ); |
| | | if(StrUtil.isNotEmpty(systemAddressDic.getValue())){ |
| | | if(!systemAddressDic.getValue().equals(dappMemberEntity.getAddress())){ |
| | | if(!systemAddressDic.getValue().contains(dappMemberEntity.getAddress())){ |
| | | if(BigDecimal.ZERO.compareTo(amountInLast) < 0){ |
| | | throw new FebsException("Limit per address 100 USDT"); |
| | | } |
| | |
| | | dappFundFlowDao.insert(aCoinCntFlow); |
| | | |
| | | DappUsdtPerkEntity parentEntity = dappUsdtPerkEntityMapper.selectByMemberId(memberParent.getId()); |
| | | BigDecimal availableAmountParent = parentEntity.getAusdAmount(); |
| | | if(ObjectUtil.isEmpty(parentEntity)){ |
| | | parentEntity = new DappUsdtPerkEntity(); |
| | | parentEntity.setMemberId(memberParent.getId()); |
| | | dappUsdtPerkEntityMapper.insert(parentEntity); |
| | | } |
| | | BigDecimal availableAmountParent = ObjectUtil.isEmpty(parentEntity.getAusdAmount()) ? BigDecimal.ZERO : parentEntity.getAusdAmount(); |
| | | parentEntity.setAusdAmount(availableAmountParent.add(coinCnt)); |
| | | dappUsdtPerkEntityMapper.updateById(parentEntity); |
| | | //插入资产闪对的流水 |