国王皇后增加模板id, 消息修复

This commit is contained in:
tianfeng 2025-11-05 20:03:14 +08:00
parent 89fd614569
commit 607ac75210
9 changed files with 39 additions and 38 deletions

View File

@ -36,4 +36,6 @@ public enum GiftSpecialEnum {
* svip礼物. * svip礼物.
*/ */
SVIP_GIFT SVIP_GIFT
} }

View File

@ -118,8 +118,8 @@ public class WeekKingQueenController extends BaseController {
* 获取有效活动 * 获取有效活动
*/ */
@GetMapping("/effective") @GetMapping("/effective")
public ActivityConfigVO getEffective(@Validated AppExtCommand cmd) { public ActivityConfigVO getEffective(AppExtCommand cmd, @RequestParam(required = false) String templateId) {
return weekKingQueenService.getEffectiveActivity(cmd); return weekKingQueenService.getEffectiveActivity(cmd, templateId);
} }
/** /**

View File

@ -36,9 +36,13 @@ public class WeekKingQueenActivityExe {
private final BadgeSourceClient badgeSourceClient; private final BadgeSourceClient badgeSourceClient;
private final PropsActivityRewardConfigClient propsActivityRewardConfigClient; private final PropsActivityRewardConfigClient propsActivityRewardConfigClient;
public ActivityConfigVO getEffectiveActivity(AppExtCommand cmd) { public ActivityConfigVO getEffectiveActivity(AppExtCommand cmd, String templateId) {
ActivityConfigBackQryCmd query = new ActivityConfigBackQryCmd(); ActivityConfigBackQryCmd query = new ActivityConfigBackQryCmd();
query.setSysOrigin(cmd.getReqSysOrigin().getOrigin()); query.setSysOrigin(cmd.getReqSysOrigin().getOrigin());
if (StringUtils.isNotBlank(templateId)) {
query.setTemplateId(Long.parseLong(templateId));
}
ActivityConfigDTO activityConfigDTO = ResponseAssert.requiredSuccess(sysActivityConfigClient.effectiveActivityConf(query)); ActivityConfigDTO activityConfigDTO = ResponseAssert.requiredSuccess(sysActivityConfigClient.effectiveActivityConf(query));
if (activityConfigDTO == null) { if (activityConfigDTO == null) {

View File

@ -157,27 +157,15 @@ public class PropCouponGrantCmdExe {
* 发送单个通知 * 发送单个通知
*/ */
private void sendNotification(PropCoupon propCoupon, UserProfileDTO user, PropCouponType couponType) { private void sendNotification(PropCoupon propCoupon, UserProfileDTO user, PropCouponType couponType) {
officialNoticeClient.send( officialNoticeClient.send(
NoticeExtTemplateCustomizeCmd.builder() NoticeExtTemplateCustomizeCmd.builder()
.toAccount(user.getId()) .toAccount(user.getId())
.noticeType(OfficialNoticeTypeEnum.RECEIVE_PROP_COUPON) .noticeType(OfficialNoticeTypeEnum.RECEIVE_PROP_COUPON)
.content(String.format("You have received a %s ticket", couponType.name())) .content("You have received a Coupon. Please check it.")
.expand(buildNotificationData(propCoupon)) .build()
.build() );
);
log.info("发送道具券赠送通知, userId:{}, couponNo:{}, couponType:{}", log.info("发送道具券赠送通知, receiverId:{}, couponNo:{}, couponType:{}",
user.getId(), propCoupon.getCouponNo(), couponType.getDesc()); user.getId(), propCoupon.getCouponNo(), propCoupon.getCouponType().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());
} }
} }

View File

