| | |
| | | coinACntDic.setValue(coinACnt.toString()); |
| | | dataDictionaryCustomMapper.updateById(coinACntDic); |
| | | |
| | | coinAPrice = coinAUsdtCnt.divide(coinACnt,8,BigDecimal.ROUND_DOWN); |
| | | coinAPrice = coinAUsdtCnt.divide(coinACnt,12,BigDecimal.ROUND_DOWN); |
| | | aCoinPriceDic.setValue(coinAPrice.toString()); |
| | | dataDictionaryCustomMapper.updateById(aCoinPriceDic); |
| | | |
| | |
| | | BigDecimal ausdPrice = new BigDecimal(ausdPriceDic.getValue()); |
| | | BigDecimal ausdAmountNeed = ausdPercentUsdt.divide(ausdPrice); |
| | | if(BigDecimal.ZERO.compareTo(ausdAmount) >= 0){ |
| | | throw new FebsException("AUSD数量不足"); |
| | | throw new FebsException("AUSDT数量不足"); |
| | | } |
| | | if(ausdAmountNeed.compareTo(ausdAmount) > 0){ |
| | | throw new FebsException("AUSD数量不足"); |
| | | throw new FebsException("AUSDT数量不足"); |
| | | } |
| | | /** |
| | | * 出局复投要求等于戓大于自己上次投资金额 |
| | |
| | | this.updateWalletCoinWithLock(aCoinCntReal,memberParent.getId(),1); |
| | | //插入资产闪对的流水 |
| | | DappFundFlowEntity dappFundFlowEntity = new DappFundFlowEntity( |
| | | dappMemberEntity.getId(), |
| | | memberParent.getId(), |
| | | aCoinCntReal, |
| | | FundFlowEnum.ANDAO_MEMBER_TO_MENBER.getCode(), |
| | | 2, |
| | |
| | | PoolEnum.COIN_A_PRICE.getCode() |
| | | ); |
| | | BigDecimal coinAPrice = new BigDecimal(aCoinPriceDic.getValue()); |
| | | coinAPrice = coinAUsdtCnt.divide(coinACnt,8,BigDecimal.ROUND_DOWN); |
| | | coinAPrice = coinAUsdtCnt.divide(coinACnt,12,BigDecimal.ROUND_DOWN); |
| | | aCoinPriceDic.setValue(coinAPrice.toString()); |
| | | dataDictionaryCustomMapper.updateById(aCoinPriceDic); |
| | | |
| | |
| | | BigDecimal.ZERO); |
| | | dappFundFlowDao.insert(aCoinCntFlow); |
| | | |
| | | DappUsdtPerkEntity parentEntity = dappUsdtPerkEntityMapper.selectByMemberId(dappMemberEntity.getId()); |
| | | DappUsdtPerkEntity parentEntity = dappUsdtPerkEntityMapper.selectByMemberId(memberParent.getId()); |
| | | BigDecimal availableAmountParent = parentEntity.getAusdAmount(); |
| | | parentEntity.setAusdAmount(availableAmountParent.add(coinCnt)); |
| | | dappUsdtPerkEntityMapper.updateById(parentEntity); |
| | | //插入资产闪对的流水 |
| | | DappFundFlowEntity aCoinCntFlowParent = new DappFundFlowEntity( |
| | | dappMemberEntity.getId(), |
| | | memberParent.getId(), |
| | | coinCnt, |
| | | FundFlowEnum.AUSDT_MEMBER_TO_MENBER.getCode(), |
| | | 2, |