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.ImportMatchingDataDTO;
import com.prolog.rdc.tms.model.dto.basicData.ProviderByCargoOwnerPopupDTO;
import com.prolog.rdc.tms.model.dto.basicData.ProviderByIdsDTO;
import com.prolog.rdc.tms.model.dto.basicData.ProviderCheckDTO;
import com.prolog.rdc.tms.model.dto.basicData.ProviderConsigneeAndShipperPopupDTO;
import com.prolog.rdc.tms.model.dto.basicData.ProviderPagingQueryDTO;
import com.prolog.rdc.tms.model.dto.basicData.ProviderQueryPopupDTO;
import com.prolog.rdc.tms.model.dto.basicData.ProviderShipperCheckDTO;
import com.prolog.rdc.tms.model.dto.basicData.ProviderShipperPagingQueryDTO;
import com.prolog.rdc.tms.model.dto.basicData.ProviderShipperPopupDTO;
import com.prolog.rdc.tms.model.dto.basicData.ShipperByIdsDTO;
import com.prolog.rdc.tms.model.dto.basicData.UserProviderPopupDTO;
import com.prolog.rdc.tms.model.vo.IntfProviderSaveVO;
import com.prolog.rdc.tms.model.vo.IntfProviderShipperSaveVO;
import com.prolog.rdc.tms.model.vo.basicConfigure.ImportPageVO;
import com.prolog.rdc.tms.model.vo.basicData.ImportMatchingDataVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderAddVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderByCargoOwnerPopupVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderByIdsVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderCheckVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderConsigneeAndShipperPopupVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderCopyVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderGeocodingVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderModifyVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderPagingQueryVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderPopupVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderShipperAddVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderShipperCheckVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderShipperModifyVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderShipperPagingQueryVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderShipperPopupVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderShipperWhetherEnableVO;
import com.prolog.rdc.tms.model.vo.basicData.ProviderWhetherEnableVO;
import com.prolog.rdc.tms.model.vo.basicData.ShipperByIdsVO;
import com.prolog.rdc.tms.model.vo.basicData.UserProviderPopupVO;

/**
 * 供应商管理服务层
 * 
 * @author Eton Woo
 * @date 2022/03/25
 */
public interface ProviderService {

	/**
	 * 供应商资料分页查询
	 * 
	 * @param providerPagingQueryVO
	 * @return
	 */
	Page<ProviderPagingQueryDTO> pageProviderData(ProviderPagingQueryVO providerPagingQueryVO);

	/**
	 * 供应商根据货主查询弹窗
	 * 
	 * @param providerByCargoOwnerPopupVO
	 * @return
	 */
	Page<ProviderByCargoOwnerPopupDTO> popupProviderByCargoOwnerData(ProviderByCargoOwnerPopupVO providerByCargoOwnerPopupVO);

	/**
	 * 供应商收发货方弹窗
	 * 
	 * @param providerConsigneeAndShipperPopupVO
	 * @return
	 */
	Page<ProviderConsigneeAndShipperPopupDTO> popupProviderConsigneeAndShipperData(ProviderConsigneeAndShipperPopupVO providerConsigneeAndShipperPopupVO);

	/**
	 * 供应商查询弹窗
	 * 
	 * @param providerPopupVO
	 * @return
	 */
	Page<ProviderQueryPopupDTO> popupProviderData(ProviderPopupVO providerPopupVO);

	/**
	 * 用户供应商弹窗
	 * 
	 * @param userProviderPopupVO
	 * @return
	 */
	Page<UserProviderPopupDTO> popupUserProviderData(UserProviderPopupVO userProviderPopupVO);

	/**
	 * 供应商发货方资料分页查询
	 * 
	 * @param providerShipperPagingQueryVO
	 * @return
	 */
	Page<ProviderShipperPagingQueryDTO> pageProviderShipperData(ProviderShipperPagingQueryVO providerShipperPagingQueryVO);

	/**
	 * 供应商发货方弹窗
	 * 
	 * @param providerShipperPopupVO
	 * @return
	 */
	Page<ProviderShipperPopupDTO> popupProviderShipperData(ProviderShipperPopupVO providerShipperPopupVO);

	/**
	 * 供应商资料批量删除
	 * 
	 * @param ids
	 * @throws Exception
	 */
	void batchDeleteProviderData(List<Long> ids) throws Exception;

	/**
	 * 供应商资料是否启用
	 * 
	 * @param providerWhetherEnableVO
	 * @throws Exception
	 */
	void whetherEnableProviderData(ProviderWhetherEnableVO providerWhetherEnableVO) throws Exception;

