| @@ -178,7 +178,10 @@ public class WxOfflineActivityGrantAwardServiceImpl implements WxOfflineActivity | |||||
| } | } | ||||
| activityItem.setIsMeet(true); | activityItem.setIsMeet(true); | ||||
| //奖项限制数量 | //奖项限制数量 | ||||
| int limitCount = wxOfflineActivityGrantAward.getOrderMoneySum() / activityItem.getAwardsItemPrice(); | |||||
| int limitCount = 0; | |||||
| if(activityItem.getAwardsItemPrice() != null || activityItem.getAwardsItemPrice() > 0){ | |||||
| limitCount = wxOfflineActivityGrantAward.getOrderMoneySum() / activityItem.getAwardsItemPrice(); | |||||
| } | |||||
| if(activityItem.getAwardsItemLimit() != null && activityItem.getAwardsItemLimit() > 0 | if(activityItem.getAwardsItemLimit() != null && activityItem.getAwardsItemLimit() > 0 | ||||
| && activityItem.getAwardsItemLimit() < limitCount){ | && activityItem.getAwardsItemLimit() < limitCount){ | ||||
| limitCount = activityItem.getAwardsItemLimit(); | limitCount = activityItem.getAwardsItemLimit(); | ||||
| @@ -337,12 +340,15 @@ public class WxOfflineActivityGrantAwardServiceImpl implements WxOfflineActivity | |||||
| throw new MallinkException(Result.ERROR, "活动项"+activityItem.getName()+"金额不满足"); | throw new MallinkException(Result.ERROR, "活动项"+activityItem.getName()+"金额不满足"); | ||||
| } | } | ||||
| //奖项限制数量 | //奖项限制数量 | ||||
| int limitCount = wxOfflineActivityGrantAward.getOrderMoneySum() / activityItem.getAwardsItemPrice(); | |||||
| int limitCount = 0; | |||||
| if(activityItem.getAwardsItemPrice() != null || activityItem.getAwardsItemPrice() > 0){ | |||||
| limitCount = wxOfflineActivityGrantAward.getOrderMoneySum() / activityItem.getAwardsItemPrice(); | |||||
| } | |||||
| if(activityItem.getAwardsItemLimit() != null && activityItem.getAwardsItemLimit() > 0 | if(activityItem.getAwardsItemLimit() != null && activityItem.getAwardsItemLimit() > 0 | ||||
| && activityItem.getAwardsItemLimit() < limitCount){ | && activityItem.getAwardsItemLimit() < limitCount){ | ||||
| limitCount = activityItem.getAwardsItemLimit(); | limitCount = activityItem.getAwardsItemLimit(); | ||||
| } | } | ||||
| if(activityGrantItemList.stream().mapToInt(WxOfflineActivityGrantItem::getAwardCount).sum()>limitCount){ | |||||
| if(limitCount != 0 && activityGrantItemList.stream().mapToInt(WxOfflineActivityGrantItem::getAwardCount).sum()>limitCount){ | |||||
| throw new MallinkException(Result.ERROR, "活动项"+activityItem.getName()+"奖券超过限制"); | throw new MallinkException(Result.ERROR, "活动项"+activityItem.getName()+"奖券超过限制"); | ||||
| } | } | ||||