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.IntfErrorLogDTO;
import com.prolog.rdc.tms.model.dto.basicData.CustomerByEncodingNameDTO;
import com.prolog.rdc.tms.model.dto.basicData.CustomerCarrierDTO;
import com.prolog.rdc.tms.model.dto.basicData.CustomerConsigneeAndShipperPopupDTO;
import com.prolog.rdc.tms.model.dto.basicData.CustomerConsigneeByEncodingNameDTO;
import com.prolog.rdc.tms.model.dto.basicData.CustomerConsigneePopupDTO;
import com.prolog.rdc.tms.model.dto.basicData.ImportMatchingDataDTO;
import com.prolog.rdc.tms.model.dto.basicData.TmsBaseCustomerDTO;
import com.prolog.rdc.tms.model.dto.basicData.TmsBaseCustomerPopDTO;
import com.prolog.rdc.tms.model.dto.basicData.TmsBaseCustomerReceiverDTO;
import com.prolog.rdc.tms.model.dto.basicData.UserCustomerPopupDTO;
import com.prolog.rdc.tms.model.vo.IntfCustomerConsigneeSaveVO;
import com.prolog.rdc.tms.model.vo.IntfCustomerSaveVO;
import com.prolog.rdc.tms.model.vo.basicConfigure.ImportPageVO;
import com.prolog.rdc.tms.model.vo.basicData.ConsigneeAddressVO;
import com.prolog.rdc.tms.model.vo.basicData.CustomerByEncodingNameVO;
import com.prolog.rdc.tms.model.vo.basicData.CustomerCarrierVO;
import com.prolog.rdc.tms.model.vo.basicData.CustomerConsigneeAndShipperPopupVO;
import com.prolog.rdc.tms.model.vo.basicData.CustomerConsigneeByEncodingNameVO;
import com.prolog.rdc.tms.model.vo.basicData.CustomerConsigneePopupVO;
import com.prolog.rdc.tms.model.vo.basicData.CustomerReceiverSaveVO;
import com.prolog.rdc.tms.model.vo.basicData.CustomerReceiverUpdateVO;
import com.prolog.rdc.tms.model.vo.basicData.ImportMatchingDataVO;
import com.prolog.rdc.tms.model.vo.basicData.QueryCustomerAndReceiverVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseCustomerDeleteVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseCustomerQueryVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseCustomerReceiverQueryVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseCustomerSaveVO;
import com.prolog.rdc.tms.model.vo.basicData.TmsBaseCustomerUpdateVO;
import com.prolog.rdc.tms.model.vo.basicData.UserCustomerPopupVO;

/**
 * 
 *
 * 基础数据-客户管理服务层
 *
 * @className :CustomerService
 * @author :fanzw
 * @creationTime :2022/03/31
 * @description :
 *
 * @modifier :fanzw
 * @modifyTime :2022/03/31
 * @reviseRemarks:
 *
 * @version :1.0.0
 *
 */
public interface CustomerService {

	/**
	 * 客户分页查询
	 * 
	 * 
	 */
	Page<TmsBaseCustomerDTO> queryCustomer(TmsBaseCustomerQueryVO vo) throws Exception;

	/**
	 * 客户查看
	 * 
	 * 
	 */
	TmsBaseCustomerDTO viewCustomer(Long id) throws Exception;

	/**
	 * 客户资料新增
	 * 
	 * 
	 */
	void saveCustomer(TmsBaseCustomerSaveVO vo) throws Exception;

	/**
	 * 客户复制
	 * 
	 * 
	 */
	void copyCustomer(TmsBaseCustomerSaveVO vo) throws Exception;

	/**
	 * 客户修改
	 * 
	 * 
	 */
	void updateCustomer(TmsBaseCustomerUpdateVO vo) throws Exception;

	/**
	 * 客户删除
	 * 
	 * 
	 */
	void deleteCustomer(List<String> ids) throws Exception;

	/**
	 * 客户启用
	 * 
	 * 
	 */
	void activeCustomer(List<String> ids) throws Exception;

	/**
	 * 客户-物理删除
	 * 
	 * @param list
	 */
	void neverDelete(List<TmsBaseCustomerDeleteVO> list) throws Exception;

	/**
	 * 收货方-物理删除
	 * 
	 * @param list
	 */
	void neverDeleteCustomerReceiver(List<TmsBaseCustomerDeleteVO> list) throws Exception;

	/**
	 * 客户收货方列表查询
	 * 
	 * 
	 */
	List<TmsBaseCustomerReceiverDTO> queryCustomerReceiver(Long customerId) throws Exception;

	/**
	 * 客户收货方查看
	 * 
	 * 
	 */
	TmsBaseCustomerReceiverDTO viewCustomerReceiver(Long id) throws Exception;

	/**
	 * 客户收货方新增
	 * 
	 * 
	 */
	void saveCustomerReceiver(CustomerReceiverSaveVO vo);

	/**
	 * 客户收货方修改
	 * 
	 * 
	 */
	void updateCustomerReceiver(CustomerReceiverUpdateVO customerReceiverUpdateVO);

	/**
	 * 客户收货方删除
	 * 
	 * 
	 */
	void deleteCustomerReceiver(List<String> ids) throws Exception;

