From 607ac75210e166e2d4c85f4b62a36aaacc0a3ef3 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Wed, 5 Nov 2025 20:03:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E7=8E=8B=E7=9A=87=E5=90=8E=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A8=A1=E6=9D=BFid=EF=BC=8C=20=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inner/enums/material/GiftSpecialEnum.java | 2 ++ .../room/WeekKingQueenController.java | 4 +-- .../query/WeekKingQueenActivityExe.java | 6 +++- .../propcoupon/PropCouponGrantCmdExe.java | 30 ++++++------------- .../propcoupon/PropCouponSendCmdExe.java | 22 +++++++------- .../gift/strategy/DiamondCountStrategy.java | 3 +- .../activity/WeekKingQueenServiceImpl.java | 4 +-- .../activity/WeekKingQueenService.java | 2 +- .../sys/impl/ActivityConfigServiceImpl.java | 4 +++ 9 files changed, 39 insertions(+), 38 deletions(-) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/material/GiftSpecialEnum.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/material/GiftSpecialEnum.java index ee9166d9..a500abfe 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/material/GiftSpecialEnum.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/material/GiftSpecialEnum.java @@ -36,4 +36,6 @@ public enum GiftSpecialEnum { * svip礼物. */ SVIP_GIFT + + } diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekKingQueenController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekKingQueenController.java index ef62e9c2..11da174e 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekKingQueenController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekKingQueenController.java @@ -118,8 +118,8 @@ public class WeekKingQueenController extends BaseController { * 获取有效活动 */ @GetMapping("/effective") - public ActivityConfigVO getEffective(@Validated AppExtCommand cmd) { - return weekKingQueenService.getEffectiveActivity(cmd); + public ActivityConfigVO getEffective(AppExtCommand cmd, @RequestParam(required = false) String templateId) { + return weekKingQueenService.getEffectiveActivity(cmd, templateId); } /** diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenActivityExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenActivityExe.java index 7a08a0bf..f7eaa7b4 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenActivityExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenActivityExe.java @@ -36,9 +36,13 @@ public class WeekKingQueenActivityExe { private final BadgeSourceClient badgeSourceClient; private final PropsActivityRewardConfigClient propsActivityRewardConfigClient; - public ActivityConfigVO getEffectiveActivity(AppExtCommand cmd) { + public ActivityConfigVO getEffectiveActivity(AppExtCommand cmd, String templateId) { ActivityConfigBackQryCmd query = new ActivityConfigBackQryCmd(); query.setSysOrigin(cmd.getReqSysOrigin().getOrigin()); + if (StringUtils.isNotBlank(templateId)) { + query.setTemplateId(Long.parseLong(templateId)); + } + ActivityConfigDTO activityConfigDTO = ResponseAssert.requiredSuccess(sysActivityConfigClient.effectiveActivityConf(query)); if (activityConfigDTO == null) { diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java index b51b980f..06b04323 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java @@ -157,27 +157,15 @@ public class PropCouponGrantCmdExe { * 发送单个通知 */ private void sendNotification(PropCoupon propCoupon, UserProfileDTO user, PropCouponType couponType) { - officialNoticeClient.send( - NoticeExtTemplateCustomizeCmd.builder() - .toAccount(user.getId()) - .noticeType(OfficialNoticeTypeEnum.RECEIVE_PROP_COUPON) - .content(String.format("You have received a %s ticket", couponType.name())) - .expand(buildNotificationData(propCoupon)) - .build() - ); + officialNoticeClient.send( + NoticeExtTemplateCustomizeCmd.builder() + .toAccount(user.getId()) + .noticeType(OfficialNoticeTypeEnum.RECEIVE_PROP_COUPON) + .content("You have received a Coupon. Please check it.") + .build() + ); - log.info("发送道具券赠送通知, userId:{}, couponNo:{}, couponType:{}", - user.getId(), propCoupon.getCouponNo(), couponType.getDesc()); - } - - /** - * 构建通知数据 - */ - private String buildNotificationData(PropCoupon propCoupon) { - return String.format("couponNo=%s&couponType=%s&propName=%s&validDays=%d", - propCoupon.getCouponNo(), - propCoupon.getCouponType().getDesc(), - propCoupon.getPropName(), - propCoupon.getValidDays()); + log.info("发送道具券赠送通知, receiverId:{}, couponNo:{}, couponType:{}", + user.getId(), propCoupon.getCouponNo(), propCoupon.getCouponType().getDesc()); } } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponSendCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponSendCmdExe.java index 685ac126..d0d6d058 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponSendCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponSendCmdExe.java @@ -1,5 +1,8 @@ package com.red.circle.other.app.command.propcoupon; +import com.red.circle.external.inner.endpoint.message.OfficialNoticeClient; +import com.red.circle.external.inner.model.cmd.message.notice.official.NoticeExtTemplateCustomizeCmd; +import com.red.circle.external.inner.model.enums.message.OfficialNoticeTypeEnum; import com.red.circle.framework.core.asserts.ResponseAssert; import com.red.circle.other.app.dto.cmd.PropCouponSendCmd; import com.red.circle.other.domain.gateway.PropCouponGateway; @@ -33,6 +36,7 @@ public class PropCouponSendCmdExe { private final PropCouponGateway propCouponGateway; private final UserProfileClient userProfileClient; private final PropCouponUseRecordDAO propCouponUseRecordDAO; + private final OfficialNoticeClient officialNoticeClient; /** * 执行赠送道具券 @@ -123,16 +127,14 @@ public class PropCouponSendCmdExe { * 发送系统消息通知接收人 */ private void sendNotification(PropCoupon propCoupon, UserProfileDTO receiver) { - // TODO: 发送系统通知 - // 示例代码(需要根据实际项目调整): - // officialNoticeClient.send( - // NoticeExtTemplateCustomizeCmd.builder() - // .toAccount(receiver.getId()) - // .noticeType(OfficialNoticeTypeEnum.RECEIVE_PROP_COUPON) - // .content("您收到了一张" + propCoupon.getCouponType().getDesc() + "道具券") - // .expand(buildNotificationData(propCoupon)) - // .build() - // ); + officialNoticeClient.send( + NoticeExtTemplateCustomizeCmd.builder() + .toAccount(receiver.getId()) + .noticeType(OfficialNoticeTypeEnum.RECEIVE_PROP_COUPON) + .content("You have received a Coupon. Please check it.") + .expand(buildNotificationData(propCoupon)) + .build() + ); log.info("发送道具券赠送通知, receiverId:{}, couponNo:{}, couponType:{}", receiver.getId(), propCoupon.getCouponNo(), propCoupon.getCouponType().getDesc()); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/DiamondCountStrategy.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/DiamondCountStrategy.java index 8bee5fe6..7392f703 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/DiamondCountStrategy.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/listener/gift/strategy/DiamondCountStrategy.java @@ -36,7 +36,7 @@ import java.util.Objects; * @author pengliang on 2022/7/26 */ @Slf4j -@Service("DIAMOND_COUNT_LISTENER") +//@Service("DIAMOND_COUNT_LISTENER") @RequiredArgsConstructor public class DiamondCountStrategy implements GiftStrategy { @@ -53,6 +53,7 @@ public class DiamondCountStrategy implements GiftStrategy { @Override public void processor(OfflineProcessGiftEvent event) { log.warn("【钻石统计】入参---{}", JSON.toJSONString(event)); + GiftGiveRunningWater runningWater = null; try { runningWater = giftGiveRunningWaterService.getByIdPrimary(event.getRunningWaterId()); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/WeekKingQueenServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/WeekKingQueenServiceImpl.java index 44afbd9e..16819490 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/WeekKingQueenServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/WeekKingQueenServiceImpl.java @@ -33,8 +33,8 @@ public class WeekKingQueenServiceImpl implements WeekKingQueenService { } @Override - public ActivityConfigVO getEffectiveActivity(AppExtCommand cmd) { - return weekKingQueenActivityExe.getEffectiveActivity(cmd); + public ActivityConfigVO getEffectiveActivity(AppExtCommand cmd, String templateId) { + return weekKingQueenActivityExe.getEffectiveActivity(cmd, templateId); } @Override diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/activity/WeekKingQueenService.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/activity/WeekKingQueenService.java index 105ea068..5c87c356 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/activity/WeekKingQueenService.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/activity/WeekKingQueenService.java @@ -19,7 +19,7 @@ public interface WeekKingQueenService { PageResult listRanking(WeekKingQueenRankingQueryCmd cmd); - ActivityConfigVO getEffectiveActivity(AppExtCommand cmd); + ActivityConfigVO getEffectiveActivity(AppExtCommand cmd, String templateId); String countDown(); diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/sys/impl/ActivityConfigServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/sys/impl/ActivityConfigServiceImpl.java index 134aede3..a4ee7865 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/sys/impl/ActivityConfigServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/sys/impl/ActivityConfigServiceImpl.java @@ -225,7 +225,11 @@ public class ActivityConfigServiceImpl implements ActivityConfigService { @Override public ActivityConfig getEffectiveActivityConf(ActivityConfigBackQryCmd query) { Criteria criteria = Criteria.where("sysOrigin").is(query.getSysOrigin()); + criteria.and("showcase").is(true); criteria.and("endTime").gt(TimestampUtils.now()); + if (query.getTemplateId() != null) { + criteria.and("templateId").is(query.getTemplateId()); + } return mongoTemplate.findOne(Query.query(criteria) .with(Sort.by(Sort.Order.desc("id")))