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 139e792e..ee69132f 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 @@ -97,6 +97,7 @@ public class PropsSendCommon { private final ConsumptionLevelService consumptionLevelService; private final PropCouponGateway propCouponGateway; private final OfficialNoticeClient officialNoticeClient; + private final UserRegionGateway userRegionGateway; /** * 发送奖励. @@ -235,7 +236,7 @@ public class PropsSendCommon { private void saveSendLog(PrizeDescribeRewardCmd param) { //发送通知 -// RegionConfig region = userRegionGateway.getRegionConfigByUserId(param.getAcceptUserId()); + RegionConfig region = userRegionGateway.getRegionConfigByUserId(param.getAcceptUserId()); propsSendLogService.saveBatch(param.getPrizes().stream().filter(Objects::nonNull) .filter(prize -> !PropsActivityRewardEnum.CUSTOMIZE.eq(prize.getType())) .map(conf -> { @@ -249,12 +250,16 @@ public class PropsSendCommon { .setOrigin(String.valueOf(param.getOrigin())); propsSendLog.setCreateTime(TimestampUtils.now()); propsSendLog.setUpdateTime(TimestampUtils.now()); -// officialNoticeClient.send( -// NoticeExtTemplateCustomizeCmd.builder().toAccount(param.getAcceptUserId()) -// .noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS) -// .content(I18nUtils.getPropsRewardContent(conf.getDetailType(), conf.getQuantity(), I18nUtils.getLanguageByRegion(region.getRegionName()))) -// .expand(null) -// .build()); + try { + officialNoticeClient.send( + NoticeExtTemplateCustomizeCmd.builder().toAccount(param.getAcceptUserId()) + .noticeType(OfficialNoticeTypeEnum.GIVE_AWAY_PROPS) + .content(I18nUtils.getPropsRewardContent(conf.getDetailType(), conf.getQuantity(), I18nUtils.getLanguageByRegion(region.getRegionName()))) + .expand(null) + .build()); + } catch (Exception e) { + log.error("saveSendLog 发送通知失败{}", e.getMessage()); + } return propsSendLog; }).collect(Collectors.toList())); diff --git a/rc-service/rc-service-other/other-start/src/test/java/SpringTest.java b/rc-service/rc-service-other/other-start/src/test/java/SpringTest.java index 52f586e8..7006fc6f 100644 --- a/rc-service/rc-service-other/other-start/src/test/java/SpringTest.java +++ b/rc-service/rc-service-other/other-start/src/test/java/SpringTest.java @@ -31,6 +31,7 @@ import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheSe import com.red.circle.other.infra.database.rds.entity.sys.GameListConfig; import com.red.circle.other.infra.database.rds.entity.user.user.OneTimeTask; import com.red.circle.other.infra.database.rds.service.sys.GameListConfigService; +import com.red.circle.other.infra.database.rds.service.user.device.LatestMobileDeviceService; import com.red.circle.other.infra.database.rds.service.user.user.OneTimeTaskService; import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.model.cmd.activity.SendActivityRewardCmd; @@ -47,6 +48,7 @@ import org.springframework.test.context.junit4.SpringRunner; import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Objects; @@ -83,6 +85,15 @@ public class SpringTest { private OneTimeTaskService oneTimeTaskService; @Autowired private PropsActivityClientService propsActivityClientService; + @Autowired + private LatestMobileDeviceService latestMobileDeviceService; + + @Test + public void getDeviceFingerprintByUserId() { + Arrays.asList(1989287386040430594L, 1989287287902359554L, 1989287471839113218L).stream().toList().forEach(id -> { + System.out.println(latestMobileDeviceService.getDeviceFingerprintByUserId(id)); + }); + } @Test public void testCompletedFirstCharge() {