package com.prolog.rdc.tms.service.basicData;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.web.multipart.MultipartFile;

import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
import com.prolog.rdc.tms.model.dto.basicData.AppointTimeQueryDTO;
import com.prolog.rdc.tms.model.dto.basicData.BranchByEncodingNameDTO;
import com.prolog.rdc.tms.model.dto.basicData.BranchByNameDTO;
import com.prolog.rdc.tms.model.dto.basicData.BranchConsigneeAndShipperPopupDTO;
import com.prolog.rdc.tms.model.dto.basicData.ImportMatchingDataDTO;
import com.prolog.rdc.tms.model.dto.basicData.TmsBaseBranchApTimeDTO;
import com.prolog.rdc.tms.model.dto.basicData.TmsBaseBranchDTO;
import com.prolog.rdc.tms.model.dto.basicData.TmsBaseCarportDTO;
import com.prolog.rdc.tms.model.entity.line.TmsBaseBranchModel;
import com.prolog.rdc.tms.model.vo.AppointTimeQueryVO;
import com.prolog.rdc.tms.model.vo.basicConfigure.ImportPageVO;
import com.prolog.rdc.tms.model.vo.basicData.BranchByEncodingNameVO;
import com.prolog.rdc.tms.model.vo.basicData.BranchByNameVO;
import com.prolog.rdc.tms.model.vo.basicData.BranchConsigneeAndShipperPopupVO;
import com.prolog.rdc.tms.model.vo.basicData.ImportMatchingDataVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseBranchQueryPopVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseBranchQueryVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseBranchSaveVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseBranchUpdateVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseCarportSaveVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseCarportUpdateVO;

/**
 * 
 *
 * 基础数据-仓库管理服务层
 *
 * @className :BranchService
 * @author :xyf
 * @creationTime :2022/03/31
 * @description :
 *
 * @modifier :xyf
 * @modifyTime :2022/03/31
 * @reviseRemarks:
 *
 * @version :1.0.0
 *
 */
public interface BranchService {

	/**
	 * 仓库分页查询
	 * 
	 * 
	 */
	Page<TmsBaseBranchDTO> queryBranch(TmsBaseBranchQueryVO vo) throws Exception;

	/**
	 * 仓库弹出框分页查询
	 * 
	 * 
	 */
	Page<TmsBaseBranchDTO> queryBranchPopup(TmsBaseBranchQueryVO vo) throws Exception;

	/**
	 * 仓库收发货方弹窗
	 * 
	 * @param branchConsigneeAndShipperPopupVO
	 * @return
	 */
	Page<BranchConsigneeAndShipperPopupDTO> popupBranchConsigneeAndShipperData(BranchConsigneeAndShipperPopupVO branchConsigneeAndShipperPopupVO);

	/**
	 * 仓库弹出框分页查询(预约管理)
	 *
	 * @param vo
	 * @return
	 */
	Page<TmsBaseBranchModel> queryBranchByBooking(TmsBaseBranchQueryPopVO vo);

	/**
	 * 仓库查看
	 * 
	 * 
	 */
	TmsBaseBranchDTO viewBranch(Long id) throws Exception;

	/**
	 * 仓库新增
	 * 
	 * 
	 */
	void saveBranch(TmsBaseBranchSaveVO vo) throws Exception;

	/**
	 * 仓库复制
	 * 
	 * 
	 */
	void copyBranch(TmsBaseBranchSaveVO vo) throws Exception;

	/**
	 * 仓库修改
	 * 
	 * 
	 */
	void updateBranch(TmsBaseBranchUpdateVO vo) throws Exception;

	/**
	 * 仓库停用
	 * 
	 * 
	 */
	void deleteBranch(List<String> ids) throws Exception;

	/**
	 * 仓库启用
	 * 
	 * 
	 */
	void activeBranch(List<String> ids) throws Exception;

	/**
	 * 车位列表查询
	 * 
	 * 
	 */
	List<TmsBaseCarportDTO> queryCarport(Long branchid, String userId) throws Exception;

	/**
	 * 车位列表查询
	 *
	 *
	 */
	List<TmsBaseCarportDTO> queryCarportList(Long branchid) throws Exception;

	/**
	 * 车位查看
	 * 
	 * 
	 */
	TmsBaseCarportDTO viewCarport(Long id) throws Exception;

