release: 赋予积分抽奖 默认task_id

release-2024-04-25
huangyw 1 month ago
parent 99e8580040
commit 18e5efed16

@ -48,4 +48,10 @@ public class TaskPointIdConstants {
public static final String INVITE_USER_20 = "22"; public static final String INVITE_USER_20 = "22";
// 积分抽奖
public static final String LOTTERY = "1000";
// 积分抽奖返还
public static final String LOTTERY_RETURNS = "1001";
} }

@ -26,7 +26,11 @@ public class drawListener {
@RabbitHandler @RabbitHandler
public void executeDraw(DrawDTO drawDTO) { public void executeDraw(DrawDTO drawDTO) {
log.info("drawDTO:{}", drawDTO); log.info("drawDTO:{}", drawDTO);
userPointLogService.executeDraw(drawDTO); try {
userPointLogService.executeDraw(drawDTO);
} catch (Exception e) {
e.printStackTrace();
}
} }
} }

@ -19,6 +19,7 @@ import com.querydsl.core.types.dsl.StringExpression;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAQueryFactory;
import constants.Constants; import constants.Constants;
import constants.ErrorConstants; import constants.ErrorConstants;
import constants.TaskPointIdConstants;
import dto.UserLoginDto; import dto.UserLoginDto;
import enums.PointEnums; import enums.PointEnums;
import enums.UserTypeEnum; import enums.UserTypeEnum;
@ -309,7 +310,7 @@ public class LotteryService {
.id(String.valueOf(idWorker.nextId())) .id(String.valueOf(idWorker.nextId()))
.type(PointEnums.TASK_POINT_TYPE_ADD.getCode()) .type(PointEnums.TASK_POINT_TYPE_ADD.getCode())
.createUser(lotteryUser.getUserId()) .createUser(lotteryUser.getUserId())
.taskPointId(null) .taskPointId(TaskPointIdConstants.LOTTERY_RETURNS)
.description(POINTS_WILL_BE_RETURNED) .description(POINTS_WILL_BE_RETURNED)
.userId(lotteryUser.getUserId()) .userId(lotteryUser.getUserId())
.score(lottery.getPoint()) .score(lottery.getPoint())
@ -402,6 +403,7 @@ public class LotteryService {
.score(point) .score(point)
.type(PointEnums.TASK_POINT_TYPE_REDUCE.getCode()) .type(PointEnums.TASK_POINT_TYPE_REDUCE.getCode())
.userId(userLoginDto.getUserId()) .userId(userLoginDto.getUserId())
.taskPointId(TaskPointIdConstants.LOTTERY)
.build(); .build();
rabbitTemplate.convertAndSend("draw", drawDTO); rabbitTemplate.convertAndSend("draw", drawDTO);

Loading…
Cancel
Save