From 4fd156ba23b23b567c004181d0e89e40156800a4 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 19 Jan 2026 22:17:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E5=8F=91=E9=80=81=E5=A5=96?= =?UTF-8?q?=E5=8A=B1=E5=92=8C=E5=88=B8=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/command/signin/SignCheckInExe.java | 44 +++++++++---------- .../command/signin/SupplementCheckInExe.java | 44 +++++++++---------- 2 files changed, 42 insertions(+), 46 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/signin/SignCheckInExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/signin/SignCheckInExe.java index 16e86afb..d674c893 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/signin/SignCheckInExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/signin/SignCheckInExe.java @@ -149,20 +149,20 @@ public class SignCheckInExe { List configs = propsActivityRewardConfigService.listByGroupId(resourceGroupId); ResponseAssert.notEmpty(CommonErrorCode.NOT_FOUND_MAPPING_INFO, configs); - PropsActivityRewardConfig config = configs.get(0); - - propsSendCommon.send(new PrizeDescribeRewardCmd() - .setTrackId(config.getGroupId()) - .setAcceptUserId(userId) - .setOrigin(SendPropsOrigin.SIGN_IN_REWARD) - .setSysOrigin(SysOriginPlatformEnum.LIKEI) - .setPrizes(Collections.singletonList(new PrizeDescribe() - .setTrackId(config.getGroupId()) - .setType(config.getType()) - .setDetailType(config.getDetailType()) - .setContent(config.getContent()) - .setQuantity(config.getQuantity()))) - ); + configs.forEach(config -> { + propsSendCommon.send(new PrizeDescribeRewardCmd() + .setTrackId(config.getGroupId()) + .setAcceptUserId(userId) + .setOrigin(SendPropsOrigin.SIGN_IN_REWARD) + .setSysOrigin(SysOriginPlatformEnum.LIKEI) + .setPrizes(Collections.singletonList(new PrizeDescribe() + .setTrackId(config.getGroupId()) + .setType(config.getType()) + .setDetailType(config.getDetailType()) + .setContent(config.getContent()) + .setQuantity(config.getQuantity()))) + ); + }); } /** @@ -174,15 +174,13 @@ public class SignCheckInExe { } try { - for (int i = 0; i < config.getLotteryTicketCount(); i++) { - Long ticketId = lotteryTicketClient.addTicket( - userId, - FIXED_ACTIVITY_ID, - config.getLotteryTicketCount(), - "SIGN_IN", - "SIGN_IN_DAY_" + config.getDayIndex() - ).getBody(); - } + lotteryTicketClient.addTicket( + userId, + FIXED_ACTIVITY_ID, + config.getLotteryTicketCount(), + "SIGN_IN", + "SIGN_IN_DAY_" + config.getDayIndex() + ); } catch (Exception e) { log.error("发放签到抽奖券失败, userId={}, dayIndex={}, count={}", userId, config.getDayIndex(), config.getLotteryTicketCount(), e); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/signin/SupplementCheckInExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/signin/SupplementCheckInExe.java index 53a2271b..822d7f56 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/signin/SupplementCheckInExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/signin/SupplementCheckInExe.java @@ -152,20 +152,20 @@ public class SupplementCheckInExe { List configs = propsActivityRewardConfigService.listByGroupId(resourceGroupId); ResponseAssert.notEmpty(CommonErrorCode.NOT_FOUND_MAPPING_INFO, configs); - PropsActivityRewardConfig config = configs.get(0); - - propsSendCommon.send(new PrizeDescribeRewardCmd() - .setTrackId(config.getGroupId()) - .setAcceptUserId(userId) - .setOrigin(SendPropsOrigin.SIGN_IN_REWARD) - .setSysOrigin(SysOriginPlatformEnum.LIKEI) - .setPrizes(Collections.singletonList(new PrizeDescribe() - .setTrackId(config.getGroupId()) - .setType(config.getType()) - .setDetailType(config.getDetailType()) - .setContent(config.getContent()) - .setQuantity(config.getQuantity()))) - ); + configs.forEach(config -> { + propsSendCommon.send(new PrizeDescribeRewardCmd() + .setTrackId(config.getGroupId()) + .setAcceptUserId(userId) + .setOrigin(SendPropsOrigin.SIGN_IN_REWARD) + .setSysOrigin(SysOriginPlatformEnum.LIKEI) + .setPrizes(Collections.singletonList(new PrizeDescribe() + .setTrackId(config.getGroupId()) + .setType(config.getType()) + .setDetailType(config.getDetailType()) + .setContent(config.getContent()) + .setQuantity(config.getQuantity()))) + ); + }); } @@ -178,15 +178,13 @@ public class SupplementCheckInExe { } try { - for (int i = 0; i < config.getLotteryTicketCount(); i++) { - Long ticketId = lotteryTicketClient.addTicket( - userId, - FIXED_ACTIVITY_ID, - config.getLotteryTicketCount(), - "SIGN_IN", - "SIGN_IN_DAY_" + config.getDayIndex() - ).getBody(); - } + lotteryTicketClient.addTicket( + userId, + FIXED_ACTIVITY_ID, + config.getLotteryTicketCount(), + "SIGN_IN", + "SIGN_IN_DAY_" + config.getDayIndex() + ); } catch (Exception e) { log.error("发放签到抽奖券失败, userId={}, dayIndex={}, count={}", userId, config.getDayIndex(), config.getLotteryTicketCount(), e);