	/**
	 * 车位新增
	 * 
	 * 
	 */
	void saveCarport(TmsBaseCarportSaveVO vo) throws Exception;

	/**
	 * 车位修改
	 * 
	 * 
	 */
	void updateCarport(TmsBaseCarportUpdateVO vo) throws Exception;

	/**
	 * 车位停用
	 * 
	 * 
	 */
	void deleteCarport(List<String> ids) throws Exception;

	/**
	 * 车位启用
	 * 
	 * 
	 */
	void activeCarport(List<String> ids) throws Exception;

	/**
	 * 仓库地址解析专用查询
	 * 
	 * 
	 */
	Page<TmsBaseBranchDTO> queryBranchForAddress(TmsBaseBranchQueryVO vo) throws Exception;

	/**
	 * 车位批量删除
	 * 
	 * @param ids
	 * @throws Exception
	 */
	void batchDeleteCarportData(List<Long> ids) throws Exception;

	/**
	 * 仓库批量删除
	 * 
	 * @param ids
	 * @throws Exception
	 */
	void batchDeleteBranchData(List<Long> ids) throws Exception;

	/**
	 * 仓库导入分页查询
	 * 
	 * @param importPageVO
	 * @return
	 */
	RestMessage<Object> pageBranchByImportBatchNumberData(ImportPageVO importPageVO);

	/**
	 * 仓库车位导入分页查询
	 * 
	 * @param importPageVO
	 * @return
	 */
	RestMessage<Object> pageBranchParkingSpaceByImportBatchNumberData(ImportPageVO importPageVO);

	/**
	 * 地址解析
	 * 
	 * @param id
	 * @param longitude
	 * @param latitude
	 * @param address
	 * @throws Exception
	 */
	void parseBranchAddress(Long id, BigDecimal longitude, BigDecimal latitude, String address) throws Exception;

	/**
	 * 仓库批量导入
	 * 
	 * @param file
	 * @return
	 * @throws Exception
	 */
	void batchImportBranchData(MultipartFile file, String importBatchNumber) throws Exception;

	/**
	 * 车位批量导入
	 * 
	 * @param file
	 * @return
	 * @throws Exception
	 */
	void batchImportCarportData(MultipartFile file, String importBatchNumber) throws Exception;

	/**
	 * 仓库导入撤销
	 * 
	 * @param batchno
	 * @throws Exception
	 */
	void rollbackData(String batchno) throws Exception;

	/**
	 * 车位导入撤销
	 * 
	 * @param batchno
	 * @throws Exception
	 */
	void rollbackCarportData(String batchno) throws Exception;

	/**
	 * 根据仓库编码名称查询仓库资料
	 * 
	 * @param branchByEncodingNameVO
	 */
	BranchByEncodingNameDTO getBranchByEncodingNameData(BranchByEncodingNameVO branchByEncodingNameVO);

	/**
	 * 根据仓库名称查询仓库资料
	 * 
	 * @param branchByNameVO
	 */
	BranchByNameDTO getBranchByNameData(BranchByNameVO branchByNameVO);

	/**
	 * 查询仓库可预约时间段
	 *
	 * @param
	 */
	List<TmsBaseBranchApTimeDTO> queryAppointTime(AppointTimeQueryVO vo) throws Exception;

	/**
	 * 查询仓库可预约时间段(拼接)
	 *
	 * @param vo
	 * @return
	 */
	List<AppointTimeQueryDTO> queryBranchTime(AppointTimeQueryVO vo);

	/**
	 * 通过仓库ID查询仓库
	 *
	 * @param
	 * @return
	 */
	TmsBaseBranchDTO getOneBranch(Long branchId);

	BranchByEncodingNameDTO getBranchByEncodingNameDataIntf(BranchByEncodingNameVO branchByEncodingNameVO);

	/**
	 * 运单导入时匹配仓资料
	 * 
	 * @param importMatchingDataVO
	 * @return
	 */
	ImportMatchingDataDTO importMatchingData(ImportMatchingDataVO importMatchingDataVO);

	/**
	 * 更新仓库经纬度
	 * @param idList
	 * @param latitude
	 * @param longitude
	 */
	void updateBranchLatitudeAndLongitude(List<Long> idList, BigDecimal latitude, BigDecimal longitude);

}
