package cn.iocoder.yudao.module.order.service.orderWarehouseAdjust;

import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.module.order.vo.orderWarehouseAdjust.*;
import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseAdjust.OrderWarehouseAdjustDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.order.vo.orderWarehouseIn.OrderWarehouseInAdjustCancelRequestVO;

/**
 * 调仓记录 Service 接口
 *
 * @author yanghao
 */
public interface OrderWarehouseAdjustService extends IService<OrderWarehouseAdjustDO> {


    /**
     * 调仓申请
     * @param createReqVO
     * @return
     */
    String adjustApply(@Valid OrderWarehouseAdjustCreateReqVO createReqVO);


    /**
     * 调仓-查看状态
     *
     * @param orderId 订单id
     * @param lang
     * @return
     */
    OrderWarehouseAdjustLastStatusBackVO adjustLastWithStatus(Long orderId, Integer lang);


    /**
    * 调仓申请 - 撤销
    *
    * @param adjustCancelRequestVO 取消对象
    * @return
    */
    Boolean cancelAdjust(OrderWarehouseInAdjustCancelRequestVO adjustCancelRequestVO);

    /**
     * 调仓申请-回调
     *
     * @param approvalId
     * @param result
     * @return
     */
    void adjustApplyCallback(String approvalId, Integer result);

    /**
     * 更新调拨出仓
     *
     * @param sendOutVO
     */
    void updateWarehouseAdjustSendOut(OrderWarehouseAdjustSendOutVO sendOutVO);

    /**
     * PDA批量调拨出仓
     * @param sendOutBatchVO
     */
    void updateWarehouseAdjustSendOutBatch(OrderWarehouseAdjustSendOutBatchVO sendOutBatchVO);

    /**
     * 更新调拨到仓
     *
     * @param arrivedVO
     */
    void updateWarehouseAdjustArrived(OrderWarehouseAdjustArrivedVO arrivedVO);

    /**
     * 删除调仓记录
     * @param id 编号
     */
    void deleteWarehouseAdjust(Long id);

    /**
     * 获得调仓记录
     * @param id 编号
     * @return 调仓记录
     */
    OrderWarehouseAdjustDO getWarehouseAdjust(Long id);

    List<OrderWarehouseAdjustBackVO> getWarehouseAdjustByOrderId(Long orderId, Integer lang);

    /**
     * 获得调仓记录列表
     * @param ids 编号
     * @return 调仓记录列表
     */
    List<OrderWarehouseAdjustDO> getWarehouseAdjustList(Collection<Long> ids);

    /**
     * 获得调仓记录分页
     * @param page 分页查询
     * @param query 查询
     * @return 调仓记录分页
     */
    PageResult<OrderWarehouseAdjustDO> getWarehouseAdjustPage(OrderWarehouseAdjustQueryVO query, PageVO page);

    /**
     * 获得调仓记录列表, 用于 Excel 导出
     * @param query 查询
     * @return 调仓记录列表
     */
    List<OrderWarehouseAdjustDO> getWarehouseAdjustList(OrderWarehouseAdjustQueryVO query);
}