	/**
	 * 供应商资料新增
	 * 
	 * @param providerAddVO
	 * @return
	 * @throws Exception
	 */
	String addProviderData(ProviderAddVO providerAddVO) throws Exception;

	/**
	 * 供应商资料查看
	 * 
	 * @param providerCheckVO
	 * @return
	 */
	ProviderCheckDTO getProviderData(ProviderCheckVO providerCheckVO);

	/**
	 * 供应商资料复制
	 * 
	 * @param providerCopyVO
	 * @throws Exception
	 */
	void copyProviderData(ProviderCopyVO providerCopyVO) throws Exception;

	/**
	 * 供应商资料修改
	 * 
	 * @param providerModifyVO
	 * @throws Exception
	 */
	void modifyProviderData(ProviderModifyVO providerModifyVO) throws Exception;

	/**
	 * 供应商发货方资料新增
	 * 
	 * @param providerShipperAddVO
	 * @return
	 * @throws Exception
	 */
	String addShipperData(ProviderShipperAddVO providerShipperAddVO) throws Exception;

	/**
	 * 供应商发货方资料是否启用
	 * 
	 * @param providerShipperWhetherEnableVO
	 * @throws Exception
	 */
	void whetherEnableShipperData(ProviderShipperWhetherEnableVO providerShipperWhetherEnableVO) throws Exception;

	/**
	 * 供应商发货方资料批量删除
	 * 
	 * @param ids
	 * @throws Exception
	 */
	void batchDeleteShipperData(List<Long> ids) throws Exception;

	/**
	 * 供应商发货方资料查看
	 * 
	 * @param providerShipperCheckVO
	 * @return
	 */
	ProviderShipperCheckDTO getShipperData(ProviderShipperCheckVO providerShipperCheckVO);

	/**
	 * 供应商发货方资料修改
	 * 
	 * @param providerShipperModifyVO
	 * @throws Exception
	 */
	void modifyShipperData(ProviderShipperModifyVO providerShipperModifyVO) throws Exception;

	/**
	 * 供应商发货方导入撤销
	 * 
	 * @param batchno
	 * @throws Exception
	 */
	void rollbackShipperData(String batchno) throws Exception;

	/**
	 * 供应商导入撤销
	 * 
	 * @param batchno
	 * @throws Exception
	 */
	void rollbackData(String batchno) throws Exception;

	/**
	 * 根据供应商ID集合分页查询
	 * 
	 * @param providerByIdsVO
	 * @return
	 */
	Page<ProviderByIdsDTO> pageProviderByIdsData(ProviderByIdsVO providerByIdsVO);

	/**
	 * 根据供应商发货方ID集合分页查询
	 * 
	 * @param shipperByIdsVO
	 * @return
	 */
	Page<ShipperByIdsDTO> pageShipperByIdsData(ShipperByIdsVO shipperByIdsVO);

	/**
	 * 供应商导入分页查询
	 * 
	 * @param importPageVO
	 * @return
	 */
	RestMessage<Object> pageProviderByImportBatchNumberData(ImportPageVO importPageVO);

	/**
	 * 供应商发货方导入分页查询
	 * 
	 * @param importPageVO
	 * @return
	 */
	RestMessage<Object> pageProviderShipperByImportBatchNumberData(ImportPageVO importPageVO);

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

	/**
	 * 供应商资料导入(新)
	 * 
	 * @param file
	 * @return
	 */
	void batchInsertProviderData(MultipartFile file) throws Exception;

	/**
	 * 供应商发货方资料导入(新)
	 * 
	 * @param file
	 * @return
	 */
	void batchInsertProviderShipperData(MultipartFile file) throws Exception;

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

	/**
	 * 供应商接口转TMS
	 *
	 * @param
	 */
	List<IntfErrorLogDTO> saveProviderInterfaceData(List<IntfProviderSaveVO> intfProviderSaveVOs);

	/**
	 * 供应商发货方接口转TMS
	 *
	 * @param
	 */
	List<IntfErrorLogDTO> saveProviderShipperInterfaceData(List<IntfProviderShipperSaveVO> intfProviderShipperSaveVOs);

	/**
	 * 供应商资料地址解析保存
	 * 
	 * @param vo
	 */
	void geocodingData(ProviderGeocodingVO vo);

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

	/**
	 * 供应商资料查看
	 *
	 * @param providerCheckVO
	 * @return
	 */
	ProviderCheckDTO getProviderByName(ProviderCheckVO providerCheckVO);
}
