|
|
@@ -208,11 +208,6 @@ public class OrderService {
|
|
|
collectionService.decreaseQuota(collectionId, 1);
|
|
|
}
|
|
|
} else {
|
|
|
-// long count = userRepo.countAllByCollectionIdAndCollectionInvitor(collectionId, userId);
|
|
|
-// int sub = collection.getAssignment() - (int) count;
|
|
|
-// if (sub > 0) {
|
|
|
-// throw new BusinessException("再拉新" + sub + "人即可购买");
|
|
|
-// }
|
|
|
if (user.getVipPoint() < 1) {
|
|
|
throw new BusinessException("没有购买名额");
|
|
|
}
|
|
|
@@ -284,7 +279,7 @@ public class OrderService {
|
|
|
|
|
|
if (usePoint > 0) {
|
|
|
// 扣除积分
|
|
|
- userRepo.updateVipPoint(userId, -usePoint);
|
|
|
+ userRepo.addVipPoint(userId, -usePoint);
|
|
|
}
|
|
|
rocketMQTemplate.syncSend(generalProperties.getUpdateStockTopic(), collectionId, 10000);
|
|
|
log.info("订单创建完成, id={}, {}ms", order.getId(), System.currentTimeMillis() - t);
|
|
|
@@ -293,7 +288,7 @@ public class OrderService {
|
|
|
collectionService.increaseStock(collectionId, qty);
|
|
|
if (usePoint > 0) {
|
|
|
// 扣除积分
|
|
|
- userRepo.updateVipPoint(userId, usePoint);
|
|
|
+ userRepo.addVipPoint(userId, usePoint);
|
|
|
log.info("取消加积分用户ID:{}, 积分:{}", userId, usePoint);
|
|
|
}
|
|
|
throw e;
|