售后:售后成功后,回滚 SKU 库存
This commit is contained in:
parent
2766dd672a
commit
74ef98f8fc
|
@ -70,10 +70,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
|
||||||
|
@ -823,7 +820,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||||
// TODO 芋艿:这块扣减规则,需要在考虑下
|
// TODO 芋艿:这块扣减规则,需要在考虑下
|
||||||
// 售后成功后,执行数据回滚逻辑
|
// 售后成功后,执行数据回滚逻辑
|
||||||
if (Objects.equals(newAfterSaleStatus, TradeOrderItemAfterSaleStatusEnum.SUCCESS.getStatus())) {
|
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);
|
reduceUserPoint(order.getUserId(), orderItem.getGivePoint(), MemberPointBizTypeEnum.AFTER_SALE_DEDUCT_GIVE, afterSaleId);
|
||||||
// 增加用户积分(返还抵扣)
|
// 增加用户积分(返还抵扣)
|
||||||
|
|
Loading…
Reference in New Issue