package cn.superdesk.uniorder.dubbo.facade.accounting.supplier;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplier;
import cn.superdesk.uniorder.dao.entity.base.UnifiedOrder;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.base.UnifiedOrderGoods;
import cn.superdesk.uniorder.dto.param.accounting.unified.supplier.AccountingOrderUnifiedSupplierQueryCriteria;
import cn.superdesk.uniorder.dto.vo.accounting.unified.supplier.AccountingOrderUnifiedSupplierStatisticsFixVoDimGoods;
import cn.superdesk.uniorder.dto.vo.accounting.unified.supplier.AccountingOrderUnifiedSupplierStatisticsFixVoDimOrder;
import cn.superdesk.uniorder.dto.vo.accounting.unified.supplier.AccountingOrderUnifiedSuplierHeadVo;
import cn.superdesk.uniorder.dto.param.accounting.unified.supplier.AccountingUnifiedSupplierOpCreateParamDimGoods;
import cn.superdesk.uniorder.dto.param.accounting.unified.supplier.UnifiedSupplierCreateDimOrderParam;
import cn.superdesk.uniorder.dto.vo.accounting.unified.supplier.AccountingOrderUnifiedSupplierListItemVo;

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

public interface DubboAccountingUnifiedSupplierService {

	/**
	 * 供应商结算2.0-对账单列表
	 * 引用
	 * 1. 后端端
	 * 2. 商户端
	 *
	 * @param params
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	R<List<AccountingOrderUnifiedSupplierListItemVo>> getStatementOfAccountList(Map<String, Object> params, int pageNum, int pageSize);

	R<List<AccountingOrderUnifiedSupplierListItemVo>> getStatementOfAccountList(AccountingOrderUnifiedSupplierQueryCriteria queryCriteria);

	AccountingOrderUnifiedSuplierHeadVo getStatementOfAccountHeadSum(Map<String, Object> params);

	AccountingOrderUnifiedSuplierHeadVo getStatementOfAccountHeadSum(AccountingOrderUnifiedSupplierQueryCriteria queryCriteria);


	AccountingUnifiedSupplier findById(Long id);

	AccountingUnifiedSupplier findByAccountingOrderSn(String accountingOrderSn);

	void updateObj(AccountingUnifiedSupplier update);


	AccountingUnifiedSupplier opCreateAccountingDimOrder(UnifiedSupplierCreateDimOrderParam unifiedSupplierCreateDimOrderParam, LoginSysUser loginSysUser);

	R<AccountingUnifiedSupplier> opCreateAccountingDimGoods(AccountingUnifiedSupplierOpCreateParamDimGoods unifiedSupplierCreateDimGoodsParam, LoginSysUser loginSysUser);

	void opEditAccountingDimOrder(AccountingUnifiedSupplier statementOfAccount, UnifiedOrder unifiedOrder, String add, LoginSysUser loginSysUser);

	void opEditAccountingDimGoods(AccountingUnifiedSupplier statementOfAccount, UnifiedOrder unifiedOrder, UnifiedOrderGoods unifiedOrderGoods, String add, LoginSysUser loginSysUser);

//	@Deprecated
//	void opRejectAccounting(AccountingUnifiedSupplier statementOfAccount);
//
//	@Deprecated
//	void opAgainAccounting(AccountingUnifiedSupplier statementOfAccount);
//
//	@Deprecated
//	void opCancelAccounting(AccountingUnifiedSupplier statementOfAccount);

	int opDelete(AccountingUnifiedSupplier statementOfAccount, LoginSysUser loginSysUser);

	/****************************************** 状态机 start ******************************************/

//	// 创建操作 -> 对账单状态 -> 待提交(3, "待提交"),
//	void opCreate(AccountingUnifiedSupplier statementOfAccount, LoginSysUser loginSysUser);
//
//	// 提交操作 -> 对账单状态 -> 未确认(0, "未确认"),// 已提交
//	void opSubmit(AccountingUnifiedSupplier statementOfAccount, LoginSysUser loginSysUser);
//
//	// 取消操作 -> 对账单状态 -> 已取消(-1, "已取消"),
//	void opCancel(AccountingUnifiedSupplier statementOfAccount, LoginSysUser loginSysUser);
//
//
//	// 重新对账操作 -> 对账单状态 -> 已取消(-1, "已取消"),
//	void opAgain(AccountingUnifiedSupplier statementOfAccount, LoginSysUser loginSysUser);
//
//	// 确认操作 -> 对账单状态 -> 已确认(1, "已确认"),
//	void opConfirm(AccountingUnifiedSupplier statementOfAccount, LoginSysUser loginSysUser);
//
//	// 申诉操作 -> 对账单状态 -> 已拒绝(2, "已拒绝"),
//	void opAppeal(AccountingUnifiedSupplier statementOfAccount, LoginSysUser loginSysUser);

	/****************************************** 状态机   end ******************************************/

	AccountingOrderUnifiedSupplierStatisticsFixVoDimOrder checkAmountErrorForFixDimOrder(Map<String, Object> params);

	AccountingOrderUnifiedSupplierStatisticsFixVoDimGoods checkAmountErrorForFixDimGoods(Map<String, Object> params);


	/****************************************** 补丁程序 start ******************************************/

	void patchXDimOrder2DimGoods(String accountingOrderSn);

	String patchXCheckAndFix(String accountingOrderSn);

    String exportExcelAccountingSupplierList(AccountingOrderUnifiedSupplierQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    /****************************************** 补丁程序   end ******************************************/
}
