|
|
@@ -299,7 +299,11 @@ public class OrderService {
|
|
|
if (usePoint > 0) {
|
|
|
// 扣除积分
|
|
|
userRepo.addVipPoint(userId, usePoint);
|
|
|
- log.info("取消加积分用户ID:{}, 积分:{}", userId, usePoint);
|
|
|
+ log.info("订单失败加积分用户ID:{}, 积分:{}", userId, usePoint);
|
|
|
+ }
|
|
|
+ if (vip) {
|
|
|
+ collectionService.decreaseQuota(collectionId, 1);
|
|
|
+ log.info("订单失败加藏品额度CollectionId:{}", collectionId);
|
|
|
}
|
|
|
throw e;
|
|
|
}
|
|
|
@@ -752,8 +756,11 @@ public class OrderService {
|
|
|
userRepo.updateVipPoint(order.getUserId(), order.getVipPoint());
|
|
|
log.info("取消加积分用户ID:{},订单ID:{},积分:{}", order.getUserId(), order.getId(), order.getVipPoint());
|
|
|
}
|
|
|
-
|
|
|
- rocketMQTemplate.syncSend(generalProperties.getUpdateStockTopic(), order.getCollectionId(), 10000);
|
|
|
+ if (order.isVip()) {
|
|
|
+ collectionService.decreaseQuota(order.getCollectionId(), 1);
|
|
|
+ log.info("取消加藏品额度CollectionId:{}", order.getCollectionId());
|
|
|
+ }
|
|
|
+ rocketMQTemplate.syncSend(generalProperties.getUpdateQuotaTopic(), order.getCollectionId(), 10000);
|
|
|
log.info("取消订单{}", order.getId());
|
|
|
} catch (Exception e) {
|
|
|
if (e instanceof BusinessException) {
|