wzy
2022-08-27 afe2e9a2da152a9b1a54d88b7637e811bf298749
src/main/java/cc/mrbird/febs/dapp/service/impl/BscUsdtContractEvent.java
@@ -32,15 +32,12 @@
    @Resource
    private RedisUtils redisUtils;
    @Resource
    private DappMemberService dappMemberService;
    @Resource
    private DappFundFlowDao dappFundFlowDao;
    @Resource
    private DappWalletCoinDao dappWalletCoinDao;
    @Resource
    private ChainProducer chainProducer;
    @Override
@@ -67,8 +64,6 @@
            if (e.from.equals("0xaa25aa7a19f9c426e07dee59b12f944f4d9f1dd3")) {
                return;
            }
            DappMemberEntity fromMember = dappMemberService.findByAddress(e.from, null);
            BigInteger tokens = e.tokens;
            BigDecimal amount = new BigDecimal(tokens.toString()).divide(BigDecimal.TEN.pow(decimals), decimals, RoundingMode.HALF_DOWN);
@@ -105,16 +100,12 @@
            }
            OnlineTransferUtil.addTransferRecord(e.from, e.to, amount, e.log.getTransactionHash(), DappTransferRecordEntity.TRANSFER_SOURCE_FLAG_APPLICATION, "USDT");
            fundFlow.setAmount(fundFlow.getAmount().negate());
            // 更改状态为已同步
            fundFlow.setStatus(2);
            dappFundFlowDao.updateById(fundFlow);
            synchronized (this) {
                DappWalletCoinEntity walletCoin = dappWalletCoinDao.selectByMemberId(fundFlow.getMemberId());
                walletCoin.setTotalAmount(walletCoin.getTotalAmount().add(amount));
                walletCoin.setAvailableAmount(walletCoin.getAvailableAmount().add(amount));
                dappWalletCoinDao.updateById(walletCoin);
            }
            chainProducer.sendAchieveTreeMsg(fundFlow.getMemberId());
        }
    }
}