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

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.accounting.score.customer.AccountingScoreCustomer;
import cn.superdesk.uniorder.dto.param.accounting.score.customer.AccountingOrderScoreCustomerQueryCriteria;
import cn.superdesk.uniorder.dto.param.accounting.score.customer.AccountingOrderScoreCustomerCreateParam;
import cn.superdesk.uniorder.dto.param.accounting.score.customer.AccountingOrderScoreCustomerOpDetailQueryCriteria;
import cn.superdesk.uniorder.dto.vo.accounting.score.customer.AccountingOrderScoreCustomerDetailVo;
import cn.superdesk.uniorder.dto.vo.accounting.score.customer.AccountingOrderScoreCustomerHeadVo;
import cn.superdesk.uniorder.dto.vo.accounting.score.customer.AccountingOrderScoreCustomerListItemVo;
import cn.superdesk.uniorder.dto.vo.invoice.customer.InvoiceApplyDetailDimCreditItemVo;

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

public interface DubboAccountingScoreCustomerService {


    /****************************************** 积分结算 对账单 start ******************************************/

    List<Long> getAccountingXCreditIdsByAccountingOrderId(Long id);

    R<List<AccountingOrderScoreCustomerListItemVo>> pageQueryAccountingOrderList(AccountingOrderScoreCustomerQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    List<AccountingOrderScoreCustomerListItemVo> queryAccountingOrderList(AccountingOrderScoreCustomerQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    AccountingOrderScoreCustomerListItemVo getAccountingOrderListByAccountingOrderSn(String accountingOrderSn, LoginSysUser loginSysUser);

    String exportExcelAccountingOrderScoreCustomerList(AccountingOrderScoreCustomerQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    AccountingOrderScoreCustomerHeadVo getAccountingOrderListHeadSum(AccountingOrderScoreCustomerQueryCriteria queryCriteria);

    /**
     * 创建结算单(对账单)(积分) ---- 与 addDzMainNew 对映
     * 效率优化 mark by linjinyu at 20211203
     *
     * @param scoreOrderReconciliationNotYetVoList
     * @param scoreAccountingCustomerCreateParam
     * @param loginSysUser
     * @return
     * @throws Exception
     */
    AccountingScoreCustomer createScoreAccountingCustomer(
            List<InvoiceApplyDetailDimCreditItemVo> scoreOrderReconciliationNotYetVoList,
            AccountingOrderScoreCustomerCreateParam scoreAccountingCustomerCreateParam, LoginSysUser loginSysUser) throws Exception;

    /****************************************** 积分结算 对账单   end ******************************************/

    /****************************************** 积分结算 对账单 详情 start ******************************************/

    AccountingOrderScoreCustomerDetailVo commonStatementOfAccountDetailDimCredit(AccountingOrderScoreCustomerOpDetailQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    String exportExcelAccountingOrderScoreCustomerDetailDimCredit(AccountingOrderScoreCustomerOpDetailQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    /****************************************** 积分结算 对账单 详情   end ******************************************/

    /****************************************** 积分结算 对账单 操作 start ******************************************/

    /**
     * 积分结算-op重新对账
     *
     * @param accountingOrderId
     * @param loginSysUser
     * @return
     */
    int opCancelAccounting(Long accountingOrderId, LoginSysUser loginSysUser);

    /**
     * 拒绝对账
     *
     * @param accountingOrderId
     * @param loginSysUser
     * @return
     */
    int opRefuseAccounting(Long accountingOrderId, LoginSysUser loginSysUser);

    /**
     * 确认对账
     *
     * @param accountingOrderId
     * @param loginSysUser
     * @return
     */
    int opConfirmAccounting(Long accountingOrderId, LoginSysUser loginSysUser);

    int opDeleteAccounting(Long accountingOrderId, LoginSysUser loginSysUser);

    /****************************************** 积分结算 对账单 操作 start ******************************************/


    void deleteObj(Long id);

    int opUpdateByPrimaryKeySelective(AccountingScoreCustomer scoreAccountingCustomer, LoginSysUser loginSysUser);

    int opUpdateFieldRemark(AccountingScoreCustomer scoreAccountingCustomer, LoginSysUser loginSysUser);


    AccountingScoreCustomer findById(Long id);

    AccountingScoreCustomer findByAccountingOrderSn(String accountingOrderSn);


    List<AccountingScoreCustomer> findByIds(List<Long> accountingOrderIds);

    void addObj(AccountingScoreCustomer scoreAccountingCustomer);

    List<AccountingScoreCustomer> findAll(Map<String, Object> queryMap);
}
