package cn.iocoder.yudao.module.order.listener;

import cn.iocoder.yudao.framework.apollo.core.event.warehouseIn.WarehouseInOrderCheckExceptionEvent;
import cn.iocoder.yudao.module.order.service.orderWarehouseIn.OrderWarehouseInService;
import lombok.AllArgsConstructor;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 入仓订单检查订单入仓异常监听
 *
 * @author zhengYi
 */
@Component("WarehouseInOrderCheckExceptionListener")
@AllArgsConstructor
public class WarehouseInOrderCheckExceptionListener {

    private final OrderWarehouseInService orderWarehouseInService;
    /**
     * 入仓订单检查订单入仓异常更新业务
     *
     * @param event 订单id
     */
    @EventListener(WarehouseInOrderCheckExceptionEvent.class)
    public void warehouseInOrderCheckExceptionEvent(WarehouseInOrderCheckExceptionEvent event) {
        orderWarehouseInService.finishWarehouseInWhenCheckException(event.getOrderId());
    }
}
