package com.xingxi.mq.server.order.service.impl;

import com.xingxi.mq.entity.OrderDetail;
import com.xingxi.mq.server.order.mapper.OrderDetailMqMapper;
import com.xingxi.mq.server.order.service.IOrderDetailVoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 订单明细Service业务层处理
 *
 * @author xingxi
 * @date 2025-02-11
 */
@Service
public class OrderDetailVoServiceImpl implements IOrderDetailVoService {
    @Autowired
    private OrderDetailMqMapper orderDetailVoMapper;

    /**
     * 校验订单是否完成
     *
     * @param orderId 订单ID
     * @return 检查结果
     */
    public int checkOrderFinished(Long orderId) {
        return orderDetailVoMapper.checkOrderFinished(orderId);
    }

    /**
     * 更新退货数量
     *
     * @param orderDetail 订单详细信息
     * @return 订单详细信息Vo集合
     */
    @Override
    public int updateReturnQty(OrderDetail orderDetail) {
        return orderDetailVoMapper.updateReturnQty(orderDetail);
    }
}
