From 18e5efed1614b0d90338d7fe7cfa77781eb98a9a Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Sat, 12 Oct 2024 09:50:07 +0800 Subject: [PATCH] =?UTF-8?q?release:=20=E8=B5=8B=E4=BA=88=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E6=8A=BD=E5=A5=96=20=E9=BB=98=E8=AE=A4task=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/constants/TaskPointIdConstants.java | 6 ++++++ .../src/main/java/com/luoo/user/listener/drawListener.java | 6 +++++- .../src/main/java/com/luoo/user/service/LotteryService.java | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/luoo_common/src/main/java/constants/TaskPointIdConstants.java b/luoo_common/src/main/java/constants/TaskPointIdConstants.java index 2252c51..bf2aa3e 100644 --- a/luoo_common/src/main/java/constants/TaskPointIdConstants.java +++ b/luoo_common/src/main/java/constants/TaskPointIdConstants.java @@ -48,4 +48,10 @@ public class TaskPointIdConstants { public static final String INVITE_USER_20 = "22"; + // 积分抽奖 + public static final String LOTTERY = "1000"; + + // 积分抽奖返还 + public static final String LOTTERY_RETURNS = "1001"; + } diff --git a/luoo_user/src/main/java/com/luoo/user/listener/drawListener.java b/luoo_user/src/main/java/com/luoo/user/listener/drawListener.java index fe02473..c50cdc2 100644 --- a/luoo_user/src/main/java/com/luoo/user/listener/drawListener.java +++ b/luoo_user/src/main/java/com/luoo/user/listener/drawListener.java @@ -26,7 +26,11 @@ public class drawListener { @RabbitHandler public void executeDraw(DrawDTO drawDTO) { log.info("drawDTO:{}", drawDTO); - userPointLogService.executeDraw(drawDTO); + try { + userPointLogService.executeDraw(drawDTO); + } catch (Exception e) { + e.printStackTrace(); + } } } diff --git a/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java b/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java index 911f774..0710a50 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java @@ -19,6 +19,7 @@ import com.querydsl.core.types.dsl.StringExpression; import com.querydsl.jpa.impl.JPAQueryFactory; import constants.Constants; import constants.ErrorConstants; +import constants.TaskPointIdConstants; import dto.UserLoginDto; import enums.PointEnums; import enums.UserTypeEnum; @@ -309,7 +310,7 @@ public class LotteryService { .id(String.valueOf(idWorker.nextId())) .type(PointEnums.TASK_POINT_TYPE_ADD.getCode()) .createUser(lotteryUser.getUserId()) - .taskPointId(null) + .taskPointId(TaskPointIdConstants.LOTTERY_RETURNS) .description(POINTS_WILL_BE_RETURNED) .userId(lotteryUser.getUserId()) .score(lottery.getPoint()) @@ -402,6 +403,7 @@ public class LotteryService { .score(point) .type(PointEnums.TASK_POINT_TYPE_REDUCE.getCode()) .userId(userLoginDto.getUserId()) + .taskPointId(TaskPointIdConstants.LOTTERY) .build(); rabbitTemplate.convertAndSend("draw", drawDTO);