| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | member.setReferrerIds(refererIds); |
| | | this.baseMapper.updateById(member); |
| | | |
| | | List<MallMember> childs = this.baseMapper.selectByRefererId(member.getInviteId()); |
| | | List<MallMember> childs = this.baseMapper.selectAllChildAgentListByInviteId(member.getInviteId()); |
| | | if (CollUtil.isEmpty(childs)) { |
| | | return; |
| | | } |
| | |
| | | public List<ChargeListExportVo> findChargeListForExcel(MoneyChargeListDto moneyChargeListDto) { |
| | | return this.mallMoneyFlowMapper.selectChargeListForExcel(moneyChargeListDto); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AdminTeamListVo> findTeamList(MallMember mallMember, QueryRequest request) { |
| | | Page<AdminTeamListVo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<AdminTeamListVo> teamListInPage = this.mallMemberMapper.selectTeamListInPage(mallMember, page); |
| | | if (CollUtil.isEmpty(teamListInPage.getRecords())) { |
| | | return teamListInPage; |
| | | } |
| | | |
| | | List<Long> memberIds = teamListInPage.getRecords().stream().map(AdminTeamListVo::getId).collect(Collectors.toList()); |
| | | List<MallMoneyFlow> mallMoneyFlows = this.mallMoneyFlowMapper.selectMemberProfitByMemberIds(memberIds); |
| | | if (CollUtil.isNotEmpty(mallMoneyFlows)) { |
| | | Map<Long, MallMoneyFlow> map = new HashMap<>(); |
| | | mallMoneyFlows.forEach(item -> { |
| | | map.put(item.getMemberId(), item); |
| | | }); |
| | | |
| | | teamListInPage.getRecords().forEach(item -> { |
| | | MallMoneyFlow mallMoneyFlow = map.get(item.getId()); |
| | | if (mallMoneyFlow != null) { |
| | | item.setTeamProfitAmount(mallMoneyFlow.getAmount()); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | return teamListInPage; |
| | | } |
| | | } |