|
|
@ -355,7 +355,7 @@ public class LotteryService {
|
|
|
|
|
|
|
|
|
|
|
|
// 已参与抽奖,不能再次参与
|
|
|
|
// 已参与抽奖,不能再次参与
|
|
|
|
LotteryUser byLotteryIdAndUserId = lotteryUserDao.findByLotteryIdAndUserId(id, userLoginDto.getUserId());
|
|
|
|
LotteryUser byLotteryIdAndUserId = lotteryUserDao.findByLotteryIdAndUserId(id, userLoginDto.getUserId());
|
|
|
|
if(byLotteryIdAndUserId != null) {
|
|
|
|
if (byLotteryIdAndUserId != null) {
|
|
|
|
throw new BizException(ErrorConstants.ALREADY_PARTICIPATED);
|
|
|
|
throw new BizException(ErrorConstants.ALREADY_PARTICIPATED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -469,6 +469,7 @@ public class LotteryService {
|
|
|
|
BooleanBuilder booleanBuilder = new BooleanBuilder();
|
|
|
|
BooleanBuilder booleanBuilder = new BooleanBuilder();
|
|
|
|
QLottery qLottery = QLottery.lottery;
|
|
|
|
QLottery qLottery = QLottery.lottery;
|
|
|
|
checkCondition(booleanBuilder, qLottery, lotterySearchDto);
|
|
|
|
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);
|
|
|
|
Pageable pageable = PageRequest.of(page - 1, size);
|
|
|
|
List<LotteryAPPVO> list = jpaQueryFactory.select(Projections.constructor(LotteryAPPVO.class,
|
|
|
|
List<LotteryAPPVO> list = jpaQueryFactory.select(Projections.constructor(LotteryAPPVO.class,
|
|
|
@ -494,7 +495,7 @@ public class LotteryService {
|
|
|
|
qLottery.publishTime
|
|
|
|
qLottery.publishTime
|
|
|
|
)).from(qLottery)
|
|
|
|
)).from(qLottery)
|
|
|
|
.where(booleanBuilder)
|
|
|
|
.where(booleanBuilder)
|
|
|
|
.orderBy(qLottery.publishTime.desc())
|
|
|
|
.orderBy(qLottery.status.asc(), qLottery.publishTime.desc())
|
|
|
|
.offset(pageable.getOffset())
|
|
|
|
.offset(pageable.getOffset())
|
|
|
|
.limit(pageable.getPageSize())
|
|
|
|
.limit(pageable.getPageSize())
|
|
|
|
.fetch();
|
|
|
|
.fetch();
|
|
|
|