From 2658bedf84d2e2cdca2f4a40afd575c3c7a78e43 Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Wed, 16 Oct 2024 08:54:16 +0800 Subject: [PATCH] =?UTF-8?q?release:=20=20lottery=20list=20=E4=B9=9F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=9C=B0=E5=8C=BA=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/luoo/user/service/LotteryService.java | 21 +++++++++++++++++++ .../com/luoo/user/vo/point/LotteryAPPVO.java | 3 +++ 2 files changed, 24 insertions(+) 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 94895ab..487db06 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 @@ -561,6 +561,27 @@ public class LotteryService { long participateNum = getParticipateNumByLotteryId(lottery.getId()); // 设置抽奖人数 lottery.setParticipateNum(participateNum); + + QLotteryRegion qLotteryRegion = QLotteryRegion.lotteryRegion; + QRegion qRegion = QRegion.region; + + List lotteryRegionList = jpaQueryFactory + .select(Projections.bean(LotteryRegionDetailVO.class, + qLotteryRegion.id, + qLotteryRegion.regionId, + qLotteryRegion.lotteryId, + qLotteryRegion.num, + qRegion.name, + qRegion.code, + qLotteryRegion.showTime + )) + .from(qLotteryRegion) + .innerJoin(qRegion) + .on(qLotteryRegion.regionId.eq(qRegion.id)) + .where(qLotteryRegion.lotteryId.eq(lottery.getId())) + .fetch(); + + lottery.setLotteryRegionList(lotteryRegionList); } }); return lotteryPageResult; diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryAPPVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryAPPVO.java index 6f53220..ec54ec1 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryAPPVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryAPPVO.java @@ -88,6 +88,8 @@ public class LotteryAPPVO implements Serializable { private BigDecimal price; @ApiModelProperty(value = "发布时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime publishTime; @Transient @@ -98,6 +100,7 @@ public class LotteryAPPVO implements Serializable { @ApiModelProperty(value = "参与人数") private Long participateNum; + private List lotteryRegionList; public LotteryAPPVO() {