release: 抽奖详情-APP新增字段

release-2024-04-25
huangyw 3 months ago
parent 2cd6d87e3f
commit a6bde0d5b2

@ -423,10 +423,7 @@ public class PointController {
public Result<LotteryDetailAPPVO> findLotteryDetailAPPVO(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
@ApiParam(value = "抽奖id", required = true) @PathVariable String id) {
LotteryDetailPCVO lotteryDetailPCVO = lotteryService.getLotteryDetailPCVO(id);
LotteryDetailAPPVO result = new LotteryDetailAPPVO();
BeanUtils.copyProperties(lotteryDetailPCVO, result);
return Result.success(result);
return Result.success(lotteryService.getLotteryDetailAPPVO(id));
}

@ -34,6 +34,7 @@ import javax.persistence.criteria.Root;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@ -593,7 +594,7 @@ public class LotteryService {
}
/**
*
* -PC
*
* @param lotteryId id
* @return
@ -645,6 +646,31 @@ public class LotteryService {
return lotteryDetailPCVO;
}
/**
* -APP
*
* @param lotteryId id
* @return
*/
public LotteryDetailAPPVO getLotteryDetailAPPVO(String lotteryId) {
LotteryDetailPCVO lotteryDetailPCVO = getLotteryDetailPCVO(lotteryId);
LotteryDetailAPPVO result = new LotteryDetailAPPVO();
BeanUtils.copyProperties(lotteryDetailPCVO, result);
UserLoginDto userLoginDto = jwtUtil.getUser();
LotteryUser lotteryUser = lotteryUserDao.findByLotteryIdAndUserId(lotteryId, userLoginDto.getUserId());
if (lotteryUser != null) {
result.setIsParticipate(PointEnums.PARTICIPATED.getCode());
} else {
result.setIsParticipate(PointEnums.NOT_PARTICIPATED.getCode());
}
long participateNum = getParticipateNumByLotteryId(lotteryId);
// 设置抽奖人数
result.setParticipateNum(participateNum);
return result;
}
/**
* id
*

@ -6,6 +6,7 @@ import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Transient;
import java.time.LocalDateTime;
import java.util.List;
@ -79,6 +80,14 @@ public class LotteryDetailAPPVO {
@ApiModelProperty(value = "抽奖区域列表")
List<LotteryRegionDetailVO> lotteryRegionList;
@Transient
@ApiModelProperty(value = "本人是否参与抽奖 1-已参加 2-未参加")
private Integer isParticipate;
@Transient
@ApiModelProperty(value = "参与人数")
private Long participateNum;
public LotteryDetailAPPVO() {
}

@ -92,9 +92,9 @@
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- excel工具 -->
<dependency>

Loading…
Cancel
Save