xiaoyong931011
2022-12-05 22819e7b84e661b65b43b8a3c8467080b1b23fa4
src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
@@ -464,17 +464,19 @@
        }
        Integer count = dappFundFlowDao.updateStatusById(DappFundFlowEntity.WITHDRAW_STATUS_AGREE,dappFundFlowEntity.getId());
        if(count > 0){
            DappFundFlowEntity dappFundFlow = dappFundFlowDao.selectById(id);
            //金额
            BigDecimal amount = dappFundFlowEntity.getAmount();
            BigDecimal amount = dappFundFlow.getAmount();
            //目标地址
            String address = dappMemberEntity.getAddress();
            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;
            }
            dappFundFlowEntity.setFromHash(hash);
            dappFundFlowDao.updateById(dappFundFlowEntity);
            log.info("{},{}",id,hash);
            dappFundFlow.setFromHash(hash);
            dappFundFlowDao.updateById(dappFundFlow);
        }
    }
@@ -507,6 +509,25 @@
        }
    }
    @Override
    public void bnbTransferTest(Long id) {
        DappFundFlowEntity dappFundFlow = dappFundFlowDao.selectById(id);
        if(ObjectUtil.isEmpty(dappFundFlow)){
            return;
        }
        //金额
        BigDecimal amount = dappFundFlow.getAmount();
        //目标地址
        String address = dappFundFlow.getAddress();
        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);
    }
    public static void main(String[] args) {
        String refererIds = "1,2,3,4,5," +
                            "6,7,8,9,10," +