|
|
@ -311,7 +311,7 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota |
|
|
|
} |
|
|
|
|
|
|
|
// 4.排名填充。有积分的按照积分排序,分数一样的名次一样
|
|
|
|
Integer ranking = page.getStartRow() + 1; |
|
|
|
Integer ranking = getStartRanking(rankingInfoDTOs, searchScopeType.getScopeType(), searchScopeId); |
|
|
|
Integer prevPoint = null; |
|
|
|
for (GroupPointRankingResultDTO g : rankingInfoDTOs) { |
|
|
|
Integer point = Integer.valueOf(g.getPoint()); |
|
|
@ -322,13 +322,42 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota |
|
|
|
|
|
|
|
GridInfoCache gridInfo = getGridInfo(g.getGridId()); |
|
|
|
g.setGridId(g.getGridId()); |
|
|
|
g.setGridNamePath(gridInfo.getGridNamePath()); |
|
|
|
if (gridInfo != null) { |
|
|
|
g.setGridNamePath(gridInfo.getGridNamePath()); |
|
|
|
} else { |
|
|
|
// todo 网格被删除了,应该怎么办?
|
|
|
|
g.setGridNamePath(" "); |
|
|
|
} |
|
|
|
g.setRanking(String.valueOf(ranking)); |
|
|
|
prevPoint = point; |
|
|
|
} |
|
|
|
return rankingInfoDTOs; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description 获取起始排名 |
|
|
|
* |
|
|
|
* @param points 积分信息分页列表 |
|
|
|
* @return |
|
|
|
* @author wxz |
|
|
|
* @date 2021.09.16 14:50:11 |
|
|
|
*/ |
|
|
|
private Integer getStartRanking(List<GroupPointRankingResultDTO> points, String scopeType, String scopeObjectId) { |
|
|
|
if (CollectionUtils.isEmpty(points)) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
GroupPointRankingResultDTO firstPoint = points.get(0); |
|
|
|
|
|
|
|
if (firstPoint.getPoint().equals("0")) { |
|
|
|
// 如果第一条积分就是0,那么查询出来有积分的组的最低名次+1(注意:point_total表不能有积分为0的记录,否则计算出来的名次会比实际名次+1)
|
|
|
|
Integer minRanking = baseDao.getMinRanking("group", scopeType, scopeObjectId); |
|
|
|
return minRanking + 1; |
|
|
|
} else { |
|
|
|
return baseDao.getRanking("group", firstPoint.getGroupId(), scopeType); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description 获取分页缺口group ranking信息 |
|
|
|
* |
|
|
|