周任务抽奖 改为 单次
This commit is contained in:
@@ -149,8 +149,13 @@ public class DiscSpinningController {
|
||||
int drawCount = Integer.parseInt(commonRepository.findOne(901).getValue());
|
||||
map.put("sum", drawCount);
|
||||
if (source != null && !source.equals(1)) {
|
||||
//任务可抽奖次数
|
||||
map.put("count", taskCenterService.countTaskDisc(userId, source.toString()));
|
||||
Integer spinningCount = recordService.countSourceRecord(userId, "taskW");
|
||||
if (spinningCount != null && spinningCount > 0) {
|
||||
map.put("count", 0);
|
||||
} else {
|
||||
int i = taskCenterService.countTaskDisc(userId, source.toString());
|
||||
map.put("count", i > 0 ? 1 : 0);
|
||||
}
|
||||
} else {
|
||||
//订单可抽奖次数
|
||||
int i = recordService.countDraw(userId);
|
||||
@@ -207,6 +212,10 @@ public class DiscSpinningController {
|
||||
} else {
|
||||
String redisKey = "";
|
||||
if (source.equals(2)) {
|
||||
Integer spinningCount = recordService.countSourceRecord(userId, "taskW");
|
||||
if (spinningCount != null && spinningCount > 0) {
|
||||
return Result.error("周抽奖用户仅可参加一次");
|
||||
}
|
||||
redisKey = RedisKeys.getDateKey("spinning:draw:taskW") + userId;
|
||||
} else if (source.equals(3)) {
|
||||
redisKey = RedisKeys.getDateKey("spinning:draw:taskM") + userId;
|
||||
|
||||
Reference in New Issue
Block a user