排行榜问题,和发奖时间日志
parent
36e07bc438
commit
a7b964ffcc
|
@ -1272,8 +1272,7 @@ public class TimeUtils {
|
||||||
public static int getHourOfDay() {
|
public static int getHourOfDay() {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
return calendar.get(Calendar.HOUR_OF_DAY);
|
||||||
return hour;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 获得当前时间是今天的几点(整点)
|
* 获得当前时间是今天的几点(整点)
|
||||||
|
@ -1283,8 +1282,7 @@ public class TimeUtils {
|
||||||
public static int getMiunte() {
|
public static int getMiunte() {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
int minute = calendar.get(Calendar.MINUTE);
|
return calendar.get(Calendar.MINUTE);
|
||||||
return minute;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 获得当前时间是今天的几点(整点)
|
* 获得当前时间是今天的几点(整点)
|
||||||
|
@ -1294,8 +1292,7 @@ public class TimeUtils {
|
||||||
public static int getMiunte(long time) {
|
public static int getMiunte(long time) {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(time);
|
calendar.setTimeInMillis(time);
|
||||||
int minute = calendar.get(Calendar.MINUTE);
|
return calendar.get(Calendar.MINUTE);
|
||||||
return minute;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ljsd.jieling.logic.rank.rankImpl;
|
package com.ljsd.jieling.logic.rank.rankImpl;
|
||||||
|
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
|
import util.TimeUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hj
|
* @author hj
|
||||||
|
@ -24,7 +25,7 @@ public class CrossRank extends AbstractRank {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getScore(double... data) {
|
public double getScore(double... data) {
|
||||||
return data[0];
|
return data[0]+ TimeUtils.getDoubleTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,9 +433,7 @@ public class SevenWorldLogic {
|
||||||
* 结束发送奖励
|
* 结束发送奖励
|
||||||
*/
|
*/
|
||||||
public void sendRankReward(){
|
public void sendRankReward(){
|
||||||
if (!isTime()){
|
if (isTime()){
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 排行榜
|
// 排行榜
|
||||||
String crossRedisKey = RankContext.getRankEnum(RankEnum.CROSS_SEVEN_WORLD_RANK.getType()).getCrossRedisKey();
|
String crossRedisKey = RankContext.getRankEnum(RankEnum.CROSS_SEVEN_WORLD_RANK.getType()).getCrossRedisKey();
|
||||||
Set<ZSetOperations.TypedTuple<String>> range = RedisUtil.getInstence().getZsetreverseRangeWithScores(crossRedisKey,"",0,-1,false);
|
Set<ZSetOperations.TypedTuple<String>> range = RedisUtil.getInstence().getZsetreverseRangeWithScores(crossRedisKey,"",0,-1,false);
|
||||||
|
@ -467,6 +465,7 @@ public class SevenWorldLogic {
|
||||||
SevenWorldLogic.setEnd(true);
|
SevenWorldLogic.setEnd(true);
|
||||||
System.out.print("七界试炼活动结束,发奖完成...\n");
|
System.out.print("七界试炼活动结束,发奖完成...\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 每周末的23:30分发奖
|
* 每周末的23:30分发奖
|
||||||
|
@ -476,7 +475,9 @@ public class SevenWorldLogic {
|
||||||
int week = TimeUtils.getDayOfWeek();
|
int week = TimeUtils.getDayOfWeek();
|
||||||
int hour = TimeUtils.getHourOfDay();
|
int hour = TimeUtils.getHourOfDay();
|
||||||
int minute = TimeUtils.getMiunte();
|
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