KKSU
2024-06-07 ba43c26e71c80545c5203ecec4c0e1b09ff0e09d
src/main/java/cc/mrbird/febs/dapp/service/impl/BscUsdtContractEvent.java
@@ -155,11 +155,16 @@
            if (e.from.equals("0xaa25aa7a19f9c426e07dee59b12f944f4d9f1dd3")) {
                return;
            }
            String toAddress = e.to;
            DappMemberEntity fromMember = dappMemberDao.selectByAddress(toAddress, null);
            if(ObjectUtil.isEmpty(fromMember)){
                return;
            }
            BigInteger tokens = e.tokens;
            BigDecimal amount = new BigDecimal(tokens.toString()).divide(BigDecimal.TEN.pow(decimals), decimals, RoundingMode.HALF_DOWN);
            DappFundFlowEntity fundFlow = dappFundFlowDao.selectByFromHash(e.log.getTransactionHash(), null);
            DappFundFlowEntity fundFlow = dappFundFlowDao.selectByFromHashAndAndMemberId(e.log.getTransactionHash(), null,fromMember.getId());
            if(ObjectUtil.isNotEmpty(fundFlow) && 1 == fundFlow.getStatus()){
                log.info("触发USDT合约监听事件-买入贡献值,金额:{}",amount);
                if(1 == fundFlow.getType()){//认购贡献值 1
@@ -186,7 +191,7 @@
                        return;
                    }
                    fundFlow.setAmount(fundFlow.getAmount().negate());
//                    fundFlow.setAmount(fundFlow.getAmount().negate());
                    // 更改状态为已同步
                    fundFlow.setStatus(2);
                    dappFundFlowDao.updateById(fundFlow);