抽奖 发放金币增加限制
This commit is contained in:
parent
c69679b883
commit
d2a4aff598
@ -696,7 +696,12 @@ public enum GoldOrigin {
|
|||||||
/**
|
/**
|
||||||
* 家族群聊付费解锁.
|
* 家族群聊付费解锁.
|
||||||
*/
|
*/
|
||||||
FAMILY_GROUP_CHAT_AMOUNT("Family group chat amount")
|
FAMILY_GROUP_CHAT_AMOUNT("Family group chat amount"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抽奖奖励
|
||||||
|
*/
|
||||||
|
LOTTERY_REWARD("Lottery reward"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|||||||
@ -23,6 +23,8 @@ import com.red.circle.wallet.inner.endpoint.wallet.WalletGoldClient;
|
|||||||
import com.red.circle.wallet.inner.model.cmd.DiamondReceiptCmd;
|
import com.red.circle.wallet.inner.model.cmd.DiamondReceiptCmd;
|
||||||
import com.red.circle.wallet.inner.model.cmd.GoldReceiptCmd;
|
import com.red.circle.wallet.inner.model.cmd.GoldReceiptCmd;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.red.circle.wallet.inner.model.enums.GoldOrigin;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -113,17 +115,19 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BigDecimal amount = prize.getPrizeValue();
|
// 防止配错导致发送大量金币
|
||||||
|
long goldAmount = prize.getPropsId() > 100000L ? 10000 : prize.getPropsId();
|
||||||
|
BigDecimal amount = BigDecimal.valueOf(goldAmount);
|
||||||
walletGoldClient.changeBalance(
|
walletGoldClient.changeBalance(
|
||||||
GoldReceiptCmd.builder()
|
GoldReceiptCmd.builder()
|
||||||
.opsIncome()
|
.opsIncome()
|
||||||
.userId(userId)
|
.userId(userId)
|
||||||
.sysOrigin(userProfile.getOriginSys())
|
.sysOrigin(userProfile.getOriginSys())
|
||||||
.eventId(recordNo)
|
.eventId(recordNo)
|
||||||
.origin(SysCurrencySendReasonEnum.LOTTERY.name())
|
.origin(GoldOrigin.LOTTERY_REWARD)
|
||||||
.originDescribe("抽奖奖励")
|
.originDescribe(GoldOrigin.LOTTERY_REWARD.name())
|
||||||
.amount(amount)
|
.amount(amount)
|
||||||
.remark("抽奖获得金币")
|
.remark("")
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -175,7 +179,7 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService {
|
|||||||
.setPropsId(prize.getPropsId())
|
.setPropsId(prize.getPropsId())
|
||||||
.setType("PROPS")
|
.setType("PROPS")
|
||||||
.setOrigin(SendPropsOrigin.LOTTERY_REWARD.name())
|
.setOrigin(SendPropsOrigin.LOTTERY_REWARD.name())
|
||||||
.setOriginDesc("抽奖奖励")
|
.setOriginDesc(SendPropsOrigin.LOTTERY_REWARD.getDesc())
|
||||||
.setDays(days)
|
.setDays(days)
|
||||||
.setUseProps(Boolean.FALSE)
|
.setUseProps(Boolean.FALSE)
|
||||||
.setAllowGive(Boolean.FALSE)
|
.setAllowGive(Boolean.FALSE)
|
||||||
@ -206,7 +210,7 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService {
|
|||||||
.setPropsId(prize.getPropsId())
|
.setPropsId(prize.getPropsId())
|
||||||
.setType(type)
|
.setType(type)
|
||||||
.setOrigin(SendPropsOrigin.LOTTERY_REWARD.name())
|
.setOrigin(SendPropsOrigin.LOTTERY_REWARD.name())
|
||||||
.setOriginDesc("抽奖奖励")
|
.setOriginDesc(SendPropsOrigin.LOTTERY_REWARD.getDesc())
|
||||||
.setDays(days)
|
.setDays(days)
|
||||||
.setUseProps(Boolean.FALSE)
|
.setUseProps(Boolean.FALSE)
|
||||||
.setAllowGive(Boolean.FALSE)
|
.setAllowGive(Boolean.FALSE)
|
||||||
@ -215,7 +219,7 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService {
|
|||||||
propsBackpackClient.giveProps(cmd);
|
propsBackpackClient.giveProps(cmd);
|
||||||
|
|
||||||
// 发送通知
|
// 发送通知
|
||||||
propsBackpackClient.givePropsNotify(userId, type, days, prize.getPropsId());
|
// propsBackpackClient.givePropsNotify(userId, type, days, prize.getPropsId());
|
||||||
|
|
||||||
log.info("Backpack props granted, userId: {}, type: {}, propsId: {}, days: {}, recordNo: {}",
|
log.info("Backpack props granted, userId: {}, type: {}, propsId: {}, days: {}, recordNo: {}",
|
||||||
userId, type, prize.getPropsId(), days, recordNo);
|
userId, type, prize.getPropsId(), days, recordNo);
|
||||||
@ -246,7 +250,7 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// 发送通知
|
// 发送通知
|
||||||
propsBackpackClient.givePropsNotify(userId, "BADGE", days, prize.getPropsId());
|
// propsBackpackClient.givePropsNotify(userId, "BADGE", days, prize.getPropsId());
|
||||||
|
|
||||||
log.info("Badge granted, userId: {}, badgeId: {}, days: {}, expireType: {}, recordNo: {}",
|
log.info("Badge granted, userId: {}, badgeId: {}, days: {}, expireType: {}, recordNo: {}",
|
||||||
userId, prize.getPropsId(), days, expireType, recordNo);
|
userId, prize.getPropsId(), days, expireType, recordNo);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user