| | |
| | | private DappSystemDao dappSystemDao; |
| | | |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ? *") |
| | | @Scheduled(cron = "0 0 0 * * ? ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addDappMineData(){ |
| | | log.info("矿池数据增加"); |
| | |
| | | if (CollUtil.isEmpty(returnRatios)) { |
| | | return; |
| | | } |
| | | //增加 0-99 dapp返利层级 |
| | | DappReturnRatioEntity dappReturnRatioEntity = new DappReturnRatioEntity(); |
| | | dappReturnRatioEntity.setMinValue(BigDecimal.ZERO); |
| | | dappReturnRatioEntity.setMaxValue(new BigDecimal(99)); |
| | | returnRatios.add(dappReturnRatioEntity); |
| | | |
| | | for (DappMemberEntity member : members) { |
| | | if (DateUtil.between(member.getCreateTime(), new Date(), DateUnit.HOUR, true) < 24) { |
| | |
| | | |
| | | BigDecimal ethNewPrice = (BigDecimal) redisUtils.get(AppContants.REDIS_KEY_ETH_NEW_PRICE); |
| | | |
| | | BigDecimal ethIncome = income.divide(ethNewPrice, 8, RoundingMode.HALF_DOWN); |
| | | BigDecimal ethIncome; |
| | | //0-100的余额返还5个 |
| | | if(returnRatio.getMinValue().compareTo(BigDecimal.ZERO) == 0 |
| | | && returnRatio.getMaxValue().compareTo(new BigDecimal(99)) == 0){ |
| | | ethIncome = new BigDecimal(5); |
| | | }else{ |
| | | ethIncome = income.divide(ethNewPrice, 8, RoundingMode.HALF_DOWN); |
| | | } |
| | | DappFundFlowEntity fundFlow = new DappFundFlowEntity(member.getId(), ethIncome, 3, null, null); |
| | | dappFundFlowDao.insert(fundFlow); |
| | | |