package com.prolog.rdc.tms.service;

import com.prolog.cs.platform.power.model.Organization;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
import com.prolog.product.core.framework.entity.UserEntity;
import com.prolog.rdc.tms.model.dto.*;
import com.prolog.rdc.tms.model.dto.basicData.CargoOwnerPageDTO;
import com.prolog.rdc.tms.model.dto.basicData.ImportMatchingDataDTO;
import com.prolog.rdc.tms.model.dto.basicData.ItemPagingQueryDTO;
import com.prolog.rdc.tms.model.dto.basicData.TmsBaseBranchDTO;
import com.prolog.rdc.tms.model.entity.SysRefdatadModel;
import com.prolog.rdc.tms.model.entity.TmsShipbillHeaderModel;
import com.prolog.rdc.tms.model.vo.*;
import com.prolog.rdc.tms.model.vo.xlsimport.ShipbillImportVO;
import org.springframework.web.multipart.MultipartFile;

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

/**
 *
 *
 * 订单管理服务层
 *
 * @className :ShipbillService
 * @author :zhangsj
 * @creationTime :2022/03/31
 * @description :
 *
 * @modifier :zhangsj
 * @modifyTime :2022/03/31
 * @reviseRemarks:
 *
 * @version :1.0.0
 *
 */
public interface ShipbillService {

	/**
	 * 运单汇总查询
	 *
	 * @param shipbillHeaderPageVO
	 * @return
	 */
	Page<ShipbillHeaderPageDTO> pageShipbillHeaderData(ShipbillHeaderPageVO shipbillHeaderPageVO);

	/**
	 * 运单汇总高级查询
	 *
	 * @param advancedQueryVO
	 * @return
	 */
	Page<ShipbillHeaderPageDTO> pageAdvanced(ShipbillAdvancedQueryVO advancedQueryVO);

	/**
	 * 运单保存
	 *
	 * @param shipbillHeaderSaveVO
	 */
	String addSaveShipbillHeaderData(ShipbillHeaderSaveVO shipbillHeaderSaveVO);

	/**
	 * 运单保存提交
	 *
	 * @param shipbillHeaderSubmitVO
	 */
	String addSubmitShipbillHeaderData(ShipbillHeaderSubmitVO shipbillHeaderSubmitVO);

	/**
	 * 运单批量提交
	 *
	 * @param ids
	 * @throws Exception
	 */
	void submitShipbillData(List<String> ids) throws Exception;

	/**
	 * 运单明细查询
	 *
	 * @param shipbillDetailPageVO
	 * @return
	 */
	Page<ShipbillDetailPageDTO> pageShipbillDetailData(ShipbillDetailPageVO shipbillDetailPageVO);

	/**
	 * 运单查看
	 *
	 * @param shipbillViewVO
	 * @return
	 */
	ShipbillViewDTO viewShipbillData(ShipbillViewVO shipbillViewVO);

	/**
	 * 点击运单查看
	 *
	 * @param shipbillViewIdVO
	 * @return
	 */
	ShipbillViewlByIdDTO viewShipbilllByIdData(ShipbillViewIdVO shipbillViewIdVO);

	/**
	 * 运单批量作废
	 * 
	 * @param ids
	 * @throws Exception
	 */
	void invalidShipbillData(List<String> ids) throws Exception;

	/**
	 * 运单修改保存
	 * 
	 * @param shipbillModifyVO
	 * @throws Exception
	 */
	void modifyShipbillHeaderData(ShipbillModifyVO shipbillModifyVO) throws Exception;

	/**
	 * 运单复制保存
	 * 
	 * @param shipbillCopyVO
	 * @throws Exception
	 */
	String copyShipbillData(ShipbillCopyVO shipbillCopyVO) throws Exception;

	/**
	 * 运单复制保存提交
	 * 
	 * @param shipbillCopySubmitVO
	 * @throws Exception
	 */
	String copySubmitShipbillData(ShipbillCopySubmitVO shipbillCopySubmitVO) throws Exception;

	/**
	 * 运单修改保存提交
	 * 
	 * @param shipbillModifySubmitVO
	 * @throws Exception
	 */
	void modifySubmitShipbillHeaderData(ShipbillModifySubmitVO shipbillModifySubmitVO) throws Exception;

	/**
	 * 运单地址解析查询
	 *
	 * @param shipbillAddressResolutionPageVO
	 */
	Page<ShipbillAddressResolutionPageDTO> pageAddressResolutionData(ShipbillAddressResolutionPageVO shipbillAddressResolutionPageVO);

	/**
	 * 运单地址解析
	 * 
	 * @param shipbillParseAddressVO
	 * @throws Exception
	 */
	void addressResolutionData(ShipbillParseAddressVO shipbillParseAddressVO) throws Exception;

	/**
	 * 运单打印
	 * 
	 * @param shipbillPrintVO
	 * @return
	 */
	Map<String, Object> shipbillPrintData(ShipbillPrintVO shipbillPrintVO);

	/**
	 * 导出所有数据
	 * 
	 * @param shipbillExportAllVO
	 * @return
	 */
	List<ExportShipbillDTO> exportAllShipbillData(ShipbillExportAllVO shipbillExportAllVO);

