幸运24-额外-螺旋降级
This commit is contained in:
@@ -114,7 +114,9 @@ public class Lucky24GiftSendService {
|
||||
return draw(config, partitionConfig, senderUid, partitionId, gift, everyGiftNum, everyoneGoldNum, receiverList, room, sendGiftTime);
|
||||
}
|
||||
|
||||
Lucky24Record extraRecord = extraService.randomExtraRecord(config, extraPoolConfig, senderUid, partitionId, extraLuckerUid, gift, everyGiftNum, everyoneGoldNum, room, sendGiftTime);
|
||||
int extraDrawMultiple = extraService.drawMultiple(extraPoolConfig, senderUid, partitionId);
|
||||
Lucky24Result extraResult = new Lucky24Result(Lucky24PoolTypeEnum.EXTRA_POOL.getType(), null, everyoneGoldNum, extraDrawMultiple, false);
|
||||
Lucky24Record extraRecord = updateMeta(config, partitionConfig, senderUid, partitionId, gift, everyGiftNum, extraLuckerUid, everyoneGoldNum, room, sendGiftTime, null, extraResult);
|
||||
|
||||
List<Long> receiverUidList = new ArrayList<>(receiverList);
|
||||
receiverUidList.remove(extraLuckerUid);
|
||||
|
@@ -2,6 +2,7 @@ package com.accompany.business.service.lucky;
|
||||
|
||||
import com.accompany.business.constant.Lucky24PoolTypeEnum;
|
||||
import com.accompany.business.dto.lucky.Lucky24GiftConfig;
|
||||
import com.accompany.business.dto.lucky.Lucky24Result;
|
||||
import com.accompany.business.model.Gift;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
@@ -115,35 +116,6 @@ public class Lucky24ExtraService {
|
||||
return luckyer;
|
||||
}
|
||||
|
||||
public Lucky24Record randomExtraRecord(Lucky24GiftConfig config, Lucky24GiftConfig.Lucky24ExtraPoolConfig extraPoolConfig, long senderUid, Integer partitionId, Long receiverUid,
|
||||
Gift gift, int giftNum, long everyoneGoldNum, Room room, Date sendGiftTime) {
|
||||
|
||||
int drawMultiple = drawMultiple(extraPoolConfig, senderUid, partitionId);
|
||||
|
||||
long afterMultiple = drawMultiple;
|
||||
|
||||
// 平台库存
|
||||
BigDecimal preWinGoldNum = BigDecimal.valueOf(afterMultiple * everyoneGoldNum);
|
||||
Lucky24StockResultVo stockResultVo = judgeStock(partitionId, preWinGoldNum, senderUid, receiverUid, gift, giftNum, everyoneGoldNum, room, sendGiftTime);
|
||||
if (!stockResultVo.isSuccess()) {
|
||||
afterMultiple = 0L;
|
||||
}
|
||||
long winGoldNum = afterMultiple * everyoneGoldNum;
|
||||
|
||||
if (winGoldNum > 0L) {
|
||||
settlementService.sendReward(config, senderUid, room, gift, winGoldNum, afterMultiple);
|
||||
}
|
||||
|
||||
userMetaService.updateExtraUserMeta(senderUid, partitionId, everyoneGoldNum, winGoldNum);
|
||||
|
||||
log.info("[lucky24] extra uid {} partitionId {} receiverUid {} drawMultiple {} preWinGoldNum {} afterMultiple {} winGoldNum {}",
|
||||
senderUid, partitionId, receiverUid, drawMultiple, preWinGoldNum, afterMultiple, winGoldNum);
|
||||
|
||||
return recordService.buildRecord(senderUid, partitionId, gift, giftNum, null != room ? room.getUid() : null,
|
||||
receiverUid, Lucky24PoolTypeEnum.EXTRA_POOL.getType(), null,
|
||||
Boolean.FALSE, drawMultiple, afterMultiple, !stockResultVo.isSuccess() ? stockResultVo : null, sendGiftTime);
|
||||
}
|
||||
|
||||
public int drawMultiple(Lucky24GiftConfig.Lucky24ExtraPoolConfig extraPoolConfig, long senderUid, Integer partitionId) {
|
||||
|
||||
Map<String, Number> userMetaMapSnapshot = userMetaService.getUserMeta(senderUid).readAllMap();
|
||||
|
Reference in New Issue
Block a user