| | |
| | | BigDecimal nodeAmount = distrbAmount.subtract(techAmount); |
| | | log.info("总分发金额:{}, 技术:{}, 节点:{}", distrbAmount, techAmount, nodeAmount); |
| | | |
| | | |
| | | BigDecimal preNode = slipSetting.getNodeProp().divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP); |
| | | log.info("每份:{}", preNode); |
| | | int i = 1; |
| | | for (DappMemberEntity parent : parents) { |
| | | BigDecimal balance = instance.balanceOf(parent.getAddress()); |
| | | log.info("地址:{}, 余额:{}", parent.getAddress(), balance); |
| | | |
| | | // 若地址持币少了指定数量 或者 不为创始节点,则不参与节点滑点 |
| | | if (balance.compareTo(new BigDecimal(miniHoldCoin.getValue())) < 0 || parent.getNodeType() == 2) { |
| | | // 若地址持币少了指定数量 |
| | | if (balance.compareTo(new BigDecimal(miniHoldCoin.getValue())) < 0) { |
| | | return; |
| | | } |
| | | |
| | | DataDictionaryCustom distribDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.DIC_TYPE_DISTRIBUTE_PROP, String.valueOf(i)); |
| | | BigDecimal total = new BigDecimal(distribDic.getValue()).multiply(preNode); |
| | | BigDecimal total = distrbAmount.multiply(new BigDecimal(distribDic.getValue()).divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)); |
| | | |
| | | // instance.transfer(parent.getAddress(), total); |
| | | DappOnlineTransferEntity distribRecord = new DappOnlineTransferEntity(parent.getAddress(), total, fundflow.getType(), 1, ChainEnum.BSC_TFC_SOURCE.name(), "TFC", fundflow.getId().toString()); |
| | | dappOnlineTransferDao.insert(distribRecord); |
| | | |