购买赠送礼物通知处理
This commit is contained in:
parent
2d1e9ee6e7
commit
8e9e291a72
@ -11,7 +11,9 @@ import com.red.circle.framework.core.response.CommonErrorCode;
|
|||||||
import com.red.circle.framework.core.response.ResponseErrorCode;
|
import com.red.circle.framework.core.response.ResponseErrorCode;
|
||||||
import com.red.circle.mq.business.model.event.task.TaskApprovalEvent;
|
import com.red.circle.mq.business.model.event.task.TaskApprovalEvent;
|
||||||
import com.red.circle.mq.rocket.business.producer.TaskMqMessage;
|
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.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.props.PropsStoreGateway;
|
||||||
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
|
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
|
||||||
import com.red.circle.other.domain.model.user.UserProfile;
|
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.ProductProps;
|
||||||
import com.red.circle.other.inner.model.dto.material.props.PropsNobleVipAbilityDTO;
|
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.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.collection.MapBuilder;
|
||||||
import com.red.circle.tool.core.date.LocalDateTimeUtils;
|
import com.red.circle.tool.core.date.LocalDateTimeUtils;
|
||||||
import com.red.circle.tool.core.date.TimestampUtils;
|
import com.red.circle.tool.core.date.TimestampUtils;
|
||||||
@ -65,6 +68,7 @@ public class PropsPurchasingCmdExe {
|
|||||||
private final PropsVipActualEquityService propsVipActualEquityService;
|
private final PropsVipActualEquityService propsVipActualEquityService;
|
||||||
private final TaskMqMessage taskMqMessage;
|
private final TaskMqMessage taskMqMessage;
|
||||||
private final PropsNobleVipClient propsNobleVipClient;
|
private final PropsNobleVipClient propsNobleVipClient;
|
||||||
|
private final UserProfileAppConvertor userProfileAppConvertor;
|
||||||
|
|
||||||
public BigDecimal execute(PropsPurchasingCmd cmd) {
|
public BigDecimal execute(PropsPurchasingCmd cmd) {
|
||||||
if (cmd.getDays() <= 0) {
|
if (cmd.getDays() <= 0) {
|
||||||
@ -179,22 +183,13 @@ public class PropsPurchasingCmdExe {
|
|||||||
|
|
||||||
|
|
||||||
private void sendGiveAwayNotice(PropsPurchasingCmd cmd, PropsStoreCommodity commodity) {
|
private void sendGiveAwayNotice(PropsPurchasingCmd cmd, PropsStoreCommodity commodity) {
|
||||||
if (cmd.isPurchasing()) {
|
UserProfileDTO userProfileDTO = userProfileAppConvertor.toUserProfileDTO(userProfileGateway.getByUserId(cmd.requiredReqUserId()));
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UserProfile userProfile = userProfileGateway.getByUserId(cmd.requiredReqUserId());
|
|
||||||
|
|
||||||
String sourceUrl = commodity.getPropsResources().getSourceUrl();
|
String sourceUrl = commodity.getPropsResources().getSourceUrl();
|
||||||
officialNoticeClient.send(NoticeExtTemplateTypeCmd.builder()
|
officialNoticeClient.send(NoticeExtTemplateTypeCmd.builder()
|
||||||
.toAccount(cmd.getAcceptUserId())
|
.toAccount(cmd.getAcceptUserId())
|
||||||
.noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS)
|
.noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS)
|
||||||
.templateParam(MapBuilder.builder()
|
.templateParam(OfficialNoticeUtils.buildUserProfile(userProfileDTO))
|
||||||
.put("userProfile", String.format("%s(%s)", userProfile.getUserNickname(), userProfile.getAccount()))
|
|
||||||
.put("userAvatar", userProfile.getUserAvatar())
|
|
||||||
.put("countryCode", userProfile.getCountryCode())
|
|
||||||
.put("countryName", userProfile.getCountryName())
|
|
||||||
.build())
|
|
||||||
.expand(sourceUrl)
|
.expand(sourceUrl)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user