release: 3.12.抽奖详情(PC) 优化detail参数

release-2024-04-25
huangyw 3 months ago
parent ccec9958ce
commit 96bcea1979

@ -397,7 +397,7 @@ public class PointController {
@ApiParam(value = "抽奖id") String lotteryId, @ApiParam(value = "抽奖id") String lotteryId,
@ApiParam(value = "页码", required = true) @PathVariable Integer page, @ApiParam(value = "页码", required = true) @PathVariable Integer page,
@ApiParam(value = "每页条数", required = true) @PathVariable Integer size, @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)); return Result.success(lotteryService.getLotteryUserList(page, size, lotteryId, userType));
} }

@ -8,10 +8,7 @@ import com.luoo.user.dao.LotteryUserDao;
import com.luoo.user.dao.UserInfoDao; import com.luoo.user.dao.UserInfoDao;
import com.luoo.user.dto.point.LotterySearchDto; import com.luoo.user.dto.point.LotterySearchDto;
import com.luoo.user.pojo.*; import com.luoo.user.pojo.*;
import com.luoo.user.vo.point.LotteryAPPVO; import com.luoo.user.vo.point.*;
import com.luoo.user.vo.point.LotteryDetailPCVO;
import com.luoo.user.vo.point.LotteryPCVO;
import com.luoo.user.vo.point.LotteryUserDetailPCVO;
import com.querydsl.core.BooleanBuilder; import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Projections; import com.querydsl.core.types.Projections;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAQueryFactory;
@ -602,18 +599,22 @@ public class LotteryService {
.fetchOne(); .fetchOne();
QLotteryRegion qLotteryRegion = QLotteryRegion.lotteryRegion; QLotteryRegion qLotteryRegion = QLotteryRegion.lotteryRegion;
List<LotteryRegion> lotteryRegionList = jpaQueryFactory QRegion qRegion = QRegion.region;
.select(Projections.bean(LotteryRegion.class, List<LotteryRegionDetailVO> lotteryRegionList = jpaQueryFactory
.select(Projections.bean(LotteryRegionDetailVO.class,
qLotteryRegion.id, qLotteryRegion.id,
qLotteryRegion.regionId, qLotteryRegion.regionId,
qLotteryRegion.lotteryId qLotteryRegion.lotteryId,
qLotteryRegion.num,
qRegion.name,
qRegion.code
)) ))
.from(qLotteryRegion) .from(qLotteryRegion)
.innerJoin(qRegion)
.on(qLotteryRegion.regionId.eq(qRegion.id))
.where(qLotteryRegion.lotteryId.eq(lotteryId)) .where(qLotteryRegion.lotteryId.eq(lotteryId))
.fetch(); .fetch();
assert lotteryDetailPCVO != null; assert lotteryDetailPCVO != null;
lotteryDetailPCVO.setLotteryRegionList(lotteryRegionList); lotteryDetailPCVO.setLotteryRegionList(lotteryRegionList);
return lotteryDetailPCVO; return lotteryDetailPCVO;

@ -79,7 +79,7 @@ public class LotteryDetailPCVO {
private String stopReason; private String stopReason;
@ApiModelProperty(value = "抽奖区域列表") @ApiModelProperty(value = "抽奖区域列表")
List<LotteryRegion> lotteryRegionList; List<LotteryRegionDetailVO> lotteryRegionList;
public LotteryDetailPCVO() { public LotteryDetailPCVO() {
} }

@ -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;
}
Loading…
Cancel
Save