package com.sunda.spmsoversea.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sunda.spmscommon.ResponseResult;
import com.sunda.spmsoversea.dto.OverseaWhsInDTO;
import com.sunda.spmsoversea.dto.OverseaWhsInQueryDTO;
import com.sunda.spmsoversea.dto.OverseaWhsInUpdateDTO;
import com.sunda.spmsoversea.entity.OverseaWhsIn;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 海外仓入库任务表头 服务类
 * </p>
 *
 * @author Wayne
 * @since 2021-08-26
 */
public interface IOverseaWhsInService extends IService<OverseaWhsIn> {

    /** 创建入库任务 */
    ResponseResult createOverseaWhsIn(OverseaWhsInDTO overseaWhsInDTO, String userId)throws Exception ;

    /** 按条件搜索入库任务表头 */
    IPage getOverseaWhsInPage(OverseaWhsInQueryDTO overseaWhsInQueryDTO);

    /** 根据前端传值，更新入库任务表头及明细  0-1，0-2，1-1，1-2，2-3（加库存）；*/
    ResponseResult updateOverseaWhsIn(OverseaWhsInUpdateDTO overseaWhsInUpdateDTO, String userId)throws Exception ;

    /** 根据前端传值，入库任务关闭 0-7，1-7； */
    ResponseResult closeOverseaWhsIn(String uuidWhsIn, int dataVersion, String userId);

    /** 根据前端传值，入库任务撤销/退回操作 2-1，3-1（减库存），4-1（减库存），5-1（减库存）；*/
    ResponseResult cancelOverseaWhsIn(String uuidWhsIn, String cancelPostingDate, int dataVersion, String userId)throws Exception ;

    /** 根据前端传值，入库任务提交SAP 3-4，3-5，5-4，5-5； */
    ResponseResult toSapOverseaWhsIn(String uuidWhsIn, String postingDate, int dataVersion, String userId)throws Exception ;

    /** 根据交货单号获取关联的所有入库任务列表 */
    List<Map<String, Object>> getOverseaWhsInList(String sapDeliveryNote);

}
