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

import jakarta.servlet.http.HttpServletResponse;
import net.lab1024.sa.admin.module.business.wms.base.location.domain.entity.LocationEntity;
import net.lab1024.sa.admin.module.business.wms.base.location.domain.form.LocationQueryForm;
import net.lab1024.sa.admin.module.business.wms.base.location.domain.form.LocationSelect;
import net.lab1024.sa.admin.module.business.wms.base.location.domain.vo.LocationsExcelVO;
import net.lab1024.sa.admin.module.business.wms.base.location.domain.vo.LocationVO;
import net.lab1024.sa.base.common.domain.PageResult;

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

public interface LocationQueryService {

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

    /**
     * 实体转VO
     *
     * @param entity 实体
     * @return LocationVO
     */
    LocationVO entityToVO(LocationEntity entity);


    /**
     * 库位下拉查询
     *
     * @param locationSelect 查询参数
     * @return List<LocationVO>
     */
    List<LocationVO> queryLocation(LocationSelect locationSelect);

    /**
     * 根据库位ID集合查询库位信息
     *
     * @param locationIdList 库位ID集合
     * @return Map<Long, LocationEntity>
     */
    Map<Long, LocationEntity> queryByLocationIdsToMap(List<Long> locationIdList);

    /**
     * 验证库区是否存在库位
     *
     * @param areaId 库区
     */
    Boolean checkLocationExist(Long areaId);

    /**
     * 根据库位编码查询库位信息
     *
     * @param locationCode 库位编码
     * @return LocationEntity
     */
    LocationEntity queryByLocationCode(String locationCode);

    /**
     * 根据库位编码集合查询库位信息
     *
     * @param locationCodes 库位编码集合
     * @return List<LocationEntity>
     */
    List<LocationEntity> queryByLocationCodes(List<String> locationCodes);

    /**
     * 根据库位编码集合查询库位信息
     *
     * @param locationCodes 库位集合
     * @return Map<String, LocationEntity>
     */
    Map<String, LocationEntity> queryByLocationCodesToMap(List<String> locationCodes);

    /**
     * 库位导出
     *
     * @return List<LocationsExcelVO>
     */
    List<LocationsExcelVO> queryLocationsExcelVO();


    /**
     * 物料总厨
     * @param queryForm 查询参数
     * @return long
     */
    long locationCount(LocationQueryForm queryForm);

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