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

import cn.superdesk.uniorder.common.enums.invoice.supplier.InvoiceApplySupplierInvoiceProgressingStatusEnum;
import cn.superdesk.uniorder.common.enums.invoice.supplier.InvoiceApplySupplierPayOffAccountStatusEnum;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplier;
import cn.superdesk.uniorder.dto.param.accounting.unified.supplier.AccountingOrderUnifiedSupplierQueryCriteria;
import cn.superdesk.uniorder.dto.vo.accounting.unified.supplier.AccountingOrderUnifiedSuplierHeadVo;
import cn.superdesk.uniorder.dto.vo.accounting.unified.supplier.AccountingOrderUnifiedSupplierListItemVo;
import cn.superdesk.uniorder.service.base.BaseService;

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

/**
 * @Description: 供应商 对账
 * @Author: linjinyu
 * @CreateDate: 9/23/20 10:46 AM
 * @UpdateUser: linjinyu
 * @UpdateDate: 9/23/20 10:46 AM
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public interface AccountingUnifiedSupplierService extends BaseService<AccountingUnifiedSupplier> {

    AccountingUnifiedSupplier findByAccountingOrderSn(String accountingOrderSn);

    /**************************************** 供应商结算2.0-对账单列表 引用 1. 后端端 2. 商户端 start ****************************************/

    R<List<AccountingOrderUnifiedSupplierListItemVo>> pageQueryAccountingOrderUnifiedSupplierList(Map<String, Object> params, int pageNum, int pageSize);

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

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

    AccountingOrderUnifiedSuplierHeadVo getStatementOfAccountHeadSum(AccountingOrderUnifiedSupplierQueryCriteria queryCriteria);

    /**************************************** 供应商结算2.0-对账单列表 引用 1. 后端端 2. 商户端 start ****************************************/

    List<AccountingOrderUnifiedSupplierListItemVo> queryAccountingOrderUnifiedSupplierList(AccountingOrderUnifiedSupplierQueryCriteria queryCriteria, LoginSysUser loginSysUser);


    int updateFieldByPrimaryKeySelective(AccountingUnifiedSupplier statementOfAccount);

    /**
     * 申请状态
     *
     * @param accountingOrderId
     * @param invoiceApplySupplierInvoiceProgressingStatusEnum
     * @param loginSysUser
     * @return
     */
    int updateFieldInvoiceStatus(
            Long accountingOrderId,
            InvoiceApplySupplierInvoiceProgressingStatusEnum invoiceApplySupplierInvoiceProgressingStatusEnum,
            LoginSysUser loginSysUser);

    /**
     * 付款状态
     *
     * @param accountingOrderId
     * @param invoiceApplySupplierPayOffAccountStatusEnum
     * @param loginSysUser
     * @return
     */
    int updateFieldBackAccountStatus(
            Long accountingOrderId,
            InvoiceApplySupplierPayOffAccountStatusEnum invoiceApplySupplierPayOffAccountStatusEnum,
            LoginSysUser loginSysUser);


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

    void patchNeedReviseMarkStatistics(List<AccountingOrderUnifiedSupplierListItemVo> resultList, LoginSysUser loginSysUser);

    void patchNeedReviseMarkServiceNoSourceFrom(List<AccountingOrderUnifiedSupplierListItemVo> resultList, LoginSysUser loginSysUser);

    int opResetNeedReviseMark(Long accountingOrderId);

    @Deprecated
    void patchXDimOrder2DimGoods(String accountingOrderSn);

    @Deprecated
    String patchXCheckAndFix(String accountingOrderSn);

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