diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/common/props/PropsSendCommon.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/common/props/PropsSendCommon.java index ee69132f..4542735f 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/common/props/PropsSendCommon.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/common/props/PropsSendCommon.java @@ -1,5 +1,6 @@ package com.red.circle.other.infra.common.props; +import com.alibaba.fastjson.JSON; import com.google.common.collect.Sets; import com.red.circle.common.business.core.enums.ReceiptType; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; @@ -27,9 +28,11 @@ import com.red.circle.other.infra.database.cache.service.other.EmojiCacheService import com.red.circle.other.infra.database.mongo.entity.live.RoomSetting; import com.red.circle.other.infra.database.mongo.service.live.RoomProfileManagerService; import com.red.circle.other.infra.database.rds.entity.badge.BadgeBackpack; +import com.red.circle.other.infra.database.rds.entity.badge.BadgePictureConfig; import com.red.circle.other.infra.database.rds.entity.props.PropsSendLog; import com.red.circle.other.infra.database.rds.entity.props.PropsSourceRecord; import com.red.circle.other.infra.database.rds.service.badge.BadgeBackpackService; +import com.red.circle.other.infra.database.rds.service.badge.BadgePictureConfigService; import com.red.circle.other.infra.database.rds.service.badge.RoomBadgeBackpackService; import com.red.circle.other.infra.database.rds.service.emoji.EmojiBagService; import com.red.circle.other.infra.database.rds.service.gift.GiftBackpackService; @@ -40,6 +43,7 @@ import com.red.circle.other.infra.database.rds.service.props.PropsVipActualEquit import com.red.circle.other.infra.database.rds.service.user.user.ConsumptionLevelService; import com.red.circle.other.infra.utils.I18nUtils; import com.red.circle.other.inner.asserts.OtherErrorCode; +import com.red.circle.other.inner.enums.material.BadgeConfigTypeEnum; import com.red.circle.other.inner.enums.material.NobleVipEnum; import com.red.circle.other.inner.enums.material.PropsCommodityType; import com.red.circle.other.inner.model.cmd.material.PrizeDescribe; @@ -98,6 +102,7 @@ public class PropsSendCommon { private final PropCouponGateway propCouponGateway; private final OfficialNoticeClient officialNoticeClient; private final UserRegionGateway userRegionGateway; + private final BadgePictureConfigService badgePictureConfigService; /** * 发送奖励. @@ -251,11 +256,25 @@ public class PropsSendCommon { propsSendLog.setCreateTime(TimestampUtils.now()); propsSendLog.setUpdateTime(TimestampUtils.now()); try { + String url = null; + Long propsId = DataTypeUtils.toLong(conf.getContent()); + PropsSourceRecord props = propsSourceRecordService.getPropsById(propsId); + if (props != null) { + url = props.getCover(); + } + + Map map = new HashMap<>(); + map.put("propType", conf.getDetailType()); + if (BadgeConfigTypeEnum.of(conf.getDetailType())) { + BadgePictureConfig badgePictureConfig = badgePictureConfigService.getByBadgeId(SysOriginPlatformEnum.LIKEI.name(), propsId); + url = badgePictureConfig != null ? badgePictureConfig.getSelectUrl() : ""; + } officialNoticeClient.send( NoticeExtTemplateCustomizeCmd.builder().toAccount(param.getAcceptUserId()) .noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS) + .title(JSON.toJSONString(map)) .content(I18nUtils.getPropsRewardContent(conf.getDetailType(), conf.getQuantity(), I18nUtils.getLanguageByRegion(region.getRegionName()))) - .expand(null) + .expand(url) .build()); } catch (Exception e) { log.error("saveSendLog 发送通知失败{}", e.getMessage());