From 96bcea1979ef1461d84fc401b01352a6ff7e314d Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Fri, 16 Aug 2024 08:38:28 +0800 Subject: [PATCH] =?UTF-8?q?release:=203.12.=E6=8A=BD=E5=A5=96=E8=AF=A6?= =?UTF-8?q?=E6=83=85(PC)=20=E4=BC=98=E5=8C=96detail=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../luoo/user/controller/PointController.java | 2 +- .../com/luoo/user/service/LotteryService.java | 19 +++++----- .../luoo/user/vo/point/LotteryDetailPCVO.java | 2 +- .../user/vo/point/LotteryRegionDetailVO.java | 35 +++++++++++++++++++ 4 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 luoo_user/src/main/java/com/luoo/user/vo/point/LotteryRegionDetailVO.java diff --git a/luoo_user/src/main/java/com/luoo/user/controller/PointController.java b/luoo_user/src/main/java/com/luoo/user/controller/PointController.java index 270a268..168bd7a 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/PointController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/PointController.java @@ -397,7 +397,7 @@ public class PointController { @ApiParam(value = "抽奖id") String lotteryId, @ApiParam(value = "页码", required = true) @PathVariable Integer page, @ApiParam(value = "每页条数", required = true) @PathVariable Integer size, - @ApiParam(value = "用户类型") Integer userType) { + @ApiParam(value = "用户类型,中奖:1,全部:null") Integer userType) { return Result.success(lotteryService.getLotteryUserList(page, size, lotteryId, userType)); } 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 5ad941a..303cce3 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 @@ -8,10 +8,7 @@ import com.luoo.user.dao.LotteryUserDao; import com.luoo.user.dao.UserInfoDao; import com.luoo.user.dto.point.LotterySearchDto; import com.luoo.user.pojo.*; -import com.luoo.user.vo.point.LotteryAPPVO; -import com.luoo.user.vo.point.LotteryDetailPCVO; -import com.luoo.user.vo.point.LotteryPCVO; -import com.luoo.user.vo.point.LotteryUserDetailPCVO; +import com.luoo.user.vo.point.*; import com.querydsl.core.BooleanBuilder; import com.querydsl.core.types.Projections; import com.querydsl.jpa.impl.JPAQueryFactory; @@ -602,18 +599,22 @@ public class LotteryService { .fetchOne(); QLotteryRegion qLotteryRegion = QLotteryRegion.lotteryRegion; - List lotteryRegionList = jpaQueryFactory - .select(Projections.bean(LotteryRegion.class, + QRegion qRegion = QRegion.region; + List lotteryRegionList = jpaQueryFactory + .select(Projections.bean(LotteryRegionDetailVO.class, qLotteryRegion.id, qLotteryRegion.regionId, - qLotteryRegion.lotteryId + qLotteryRegion.lotteryId, + qLotteryRegion.num, + qRegion.name, + qRegion.code )) .from(qLotteryRegion) + .innerJoin(qRegion) + .on(qLotteryRegion.regionId.eq(qRegion.id)) .where(qLotteryRegion.lotteryId.eq(lotteryId)) .fetch(); - - assert lotteryDetailPCVO != null; lotteryDetailPCVO.setLotteryRegionList(lotteryRegionList); return lotteryDetailPCVO; diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailPCVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailPCVO.java index ac0119e..01e533c 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailPCVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailPCVO.java @@ -79,7 +79,7 @@ public class LotteryDetailPCVO { private String stopReason; @ApiModelProperty(value = "抽奖区域列表") - List lotteryRegionList; + List lotteryRegionList; public LotteryDetailPCVO() { } diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryRegionDetailVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryRegionDetailVO.java new file mode 100644 index 0000000..401a08c --- /dev/null +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryRegionDetailVO.java @@ -0,0 +1,35 @@ +package com.luoo.user.vo.point; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @program: luoo_parent + * @description: 抽奖区域 + * @author: yawei.huang + * @create: 2024-08-16 08:08 + **/ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class LotteryRegionDetailVO { + @ApiModelProperty(value = "主键") + private String id; + + @ApiModelProperty(value = "抽奖id") + private String lotteryId; + + @ApiModelProperty(value = "区域id") + private Integer regionId; + + @ApiModelProperty(value = "数量") + private Integer num; + + @ApiModelProperty(value = "区域名称") + private String name; + + @ApiModelProperty(value = "区域编码") + private String code; +}