幸运25-poolJudge-delPool前加判curPoolType

This commit is contained in:
khalil
2025-05-07 18:33:13 +08:00
parent 27ec2aa3bc
commit baa4664136
2 changed files with 13 additions and 8 deletions

View File

@@ -95,7 +95,7 @@ public class Lucky25DrawService {
}
Lucky25GiftConfig partitionConfig = config.getRatioByPartitionId(partitionId);
if (null != partitionConfig.getJudgeInputThreshold() && beforeTotalInput > partitionConfig.getJudgeInputThreshold()){
if (null != partitionConfig.getJudgeInputThreshold() && beforeTotalInput >= partitionConfig.getJudgeInputThreshold()){
Number curPoolTypeN = userMetaMap.get(Lucky25UserMetaService.POOL_TYPE);
if (null != curPoolTypeN){
int curPoolType = curPoolTypeN.intValue();

View File

@@ -63,11 +63,7 @@ public class Lucky25PoolService {
public void delPoolAndGenPool(Lucky25GiftConfig config, Long uid, int poolType, int genNum){
RQueue<Lucky25Result> userPool = getUserPool(uid);
delAndGenRandomPoolByType(config, uid, userPool, poolType, genNum);
}
private void delAndGenRandomPoolByType(Lucky25GiftConfig config, Long uid, RQueue<Lucky25Result> userPool,
Integer pooType, int genNum) {
boolean locked = false;
RLock lock = redissonClient.getLock(RedisKey.lucky_25_user_lock.getKey(uid.toString()));
try {
@@ -76,12 +72,16 @@ public class Lucky25PoolService {
throw new ServiceException(BusiStatus.SERVERBUSY);
}
Number curPoolTypeN = userMetaService.getUserMeta(uid).get(Lucky25UserMetaService.POOL_TYPE);
if (null == curPoolTypeN || curPoolTypeN.intValue() != poolType){
log.error("[lucky24] delPoolAndGenPool curPoolType != poolType uid {} curPoolType {} poolType {}", uid, curPoolTypeN, poolType);
throw new ServiceException(BusiStatus.SERVERBUSY);
}
userPool.clear();
Lucky25PoolTypeEnum poolType = Lucky25PoolTypeEnum.get(pooType);
List<Lucky25Pool> poolList = poolMapper.selectList(Wrappers.<Lucky25Pool>lambdaQuery()
.eq(Lucky25Pool::getType, poolType.getType()));
.eq(Lucky25Pool::getType, poolType));
if (CollectionUtils.isEmpty(poolList)){
throw new ServiceException(BusiStatus.SEIZE_TREASURE_POOL_CONFIG_ERROR);
}
@@ -104,6 +104,11 @@ public class Lucky25PoolService {
}
}
private void delAndGenRandomPoolByType(Lucky25GiftConfig config, Long uid, RQueue<Lucky25Result> userPool,
Integer pooType, int genNum) {
}
private void genPool(Lucky25GiftConfig config, Long uid, int partitionId, RQueue<Lucky25Result> userPool) {
boolean locked = false;
RLock lock = redissonClient.getLock(RedisKey.lucky_25_user_lock.getKey(uid.toString()));