package com.ruoyi.basicData.service;


import com.ruoyi.basicData.domain.TWarehouseArea;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.TreeSelect;
import com.ruoyi.common.core.domain.entity.TWarehouse;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.warehouseBusiness.domain.dto.WarehouseSubmitDTO;
import com.ruoyi.warehouseBusiness.domain.vo.WarehouseInfoVO;

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

/**
 * 仓库Service接口
 *
 * @author ruoyi
 * @date 2020-12-11
 */
public interface ITWarehouseService {
    /**
     * 查询仓库
     *
     * @param fId 仓库ID
     * @return 仓库
     */
    public WarehouseInfoVO selectTWarehouseById(Long fId);

    public Map<String, Object> selectTWarehouseById1(Long fId);

    /**
     * 查询仓库列表
     *
     * @param tWarehouse 仓库
     * @return 仓库集合
     */
    public List<TWarehouse> selectTWarehouseList(TWarehouse tWarehouse);

    public List<TWarehouse> selectTWarehouseLists(TWarehouse tWarehouse);

    public List<Map<String, Object>> appGetWarehouseList();

    /**
     * 新增仓库
     *
     * @param tWarehouse 仓库
     * @return 结果
     */
    public int insertTWarehouse(TWarehouse tWarehouse);

    public AjaxResult insertTWarehouse1(String tWarehouse, String tWarehouseArea, LoginUser loginUser);

    /**
     * 修改仓库
     *
     * @param tWarehouse 仓库
     * @return 结果
     */
    public AjaxResult updateTWarehouse(TWarehouse tWarehouse);

    public int updateTWarehouses(TWarehouse tWarehouse);

    /**
     * 批量删除仓库
     *
     * @param fIds 需要删除的仓库ID
     * @return 结果
     */
    public AjaxResult deleteTWarehouseByIds(Long[] fIds);

    /**
     * 删除仓库信息
     *
     * @param fId 仓库ID
     * @return 结果
     */
    public int deleteTWarehouseById(Long fId);

    /**
     * 检验编号唯一
     *
     * @return
     */
    public String checkUFNoUnique(TWarehouse tWarehouse);

    /**
     * 检验编号名称
     *
     * @return
     */
    public String checkUFNnameUnique(TWarehouse tWarehouse);

    /**
     * 检验编号地址
     *
     * @return
     */
    public String checkUFAaddrUnique(TWarehouse tWarehouse);

    /**
     * 检验编号唯一
     *
     * @return
     */
    public String checkUFTWarehouseAreaNoUnique(TWarehouseArea tWarehouseAreas);

    /**
     * 检验编号名称
     *
     * @return
     */
    public String checkUTWarehouseAreaFNnameUnique(TWarehouseArea tWarehouseAreas);

    /**
     * 根据ID查询所有子部门（正常状态）
     *
     * @param fId fID
     * @return 子部门数
     */
    public int selectNormalChildrenDeptById(Long fId);

    /**
     * 构建前端所需要下拉树结构
     *
     * @param tWarehouses 部门列表
     * @return 下拉树结构列表
     */
    public List<TreeSelect> buildDeptTreeSelect(List<TWarehouse> tWarehouses);

    /**
     * 构建前端所需要树结构
     *
     * @param depts 部门列表
     * @return 树结构列表
     */
    public List<TWarehouse> buildDeptTree(List<TWarehouse> depts);

    /**
     * 检验是否可添加库区
     *
     * @return
     */
    public String checkUFAreUnique(TWarehouse tWarehouse);

    public String checkNameUnique(TWarehouse tWarehouse);

    /**
     * 是否存在部门子节点
     *
     * @param fId 部门ID
     * @return 结果
     */
    public boolean hasChildByfId(Long fId);

    /**
     * 查询部门是否存在用户
     *
     * @param deptId 部门ID
     * @return 结果 true 存在 false 不存在
     */
    public boolean checkDeptExistWarehouse(Long deptId);

    public boolean checkDeptExistWarehouseItems(Long deptId);

    /**
     * 新增仓库
     *
     * @param tWarehouse
     * @return
     */
    AjaxResult warehouseSubmit(WarehouseSubmitDTO tWarehouse);

    /**
     * 修改仓库
     *
     * @param tWarehouse
     * @return
     */
    AjaxResult edit(WarehouseSubmitDTO tWarehouse);

    /**
     * 仓库懒加载列表
     *
     * @param tWarehouse
     * @return
     */
    List<TWarehouse> lazyList(TWarehouse tWarehouse);
}
