Authored by Lixiaodi

微信抽奖 提交

... ... @@ -106,21 +106,21 @@ public class LotteryController {
private void checkLotteryId(Integer lotteryId) {
if (lotteryId == null|| lotteryId <= 0) {
logger.warn("LotteryId is empty");
logger.warn("LotteryId is invalid {}", lotteryId);
throw new ServiceException(500, "活动编号不合法");
}
}
private void checkUserId(Integer userId) {
if (userId == null || userId <= 0) {
logger.warn("UserId is empty");
logger.warn("UserId is invalid {}", userId);
throw new ServiceException(500, "用户id不合法");
}
}
private void checkOrderCode(String orderCode) {
if (StringUtils.isBlank(orderCode)) {
logger.warn("OrderCode is empty");
logger.warn("OrderCode is invalid {}", orderCode);
throw new ServiceException(500, "订单编号不合法");
}
}
... ...
... ... @@ -121,6 +121,9 @@ public class LotteryServiceImpl implements ILotteryService , ApplicationContextA
prize = p;
}
}
if (prize == null) {
logger.warn("错误的奖品id:活动id{} 奖品id{}", lotteryId, rec.getPrizeId());
}
havePrize = !hasRealPrize(prize);
}
if (havePrize) {
... ...