xiaoyong931011
2022-11-30 8e444d790b352f906d046ed38b620e1214735953
src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
@@ -430,25 +430,26 @@
    @Override
    public void bnbTransfer(Long id) {
        log.info("{}",id);
        //获取对应的流水记录
        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectById(id);
        if(DappFundFlowEntity.WITHDRAW_STATUS_AGREE == dappFundFlowEntity.getStatus()){
            return;
        }
        //金额
        BigDecimal amount = dappFundFlowEntity.getAmount();
        Long memberId = dappFundFlowEntity.getMemberId();
        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId);
        if(ObjectUtil.isEmpty(dappMemberEntity)){
            return;
        }
        //目标地址
        String address = dappMemberEntity.getAddress();
        String hash = ChainService.getInstance(ChainEnum.BSC_USDT.name()).transfer(address, amount);
        if(StrUtil.isEmpty(hash)){
            return;
        }
        dappFundFlowEntity.setToHash(hash);
//        //金额
//        BigDecimal amount = dappFundFlowEntity.getAmount();
//        Long memberId = dappFundFlowEntity.getMemberId();
//        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId);
//        if(ObjectUtil.isEmpty(dappMemberEntity)){
//            return;
//        }
//        //目标地址
//        String address = dappMemberEntity.getAddress();
//        String hash = ChainService.getInstance(ChainEnum.BSC_USDT.name()).transfer(address, amount);
//        if(StrUtil.isEmpty(hash)){
//            return;
//        }
//        dappFundFlowEntity.setToHash(hash);
        dappFundFlowEntity.setStatus(DappFundFlowEntity.WITHDRAW_STATUS_AGREE);
        dappFundFlowDao.updateById(dappFundFlowEntity);