release: 已参与抽奖,不能再次参与

release-2024-04-25
huangyw 2 months ago
parent 582bc72be3
commit decff08a7c

@ -350,6 +350,12 @@ public class LotteryService {
// 校验用户是否可参与
UserInfo userInfo = userInfoDao.findById(userLoginDto.getUserId()).get();
// 已参与抽奖,不能再次参与
LotteryUser byLotteryIdAndUserId = lotteryUserDao.findByLotteryIdAndUserId(id, userLoginDto.getUserId());
if(byLotteryIdAndUserId != null) {
throw new BizException(ErrorConstants.ALREADY_PARTICIPATED);
}
Integer participant = lottery.getParticipant();
if (Objects.equals(participant, PointEnums.LOTTERY_ALL_MEMBER.getCode())) {
// 会员可参与

Loading…
Cancel
Save