package net.lab1024.sa.admin.module.business.wms.base.stock.service;


import jakarta.servlet.http.HttpServletResponse;
import net.lab1024.sa.admin.module.business.wms.base.item.domain.form.ItemQueryForm;
import net.lab1024.sa.admin.module.business.wms.base.stock.domain.entity.StockEntity;
import net.lab1024.sa.admin.module.business.wms.base.stock.domain.form.StockQueryForm;
import net.lab1024.sa.admin.module.business.wms.base.stock.domain.form.StockSelect;
import net.lab1024.sa.admin.module.business.wms.base.stock.domain.vo.StockVO;
import net.lab1024.sa.admin.module.business.wms.base.stock.domain.vo.StocksExcelVO;
import net.lab1024.sa.base.common.domain.PageResult;

import java.util.List;
import java.util.Map;

public interface StockQueryService {

    /**
     * 分页查询
     *
     * @param queryForm 查询参数
     * @return PageResult<StockVO>
     */
    PageResult<StockVO> queryPage(StockQueryForm queryForm);

    /**
     * 容器下拉查询
     *
     * @param stockSelect 入参
     * @return List<StockEntity>
     */
    List<StockEntity> queryStock(StockSelect stockSelect);


    /**
     * 根据容器id集合查询容器信息
     *
     * @param stockIdList 容器id集合
     * @return Map<Long, StockEntity>
     */
    Map<Long, StockEntity> queryByStockIdsToMap(List<Long> stockIdList);


    /**
     * 根据容器编码查询容器信息
     *
     * @param stockCode 容器编码
     * @return StockEntity
     */
    StockEntity queryByStockCode(String stockCode);

    /**
     * 根据容器编码集合查询容器信息
     *
     * @param stockCodes 容器料编码集合
     * @return List<StockEntity>
     */
    List<StockEntity> queryByStockCodes(List<String> stockCodes);

    /**
     * 根据容器编码集合查询容器信息
     *
     * @param stockCodes 容器编码集合
     * @return Map<String, StockEntity>
     */
    Map<String, StockEntity> queryByStockCodesToMap(List<String> stockCodes);

    /**
     * 根据库位id查询容器信息
     *
     * @param locationId 库位
     * @return StockEntity
     */
    StockEntity queryStockByLocationId(Long locationId);

    /**
     * 容器导出
     *
     * @return List<StocksExcelVO>
     */
    List<StocksExcelVO> queryStocksExcelVO();

    /**
     * 容器总数
     * @param queryForm 查询参数
     * @return long
     */
    long stockCount(StockQueryForm queryForm);

    /**
     * 物料导出
     * @param taskId 任务ID
     * @param queryForm 查询参数
     * @param response 请求
     */
    void exportStock(String taskId, StockQueryForm queryForm, HttpServletResponse response);

}
