周任务抽奖 改为 单次

This commit is contained in:
2025-01-14 17:45:29 +08:00
parent 881f3b8faf
commit 81f43a0273

View File

@@ -149,8 +149,13 @@ public class DiscSpinningController {
int drawCount = Integer.parseInt(commonRepository.findOne(901).getValue()); int drawCount = Integer.parseInt(commonRepository.findOne(901).getValue());
map.put("sum", drawCount); map.put("sum", drawCount);
if (source != null && !source.equals(1)) { if (source != null && !source.equals(1)) {
//任务可抽奖次数 Integer spinningCount = recordService.countSourceRecord(userId, "taskW");
map.put("count", taskCenterService.countTaskDisc(userId, source.toString())); 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 { } else {
//订单可抽奖次数 //订单可抽奖次数
int i = recordService.countDraw(userId); int i = recordService.countDraw(userId);
@@ -207,6 +212,10 @@ public class DiscSpinningController {
} else { } else {
String redisKey = ""; String redisKey = "";
if (source.equals(2)) { 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; redisKey = RedisKeys.getDateKey("spinning:draw:taskW") + userId;
} else if (source.equals(3)) { } else if (source.equals(3)) {
redisKey = RedisKeys.getDateKey("spinning:draw:taskM") + userId; redisKey = RedisKeys.getDateKey("spinning:draw:taskM") + userId;