| | |
| | | //投注人是否加入 |
| | | DappSystemProfit dappSystemProfit = dappSystemProfitDao.selectByMemberIdAndState(dappMemberEntity.getId(), DappSystemProfit.STATE_IN); |
| | | if(ObjectUtil.isNotEmpty(dappSystemProfit)){ |
| | | List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectListBySystemProfitIdAndState(dappSystemProfit.getId(),DappFundFlowEntity.WITHDRAW_STATUS_ING); |
| | | List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectListByState(DappFundFlowEntity.WITHDRAW_STATUS_ING); |
| | | if(CollUtil.isNotEmpty(dappFundFlowEntities)){ |
| | | for(DappFundFlowEntity dappFundFlowEntity : dappFundFlowEntities){ |
| | | |
| | | //发送转币消息 |
| | | chainProducer.sendBnbTransferMsg(dappFundFlowEntity.getId()); |
| | | DappMemberEntity dappMember = dappMemberDao.selectById(dappFundFlowEntity.getMemberId()); |
| | | trans(new BigInteger(dappFundFlowEntity.getAmount().toString()),dappMember.getAddress()); |
| | | // DappMemberEntity dappMember = dappMemberDao.selectById(dappFundFlowEntity.getMemberId()); |
| | | // trans(new BigInteger(dappFundFlowEntity.getAmount().toString()),dappMember.getAddress()); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 从合约内转币到制定地址 |
| | | */ |
| | | public void trans(BigInteger amount, String to1){ |
| | | public String trans(BigInteger amount, String to1){ |
| | | String transactionHash = null; |
| | | Credentials credentials = Credentials.create(privateKey); |
| | | Abi contract = Abi.load(contractAddr, getInstance(), credentials, getStaticGasProvider()); |
| | | try { |
| | | TransactionReceipt send = contract.trans(amount, to1).send(); |
| | | transactionHash = send.getTransactionHash(); |
| | | } catch (Exception exception) { |
| | | exception.printStackTrace(); |
| | | } |
| | | return transactionHash; |
| | | } |
| | | } |