From 8e9e291a725b6201fd816574b63d315475c8cdb6 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 16 Oct 2025 19:23:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E8=B5=A0=E9=80=81=E7=A4=BC?= =?UTF-8?q?=E7=89=A9=E9=80=9A=E7=9F=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/material/PropsPurchasingCmdExe.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/PropsPurchasingCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/PropsPurchasingCmdExe.java index e6ec5bda..41f2011f 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/PropsPurchasingCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/PropsPurchasingCmdExe.java @@ -11,7 +11,9 @@ import com.red.circle.framework.core.response.CommonErrorCode; import com.red.circle.framework.core.response.ResponseErrorCode; import com.red.circle.mq.business.model.event.task.TaskApprovalEvent; import com.red.circle.mq.rocket.business.producer.TaskMqMessage; +import com.red.circle.other.app.convertor.user.UserProfileAppConvertor; import com.red.circle.other.app.dto.cmd.material.PropsPurchasingCmd; +import com.red.circle.other.app.util.OfficialNoticeUtils; import com.red.circle.other.domain.gateway.props.PropsStoreGateway; import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.domain.model.user.UserProfile; @@ -27,6 +29,7 @@ import com.red.circle.other.inner.model.dto.material.props.NobleVipAbility; import com.red.circle.other.inner.model.dto.material.props.ProductProps; import com.red.circle.other.inner.model.dto.material.props.PropsNobleVipAbilityDTO; import com.red.circle.other.inner.model.dto.material.props.PropsStoreCommodity; +import com.red.circle.other.inner.model.dto.user.UserProfileDTO; import com.red.circle.tool.core.collection.MapBuilder; import com.red.circle.tool.core.date.LocalDateTimeUtils; import com.red.circle.tool.core.date.TimestampUtils; @@ -65,6 +68,7 @@ public class PropsPurchasingCmdExe { private final PropsVipActualEquityService propsVipActualEquityService; private final TaskMqMessage taskMqMessage; private final PropsNobleVipClient propsNobleVipClient; + private final UserProfileAppConvertor userProfileAppConvertor; public BigDecimal execute(PropsPurchasingCmd cmd) { if (cmd.getDays() <= 0) { @@ -179,22 +183,13 @@ public class PropsPurchasingCmdExe { private void sendGiveAwayNotice(PropsPurchasingCmd cmd, PropsStoreCommodity commodity) { - if (cmd.isPurchasing()) { - return; - } - - UserProfile userProfile = userProfileGateway.getByUserId(cmd.requiredReqUserId()); + UserProfileDTO userProfileDTO = userProfileAppConvertor.toUserProfileDTO(userProfileGateway.getByUserId(cmd.requiredReqUserId())); String sourceUrl = commodity.getPropsResources().getSourceUrl(); officialNoticeClient.send(NoticeExtTemplateTypeCmd.builder() .toAccount(cmd.getAcceptUserId()) .noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS) - .templateParam(MapBuilder.builder() - .put("userProfile", String.format("%s(%s)", userProfile.getUserNickname(), userProfile.getAccount())) - .put("userAvatar", userProfile.getUserAvatar()) - .put("countryCode", userProfile.getCountryCode()) - .put("countryName", userProfile.getCountryName()) - .build()) + .templateParam(OfficialNoticeUtils.buildUserProfile(userProfileDTO)) .expand(sourceUrl) .build()); }