package com.yiqi.order.service;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yiqi.order.domain.OrderPurchaseGoods;
import com.yiqi.order.domain.dto.OrderGoodsOutGoodsDTO;
import com.yiqi.order.domain.dto.OrderPurchaseGoodsAddDTO;
import com.yiqi.order.domain.dto.OrderPurchaseGoodsQueryDTO;
import com.yiqi.order.domain.vo.OrderDeliveryPathVO;
import com.yiqi.order.domain.vo.OrderPurchaseGoodsInfoVO;
import com.yiqi.order.domain.vo.OrderPurchaseGoodsVO;
import com.yiqi.order.domain.vo.OrderSellGoodsListVO;

/**
 * 商品订单Service接口
 *
 * @author ruoyi
 * @date 2023-10-17
 */
public interface IOrderPurchaseGoodsService extends IService<OrderPurchaseGoods> {
    /**
     * 查询商品订单
     *
     * @param id 商品订单主键
     * @return 商品订单
     */
    public List<OrderPurchaseGoodsVO> selectOrderPurchaseGoodsById(Long id);

    /**
     * 查询商品订单列表
     *
     * @param orderPurchaseGoods 商品订单
     * @return 商品订单集合
     */
    public List<OrderPurchaseGoods> selectOrderPurchaseGoodsList(OrderPurchaseGoods orderPurchaseGoods);

    /**
     * 商品出货订单列表
     *
     * @param orderPurchaseGoodsQueryDTO 商品订单
     * @return 商品订单集合
     */
    public List<OrderSellGoodsListVO> sellGoodsList(OrderPurchaseGoodsQueryDTO orderPurchaseGoodsQueryDTO);

    /**
     * 商品出货订单列表--总部工厂的门店订单列表
     *
     * @param orderPurchaseGoodsQueryDTO 商品订单
     * @return 商品出货订单列表--总部工厂的门店订单列表
     */
    public List<OrderSellGoodsListVO> sellGoodsListByHqFactory(OrderPurchaseGoodsQueryDTO orderPurchaseGoodsQueryDTO);

    /**
     * 商品出货-接单(确认订单)
     *
     * @param orderId 商品订单id
     * @return 结果
     */
    public int confirmOrder(Long orderId);

    /**
     * 商品出货-拒单
     *
     * @param orderId 商品订单id
     * @return 结果
     */
    public int refuseOrder(Long orderId);

    /**
     * 商品出货-取消订单
     *
     * @param orderId 商品订单id
     * @return 结果
     */
    public int cancelOrderGoods(Long orderId);

    /**
     * 商品出货-出货
     *
     * @param orderGoodsOutGoodsDTO 商品订单id
     * @param deliveryWay 配送方式
     * @return 结果
     */
    public int outOrderGoods(OrderGoodsOutGoodsDTO orderGoodsOutGoodsDTO, String deliveryWay) throws Exception;

    /**
     * 快递签收成功后，处理订单
     * @param orderNo
     */
    public void handleDeliverySuccessUpdateOrderStatus(String orderNo);

    /**
     * 商品确认收货
     *
     * @param orderId 商品订单id
     * @return 结果
     */
    public int confirmReceiveGoodsByOrderGoods(Long orderId);

    /**
     * 新增商品订单
     *
     * @param orderPurchaseGoodsAddDTO 商品订单明细
     * @return 结果
     */
    public int insertOrderPurchaseGoods(OrderPurchaseGoodsAddDTO orderPurchaseGoodsAddDTO);

    /**
     * 修改商品订单
     *
     * @param orderPurchaseGoods 商品订单
     * @return 结果
     */
    public int updateOrderPurchaseGoods(OrderPurchaseGoods orderPurchaseGoods);

    /**
     * 批量删除商品订单
     *
     * @param ids 需要删除的商品订单主键集合
     * @return 结果
     */
    public int deleteOrderPurchaseGoodsByIds(Long[] ids);

    /**
     * 删除商品订单信息
     *
     * @param id 商品订单主键
     * @return 结果
     */
    public int deleteOrderPurchaseGoodsById(Long id);

    /**
     * 查询出货订单物流轨迹
     */
    public OrderDeliveryPathVO getDeliveryPath(Long orderId) throws Exception;


    void handleAddressInfo(OrderPurchaseGoodsInfoVO orderPurchaseGoodsInfoVO, OrderPurchaseGoods purchaseGoods);


}