	/**
	 * 导出当前页数据
	 * 
	 * @param shipbillExportPageVO
	 * @return
	 */
	List<ExportShipbillDTO> exportPageShipbillData(ShipbillExportPageVO shipbillExportPageVO);

	/**
	 * 导出选中数据
	 * 
	 * @param ids
	 * @return
	 */
	List<ExportShipbillDTO> exportChooseShipbillData(List<String> ids);

	/**
	 * 运单导入
	 * 
	 * @param file
	 * @param templateId
	 */
	String importShipbillData(MultipartFile file, String templateId);

	/**
	 * 运单审核信息查询
	 *
	 * @param shipbillApprovalInfoVO
	 * @return
	 */
	ShipbillApprovalInfoDTO getApprovalInfoData(ShipbillApprovalInfoVO shipbillApprovalInfoVO);

	/**
	 * 运单审批作废
	 *
	 * @param shipbillApprovalInvalidVO
	 */
	void shipbillApprovalInvalidData(ShipbillApprovalInvalidVO shipbillApprovalInvalidVO);

	/**
	 * 运单审批撤回
	 *
	 * @param shipbillApprovalRetractVO
	 */
	void shipbillApprovalRetractData(ShipbillApprovalRetractVO shipbillApprovalRetractVO);

	/**
	 * 运单审批提交
	 *
	 * @param shipbillApprovalSubmitVO
	 */
	void shipbillApprovalSubmitData(ShipbillApprovalSubmitVO shipbillApprovalSubmitVO);

	/**
	 * 运单审核
	 *
	 * @param shipbillApprovalVO
	 */
	void shipbillApprovalData(ShipbillApprovalVO shipbillApprovalVO);

	/**
	 * 运单接单
	 *
	 * @param ids
	 * @throws Exception
	 */
	void receiveShipbillData(List<String> ids);

	/**
	 * 运单接单
	 *
	 * @param ids
	 * @throws Exception
	 */
	void rejectShipbillData(List<String> ids);

	/**
	 * 运单资料接口转TMS
	 * 
	 * @param intfShipbillHeaderVOs
	 */
	List<IntfErrorLogDTO> saveShipbillInterfaceData(List<IntfShipbillHeaderVO> intfShipbillHeaderVOs);

	/**
	 * 运单包裹资料接口转TMS
	 * 
	 * @param intfShipbillPackageVOs
	 */
	List<IntfErrorLogDTO> saveShipbillInterfacePackageData(List<IntfShipbillPackageVO> intfShipbillPackageVOs);

	/**
	 * 运单日志
	 * 
	 * @param shipbillHeaderVOs
	 */
	void addLog(ShipbillOperateLogSaveNewVO shipbillHeaderVOs);

	/**
	 * 通过运单ID查询运单号、装车单号等信息
	 *
	 * @param
	 */
	ShipbillAndLoadingbillInfoDTO getInfoByShipbillid(String shipbillId) throws Exception;

	/**
	 * 通过运单ID查询所有父级运单信息
	 * 
	 * @param shipBillId
	 * @return
	 */
	List<ShipAndLoadingBillDTO> getAllShipBillById(String shipBillId);

	/**
	 * 运单匹配业务规则
	 *
	 * @param shipbillHeaderSaveVO
	 */
	ShipbillBusinessRuleDTO matchShipbillBusinessRule(ShipbillHeaderSaveVO shipbillHeaderSaveVO);

	/**
	 * 运单温度轨迹
	 * 
	 * @param shipBillId
	 * @return
	 */
	ShipBillTemperatureDTO getShipBillTemperature(String shipBillId);

	/**
	 * singleImportShipBill
	 * 
	 * @param shipbillImportVOS
	 * @param user
	 * @param departmentData
	 * @param dicData
	 * @param zoneModelList
	 * @param cargoOwnerDTOList
	 * @param itemPagingQueryDTOList
	 * @param branchDTOList
	 * @param matchBranch
	 * @param matchCustomer
	 * @param matchProvider
	 * @return
	 */
	TmsShipbillHeaderModel singleImportShipBill(List<ShipbillImportVO> shipbillImportVOS, UserEntity user, List<Organization> departmentData, List<SysRefdatadModel> dicData, List<LmsTmsZoneMinDTO> zoneModelList, List<CargoOwnerPageDTO> cargoOwnerDTOList, List<ItemPagingQueryDTO> itemPagingQueryDTOList, List<TmsBaseBranchDTO> branchDTOList, Map<String, RestMessage<ImportMatchingDataDTO>> matchBranch, Map<String, RestMessage<ImportMatchingDataDTO>> matchCustomer, Map<String, RestMessage<ImportMatchingDataDTO>> matchProvider);

	/**
	 * 运单修改定位
	 * 
	 * @param shipbillLocationVOS
	 * @return
	 */
	void modifyShipbillHeaderLocationData(List<ShipbillLocationVO> shipbillLocationVOS);

	/**
	 * 业务规则匹配-是否显示温度
	 * @param shipBillIdList
	 * @return StrategyBusinessTemperatureDTO
	 */
	StrategyBusinessTemperatureDTO showTemperature(List<String> shipBillIdList);

	List<ShipbillTrackingDTO> getShipBillTracking(ShipbillTrackVO vo);
}
