排行榜问题,和发奖时间日志
parent
36e07bc438
commit
a7b964ffcc
|
@ -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);
|
||||
}
|
||||
|
||||
// /**
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 每周末的23:30分发奖
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue