| @@ -173,39 +173,23 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| // + couponOrder ---待使用 | // + couponOrder ---待使用 | ||||
| int countOrder = 0, countCouponOrder = 0; | int countOrder = 0, countCouponOrder = 0; | ||||
| if(counpon.getType().equals(EnumCouponType.COUPON_PRESS.getCode())) { | |||||
| // 砍价券待支付有两个状态 | |||||
| try { | |||||
| WxOrder orderQ = new WxOrder(); | |||||
| orderQ.setTenantId(user.getTenantId()); | |||||
| orderQ.setProductId(counpon.getId()); | |||||
| orderQ.setType(EnumOrderType.COUPON.getCode()); | |||||
| orderQ.setcUserId(user.getId()); | |||||
| List<Integer> statusS = new ArrayList<Integer>(); | |||||
| statusS.add(EnumOrderStatus.ORDER_STATUS_PRESSING.getCode()); | |||||
| statusS.add(EnumOrderStatus.ORDER_STATUS_PRESS_COMPLETE.getCode()); | |||||
| orderQ.setStatusS(statusS); | |||||
| countOrder = wxOrderMapper.countList(orderQ); | |||||
| } catch (Exception e) { | |||||
| logger.error("购买是否超限-DB, couponId: " + counpon.getId() + ", e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL); | |||||
| } | |||||
| } else { | |||||
| // 非砍价券 | |||||
| try { | |||||
| WxOrder orderQ = new WxOrder(); | |||||
| orderQ.setTenantId(user.getTenantId()); | |||||
| orderQ.setProductId(counpon.getId()); | |||||
| orderQ.setType(EnumOrderType.COUPON.getCode()); | |||||
| orderQ.setcUserId(user.getId()); | |||||
| orderQ.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode()); | |||||
| countOrder = wxOrderMapper.countList(orderQ); | |||||
| } catch (Exception e) { | |||||
| logger.error("购买是否超限-DB, couponId: " + counpon.getId() + ", e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL); | |||||
| } | |||||
| } | |||||
| try { | |||||
| WxOrder orderQ = new WxOrder(); | |||||
| orderQ.setTenantId(user.getTenantId()); | |||||
| orderQ.setProductId(counpon.getId()); | |||||
| orderQ.setType(EnumOrderType.COUPON.getCode()); | |||||
| orderQ.setcUserId(user.getId()); | |||||
| List<Integer> statusS = new ArrayList<Integer>(); | |||||
| statusS.add(EnumOrderStatus.ORDER_STATUS_PRESSING.getCode()); | |||||
| statusS.add(EnumOrderStatus.ORDER_STATUS_PRESS_COMPLETE.getCode()); //砍价券专有状态 | |||||
| statusS.add(EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode());//砍价券专有状态 | |||||
| orderQ.setStatusS(statusS); | |||||
| countOrder = wxOrderMapper.countList(orderQ); | |||||
| } catch (Exception e) { | |||||
| logger.error("购买是否超限-DB, couponId: " + counpon.getId() + ", e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL); | |||||
| } | |||||
| try { | try { | ||||
| WxCouponOrder couponOrderQ = new WxCouponOrder(); | WxCouponOrder couponOrderQ = new WxCouponOrder(); | ||||