售后:售后成功后,回滚 SKU 库存

This commit is contained in:
owen 2023-09-27 00:24:22 +08:00
parent 2766dd672a
commit 74ef98f8fc
1 changed files with 3 additions and 5 deletions

View File

@ -70,10 +70,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.*;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
@ -823,7 +820,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
// TODO 芋艿这块扣减规则需要在考虑下
// 售后成功后执行数据回滚逻辑
if (Objects.equals(newAfterSaleStatus, TradeOrderItemAfterSaleStatusEnum.SUCCESS.getStatus())) {
// TODO @疯狂这里库存也要扣减下
// 增加 SKU 库存
productSkuApi.updateSkuStock(TradeOrderConvert.INSTANCE.convert(Collections.singletonList(orderItem)));
// 扣减用户积分赠送的
reduceUserPoint(order.getUserId(), orderItem.getGivePoint(), MemberPointBizTypeEnum.AFTER_SALE_DEDUCT_GIVE, afterSaleId);
// 增加用户积分返还抵扣