package cn.superdesk.uniorder.service.accounting.unified.customer;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.enums.accounting.customer.AccountingOrderCustomerAccountingStatusEnum;
import cn.superdesk.uniorder.dao.entity.accounting.unified.customer.AccountingUnifiedCustomer;
import cn.superdesk.uniorder.dao.entity.invoice.customer.InvoiceApplyXGoods;
import cn.superdesk.uniorder.dao.entity.sys.SysOrder;
import cn.superdesk.uniorder.dto.vo.accounting.unified.customer.*;
import cn.superdesk.uniorder.dto.vo.accounting.unified.customer.statement.CustomerStatementOfAccountDetailItemVo;
import cn.superdesk.uniorder.dto.vo.accounting.unified.customer.statement.CustomerStatementOfAccountDetailVo;
import cn.superdesk.uniorder.dto.vo.sys.SysInvoiceOrder;
import cn.superdesk.uniorder.dto.vo.sys.SysOrderQuery;
import cn.superdesk.uniorder.service.base.BaseService;

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

/**
 * @Description: 客户结算 对账单
 * @Author: linjinyu 部分重构
 * @CreateDate: 6/29/20 3:52 PM
 * @UpdateUser: linjinyu
 * @UpdateDate: 6/29/20 3:52 PM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public interface AccountingUnifiedCustomerService extends BaseService<AccountingUnifiedCustomer> {


	AccountingUnifiedCustomer findByAccountingOrderSn(String accountingOrderSn);

	@Deprecated
	List<SysOrder> findAllFromOrder(Map<String, Object> queryMap);

	@Deprecated
	List<String> findRealNamesByOrder(Map<String, Object> queryMap);

	R<List<DzMainAutoPage>> findAllViewPage(Map<String, Object> params, int pageNo, int pageSize);

	@Deprecated
	R<List<ViewSysOrder>> findOrderViewPage(Map<String, Object> params, int pageNo, int pageSize);

	@Deprecated
	List<ViewSysOrderGoods> findOrderViewGoods(SysOrderQuery params);


	/**
	 * 客户结算-对账单 List 不分页 版本
	 *
	 * @param params
	 * @return
	 */
	List<CustomerStatementOfAccountDetailVo> getAccountingUnifiedCustomerViewByPage(Map<String, Object> params);

	/**
	 * 客户结算-对账单 List
	 *
	 * @param queryMap
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	R<List<CustomerStatementOfAccountDetailVo>> getAccountingUnifiedCustomerViewByPage(Map<String, Object> queryMap, int pageNo, int pageSize);

	ReportOrderQA getAccountingUnifiedCustomerViewHead(Map<String, Object> params);

	@Deprecated
	ReportOrderQA findReportFromOrder(Map<String, Object> params);

	@Deprecated
	ReportOrderQA getOrderReportData(SysOrderQuery query);

	@Deprecated
	ReportOrderQA getOrderReportDataDeath(SysOrderQuery query);

	@Deprecated
	List<ViewSysOrderJoinGoods> findOrderViewGoodsTb(Map<String, Object> params);


	List<CustomerStatementOfAccountDetailVo> getDzMainView(Map<String, Object> params);

	//ResponseResult<List<ViewSysOrderGoods>> getOrderViewByPage(SysOrderQuery params, int pageNum, int pageSize);

	R<List<ExpSysOrder>> getOrderViewByPage(SysOrderQuery params, int pageNum, int pageSize);

	@Deprecated
	List<CustomerStatementOfAccountDetailItemVo> getDzMainViewExcel(Map<String, Object> params);

	R<List<ExpSysOrder>> getOrderViewByPageProject(SysOrderQuery params, int pageNum, int pageSize);


	@Deprecated
	List<ExpSysOrder> findOrderViewExcel(Map<String, Object> params);

	List<ExpSysOrder> getOrderViewExcel(SysOrderQuery query);

	SysInvoiceOrder findInvByOrderId(Long id);


	/****************************************** 对账单 状态 回款状态 start ******************************************/
	void updateFieldBackAccountStatusByInvoiceX(List<InvoiceApplyXGoods> invoiceX);

	/****************************************** 对账单 状态 回款状态   end ******************************************/


	void optAccountingCustomerActionCancel(Long id, AccountingOrderCustomerAccountingStatusEnum accountingOrderAccountingStatusEnum);




	/****************************************** 补丁程序 start ******************************************/
	void patchXDimOrder2DimGoods(String accountingOrderSn);
	void patchXAccountingAmountAndQuantityOrderAndQuantityGoods(String accountingOrderSn);
	/****************************************** 补丁程序   end ******************************************/

}
