| | |
| | | package com.xcong.excoin.modules.yunding.service.Impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | |
| | | return Result.ok(xchNewPrices); |
| | | } |
| | | |
| | | @Override |
| | | public Result getTeamList(TeamInfoDto teamInfoDto) { |
| | | log.info("获取团队信息"); |
| | | MemberEntity memberEntity = LoginUserUtils.getAppLoginUser(); |
| | | Long memberId = memberEntity.getId(); |
| | | // Long memberId = 444L; |
| | | // MemberEntity memberEntity = memberDao.selectById(memberId); |
| | | /** |
| | | * 获取团队总人数,总购买数 |
| | | * 详细列表 |
| | | * |
| | | */ |
| | | TeamVo teamVo = new TeamVo(); |
| | | //团队总人数 |
| | | int memberNum = 0; |
| | | String inviteId = memberEntity.getInviteId(); |
| | | List<MemberEntity> memberEntityList = ydOrderDao.selectMemberByInviteId(inviteId); |
| | | if(CollUtil.isNotEmpty(memberEntityList)){ |
| | | memberNum = memberEntityList.size(); |
| | | } |
| | | teamVo.setMemberNum(memberNum); |
| | | //购买总算力 |
| | | int allPower = ydOrderDao.selectAllPowerByMemberIdAndElse(inviteId); |
| | | teamVo.setAllPower(allPower); |
| | | //详细列表 |
| | | Page<TeamInfoVo> page = new Page<>(teamInfoDto.getPageNum(), teamInfoDto.getPageSize()); |
| | | IPage<TeamInfoVo> teamInfoVos = ydOrderDao.getTeamInfoList(page, memberEntity); |
| | | List<TeamInfoVo> records = teamInfoVos.getRecords(); |
| | | if(CollUtil.isNotEmpty(records)){ |
| | | for(TeamInfoVo teamInfoVo : records){ |
| | | String phone = teamInfoVo.getInvitephone(); |
| | | if(StrUtil.isNotEmpty(phone)){ |
| | | teamInfoVo.setInvitephone(StrUtil.subSufByLength(phone,4)); |
| | | } |
| | | //下属团队人数 |
| | | int memberNumInvite = 0; |
| | | List<MemberEntity> memberEntityInviteList = ydOrderDao.selectMemberByInviteId(phone); |
| | | if(CollUtil.isNotEmpty(memberEntityInviteList)){ |
| | | memberNumInvite = memberEntityInviteList.size(); |
| | | } |
| | | teamInfoVo.setMemberNum(memberNumInvite); |
| | | //下属团队总算力 |
| | | int powerNum = ydOrderDao.selectAllPowerByMemberIdAndElse(phone); |
| | | teamInfoVo.setPowerNum(powerNum); |
| | | } |
| | | } |
| | | teamVo.setTeamInfoVos(records); |
| | | return Result.ok(teamVo); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 去加减币币账户余额,减少产品的剩余数目 |