|
|
|
@ -8,6 +8,7 @@ import com.tz.platform.common.core.tools.DateUtil;
|
|
|
|
|
import com.tz.platform.entity.*;
|
|
|
|
|
import com.tz.platform.juejin.JueJinApi;
|
|
|
|
|
import com.tz.platform.repository.*;
|
|
|
|
|
import io.swagger.models.auth.In;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
@ -234,7 +235,11 @@ public class RankingBiz {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
computeScore(rankingList,currentTask,competition,baseRatio);
|
|
|
|
|
computeRanking(rankingList,currentTask,competition.getTeamMaxCount(),now);
|
|
|
|
|
if(competition.getTeamMaxCount() == null){
|
|
|
|
|
computeRanking(rankingList,currentTask,1,now);
|
|
|
|
|
}else{
|
|
|
|
|
computeRanking(rankingList,currentTask,competition.getTeamMaxCount(),now);
|
|
|
|
|
}
|
|
|
|
|
computeMemberRank(currentTask.getCompetitionId(),currentTask.getStageId(),competition.getTeamMaxCount());
|
|
|
|
|
competition.setUpdateRankDate(now);
|
|
|
|
|
competitionDao.save(competition);
|
|
|
|
@ -393,12 +398,14 @@ public class RankingBiz {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// rankingList.sort(Comparator.comparing(Ranking::getFinanceScore).reversed());
|
|
|
|
|
//// for(int i = 0;i<rankingList.size();i++){
|
|
|
|
|
//// int rank = i + 1;
|
|
|
|
|
//// Ranking ranking = rankingList.get(i);
|
|
|
|
|
//// ranking.setPersonalRank(rank);
|
|
|
|
|
//// memberDao.updatePersonalRank(ranking.getUserNo(),ranking.getStageId(),ranking.getCompId(),rank);
|
|
|
|
|
//// }
|
|
|
|
|
rankingList.sort(Comparator.comparing(Ranking::getPnlRatio).reversed());
|
|
|
|
|
for(int i = 0;i<rankingList.size();i++){
|
|
|
|
|
int rank = i + 1;
|
|
|
|
|
Ranking ranking = rankingList.get(i);
|
|
|
|
|
ranking.setPersonalRank(rank);
|
|
|
|
|
memberDao.updatePersonalRank(ranking.getUserNo(),ranking.getStageId(),ranking.getCompId(),rank);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// try {
|
|
|
|
|
// Map<Integer, Double> tcrMap = sortMapByValues(teamCombineRank);
|
|
|
|
|
// AtomicInteger rank = new AtomicInteger(0);
|
|
|
|
@ -463,7 +470,7 @@ public class RankingBiz {
|
|
|
|
|
*/
|
|
|
|
|
private double computeFinaceScore(CompetitionTask task,double userRatio,double baseRatio,double maxUserRatio){
|
|
|
|
|
// double score = task.getFinanceBasePower() + ((userRatio - baseRatio) /(maxUserRatio - baseRatio))* task.getFinancegetFinanceProfitPowerProfitPower();
|
|
|
|
|
double score = task.getFinanceProfitPower() + ((userRatio - baseRatio) /(maxUserRatio - baseRatio))* task.getFinanceBasePower();
|
|
|
|
|
double score = task.getFinanceProfitPower() + ((userRatio) /(maxUserRatio))* task.getFinanceBasePower();
|
|
|
|
|
return score;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|