| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -263,7 +263,9 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public List<GroupPointRankingResultDTO> listGroupPointRandingInPercificScope(SearchScopeTypeEnum searchScopeType, String searchScopeId, Integer pageNo, Integer pageSize) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public List<GroupPointRankingResultDTO> listGroupPointRandingInPercificScope(SearchScopeTypeEnum searchScopeType, String searchScopeId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                                                                 Integer pageNo, Integer pageSize, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                                                                 String currentUserId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 1.查询有积分的小组得分排名
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        PageInfo<BizPointTotalDetailEntity> entityPageInfo = PageHelper.startPage(pageNo, pageSize).doSelectPageInfo(() -> { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -283,7 +285,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> groupIds = groupList.stream().map(g -> g.getObjectId()).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 2.将列表填充基本信息并且转换为dto
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<GroupPointRankingResultDTO> rankingInfoDTOs = convertGroupRankingInfoEntity2DTOs(groupIds, groupList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<GroupPointRankingResultDTO> rankingInfoDTOs = convertGroupRankingInfoEntity2DTOs(groupIds, groupList, currentUserId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Page page = new Page(pageNo, pageSize); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -304,7 +306,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 不足0的从0开始
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            startRow = Math.max(startRow, 0); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<GroupPointRankingResultDTO> gap; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            gap = fillGroupPageGap(existingGroupIds, searchScopeType, searchScopeId, startRow, pageSize - groupList.size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            gap = fillGroupPageGap(existingGroupIds, searchScopeType, searchScopeId, startRow, pageSize - groupList.size(), currentUserId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            rankingInfoDTOs.addAll(gap); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -336,7 +338,8 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @author wxz | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @date 2021.09.07 16:30:28 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private List<GroupPointRankingResultDTO> fillGroupPageGap(List<String> existingGroupIds, SearchScopeTypeEnum searchScopeType, String searchScopeObjectId, Integer startRow, Integer rowCount) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private List<GroupPointRankingResultDTO> fillGroupPageGap(List<String> existingGroupIds, SearchScopeTypeEnum searchScopeType, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                                              String searchScopeObjectId, Integer startRow, Integer rowCount, String currentUserId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        GroupFormDTO form = new GroupFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        form.setExcludeGroupIds(existingGroupIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        form.setOrder(GroupFormDTO.OrderTypeEnum.DESC); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -359,6 +362,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setGroupName(g.getGroupName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setGroupId(g.getGroupId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setGridId(g.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setGroupLeaderFlag(g.getLeaderId().equals(currentUserId) ? "leader" : "member"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return dto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -371,7 +375,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @author wxz | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @date 2021.09.07 15:52:17 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private List<GroupPointRankingResultDTO> convertGroupRankingInfoEntity2DTOs(List<String> groupIds, List<BizPointTotalDetailEntity> groupList) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private List<GroupPointRankingResultDTO> convertGroupRankingInfoEntity2DTOs(List<String> groupIds, List<BizPointTotalDetailEntity> groupList, String currentUserId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(groupIds)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -394,6 +398,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setPoint(g.getTotalPoint().toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setGroupHeadPhoto(groupInfo.getGroupHeadPhoto()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setGridId(g.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setGroupLeaderFlag(groupInfo.getLeaderId().equals(currentUserId) ? "leader" : "member"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return dto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return rankingDTOs; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -483,6 +488,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setPoint(point.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setGridRanking(gridRanking); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setCustomerRanking(customerRanking); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setGroupLeaderFlag(g.getGroupLeaderFlag()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return dto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return groupDtoList; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |