| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(goods.getStatus() == 1){ |
| | | throw new RuntimeException(goods.getName() + "商品已被下架"); |
| | | } |
| | | if(!goods.getCommodityAuthority().contains("-1") && !goods.getCommodityAuthority().contains(appUser.getVipId().toString())){ |
| | | throw new RuntimeException("无权限购买" + goods.getName()); |
| | | } |
| | | |
| | | ids.add(id); |
| | | } |
| | | |
| | |
| | | //处理优惠券 |
| | | if(null != order.getUserCouponId()){ |
| | | UserCoupon userCoupon = userCouponClient.getUserCoupon(order.getUserCouponId()).getData(); |
| | | if(null != userCoupon && 1 == userCoupon.getStatus()){ |
| | | userCoupon.setStatus(2); |
| | | if(null != userCoupon && null == userCoupon.getUseTime()){ |
| | | userCoupon.setUseTime(LocalDateTime.now()); |
| | | userCouponClient.editUserCoupon(userCoupon); |
| | | } |
| | |
| | | //处理优惠券 |
| | | if(null != order.getUserCouponId()){ |
| | | UserCoupon userCoupon = userCouponClient.getUserCoupon(order.getUserCouponId()).getData(); |
| | | if(null != userCoupon && 1 == userCoupon.getStatus()){ |
| | | if(null != userCoupon && null == userCoupon.getUseTime()){ |
| | | userCoupon.setStatus(2); |
| | | userCoupon.setUseTime(LocalDateTime.now()); |
| | | userCouponClient.editUserCoupon(userCoupon); |