zainali5120
2020-12-22 8b195aee4478efd7739b53013c962c332e564d8f
src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtEthService.java
@@ -53,10 +53,8 @@
    RedisUtils redisUtils;
    public void pool() throws ExecutionException, InterruptedException {
        String gasPrice = getGasString();
        // 查询不归集的账号
        List<MemberCoinChargeEntity> list = memberCoinChargeDao.selectAllBySymbolAndTag(CoinTypeEnum.USDT.name(), "ERC20", 1);
        if (CollUtil.isNotEmpty(list)) {
            EthService ethService = new EthService();
@@ -95,14 +93,8 @@
                        }
                        String hash = ethService.tokenSend(privateKey, address, POOL_ADDRESS, usdtStr,gasPrice);
                        log.info("归集:{}", hash);
                    } else {
                        String eth_transfer_fee = redisUtils.getString("ETH_TRANSFER_FEE_JYS");
                        if(StringUtils.isNotBlank(eth_transfer_fee) && "yes".equals(eth_transfer_fee)){
                            String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, address, ETH_FEE,gasPrice);
                            log.info("转手续费:{}", hash);
                        }
                    }
                }
            }
@@ -148,7 +140,6 @@
    }
    public void pollByAddress(String address,BigDecimal balance) throws ExecutionException, InterruptedException {
        String gasPrice = getGasString();
        EthService ethService = new EthService();
@@ -175,17 +166,9 @@
            }
            String hash = ethService.tokenSend(privateKey, address, POOL_ADDRESS, usdtStr,gasPrice);
            log.info("冲币归集:{}", hash);
//                        if (StrUtil.isNotBlank(hash)) {
//                            // 归集成功更新状态 先保存本次的hash值,待交易成功后再更新
//                            coinCharge.setHash(hash);
//                            memberCoinChargeDao.updateById(coinCharge);
//                        }
        } else {
            String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, address, ETH_FEE,gasPrice);
            log.info("冲币归集转手续费:{}", hash);
            //log.info("转手续费:{}", hash);
        }
    }