| | |
| | | import cc.mrbird.febs.common.contants.AppContants; |
| | | import cc.mrbird.febs.common.enumerates.DataDicEnum; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.dapp.chain.ChainEnum; |
| | | import cc.mrbird.febs.dapp.chain.ChainService; |
| | | import cc.mrbird.febs.dapp.chain.ContractEventService; |
| | | import cc.mrbird.febs.dapp.entity.DappAchieve; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.entity.DataDictionaryCustom; |
| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private AsyncCjService asyncCjService; |
| | | |
| | | @Autowired |
| | | private ContractEventService bscCoinContractEvent; |
| | | |
| | | @Test |
| | | public void mineJob() { |
| | | Long memberId = 129L; |
| | | List<DappAchieve> dappAchieves = dappAchieveMapper.selectListByMemberId(memberId); |
| | | |
| | | BigDecimal goldAmountDone = dappAchieveMapper.selectGoldAmountByMemberId(memberId); |
| | | BigDecimal coinAmountDone = dappAchieveMapper.selectCoinAmountByMemberId(memberId); |
| | | if(CollUtil.isNotEmpty(dappAchieves)){ |
| | | BigDecimal goldAmount = dappAchieves.stream().map(DappAchieve::getGoldAmount).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(8,BigDecimal.ROUND_DOWN); |
| | | BigDecimal coinAmount = dappAchieves.stream().map(DappAchieve::getCoinAmount).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(8,BigDecimal.ROUND_DOWN); |
| | | BigDecimal goldAmountAva = goldAmount.subtract(goldAmountDone);//金本位剩余 |
| | | BigDecimal coinAmountAva = coinAmount.subtract(coinAmountDone);//币本位剩余 |
| | | |
| | | System.out.println(goldAmountAva); |
| | | System.out.println(coinAmountAva); |
| | | } |
| | | ChainService.coinRewardEventListener(BigInteger.valueOf(40116050), null, bscCoinContractEvent, ChainEnum.BSC_GFA.name()); |
| | | // List<DappAchieve> dappAchieves = dappAchieveMapper.selectList(null); |
| | | // if(CollUtil.isNotEmpty(dappAchieves)){ |
| | | // for(DappAchieve dappAchieve : dappAchieves){ |