功能调整

master
tianea 2 years ago
parent 8fb6782f86
commit 605c750857

@ -438,7 +438,7 @@ public class RankingBiz {
* @param financeScore * @param financeScore
* @return * @return
*/ */
private double computeCombineScore(CompetitionTask task,Double examScore,double financeScore){ private double computeCombineScore(CompetitionTask task,Double examScore,Double financeScore){
if(examScore == null){ if(examScore == null){
examScore =0d; examScore =0d;
} }
@ -446,6 +446,9 @@ public class RankingBiz {
if(power == null){ if(power == null){
power = 0L; power = 0L;
} }
if(financeScore == null){
financeScore = 0D;
}
double score = (examScore*power+financeScore*task.getFinancePower())/100; double score = (examScore*power+financeScore*task.getFinancePower())/100;
return score; return score;
} }
@ -459,7 +462,7 @@ public class RankingBiz {
* @return * @return
*/ */
private double computeFinaceScore(CompetitionTask task,double userRatio,double baseRatio,double maxUserRatio){ private double computeFinaceScore(CompetitionTask task,double userRatio,double baseRatio,double maxUserRatio){
// double score = task.getFinanceBasePower() + ((userRatio - baseRatio) /(maxUserRatio - baseRatio))* task.getFinanceProfitPower(); // 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 - baseRatio) /(maxUserRatio - baseRatio))* task.getFinanceBasePower();
return score; return score;
} }

@ -43,14 +43,17 @@ public interface CompetitionMemberDao extends JpaRepository<CompetitionMember,In
CompetitionMember getByCompetitionIdAndStageIdAndUserId(Long compId,Integer stageId,Long userId); CompetitionMember getByCompetitionIdAndStageIdAndUserId(Long compId,Integer stageId,Long userId);
CompetitionMember getByCompetitionIdAndStageIdAndUserIdAndTeamId(Long compId,Integer stageId,Long userId,Integer teamId); CompetitionMember getByCompetitionIdAndStageIdAndUserIdAndTeamId(Long compId,Integer stageId,Long userId,Integer teamId);
@Transactional
@Modifying @Modifying
@Query(value = "update competition_member set exam_score=:score where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true) @Query(value = "update competition_member set exam_score=:score where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true)
int updateScore(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("score") Double score); int updateScore(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("score") Double score);
@Transactional
@Modifying @Modifying
@Query(value = "update competition_member set exam_start_time=:startTime where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true) @Query(value = "update competition_member set exam_start_time=:startTime where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true)
int updateExamStartTime(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("startTime") Date startTime); int updateExamStartTime(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("startTime") Date startTime);
@Transactional
@Modifying @Modifying
@Query(value = "update competition_member set exam_end_time=:endTime,exam_cost_time=:costTime where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true) @Query(value = "update competition_member set exam_end_time=:endTime,exam_cost_time=:costTime where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true)
int updateExamEndTimeAndCostTime(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("endTime") Date endTime, @Param("costTime") Long costTime); int updateExamEndTimeAndCostTime(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("endTime") Date endTime, @Param("costTime") Long costTime);
@ -58,10 +61,12 @@ public interface CompetitionMemberDao extends JpaRepository<CompetitionMember,In
@Query(value = "update competition_member set report_id=:reportId where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true) @Query(value = "update competition_member set report_id=:reportId where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true)
int updateReportId(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("reportId") Integer reportId); int updateReportId(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("reportId") Integer reportId);
@Transactional
@Modifying @Modifying
@Query(value = "update competition_member set highest_ratio=:ratio where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true) @Query(value = "update competition_member set highest_ratio=:ratio where user_id=:userNo and stage_id=:stageId and competition_id=:compId",nativeQuery = true)
int updateHighestRatio(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("ratio") Double ratio); int updateHighestRatio(@Param("userNo") Long userNo,@Param("stageId") Integer stageId,@Param("compId") Long comId, @Param("ratio") Double ratio);
@Transactional
@Modifying @Modifying
@Query(value = "update competition_member set combine_score=:combineScore where id=:id",nativeQuery = true) @Query(value = "update competition_member set combine_score=:combineScore where id=:id",nativeQuery = true)
int updateComineScore(@Param("combineScore") Double combineScore,@Param("id") Integer id); int updateComineScore(@Param("combineScore") Double combineScore,@Param("id") Integer id);

Loading…
Cancel
Save