| | |
| | | import cc.mrbird.febs.dapp.chain.ChainEnum; |
| | | import cc.mrbird.febs.dapp.chain.ChainService; |
| | | import cc.mrbird.febs.dapp.chain.ContractChainService; |
| | | import cc.mrbird.febs.dapp.contract.andao.AndaoContractMain; |
| | | import cc.mrbird.febs.dapp.dto.*; |
| | | import cc.mrbird.febs.dapp.entity.*; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.web3j.utils.Strings; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | |
| | | ); |
| | | dappMemberInfoVo.setCoinAPrice((ObjectUtil.isEmpty(coinAPriceDic) ? new BigDecimal("1") : new BigDecimal(coinAPriceDic.getValue())) |
| | | .setScale(12,BigDecimal.ROUND_DOWN)); |
| | | |
| | | /** |
| | | * 今日涨幅 |
| | | */ |
| | | //最新的一条记录 |
| | | DappAKlineEntity dappAKlineNow = dappAKlineMapper.selectOneByType(); |
| | | BigDecimal closePriceNow = dappAKlineNow.getClosePrice(); |
| | | //拿日线的最后一条数据 |
| | | DappAKlineEntity dappAKlineStart = dappAKlineMapper.selectDayByType(); |
| | | BigDecimal closePriceStart = dappAKlineStart.getClosePrice(); |
| | | |
| | | BigDecimal subtract = closePriceNow.subtract(closePriceStart); |
| | | BigDecimal bigDecimal = subtract.divide(closePriceStart, 4, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN); |
| | | dappMemberInfoVo.setTodayIncrease(bigDecimal); |
| | | |
| | | /** |
| | | * 全网剩余ANDAO总量,燃烧ANDAO总量 |
| | | */ |
| | | DataDictionaryCustom coinACntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PoolEnum.COIN_A_CNT.getType(), |
| | | PoolEnum.COIN_A_CNT.getCode() |
| | | ); |
| | | dappMemberInfoVo.setAndaoNum( |
| | | ObjectUtil.isEmpty(coinACntDic) ? |
| | | new BigDecimal("0") : |
| | | new BigDecimal(coinACntDic.getValue()).setScale(2,BigDecimal.ROUND_DOWN) |
| | | ); |
| | | |
| | | BigDecimal bigDecimal1 = dappFundFlowDao.selectSumAmountByType(FundFlowEnum.A_COIN_FIRE.getCode()); |
| | | dappMemberInfoVo.setFireAndaoNum(bigDecimal1.setScale(2,BigDecimal.ROUND_DOWN)); |
| | | |
| | | return new FebsResponse().success().data(dappMemberInfoVo); |
| | | } |
| | | |
| | |
| | | myInviteChildInfoVo.setAddress(child.getAddress()); |
| | | myInviteChildInfoVo.setAccountType(child.getAccountType()); |
| | | DappUsdtPerkEntity childUsdtPerkEntity = dappUsdtPerkEntityMapper.selectByMemberId(child.getId()); |
| | | if(ObjectUtil.isEmpty(dappUsdtPerkEntity)){ |
| | | dappUsdtPerkEntity = new DappUsdtPerkEntity(); |
| | | dappUsdtPerkEntity.setMemberId(child.getId()); |
| | | dappUsdtPerkEntityMapper.insert(dappUsdtPerkEntity); |
| | | myInviteChildInfoVo.setMemberAchieve(BigDecimal.ZERO); |
| | | }else{ |
| | | myInviteChildInfoVo.setMemberAchieve(childUsdtPerkEntity.getAchieveAmount()); |
| | | // BigDecimal achieveAmountByMemberId = dappUsdtPerkEntityMapper.selectAchieveAmountByMemberId(child.getId()); |
| | | if(ObjectUtil.isEmpty(childUsdtPerkEntity)){ |
| | | childUsdtPerkEntity = new DappUsdtPerkEntity(); |
| | | childUsdtPerkEntity.setMemberId(child.getId()); |
| | | dappUsdtPerkEntityMapper.insert(childUsdtPerkEntity); |
| | | } |
| | | |
| | | // myInviteChildInfoVo.setMemberAchieve(ObjectUtil.isEmpty(childUsdtPerkEntity.getAchieveAmount()) ? BigDecimal.ZERO : childUsdtPerkEntity.getAchieveAmount()); |
| | | myInviteChildInfoVo.setMemberAchieve(ObjectUtil.isEmpty(childUsdtPerkEntity.getAchieveAmount()) ? BigDecimal.ZERO : childUsdtPerkEntity.getAchieveAmount()); |
| | | HashMap<String, BigDecimal> childMaxMinAchieve = getMaxMinAchieve(child.getId()); |
| | | myInviteChildInfoVo.setMaxAchieve(childMaxMinAchieve.get(AppContants.MAXACHIEVE)); |
| | | myInviteChildInfoVo.setMinAchieve(childMaxMinAchieve.get(AppContants.MINACHIEVE)); |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | public static List<List<String>> partitionList(List<String> originalList, int partitionSize) { |
| | | List<List<String>> partitionedList = new ArrayList<>(); |
| | | int size = originalList.size(); |
| | | for (int i = 0; i < size; i += partitionSize) { |
| | | int end = Math.min(size, i + partitionSize); |
| | | List<String> sublist = originalList.subList(i, end); |
| | | partitionedList.add(sublist); |
| | | } |
| | | return partitionedList; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户的大小区业绩 |
| | | * @param memberId |