Browse Source

Merge branch 'dev' into 2D展厅

licailing 4 years ago
parent
commit
4247404181
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/main/java/com/izouma/nineth/service/OrderService.java

+ 5 - 0
src/main/java/com/izouma/nineth/service/OrderService.java

@@ -40,6 +40,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.EncoderException;
 import org.apache.commons.codec.net.URLCodec;
 import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.rocketmq.client.producer.SendResult;
 import org.apache.rocketmq.spring.core.RocketMQTemplate;
@@ -201,6 +202,10 @@ public class OrderService {
                     if (user.getVipPurchase() - purchase <= 0) {
                         throw new BusinessException("vip名额已使用完毕!");
                     }
+                    // vip扣除额度
+                    if (ObjectUtils.isNotEmpty(collection.getVipQuota())) {
+                        collectionService.decreaseQuota(collectionId, 1);
+                    }
                 } else {
 //                    long count = userRepo.countAllByCollectionIdAndCollectionInvitor(collectionId, userId);
 //                    int sub = collection.getAssignment() - (int) count;