斋月活动抽奖进度处理
This commit is contained in:
parent
6df54426ce
commit
b9a446ae4c
@ -189,8 +189,8 @@ public class GameHkysRestController {
|
|||||||
//累计游戏排行榜
|
//累计游戏排行榜
|
||||||
incGameRankingRecord(cmd, gameListConfig);
|
incGameRankingRecord(cmd, gameListConfig);
|
||||||
|
|
||||||
//处理游戏消费任务
|
//处理游戏获得任务
|
||||||
if (cmd.getType() == 1) {
|
if (cmd.getType() == 2) {
|
||||||
gameActivityService.handleGameSpendTask(userId, cmd.getCoin());
|
gameActivityService.handleGameSpendTask(userId, cmd.getCoin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -692,13 +692,16 @@ public class GiftCountStrategy implements GiftStrategy {
|
|||||||
|
|
||||||
log.info("Spins送礼物任务, userId={}, giftCount={}", userId, giftCount);
|
log.info("Spins送礼物任务, userId={}, giftCount={}", userId, giftCount);
|
||||||
|
|
||||||
// 处理送出5个礼物任务
|
List<Long> giftIds = List.of(2008386103976968193L, 1995470109066625026L, 1991071998523138049L);
|
||||||
spinsUserTaskProgressService.updateTaskProgress(
|
if (runningWater.getGiftId() != null && giftIds.contains(runningWater.getGiftId())) {
|
||||||
new SpinsTaskProgressUpdateCmd()
|
// 处理送出5个礼物任务
|
||||||
.setUserId(userId)
|
spinsUserTaskProgressService.updateTaskProgress(
|
||||||
.setTaskCode("SPINS_SEND_GIFT_5")
|
new SpinsTaskProgressUpdateCmd()
|
||||||
.setProgressValue(giftCount)
|
.setUserId(userId)
|
||||||
);
|
.setTaskCode("SPINS_SEND_GIFT_5")
|
||||||
|
.setProgressValue(giftCount)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
log.info("Spins送礼物任务处理成功, userId={}, giftCount={}", userId, giftCount);
|
log.info("Spins送礼物任务处理成功, userId={}, giftCount={}", userId, giftCount);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -183,7 +183,7 @@ public class TaskListener implements MessageListener {
|
|||||||
spinsUserTaskProgressService.updateTaskProgress(
|
spinsUserTaskProgressService.updateTaskProgress(
|
||||||
new SpinsTaskProgressUpdateCmd()
|
new SpinsTaskProgressUpdateCmd()
|
||||||
.setUserId(userId)
|
.setUserId(userId)
|
||||||
.setTaskCode("SPINS_MIC_1_HOUR")
|
.setTaskCode("SPINS_MIC_90_MIN")
|
||||||
.setProgressValue(micTime)
|
.setProgressValue(micTime)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -18,17 +18,17 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class GameActivityService {
|
public class GameActivityService {
|
||||||
|
|
||||||
private static final long MAX_DAILY_SPEND = 50000L;
|
private static final long MAX_DAILY_SPEND = 500000L;
|
||||||
private static final String REDIS_KEY_PREFIX = "spins:daily:game:spend:";
|
private static final String REDIS_KEY_PREFIX = "spins:daily:game:save:";
|
||||||
|
|
||||||
private final RedisService redisService;
|
private final RedisService redisService;
|
||||||
private final SpinsUserTaskProgressService spinsUserTaskProgressService;
|
private final SpinsUserTaskProgressService spinsUserTaskProgressService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理游戏消费任务
|
* 处理游戏消费/获得任务
|
||||||
*
|
*
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @param spendAmount 本次消费金额
|
* @param spendAmount 本次消费/获得金额
|
||||||
*/
|
*/
|
||||||
public void handleGameSpendTask(Long userId, Long spendAmount) {
|
public void handleGameSpendTask(Long userId, Long spendAmount) {
|
||||||
try {
|
try {
|
||||||
@ -46,7 +46,7 @@ public class GameActivityService {
|
|||||||
redisService.expire(redisKey, expireSeconds, TimeUnit.SECONDS);
|
redisService.expire(redisKey, expireSeconds, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果累计已经超过50000,不再处理任务
|
// 如果累计已经超过500000,不再处理任务
|
||||||
if (totalSpend - spendAmount >= MAX_DAILY_SPEND) {
|
if (totalSpend - spendAmount >= MAX_DAILY_SPEND) {
|
||||||
log.info("Spins游戏消费任务已达上限, userId={}, totalSpend={}", userId, totalSpend);
|
log.info("Spins游戏消费任务已达上限, userId={}, totalSpend={}", userId, totalSpend);
|
||||||
return;
|
return;
|
||||||
@ -64,27 +64,27 @@ public class GameActivityService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新游戏消费进度
|
* 更新游戏进度
|
||||||
*/
|
*/
|
||||||
private void updateGameSpendProgress(Long userId, int progressValue) {
|
private void updateGameSpendProgress(Long userId, int progressValue) {
|
||||||
spinsUserTaskProgressService.updateTaskProgress(
|
spinsUserTaskProgressService.updateTaskProgress(
|
||||||
new SpinsTaskProgressUpdateCmd()
|
new SpinsTaskProgressUpdateCmd()
|
||||||
.setUserId(userId)
|
.setUserId(userId)
|
||||||
.setTaskCode("SPINS_SPEND_5000")
|
.setTaskCode("SPINS_SAVE_50000")
|
||||||
.setProgressValue(progressValue)
|
.setProgressValue(progressValue)
|
||||||
);
|
);
|
||||||
|
|
||||||
spinsUserTaskProgressService.updateTaskProgress(
|
spinsUserTaskProgressService.updateTaskProgress(
|
||||||
new SpinsTaskProgressUpdateCmd()
|
new SpinsTaskProgressUpdateCmd()
|
||||||
.setUserId(userId)
|
.setUserId(userId)
|
||||||
.setTaskCode("SPINS_SPEND_10000")
|
.setTaskCode("SPINS_SAVE_100000")
|
||||||
.setProgressValue(progressValue)
|
.setProgressValue(progressValue)
|
||||||
);
|
);
|
||||||
|
|
||||||
spinsUserTaskProgressService.updateTaskProgress(
|
spinsUserTaskProgressService.updateTaskProgress(
|
||||||
new SpinsTaskProgressUpdateCmd()
|
new SpinsTaskProgressUpdateCmd()
|
||||||
.setUserId(userId)
|
.setUserId(userId)
|
||||||
.setTaskCode("SPINS_SPEND_50000")
|
.setTaskCode("SPINS_SAVE_500000")
|
||||||
.setProgressValue(progressValue)
|
.setProgressValue(progressValue)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -218,8 +218,8 @@ public class GameBaishunServiceImpl implements GameBaishunService {
|
|||||||
//累计游戏排行榜
|
//累计游戏排行榜
|
||||||
incGameRankingRecord(request, gameListConfig);
|
incGameRankingRecord(request, gameListConfig);
|
||||||
|
|
||||||
//处理游戏消费任务
|
//处理游戏获得任务
|
||||||
if (request.getCurrencyDiff() < 0) {
|
if (request.getCurrencyDiff() > 0) {
|
||||||
gameActivityService.handleGameSpendTask(userId, Math.abs(request.getCurrencyDiff()));
|
gameActivityService.handleGameSpendTask(userId, Math.abs(request.getCurrencyDiff()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -318,8 +318,8 @@ public class HotGameServiceImpl implements HotGameService {
|
|||||||
//FruitParty
|
//FruitParty
|
||||||
incGameRankingTmpActivity(param);
|
incGameRankingTmpActivity(param);
|
||||||
|
|
||||||
//处理游戏消费任务
|
//处理游戏获得任务
|
||||||
if (param.getType() == 1) {
|
if (param.getType() == 2) {
|
||||||
gameActivityService.handleGameSpendTask(userId, param.getCoin());
|
gameActivityService.handleGameSpendTask(userId, param.getCoin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -171,10 +171,8 @@ public class YomiGameServiceImpl implements YomiGameService {
|
|||||||
|
|
||||||
// 游戏参与打榜活动
|
// 游戏参与打榜活动
|
||||||
incGameRankingActivity(userId, changeValue, gameConfig.getGameId());
|
incGameRankingActivity(userId, changeValue, gameConfig.getGameId());
|
||||||
}
|
|
||||||
|
|
||||||
//处理游戏消费任务
|
//处理游戏获得任务
|
||||||
if (isConsume(cmd)) {
|
|
||||||
gameActivityService.handleGameSpendTask(userId, changeValue.longValue());
|
gameActivityService.handleGameSpendTask(userId, changeValue.longValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user