package com.uas.platform.b2b.service;

import java.util.List;

import org.springframework.data.domain.Page;

import com.uas.platform.b2b.model.SaleARCheck;
import com.uas.platform.b2b.model.SaleARCheckItem;
import com.uas.platform.b2b.model.SaleARCheckReply;
import com.uas.platform.b2b.model.SearchFilter;
import com.uas.platform.core.model.PageInfo;

public interface SaleARCheckService {

	/**
	 * 批量保存应付对账单
	 * 
	 * @param changeItems
	 * @return
	 */
	public void save(List<SaleARCheckItem> checkItems);

	/**
	 * 分页查找应付对账单，包括明细
	 * 
	 * @param pageInfo
	 * @param keyword
	 *            查找关键字
	 * @return
	 */
	public Page<SaleARCheck> findAllByPageInfo(PageInfo pageInfo, String keyword, SearchFilter searchFilter);

	/**
	 * 根据ID查找应付对账单
	 * 
	 * @param id
	 * @return
	 */
	public SaleARCheck findById(Long id);
	
	/**
	 * 回复对账单明细
	 * @param reply
	 * @param agreed
	 * @param isB2b
	 * @return
	 */
	public SaleARCheckReply reply(SaleARCheckReply reply, boolean agreed, boolean isB2b);

	/**
	 * 根据明细ID获取明细的对账回复记录
	 * @param itemId
	 * @return
	 */
	public List<SaleARCheckReply> getReplies(Long itemId);
	
	/**
	 * 获取需要上传到供应商ERP的客户的对账单回复
	 * @return
	 */
	public List<SaleARCheckReply> getUploadReply();
	
	/**
	 * 客户对账回复上传到供应商ERP成功后修改回复的传输状态
	 * @param replies
	 */
	public void uploadReplySuccess(String[] ids);

	/**
	 * 批量处理供应商在ERP做的回复
	 * @param replies
	 */
	public void reply(List<SaleARCheckReply> replies);
	
}
