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; +}