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);