| | |
| | | import cc.mrbird.febs.dapp.chain.ContractChainService; |
| | | import cc.mrbird.febs.dapp.dto.SystemDto; |
| | | import cc.mrbird.febs.dapp.entity.*; |
| | | import cc.mrbird.febs.dapp.enumerate.CardPeriod; |
| | | import cc.mrbird.febs.dapp.mapper.*; |
| | | import cc.mrbird.febs.dapp.service.DappSystemService; |
| | | import cc.mrbird.febs.dapp.utils.OnlineTransferUtil; |
| | |
| | | result.put("sourceTFC", ChainService.getInstance(ChainEnum.BSC_TFC.name()).balanceOf(ChainEnum.BSC_TFC_SOURCE.getAddress())); |
| | | result.put("sourceUSDT", ChainService.getInstance(ChainEnum.BSC_USDT.name()).balanceOf(ChainEnum.BSC_USDT_SOURCE.getAddress())); |
| | | result.put("cardCnt", 1000); |
| | | result.put("nftPrice", AppContants.NFT_ACTIVE_PRICE); |
| | | return result; |
| | | } |
| | | |
| | |
| | | } |
| | | system.setBuyRemain(balance); |
| | | system.setBuyTotal(balance); |
| | | |
| | | |
| | | Object maxDailyBuy = redisUtils.get(AppContants.REDIS_KEY_IDO_USDT_MAX_BUY_DAILY + member.getAddress()); |
| | | if (maxDailyBuy == null) { |
| | | DateTime tomorrow = DateUtil.beginOfDay(DateUtil.tomorrow()); |
| | | long time = DateUtil.between(new Date(), tomorrow, DateUnit.SECOND, true); |
| | | |
| | | redisUtils.set(AppContants.REDIS_KEY_IDO_USDT_MAX_BUY_DAILY + member.getAddress(), new BigDecimal("1000"), time); |
| | | } |
| | | |
| | | return system; |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | DataDictionaryCustom boxRecommendCnt = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.DIC_TYPE_SYSTEM_SETTING, AppContants.DIC_VALUE_BOX_RECOMMEND_CNT); |
| | | BigInteger totalSupply = ChainService.getInstance(ChainEnum.BSC_NFT_SDC.name()).totalSupplyNFT(); |
| | | int box = 0; |
| | | // 需要第一次购买,才在推荐中加1 |
| | | Object parentRecommend = redisUtils.hget(AppContants.IDO_MEMBER_RECOMMEND_CNT, parent.getAddress()); |
| | |
| | | int i = (int) parentRecommend; |
| | | |
| | | // 如果超过10个,则新增一个盲盒,并重置推荐人数 |
| | | if (++i == new Integer(boxRecommendCnt.getValue())) { |
| | | if (++i == CardPeriod.ONE.recommendCnt(totalSupply.intValue())) { |
| | | box = 1; |
| | | redisUtils.hset(AppContants.IDO_MEMBER_RECOMMEND_CNT, parent.getAddress(), 0); |
| | | } else { |