From 268bc9ad606519e587def8fc9fa54143e838822e Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Thu, 10 Oct 2024 09:23:07 +0800 Subject: [PATCH] =?UTF-8?q?release:=20=E5=85=88=E6=A0=B9=E6=8D=AE=E5=BC=80?= =?UTF-8?q?=E5=A5=96=E7=8A=B6=E6=80=81=EF=BC=8C=E5=86=8D=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/luoo/user/service/LotteryService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 180bd5d..dbe2f65 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 @@ -355,7 +355,7 @@ public class LotteryService { // 已参与抽奖,不能再次参与 LotteryUser byLotteryIdAndUserId = lotteryUserDao.findByLotteryIdAndUserId(id, userLoginDto.getUserId()); - if(byLotteryIdAndUserId != null) { + if (byLotteryIdAndUserId != null) { throw new BizException(ErrorConstants.ALREADY_PARTICIPATED); } @@ -469,6 +469,7 @@ public class LotteryService { BooleanBuilder booleanBuilder = new BooleanBuilder(); QLottery qLottery = QLottery.lottery; checkCondition(booleanBuilder, qLottery, lotterySearchDto); + booleanBuilder.and(qLottery.status.in(new Integer[]{PointEnums.LOTTERY_STATUS_LOTTERY.getCode(), PointEnums.LOTTERY_STATUS_SIGN.getCode()})); // 创建分页对象 Pageable pageable = PageRequest.of(page - 1, size); List list = jpaQueryFactory.select(Projections.constructor(LotteryAPPVO.class, @@ -494,7 +495,7 @@ public class LotteryService { qLottery.publishTime )).from(qLottery) .where(booleanBuilder) - .orderBy(qLottery.publishTime.desc()) + .orderBy(qLottery.status.asc(), qLottery.publishTime.desc()) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) .fetch();