| | |
| | | |
| | | import cc.mrbird.febs.common.enumerates.RunVipDataDictionaryEnum; |
| | | import cc.mrbird.febs.common.enumerates.YesOrNoEnum; |
| | | import cc.mrbird.febs.common.utils.AppContants; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.mall.entity.MallCharge; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallChargeMapper; |
| | |
| | | private MallChargeMapper mallChargeMapper; |
| | | @Resource |
| | | private AgentProducer agentProducer; |
| | | @Resource |
| | | private RedisUtils redisUtils; |
| | | |
| | | @Override |
| | | public void sdmUSDT(EthUsdtContract.TransferEventResponse e) { |
| | |
| | | BigInteger tokens = e.tokens; |
| | | BigDecimal amount = new BigDecimal(tokens.toString()) |
| | | .divide(BigDecimal.TEN.pow(decimals), decimals, RoundingMode.HALF_DOWN) |
| | | .setScale(2,BigDecimal.ROUND_DOWN); |
| | | .setScale(2,RoundingMode.DOWN); |
| | | |
| | | |
| | | String chargeRedis = redisUtils.getString(AppContants.CHARGE_AMOUNT_PROFIX + amount); |
| | | if (StrUtil.isBlank(chargeRedis)) { |
| | | log.info("Redis未扫描到充值金额:{}",transactionHash); |
| | | return; |
| | | }else{ |
| | | redisUtils.del(AppContants.CHARGE_AMOUNT_PROFIX + amount); |
| | | log.info("Redis扫描到充值记录:{},{}",transactionHash,chargeRedis); |
| | | } |
| | | |
| | | LambdaQueryWrapper<MallCharge> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(MallCharge::getAddress, fromAddress); |
| | | queryWrapper.eq(MallCharge::getSysAddress, sysAddress); |
| | | queryWrapper.eq(MallCharge::getAmount, amount); |
| | | queryWrapper.eq(MallCharge::getAmountReal, amount); |
| | | queryWrapper.eq(MallCharge::getMemberId, Long.parseLong(chargeRedis)); |
| | | queryWrapper.eq(MallCharge::getType, type); |
| | | queryWrapper.eq(MallCharge::getState, YesOrNoEnum.ING.getValue()); |
| | | List<MallCharge> mallCharges = mallChargeMapper.selectList(queryWrapper); |