排行榜问题,和发奖时间日志

duhui 2021-10-10 23:34:35 +08:00
parent 36e07bc438
commit a7b964ffcc
3 changed files with 37 additions and 38 deletions

View File

@ -1272,8 +1272,7 @@ public class TimeUtils {
public static int getHourOfDay() {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
int hour = calendar.get(Calendar.HOUR_OF_DAY);
return hour;
return calendar.get(Calendar.HOUR_OF_DAY);
}
/**
* ()
@ -1283,8 +1282,7 @@ public class TimeUtils {
public static int getMiunte() {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
int minute = calendar.get(Calendar.MINUTE);
return minute;
return calendar.get(Calendar.MINUTE);
}
/**
* ()
@ -1294,8 +1292,7 @@ public class TimeUtils {
public static int getMiunte(long time) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
int minute = calendar.get(Calendar.MINUTE);
return minute;
return calendar.get(Calendar.MINUTE);
}
// /**

View File

@ -1,6 +1,7 @@
package com.ljsd.jieling.logic.rank.rankImpl;
import com.ljsd.jieling.db.redis.RedisUtil;
import util.TimeUtils;
/**
* @author hj
@ -24,7 +25,7 @@ public class CrossRank extends AbstractRank {
@Override
public double getScore(double... data) {
return data[0];
return data[0]+ TimeUtils.getDoubleTime();
}
}

View File

@ -433,9 +433,7 @@ public class SevenWorldLogic {
*
*/
public void sendRankReward(){
if (!isTime()){
return;
}
if (isTime()){
// 排行榜
String crossRedisKey = RankContext.getRankEnum(RankEnum.CROSS_SEVEN_WORLD_RANK.getType()).getCrossRedisKey();
Set<ZSetOperations.TypedTuple<String>> range = RedisUtil.getInstence().getZsetreverseRangeWithScores(crossRedisKey,"",0,-1,false);
@ -467,6 +465,7 @@ public class SevenWorldLogic {
SevenWorldLogic.setEnd(true);
System.out.print("七界试炼活动结束,发奖完成...\n");
}
}
/**
* 2330
@ -476,7 +475,9 @@ public class SevenWorldLogic {
int week = TimeUtils.getDayOfWeek();
int hour = TimeUtils.getHourOfDay();
int minute = TimeUtils.getMiunte();
return week == 7 && hour == 23 && minute == 30;
boolean b = week == 7 && hour == 23 && minute == 30;
LOGGER.info("当前时间week:{},hour:{},minute:{},result:{}",week,hour,minute,b);
return b;
}
}