src/main/java/cc/mrbird/febs/dapp/mapper/DappSystemProfitDao.java
@@ -31,4 +31,6 @@ IPage<AdminSystemProfitFlowListVo> selectSystemProfitFlowListInPage(@Param("record")DappSystemProfit dappSystemProfit, Page<AdminSystemProfitFlowListVo> page); List<DappSystemProfit> selectDappSysstemProfitByState(@Param("state")int stateIn); DappSystemProfit selectByMemberId(@Param("memberId")Long memberId); } src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
@@ -463,21 +463,21 @@ return; } Integer count = dappFundFlowDao.updateStatusById(DappFundFlowEntity.WITHDRAW_STATUS_AGREE,dappFundFlowEntity.getId()); if(count > 0){ DappFundFlowEntity dappFundFlow = dappFundFlowDao.selectById(id); //金额 BigDecimal amount = dappFundFlow.getAmount(); //目标地址 String address = dappFundFlow.getAddress(); // String hash = ChainService.getInstance(ChainEnum.BSC_USDT.name()).transfer(address, amount); String hash = ChainService.getInstance(ChainEnum.BNB.name()).transferBaseToken(address, amount); if(StrUtil.isEmpty(hash)){ return; } log.info("{},{}",id,hash); dappFundFlow.setFromHash(hash); dappFundFlowDao.updateById(dappFundFlow); } // if(count > 0){ // DappFundFlowEntity dappFundFlow = dappFundFlowDao.selectById(id); // //金额 // BigDecimal amount = dappFundFlow.getAmount(); // //目标地址 // String address = dappFundFlow.getAddress(); // // String hash = ChainService.getInstance(ChainEnum.BSC_USDT.name()).transfer(address, amount); // String hash = ChainService.getInstance(ChainEnum.BNB.name()).transferBaseToken(address, amount); // if(StrUtil.isEmpty(hash)){ // return; // } // log.info("{},{}",id,hash); // dappFundFlow.setFromHash(hash); // dappFundFlowDao.updateById(dappFundFlow); // } } @Override @@ -512,6 +512,11 @@ @Override public void bnbTransferTest(Long id) { DappFundFlowEntity dappFundFlow = dappFundFlowDao.selectById(id); //用户已经加入动能队列 DappSystemProfit dappSystemProfit = dappSystemProfitDao.selectById(dappFundFlow.getSystemProfitId()==null ? 0L : dappFundFlow.getSystemProfitId()); if(ObjectUtil.isEmpty(dappSystemProfit)){ return; } if(ObjectUtil.isEmpty(dappFundFlow)){ return; } src/main/java/cc/mrbird/febs/job/BnbTransferJob.java
@@ -21,7 +21,7 @@ @Autowired private ChainProducer chainProducer; @Scheduled(cron = "0/3 * * * * ? ") @Scheduled(cron = "0/5 * * * * ? ") public void BnbTransferAgain() { DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectByStateAndVersionAndFromHashLimitOne(2,2); if(ObjectUtil.isNotEmpty(dappFundFlowEntity)){ src/main/java/cc/mrbird/febs/rabbit/consumer/ChainConsumer.java
@@ -69,7 +69,7 @@ */ @RabbitListener(queues = QueueConstants.QUEUE_BNB_TRANSFER) public void bnbTransfer(Long id) { log.info("消费转账拨币:{}", id); log.info("消费转账拨币第一步:{}", id); dappSystemService.bnbTransfer(id); } @@ -78,7 +78,7 @@ */ @RabbitListener(queues = QueueConstants.QUEUE_BNB_TRANSFER_TEST) public void bnbTransferTest(Long id) { log.info("消费转账拨币:{}", id); log.info("消费转账拨币第二步:{}", id); dappSystemService.bnbTransferTest(id); } src/main/resources/application-prod.yml
@@ -2,7 +2,7 @@ datasource: dynamic: # 是否开启 SQL日志输出,生产环境建议关闭,有性能损耗 p6spy: true p6spy: false hikari: connection-timeout: 30000 max-lifetime: 1800000 src/main/resources/mapper/dapp/DappSystemProfitDao.xml
@@ -103,4 +103,11 @@ order by a.id asc </select> <select id="selectByMemberId" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit"> select a.* from dapp_system_profit a where member_id = #{memberId} limit 1 </select> </mapper>