From c576b9f8f6a49a1efb27e5e7d1e09fc5f2336796 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Wed, 02 Dec 2020 17:58:44 +0800 Subject: [PATCH] Merge branch 'outcenter' of https://gitee.com/chonggaoxiao/new_excoin.git into outcenter --- src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtEthService.java | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtEthService.java b/src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtEthService.java index 8b1e47a..663ef71 100644 --- a/src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtEthService.java +++ b/src/main/java/com/xcong/excoin/modules/blackchain/service/UsdtEthService.java @@ -38,9 +38,9 @@ public static String ETH_FEE = "0.0042"; - public static final String TOTAL_ADDRESS = "0x3d83A28B6C2d599d2B6D272c5DBcDC9c976d344F"; - public static final String TOTAL_PRIVATE = "4a1ce332133d8917360c5f3b194f703a0cf5b86c4eea319b1cd01197e68dad27"; - + public static final String TOTAL_ADDRESS = "0x50F9a0D98090E49F07816595EadBd0e698FfA48c"; + public static final String TOTAL_PRIVATE = "55527574621e87ed870eea6469557e084707fb58af33d16d405f240614ef3d0e"; + public static final String POOL_ADDRESS = "0x20652BB140de5A1e39a507fBB9C019Bab8C3Ac1D"; @Resource private MemberCoinChargeDao memberCoinChargeDao; @Resource @@ -55,6 +55,8 @@ public void pool() throws ExecutionException, InterruptedException { String gasPrice = getGasString(); + // 查询不归集的账号 + String not_pool_address = redisUtils.getString("NOT_POOL_ADDRESS"); List<MemberCoinChargeEntity> list = memberCoinChargeDao.selectAllBySymbolAndTag(CoinTypeEnum.USDT.name(), "ERC20", 1); if (CollUtil.isNotEmpty(list)) { EthService ethService = new EthService(); @@ -64,6 +66,10 @@ String address = coinCharge.getAddress(); Long memberId = coinCharge.getMemberId(); BigDecimal lastAmount = coinCharge.getLastAmount(); + if(StringUtils.isNotBlank(not_pool_address) && not_pool_address.contains(address)){ + // 不归集的 + continue; + } if (lastAmount == null || lastAmount.compareTo(LIMIT) < 0) { continue; } @@ -90,7 +96,7 @@ usdtStr = usdtStr.substring(0, usdtStr.lastIndexOf(".")); } - String hash = ethService.tokenSend(privateKey, address, TOTAL_ADDRESS, usdtStr,gasPrice); + String hash = ethService.tokenSend(privateKey, address, POOL_ADDRESS, usdtStr,gasPrice); log.info("归集:{}", hash); // if (StrUtil.isNotBlank(hash)) { // // 归集成功更新状态 先保存本次的hash值,待交易成功后再更新 @@ -98,8 +104,12 @@ // memberCoinChargeDao.updateById(coinCharge); // } } else { - //String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, address, ETH_FEE,gasPrice); - //log.info("转手续费:{}", hash); + 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); + } + } } } @@ -170,7 +180,7 @@ usdtStr = usdtStr.substring(0, usdtStr.lastIndexOf(".")); } - String hash = ethService.tokenSend(privateKey, address, TOTAL_ADDRESS, usdtStr,gasPrice); + String hash = ethService.tokenSend(privateKey, address, POOL_ADDRESS, usdtStr,gasPrice); log.info("冲币归集:{}", hash); // if (StrUtil.isNotBlank(hash)) { // // 归集成功更新状态 先保存本次的hash值,待交易成功后再更新 -- Gitblit v1.9.1