release- lottery h5接口处理

release-2024-04-25
huangyw 2 months ago
parent 595a92313d
commit a96b71bd06

@ -365,9 +365,9 @@ public class PointController {
@ApiOperation(value = "3.10.已参与抽奖的人(APP)", notes = "APP") @ApiOperation(value = "3.10.已参与抽奖的人(APP)", notes = "APP")
@PostMapping("/lottery/participated/{page}/{size}") @PostMapping("/lottery/participated/{page}/{size}")
@GlobalInterceptor(checkAppUserLogin = true) // @GlobalInterceptor(checkAppUserLogin = true)
public Result<PageResult<LotteryUserAPPVO>> findParticipatedLotteryUserList( public Result<PageResult<LotteryUserAPPVO>> findParticipatedLotteryUserList(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @ApiParam(value = "Header中的token信息") @RequestHeader("Authorization") String token,
@ApiParam(value = "查询参数") @RequestBody LotteryParticipatedSearchDto lotteryParticipatedSearchDto, @ApiParam(value = "查询参数") @RequestBody LotteryParticipatedSearchDto lotteryParticipatedSearchDto,
@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) {
@ -411,9 +411,9 @@ public class PointController {
@ApiOperation(value = "3.14.抽奖详情(APP)", notes = "APP") @ApiOperation(value = "3.14.抽奖详情(APP)", notes = "APP")
@GetMapping("/app/lottery/detail/{id}") @GetMapping("/app/lottery/detail/{id}")
@GlobalInterceptor(checkAppUserLogin = true) // @GlobalInterceptor(checkAppUserLogin = true)
public Result<LotteryDetailAPPVO> findLotteryDetailAPPVO( public Result<LotteryDetailAPPVO> findLotteryDetailAPPVO(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @ApiParam(value = "Header中的token信息") @RequestHeader("Authorization") String token,
@ApiParam(value = "抽奖id", required = true) @PathVariable String id) { @ApiParam(value = "抽奖id", required = true) @PathVariable String id) {
return Result.success(lotteryService.getLotteryDetailAPPVO(id)); return Result.success(lotteryService.getLotteryDetailAPPVO(id));
} }

@ -705,6 +705,13 @@ public class LotteryService {
.limit(pageable.getPageSize()) .limit(pageable.getPageSize())
.fetch(); .fetch();
UserLoginDto user = jwtUtil.getUser();
if (user == null) {
for (LotteryUserAPPVO lotteryUserAPPVO : lotteryUserList) {
lotteryUserAPPVO.setResult(null);
}
}
long total = jpaQueryFactory long total = jpaQueryFactory
.select(qLotteryUser.count()) .select(qLotteryUser.count())
.from(qLotteryUser) .from(qLotteryUser)
@ -837,12 +844,15 @@ public class LotteryService {
BeanUtils.copyProperties(lotteryDetailPCVO, result); BeanUtils.copyProperties(lotteryDetailPCVO, result);
UserLoginDto userLoginDto = jwtUtil.getUser(); UserLoginDto userLoginDto = jwtUtil.getUser();
if (userLoginDto != null) {
LotteryUser lotteryUser = lotteryUserDao.findByLotteryIdAndUserId(lotteryId, userLoginDto.getUserId()); LotteryUser lotteryUser = lotteryUserDao.findByLotteryIdAndUserId(lotteryId, userLoginDto.getUserId());
if (lotteryUser != null) { if (lotteryUser != null) {
result.setIsParticipate(PointEnums.PARTICIPATED.getCode()); result.setIsParticipate(PointEnums.PARTICIPATED.getCode());
} else { } else {
result.setIsParticipate(PointEnums.NOT_PARTICIPATED.getCode()); result.setIsParticipate(PointEnums.NOT_PARTICIPATED.getCode());
} }
}
long participateNum = getParticipateNumByLotteryId(lotteryId); long participateNum = getParticipateNumByLotteryId(lotteryId);
// 设置抽奖人数 // 设置抽奖人数
result.setParticipateNum(participateNum); result.setParticipateNum(participateNum);

Loading…
Cancel
Save