浏览代码

feat:智能陪练一期

Joburgess 3 年之前
父节点
当前提交
c387b20f34

+ 5 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicCompareRecordServiceImpl.java

@@ -129,17 +129,17 @@ public class SysMusicCompareRecordServiceImpl extends BaseServiceImpl<Long, SysM
 		}
 
 		for (int i = 0; i < userTrainStat.size(); i++) {
-			if(userTrainStat.get(i).getUserId().equals(queryInfo.getUserId())){
-				head = userTrainStat.get(i);
-			}
+			userTrainStat.get(i).setRankNum(i+1);
+			userTrainStat.get(i).setTrainTime(userTrainStat.get(i).getTrainTime()/60);
 			if(studentSubjectMap.containsKey(userTrainStat.get(i).getUserId())){
 				userTrainStat.get(i).setSubjectName(studentSubjectMap.get(userTrainStat.get(i).getUserId()));
 			}
 			if(detail.size()<10){
-				userTrainStat.get(i).setRankNum(i+1);
-				userTrainStat.get(i).setTrainTime(userTrainStat.get(i).getTrainTime()/60);
 				detail.add(userTrainStat.get(i));
 			}
+			if(userTrainStat.get(i).getUserId().equals(queryInfo.getUserId())){
+				head = userTrainStat.get(i);
+			}
 		}
 		result.setHead(head);
 		detail.sort(Comparator.comparing(MusicCompareRankingDto::getRankNum).thenComparing(MusicCompareRankingDto::getUserId));