Commit 249d4ca0 authored by liming's avatar liming

个人排名查询修改

parent 035431ed
...@@ -388,6 +388,8 @@ public class SportUserTrainingLogService { ...@@ -388,6 +388,8 @@ public class SportUserTrainingLogService {
if (rank == null) { if (rank == null) {
result = new SportUserMonthRankResponseDTO(); result = new SportUserMonthRankResponseDTO();
result.setRank(0); result.setRank(0);
result.setScoreRank(0);
result.setCalorieRank(0);
result.setTotalCalorie(0); result.setTotalCalorie(0);
result.setOneMinutesFtp(BigDecimal.ZERO); result.setOneMinutesFtp(BigDecimal.ZERO);
result.setFiveMinutesFtp(BigDecimal.ZERO); result.setFiveMinutesFtp(BigDecimal.ZERO);
...@@ -395,8 +397,13 @@ public class SportUserTrainingLogService { ...@@ -395,8 +397,13 @@ public class SportUserTrainingLogService {
result.setScore(BigDecimal.ZERO); result.setScore(BigDecimal.ZERO);
} else { } else {
result = sportUserConverter.toSportUserMonthRankResponseDTO(rank); result = sportUserConverter.toSportUserMonthRankResponseDTO(rank);
result.setRank(sportUserMonthRankBusinessMapper.getMyRank(type, rank.getScore(), rank.getTotalCalorie(), Integer scoreRank = sportUserMonthRankBusinessMapper.getMyRank(1, rank.getScore(), rank.getTotalCalorie(),
rank.getUpdateTime(), year, month)); rank.getUpdateTime(), year, month);
Integer calorieRank = sportUserMonthRankBusinessMapper.getMyRank(2, rank.getScore(), rank.getTotalCalorie(),
rank.getUpdateTime(), year, month);
result.setRank(scoreRank);
result.setScoreRank(scoreRank);
result.setCalorieRank(calorieRank);
} }
SportUser user = sportUserMapper.selectById(userId); SportUser user = sportUserMapper.selectById(userId);
......
...@@ -13,6 +13,10 @@ public class SportUserMonthRankResponseDTO { ...@@ -13,6 +13,10 @@ public class SportUserMonthRankResponseDTO {
private Long playerId; private Long playerId;
@ApiModelProperty("排名") @ApiModelProperty("排名")
private Integer rank; private Integer rank;
@ApiModelProperty("积分排名")
private Integer scoreRank;
@ApiModelProperty("卡路里排名")
private Integer calorieRank;
@ApiModelProperty("昵称") @ApiModelProperty("昵称")
private String nickname; private String nickname;
@ApiModelProperty("头像") @ApiModelProperty("头像")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment