斋月活动抽奖进度处理

This commit is contained in:
tianfeng 2026-02-09 12:26:17 +08:00
parent 6df54426ce
commit b9a446ae4c
7 changed files with 28 additions and 27 deletions

View File

@ -189,8 +189,8 @@ public class GameHkysRestController {
//累计游戏排行榜
incGameRankingRecord(cmd, gameListConfig);
//处理游戏消费任务
if (cmd.getType() == 1) {
//处理游戏获得任务
if (cmd.getType() == 2) {
gameActivityService.handleGameSpendTask(userId, cmd.getCoin());
}

View File

@ -692,13 +692,16 @@ public class GiftCountStrategy implements GiftStrategy {
log.info("Spins送礼物任务, userId={}, giftCount={}", userId, giftCount);
// 处理送出5个礼物任务
spinsUserTaskProgressService.updateTaskProgress(
new SpinsTaskProgressUpdateCmd()
.setUserId(userId)
.setTaskCode("SPINS_SEND_GIFT_5")
.setProgressValue(giftCount)
);
List<Long> giftIds = List.of(2008386103976968193L, 1995470109066625026L, 1991071998523138049L);
if (runningWater.getGiftId() != null && giftIds.contains(runningWater.getGiftId())) {
// 处理送出5个礼物任务
spinsUserTaskProgressService.updateTaskProgress(
new SpinsTaskProgressUpdateCmd()
.setUserId(userId)
.setTaskCode("SPINS_SEND_GIFT_5")
.setProgressValue(giftCount)
);
}
log.info("Spins送礼物任务处理成功, userId={}, giftCount={}", userId, giftCount);
} catch (Exception e) {

View File

@ -183,7 +183,7 @@ public class TaskListener implements MessageListener {
spinsUserTaskProgressService.updateTaskProgress(
new SpinsTaskProgressUpdateCmd()
.setUserId(userId)
.setTaskCode("SPINS_MIC_1_HOUR")
.setTaskCode("SPINS_MIC_90_MIN")
.setProgressValue(micTime)
);

View File

@ -18,17 +18,17 @@ import java.util.concurrent.TimeUnit;
@RequiredArgsConstructor
public class GameActivityService {
private static final long MAX_DAILY_SPEND = 50000L;
private static final String REDIS_KEY_PREFIX = "spins:daily:game:spend:";
private static final long MAX_DAILY_SPEND = 500000L;
private static final String REDIS_KEY_PREFIX = "spins:daily:game:save:";
private final RedisService redisService;
private final SpinsUserTaskProgressService spinsUserTaskProgressService;
/**
* 处理游戏消费任务
* 处理游戏消费/获得任务
*
* @param userId 用户ID
* @param spendAmount 本次消费金额
* @param spendAmount 本次消费/获得金额
*/
public void handleGameSpendTask(Long userId, Long spendAmount) {
try {
@ -46,7 +46,7 @@ public class GameActivityService {
redisService.expire(redisKey, expireSeconds, TimeUnit.SECONDS);
}
// 如果累计已经超过50000不再处理任务
// 如果累计已经超过500000不再处理任务
if (totalSpend - spendAmount >= MAX_DAILY_SPEND) {
log.info("Spins游戏消费任务已达上限, userId={}, totalSpend={}", userId, totalSpend);
return;
@ -64,27 +64,27 @@ public class GameActivityService {
}
/**
* 更新游戏消费进度
* 更新游戏进度
*/
private void updateGameSpendProgress(Long userId, int progressValue) {
spinsUserTaskProgressService.updateTaskProgress(
new SpinsTaskProgressUpdateCmd()
.setUserId(userId)
.setTaskCode("SPINS_SPEND_5000")
.setTaskCode("SPINS_SAVE_50000")
.setProgressValue(progressValue)
);
spinsUserTaskProgressService.updateTaskProgress(
new SpinsTaskProgressUpdateCmd()
.setUserId(userId)
.setTaskCode("SPINS_SPEND_10000")
.setTaskCode("SPINS_SAVE_100000")
.setProgressValue(progressValue)
);
spinsUserTaskProgressService.updateTaskProgress(
new SpinsTaskProgressUpdateCmd()
.setUserId(userId)
.setTaskCode("SPINS_SPEND_50000")
.setTaskCode("SPINS_SAVE_500000")
.setProgressValue(progressValue)
);
}

View File

@ -218,8 +218,8 @@ public class GameBaishunServiceImpl implements GameBaishunService {
//累计游戏排行榜
incGameRankingRecord(request, gameListConfig);
//处理游戏消费任务
if (request.getCurrencyDiff() < 0) {
//处理游戏获得任务
if (request.getCurrencyDiff() > 0) {
gameActivityService.handleGameSpendTask(userId, Math.abs(request.getCurrencyDiff()));
}
}

View File

@ -318,8 +318,8 @@ public class HotGameServiceImpl implements HotGameService {
//FruitParty
incGameRankingTmpActivity(param);
//处理游戏消费任务
if (param.getType() == 1) {
//处理游戏获得任务
if (param.getType() == 2) {
gameActivityService.handleGameSpendTask(userId, param.getCoin());
}

View File

@ -171,13 +171,11 @@ public class YomiGameServiceImpl implements YomiGameService {
// 游戏参与打榜活动
incGameRankingActivity(userId, changeValue, gameConfig.getGameId());
}
//处理游戏消费任务
if (isConsume(cmd)) {
//处理游戏获得任务
gameActivityService.handleGameSpendTask(userId, changeValue.longValue());
}
return new YomiBalanceCO(currentBalance);
} catch (Exception e) {