| | |
| | | private final MallGoodsCategoryMapper mallGoodsCategoryMapper; |
| | | private final PlatformBannerMapper platformBannerMapper; |
| | | private final MallGoodsImagesMapper goodsImagesMapper; |
| | | private final MemberCoinWithdrawDao memberCoinWithdrawDao; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | member = insertMember(connectDto.getAddress(), referenceID,nodeType); |
| | | } |
| | | |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(member.getId()); |
| | | if(2 == dappMemberEntity.getChangeAble()){ |
| | | throw new FebsException("账号已冻结"); |
| | | } |
| | | |
| | | String key = LoginUserUtil.getLoginKey(connectDto.getAddress(), connectDto.getNonce(), connectDto.getSign()); |
| | | redisUtils.hset(AppContants.REDIS_KEY_MEMBER_INFO, connectDto.getAddress(), member); |
| | | |
| | |
| | | member.setCurrentUser(currentUser.getUserId()); |
| | | } |
| | | IPage<DappMemberEntity> dappMemberEntityIPage = dappMemberDao.selectInPage(member, page); |
| | | // List<DappMemberEntity> records = dappMemberEntityIPage.getRecords(); |
| | | // if(CollUtil.isNotEmpty(records)){ |
| | | // for(DappMemberEntity memberEntity : records){ |
| | | // Long memberId = memberEntity.getId(); |
| | | // DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId); |
| | | // memberEntity.setCoinAmount(ObjectUtil.isEmpty(dappWalletCoinEntity) ? BigDecimal.ZERO : dappWalletCoinEntity.getAvailableAmount()); |
| | | // |
| | | // DappWalletMineEntity dappWalletMineEntity = dappWalletMineDao.selectByMemberId(memberId); |
| | | // memberEntity.setScoreAmount(ObjectUtil.isEmpty(dappWalletMineEntity) ? BigDecimal.ZERO : dappWalletMineEntity.getAvailableAmount()); |
| | | // } |
| | | // } |
| | | List<DappMemberEntity> records = dappMemberEntityIPage.getRecords(); |
| | | if(CollUtil.isNotEmpty(records)){ |
| | | for(DappMemberEntity memberEntity : records){ |
| | | Long memberId = memberEntity.getId(); |
| | | |
| | | // List<MallAchieveRecord> mallAchieveRecords = mallAchieveRecordMapper.selectListByMemberId(memberId); |
| | | List<MallAchieveRecord> mallAchieveRecords = mallAchieveRecordMapper.selectListByMemberIdAndScore(memberId); |
| | | BigDecimal myShareAchieve = BigDecimal.ZERO; |
| | | if(CollUtil.isNotEmpty(mallAchieveRecords)){ |
| | | Date payTime = mallAchieveRecords.get(0).getPayTime(); |
| | | //下第一单之后的共享区全部业绩 |
| | | myShareAchieve = mallAchieveRecordMapper.selectAchieveTotalByCreateTime(payTime); |
| | | } |
| | | memberEntity.setMyShareAchieve(myShareAchieve); |
| | | |
| | | |
| | | BigDecimal totalIncomeMember = dappMemberDao.selectAllAchieveByRefId(memberEntity.getInviteId()); |
| | | memberEntity.setMyTeamAchieve(totalIncomeMember); |
| | | |
| | | BigDecimal withdrawAmount = memberCoinWithdrawDao.selectByMemberIdAndStatus(memberId, MemberCoinWithdrawEntity.STATUS_YES); |
| | | memberEntity.setWithdrawAmount(withdrawAmount); |
| | | } |
| | | } |
| | | return dappMemberEntityIPage; |
| | | } |
| | | |
| | |
| | | dappMemberInfoVo.setWaitPayCnt(waitPayCnt); |
| | | dappMemberInfoVo.setPayCnt(payCnt); |
| | | dappMemberInfoVo.setCancelCnt(cancelCnt); |
| | | |
| | | // List<MallAchieveRecord> mallAchieveRecords = mallAchieveRecordMapper.selectListByMemberId(member.getId()); |
| | | List<MallAchieveRecord> mallAchieveRecords = mallAchieveRecordMapper.selectListByMemberIdAndScore(member.getId()); |
| | | BigDecimal myShareAchieve = BigDecimal.ZERO; |
| | | if(CollUtil.isNotEmpty(mallAchieveRecords)){ |
| | | Date payTime = mallAchieveRecords.get(0).getPayTime(); |
| | | //下第一单之后的共享区全部业绩 |
| | | myShareAchieve = mallAchieveRecordMapper.selectAchieveTotalByCreateTime(payTime); |
| | | } |
| | | dappMemberInfoVo.setMyShareAchieve(myShareAchieve); |
| | | return new FebsResponse().success().data(dappMemberInfoVo); |
| | | } |
| | | |
| | |
| | | @Transactional |
| | | public Long createOrder(AddOrderDto addOrderDto) { |
| | | DappMemberEntity member = LoginUserUtil.getAppUser(); |
| | | |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(member.getId()); |
| | | if(2 == dappMemberEntity.getChangeAble()){ |
| | | throw new FebsException("账号已冻结"); |
| | | } |
| | | // DappMemberEntity member = dappMemberDao.selectById(1L); |
| | | /** |
| | | * 1、商品是否上架 |
| | | * 2、用户余额是否足够 |
| | | */ |
| | | |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(addOrderDto.getGoodsId()); |
| | | if(ObjectUtil.isEmpty(mallGoods)){ |
| | | throw new FebsException("商品不存在"); |
| | |
| | | } |
| | | BigDecimal totalAmount = orderInfo.getAmount(); |
| | | if(achieveAva.compareTo(totalAmount) < 0){ |
| | | throw new FebsException("用户最多购买"+achieveAva.setScale(2,BigDecimal.ROUND_DOWN)+"USDT"); |
| | | throw new FebsException("用户最多购买"+achieveAva.setScale(2,BigDecimal.ROUND_DOWN)); |
| | | } |
| | | |
| | | DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(member.getId()); |
| | |
| | | |
| | | @Override |
| | | public List<AKLineLimitVo> packageKline() { |
| | | return dappAKlineMapper.selectListByTypeAndLimit(2, 30); |
| | | // return dappAKlineMapper.selectListByTypeAndLimit(2, 30); |
| | | List<AKLineLimitVo> akLineLimitVos = dappAKlineMapper.selectListByTypeAndLimitDesc(1, 60); |
| | | List<AKLineLimitVo> sortedList = akLineLimitVos.stream() |
| | | .sorted((k1, k2) -> k1.getCreateTime().compareTo(k2.getCreateTime())) |
| | | .collect(Collectors.toList()); |
| | | return sortedList; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse changeAbleYes(Long id) { |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(id); |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | dappMemberEntity.setChangeAble(1); |
| | | dappMemberDao.updateById(dappMemberEntity); |
| | | return new FebsResponse().success(); |
| | | } |
| | | @Override |
| | | public FebsResponse changeAbleNo(Long id) { |
| | | DappMemberEntity dappMemberEntity = dappMemberDao.selectById(id); |
| | | if(ObjectUtil.isEmpty(dappMemberEntity)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | dappMemberEntity.setChangeAble(2); |
| | | dappMemberDao.updateById(dappMemberEntity); |
| | | |
| | | redisUtils.hdel(AppContants.REDIS_KEY_SIGN, dappMemberEntity.getAddress()); |
| | | redisUtils.hdel(AppContants.REDIS_KEY_MEMBER_INFO, dappMemberEntity.getAddress()); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | public static List<List<String>> partitionList(List<String> originalList, int partitionSize) { |