From 1b5fc22d7f583f480878badef1f19c6b99080e39 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 15 Jan 2026 17:02:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=A5=96=E6=96=B0=E5=A2=9E=E7=A2=8E?= =?UTF-8?q?=E7=89=87=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LotteryPrizeGrantServiceImpl.java | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/impl/LotteryPrizeGrantServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/impl/LotteryPrizeGrantServiceImpl.java index 0f479868..a2621b71 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/impl/LotteryPrizeGrantServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/impl/LotteryPrizeGrantServiceImpl.java @@ -7,10 +7,12 @@ import com.red.circle.common.business.enums.SendPropsOrigin; import com.red.circle.other.app.service.activity.LotteryPrizeGrantService; import com.red.circle.other.infra.database.rds.entity.activity.LotteryPrize; import com.red.circle.other.inner.endpoint.material.props.BadgeBackpackClient; +import com.red.circle.other.inner.endpoint.material.props.FragmentsBackpackClient; import com.red.circle.other.inner.endpoint.material.props.PropsBackpackClient; import com.red.circle.other.inner.endpoint.material.props.RoomThemeBackpackClient; import com.red.circle.other.inner.endpoint.user.user.UserProfileClient; import com.red.circle.other.inner.enums.material.BadgeBackpackExpireTypeEnum; +import com.red.circle.other.inner.enums.material.PropsTypeEnum; import com.red.circle.other.inner.enums.sys.SysBadgeConfigTypeEnum; import com.red.circle.other.inner.enums.sys.SysCurrencySendReasonEnum; import com.red.circle.other.inner.model.cmd.material.GiveBadgeCmd; @@ -23,6 +25,7 @@ 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.GoldReceiptCmd; import java.math.BigDecimal; +import java.util.Set; import com.red.circle.wallet.inner.model.enums.GoldOrigin; import lombok.RequiredArgsConstructor; @@ -46,6 +49,7 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService { private final BadgeBackpackClient badgeBackpackClient; private final RoomThemeBackpackClient roomThemeBackpackClient; private final UserProfileClient userProfileClient; + private final FragmentsBackpackClient fragmentsBackpackClient; @Override public void grantPrize(Long userId, LotteryPrize prize, String recordNo) { @@ -79,6 +83,10 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService { case "BADGE": grantBadge(userId, prize, recordNo); break; + + case "FRAGMENTS": + grantFragments(userId, prize); + break; case "THEME": grantTheme(userId, prize, recordNo); @@ -248,12 +256,26 @@ public class LotteryPrizeGrantServiceImpl implements LotteryPrizeGrantService { .setDays(days) .setBadgeType(SysBadgeConfigTypeEnum.ACTIVITY) ); - - // 发送通知 -// propsBackpackClient.givePropsNotify(userId, "BADGE", days, prize.getPropsId()); - - log.info("Badge granted, userId: {}, badgeId: {}, days: {}, expireType: {}, recordNo: {}", - userId, prize.getPropsId(), days, expireType, recordNo); + } + + /** + * 发放徽章. + */ + private void grantFragments(Long userId, LotteryPrize prize) { + if (prize.getPropsId() == null) { + return; + } + + // 这里的天数是数量,随便数量 + int days = prize.getPrizeValue() != null ? prize.getPrizeValue().intValue() : 1; + + // 新增碎片 + fragmentsBackpackClient.incrFragments( + userId, + prize.getPropsId(), + days, + PropsTypeEnum.FRAGMENTS.name() + ); } /**