Authored by Lixiaodi

微信抽奖 提交

@@ -106,21 +106,21 @@ public class LotteryController { @@ -106,21 +106,21 @@ public class LotteryController {
106 106
107 private void checkLotteryId(Integer lotteryId) { 107 private void checkLotteryId(Integer lotteryId) {
108 if (lotteryId == null|| lotteryId <= 0) { 108 if (lotteryId == null|| lotteryId <= 0) {
109 - logger.warn("LotteryId is empty"); 109 + logger.warn("LotteryId is invalid {}", lotteryId);
110 throw new ServiceException(500, "活动编号不合法"); 110 throw new ServiceException(500, "活动编号不合法");
111 } 111 }
112 } 112 }
113 113
114 private void checkUserId(Integer userId) { 114 private void checkUserId(Integer userId) {
115 if (userId == null || userId <= 0) { 115 if (userId == null || userId <= 0) {
116 - logger.warn("UserId is empty"); 116 + logger.warn("UserId is invalid {}", userId);
117 throw new ServiceException(500, "用户id不合法"); 117 throw new ServiceException(500, "用户id不合法");
118 } 118 }
119 } 119 }
120 120
121 private void checkOrderCode(String orderCode) { 121 private void checkOrderCode(String orderCode) {
122 if (StringUtils.isBlank(orderCode)) { 122 if (StringUtils.isBlank(orderCode)) {
123 - logger.warn("OrderCode is empty"); 123 + logger.warn("OrderCode is invalid {}", orderCode);
124 throw new ServiceException(500, "订单编号不合法"); 124 throw new ServiceException(500, "订单编号不合法");
125 } 125 }
126 } 126 }
@@ -121,6 +121,9 @@ public class LotteryServiceImpl implements ILotteryService , ApplicationContextA @@ -121,6 +121,9 @@ public class LotteryServiceImpl implements ILotteryService , ApplicationContextA
121 prize = p; 121 prize = p;
122 } 122 }
123 } 123 }
  124 + if (prize == null) {
  125 + logger.warn("错误的奖品id:活动id{} 奖品id{}", lotteryId, rec.getPrizeId());
  126 + }
124 havePrize = !hasRealPrize(prize); 127 havePrize = !hasRealPrize(prize);
125 } 128 }
126 if (havePrize) { 129 if (havePrize) {