package com.yh.saas.plugin.yiliangyiyun.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
import com.baomidou.mybatisplus.service.IService;
import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView;
import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseView;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 记录仓库信息 服务类
 * </p>
 *
 * @author Gongdc
 * @since 2021-05-21
 */
public interface IWarehouseBaseInfoService extends IService<WarehouseBaseInfo> {


    /**
     * 添加仓库
     */
    String addWarehouse(WarehouseBaseInfo warehouseBaseInfo);

    /**
     * 添加临时仓库
     * @param warehouseBaseInfo
     * @return
     */
    String addTemporaryWarehouse(WarehouseBaseInfo warehouseBaseInfo);

    /**
     * 编辑仓库
     */
    String editWarehouse(WarehouseBaseInfo warehouseBaseInfo);

    /**
     * 查看库房下拉列表
     * @param compId
     * @return
     */
    List<WarehouseBaseInfo> selectWarehouse(String compId,String warehouseType);

    /**
     * 查看库房
     */
    WarehouseBaseInfo getWarehouse(String id);

    /**
     * 仓库管理页面列表
     *
     * @param compId
     * @return
     */
    WarehouseBaseInfo selectWarehouseViewinfo(String compId,String warehouseName,String warehouseType);

    /**
     * 今日储量明细
     * @param compId
     * @return
     */
    List<WarehouseNumView> reservesDetails(String compId);

    /**
     * 全部仓库
     * @param compId
     * @return
     */
    List<WarehouseView> allWarehouse(String compId,String warehouseName,String goodsName);

    /**
     * 更改显示状态
     */
    String editShow(String id);

    /**
     *查询所有库房
     */
    List<WarehouseBaseInfo> selectAllWarehouse(String compId,String warehouseType,String warehouseName);

    /**
     * 删除库房
     */
     void deleteWarehouse(String id);

    /**
     * 清仓状态
     * @param id
     * @return
     */
     String editCleared(String id);
    /**
     * 出入库合同编号下拉列表
     *
     * @param compId
     * @param flag 0 采购合同编号 1销售合同编号 2 移库任务编号+采购、销售合同编号 null 采购、销售合同编号
     */
    List<ContractManagementInfo> selectContractNoList(String compId,Integer flag);

    /**
     * 查看自己负责的常用仓库
     * @param compId
     * @return
     */
    List<WarehouseBaseInfo> selectWarehouseSelf(String compId,String personCharge);
    /**
     * 查看自己负责的常用仓库
     * @param compId
     * @return
     */
    List<WarehouseBaseInfo> selectWarehouseSelfApp(String compId,String personCharge);
    /**
     * 获取打印数据
     * @param id
     * @return
     */
    WarehouseInOutInfo getPrintInfo(String id);
    /**
     * 查出库时的成本
     *
     * @param contractNo
     * @param carNo
     */
    Float selectCost(String contractNo,String carNo);
    /**
     * 查看自己负责的仓库
     * @param compId
     * @return
     */
    List<WarehouseBaseInfo> selectResponsible(String compId,String personCharge);
    void export(WarehouseBaseInfo warehouseBaseInfo, HttpServletResponse response) throws Exception;
    void exportOut(WarehouseBaseInfo warehouseBaseInfo, HttpServletResponse response) throws Exception;


    String exportphone(WarehouseBaseInfo warehouseBaseInfo, HttpServletResponse response) throws Exception;

    String exportPhoneOut(WarehouseBaseInfo warehouseBaseInfo, HttpServletResponse response) throws Exception;

    Integer getTemWareHouseCountByCondition(Map<String, Object> pageView);

    /**
     * 库点利润详情列表查询
     *
     * @param warehouseBaseInfo
     * @return
     */
    Page<WarehouseBaseInfo> selectBaseInfo(WarehouseBaseInfo warehouseBaseInfo);
    /**
     * 库点利润图表
     *
     * @param warehouseBaseInfo
     */
    WarehouseBaseInfo selectWarehouseChart(WarehouseBaseInfo warehouseBaseInfo);
}