	/**
	 * 客户收货方启用
	 * 
	 * 
	 */
	void activeCustomerReceiver(List<String> ids) throws Exception;

	/**
	 * 客户地址解析专用查询
	 * 
	 * 
	 */
	Page<TmsBaseCustomerDTO> queryCustomerForAddress(TmsBaseCustomerQueryVO vo) throws Exception;

	/**
	 * 收货方地址解析专用查询
	 * 
	 * 
	 */
	Page<TmsBaseCustomerReceiverDTO> queryCustomerReceiverForAddress(TmsBaseCustomerReceiverQueryVO vo) throws Exception;

	/**
	 * 客户弹出框查询查询
	 * 
	 * 
	 */
	Page<TmsBaseCustomerDTO> queryTmsBaseCustomerPopup(TmsBaseCustomerQueryVO vo) throws Exception;

	/**
	 * 客户收发货方弹窗
	 * 
	 * @param customerConsigneeAndShipperPopupVO
	 * @return
	 */
	Page<CustomerConsigneeAndShipperPopupDTO> popupCustomerConsigneeAndShipperData(CustomerConsigneeAndShipperPopupVO customerConsigneeAndShipperPopupVO);

	/**
	 * 用户客户弹窗
	 * 
	 * @param userCustomerPopupVO
	 * @return
	 */
	Page<UserCustomerPopupDTO> popupUserCustomerData(UserCustomerPopupVO userCustomerPopupVO);

	/**
	 * 客户-收货方查询
	 *
	 *
	 */
	Page<TmsBaseCustomerPopDTO> queryCustomerAndReceiver(QueryCustomerAndReceiverVO vo);

	/**
	 * 客户导入撤销
	 * 
	 * @param batchno
	 */
	void rollbackData(String batchno);

	/**
	 * 收货方批量导入(新)
	 * 
	 * @param file
	 * @throws Exception
	 */
	void batchImportCustomerReceiverData(MultipartFile file, String importBatchNumber) throws Exception;

	/**
	 * 收货方导入撤销
	 * 
	 * @param batchno
	 */
	void rollbackByCustomerReceiverData(String batchno);

	/**
	 * 客户导入分页查询
	 * 
	 * @param importPageVO
	 * @return
	 */
	RestMessage<Object> pageCustomerByImportBatchNumberData(ImportPageVO importPageVO);

	/**
	 * 客户收货方导入分页查询
	 * 
	 * @param importPageVO
	 * @return
	 */
	RestMessage<Object> pageCustomerConsigneeByImportBatchNumberData(ImportPageVO importPageVO);

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

	/**
	 * 客户收货方弹窗
	 * 
	 * @param customerConsigneePopupVO
	 * @return
	 */
	Page<CustomerConsigneePopupDTO> popupCustomerConsigneeData(CustomerConsigneePopupVO customerConsigneePopupVO);

	/**
	 * 客户导入(新)
	 * 
	 * @param file
	 * @return
	 */
	void batchImportCustomerData(MultipartFile file, String importBatchNumber) throws Exception;

	/**
	 * 根据客户编码名称查询客户资料
	 * 
	 * @param customerByEncodingNameVO
	 */
	CustomerByEncodingNameDTO getCustomerByEncodingNameData(CustomerByEncodingNameVO customerByEncodingNameVO);

	/**
	 * 根据客户收货方编码名称查询客户收货方资料
	 * 
	 * @param customerConsigneeByEncodingNameVO
	 */
	CustomerConsigneeByEncodingNameDTO getCustomerConsigneeByEncodingNameData(CustomerConsigneeByEncodingNameVO customerConsigneeByEncodingNameVO);

	/**
	 * 客户收货方匹配唯一承运方
	 *
	 * @param carrierVO
	 */
	CustomerCarrierDTO customerCarrier(CustomerCarrierVO carrierVO);

	/**
	 * 客户接口转TMS
	 *
	 * @param
	 */
	List<IntfErrorLogDTO> saveCustomerInterfaceData(List<IntfCustomerSaveVO> intfCustomerSaveVOs);

	/**
	 * 客户收货方接口转TMS
	 *
	 * @param
	 */
	List<IntfErrorLogDTO> saveCustomerConsigneeInterfaceData(List<IntfCustomerConsigneeSaveVO> vos);

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

	/**
	 * 临时客户收货方保存
	 *
	 * @param consigneeAddressVO
	 * @return
	 */
	void tempConsigneeSave(ConsigneeAddressVO consigneeAddressVO);

	/**
	 * 临时客户收货方更新
	 *
	 * @param consigneeAddressVO
	 * @return
	 */
	void tempConsigneeUpdate(ConsigneeAddressVO consigneeAddressVO);

	/**
	 * 临时客户收货方删除
	 *
	 * @param consigneeIds
	 * @return
	 */
	void tempConsigneeDelete(List<Long> consigneeIds);

	/**
	 * 更新收货方经纬度
	 * @param idList
	 * @param latitude
	 * @param longitude
	 */
	void updateConsigneeLatitudeAndLongitude(List<Long> idList, BigDecimal latitude, BigDecimal longitude);

	/**
	 * 根据客户名称查询客户资料
	 *
	 * @param customerByEncodingNameVO
	 */
	CustomerByEncodingNameDTO getCustomerByNameData(CustomerByEncodingNameVO customerByEncodingNameVO);


}
