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.SafetyInventorySearchDTO;
import com.sunda.spmsoversea.entity.SafetyInventory;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 安全库存表 服务类
 * </p>
 *
 * @author Wayne
 * @since 2022-01-04
 */
public interface ISafetyInventoryService extends IService<SafetyInventory> {

    /** 获取转储交货单表头分页列表 */
    IPage getSafetyInventoryPage(SafetyInventorySearchDTO safetyInventorySearchDTO);

    /** 导出安全库存 */
    ResponseResult exportSafetyInventoryDtl(String werks, String materialNo);
    /** 获取安全库存一条详细数据 */
    Map<String, Object> getSafetyInventoryInfo(String uuid);

    /** 获取安全库存一条数据 */
    SafetyInventory getSafetyInventory(String uuid);

    /** 新建或更新安全库存数据 */
    ResponseResult createSafetyInventory(SafetyInventory safetyInventory, String userId)throws Exception ;

    /** 删除安全库存数据 */
    ResponseResult deleteSafetyInventory(String uuid, Integer dataVersion, String userId)throws Exception ;

    /** 获取工厂下指定物料上年度标准消耗用量 */
    ResponseResult getStandardConsumption(String werks, String materialNo, Integer yearNumber);

    /** 获取指定工厂下，有安全库存数量信息 且 对应物料库存数量 低于 安全库存数量的数据 */
    ResponseResult getBelowSafetyInventory(String werks);
    
    /** 批量导入安全库存 */
	ResponseResult batchCreateSafety(List<SafetyInventory> safetyList, String userId);

}

