| @@ -778,15 +778,25 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| if (null != checkPressResult) { | if (null != checkPressResult) { | ||||
| WxPressBatch pressBatch = checkPressResult.getPressBatch(); | WxPressBatch pressBatch = checkPressResult.getPressBatch(); | ||||
| List<Long> cids = checkPressResult.getCouponIdList(); | List<Long> cids = checkPressResult.getCouponIdList(); | ||||
| couponOrderQ.setCouponIds(cids); | |||||
| if (pressBatch.getPromoterLimitRule().equals(EnumCouponUseLimitRule.TOBEUSED_USELIMIT.getCode())) { | |||||
| couponOrderQ.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()); | |||||
| } | |||||
| int _count = wxCouponOrderMapper.findProductCount(couponOrderQ)+couponNumber; | |||||
| if (_count > pressBatch.getPromoterAllowCount()) { | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"当前用户已达砍价["+counpon.getTitle()+"]所在批次活动发起次数上限."); | |||||
| if (null != cids && cids.size() > 0 ) { | |||||
| couponOrderQ.setCouponIds(cids); | |||||
| //判断这些券发起中+已完成的 | |||||
| WxOrder order = new WxOrder(); | |||||
| order.setCouponIds(cids); | |||||
| //if (pressBatch.getPromoterLimitRule().equals(EnumCouponUseLimitRule.TOBEUSED_USELIMIT.getCode())) { | |||||
| List<Integer> statusS = new ArrayList<Integer>(); | |||||
| statusS.add(EnumOrderStatus.ORDER_STATUS_PRESSING.getCode()); | |||||
| statusS.add(EnumOrderStatus.ORDER_STATUS_PRESS_COMPLETE.getCode()); | |||||
| order.setStatusS(statusS); | |||||
| //} | |||||
| int _count = wxOrderMapper.countCouponConditionType1(order); | |||||
| if (_count > pressBatch.getPromoterAllowCount()) { | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"当前用户已达砍价["+counpon.getTitle()+"]所在批次活动发起次数上限."); | |||||
| } | |||||
| return _count; | |||||
| }else { | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"砍价批次["+pressBatch.getName()+"]未设置券."); | |||||
| } | } | ||||
| return _count; | |||||
| }else { | }else { | ||||
| if (counpon.getUseLimitRule().equals(EnumCouponUseLimitRule.TOBEUSED_USELIMIT.getCode())) { | if (counpon.getUseLimitRule().equals(EnumCouponUseLimitRule.TOBEUSED_USELIMIT.getCode())) { | ||||
| couponOrderQ.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()); | couponOrderQ.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()); | ||||