| | |
| | | String address = addressEntity.getAddress(); |
| | | Long memberId = addressEntity.getMemberId(); |
| | | |
| | | if (StrUtil.isNotBlank(address)) { |
| | | if (StrUtil.isBlank(address)) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | if (balance.compareTo(early) > 0) { |
| | | BigDecimal newBalance = balance.subtract(early); |
| | | memberWalletCoinDao.updateBlockBalance(memberId, newBalance, balance, 0); |
| | | memberWalletCoinDao.updateBlockBalance(walletCoinEntity.getId(), newBalance, balance, 0); |
| | | |
| | | insertCoinCharge(address, memberId, newBalance, CoinTypeEnum.USDT.name(), "ERC20", balance); |
| | | // TODO 钉钉发送, 短信提醒 |
| | |
| | | log.info("#ETH更新:{},{},{}#", memberId, balance, early); |
| | | |
| | | BigDecimal newBalance = balance.subtract(early); |
| | | memberWalletCoinDao.updateBlockBalance(memberId, newBalance, balance, 0); |
| | | memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), newBalance, balance, 0); |
| | | insertCoinCharge(address, memberId, newBalance, CoinTypeEnum.ETH.name(), null, balance); |
| | | |
| | | // 插入财务记录 |
| | |
| | | if (balance.compareTo(early) > 0) { |
| | | BigDecimal newBalance = balance.subtract(early); |
| | | |
| | | memberWalletCoinDao.updateBlockBalance(memberId, newBalance, balance, 0); |
| | | memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), newBalance, balance, 0); |
| | | insertCoinCharge(address, memberId, newBalance, CoinTypeEnum.USDT.name(), "OMNI", balance); |
| | | |
| | | // TODO 钉钉消息, 短信提醒 |
| | |
| | | if (balance.compareTo(early) > 0) { |
| | | log.info("#btc同步:{}, {}, {}#", memberId, balance, early); |
| | | BigDecimal newBalance = balance.subtract(early); |
| | | memberWalletCoinDao.updateBlockBalance(memberId, newBalance, balance, 0); |
| | | memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), newBalance, balance, 0); |
| | | |
| | | insertCoinCharge(address, memberId, newBalance, CoinTypeEnum.BTC.name(), null, balance); |
| | | LogRecordUtils.insertMemberAccountMoneyChange(memberId, "转入", newBalance, CoinTypeEnum.BTC.name(), 1, 1); |
| | |
| | |
|
| | | int subFrozenBalance(@Param("memberId") Long memberId, @Param("id") Long id, @Param("amount") BigDecimal amount);
|
| | |
|
| | | int updateBlockBalance(@Param("memberId") Long memberId, @Param("availableBalance") BigDecimal availableBalance, @Param("earlyBalance") BigDecimal earlyBalance, @Param("blockNumber") Integer blockNumber);
|
| | | int updateBlockBalance(@Param("id") Long id, @Param("availableBalance") BigDecimal availableBalance, @Param("earlyBalance") BigDecimal earlyBalance, @Param("blockNumber") Integer blockNumber);
|
| | | }
|
| | |
| | | total_balance = IFNULL(total_balance, 0) + #{availableBalance},
|
| | | early_balance = IFNULL(early_balance, 0) + #{earlyBalance},
|
| | | block_number = IFNULL(block_number, 0) + #{blockNumber}
|
| | | where id=#{memberId}
|
| | | where id=#{id}
|
| | | </update>
|
| | |
|
| | |
|