@ -1,5 +1,8 @@
package com.red.circle.other.app.command.propcoupon; 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.framework.core.asserts.ResponseAssert;
import com.red.circle.other.app.dto.cmd.PropCouponSendCmd; import com.red.circle.other.app.dto.cmd.PropCouponSendCmd;
import com.red.circle.other.domain.gateway.PropCouponGateway; import com.red.circle.other.domain.gateway.PropCouponGateway;
@ -33,6 +36,7 @@ public class PropCouponSendCmdExe {
private final PropCouponGateway propCouponGateway; private final PropCouponGateway propCouponGateway;
private final UserProfileClient userProfileClient; private final UserProfileClient userProfileClient;
private final PropCouponUseRecordDAO propCouponUseRecordDAO; private final PropCouponUseRecordDAO propCouponUseRecordDAO;
private final OfficialNoticeClient officialNoticeClient;
/** /**
* 执行赠送道具券 * 执行赠送道具券
@ -123,16 +127,14 @@ public class PropCouponSendCmdExe {
* 发送系统消息通知接收人 * 发送系统消息通知接收人
*/ */
private void sendNotification(PropCoupon propCoupon, UserProfileDTO receiver) { private void sendNotification(PropCoupon propCoupon, UserProfileDTO receiver) {
// TODO: 发送系统通知 officialNoticeClient.send(
// 示例代码需要根据实际项目调整: NoticeExtTemplateCustomizeCmd.builder()
// officialNoticeClient.send( .toAccount(receiver.getId())
// NoticeExtTemplateCustomizeCmd.builder() .noticeType(OfficialNoticeTypeEnum.RECEIVE_PROP_COUPON)
// .toAccount(receiver.getId()) .content("You have received a Coupon. Please check it.")
// .noticeType(OfficialNoticeTypeEnum.RECEIVE_PROP_COUPON) .expand(buildNotificationData(propCoupon))
// .content("您收到了一张" + propCoupon.getCouponType().getDesc() + "道具券") .build()
// .expand(buildNotificationData(propCoupon)) );
// .build()
// );
log.info("发送道具券赠送通知, receiverId:{}, couponNo:{}, couponType:{}", log.info("发送道具券赠送通知, receiverId:{}, couponNo:{}, couponType:{}",
receiver.getId(), propCoupon.getCouponNo(), propCoupon.getCouponType().getDesc()); receiver.getId(), propCoupon.getCouponNo(), propCoupon.getCouponType().getDesc());

View File

@ -36,7 +36,7 @@ import java.util.Objects;
* @author pengliang on 2022/7/26 * @author pengliang on 2022/7/26
*/ */
@Slf4j @Slf4j
@Service("DIAMOND_COUNT_LISTENER") //@Service("DIAMOND_COUNT_LISTENER")
@RequiredArgsConstructor @RequiredArgsConstructor
public class DiamondCountStrategy implements GiftStrategy { public class DiamondCountStrategy implements GiftStrategy {
@ -53,6 +53,7 @@ public class DiamondCountStrategy implements GiftStrategy {
@Override @Override
public void processor(OfflineProcessGiftEvent event) { public void processor(OfflineProcessGiftEvent event) {
log.warn("【钻石统计】入参---{}", JSON.toJSONString(event)); log.warn("【钻石统计】入参---{}", JSON.toJSONString(event));
GiftGiveRunningWater runningWater = null; GiftGiveRunningWater runningWater = null;
try { try {
runningWater = giftGiveRunningWaterService.getByIdPrimary(event.getRunningWaterId()); runningWater = giftGiveRunningWaterService.getByIdPrimary(event.getRunningWaterId());

View File

@ -33,8 +33,8 @@ public class WeekKingQueenServiceImpl implements WeekKingQueenService {
} }
@Override @Override
public ActivityConfigVO getEffectiveActivity(AppExtCommand cmd) { public ActivityConfigVO getEffectiveActivity(AppExtCommand cmd, String templateId) {
return weekKingQueenActivityExe.getEffectiveActivity(cmd); return weekKingQueenActivityExe.getEffectiveActivity(cmd, templateId);
} }
@Override @Override

View File

@ -19,7 +19,7 @@ public interface WeekKingQueenService {
PageResult<UserRankCO> listRanking(WeekKingQueenRankingQueryCmd cmd); PageResult<UserRankCO> listRanking(WeekKingQueenRankingQueryCmd cmd);
ActivityConfigVO getEffectiveActivity(AppExtCommand cmd); ActivityConfigVO getEffectiveActivity(AppExtCommand cmd, String templateId);
String countDown(); String countDown();

View File

@ -225,7 +225,11 @@ public class ActivityConfigServiceImpl implements ActivityConfigService {
@Override @Override
public ActivityConfig getEffectiveActivityConf(ActivityConfigBackQryCmd query) { public ActivityConfig getEffectiveActivityConf(ActivityConfigBackQryCmd query) {
Criteria criteria = Criteria.where("sysOrigin").is(query.getSysOrigin()); Criteria criteria = Criteria.where("sysOrigin").is(query.getSysOrigin());
criteria.and("showcase").is(true);
criteria.and("endTime").gt(TimestampUtils.now()); criteria.and("endTime").gt(TimestampUtils.now());
if (query.getTemplateId() != null) {
criteria.and("templateId").is(query.getTemplateId());
}
return mongoTemplate.findOne(Query.query(criteria) return mongoTemplate.findOne(Query.query(criteria)
.with(Sort.by(Sort.Order.desc("id"))) .with(Sort.by(Sort.Order.desc("id")))