package cn.superdesk.uniorder.service.thirdpart.qchjc.account;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplier;
import cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceBankInfo;
import cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.accounting.QchjcAccountingUnifiedSupplierEntity;
import cn.superdesk.uniorder.dao.entity.thirdpart.qchjc.invoice.QchjcInvoiceApplySupplierEntity;
import cn.superdesk.uniorder.dto.param.accounting.qchjc.QchjcSupplierAccountingListRequest;
import cn.superdesk.uniorder.dto.param.thirdpart.qchjc.accounting.QchjcSupplierStorageParam;
import cn.superdesk.uniorder.dto.param.thirdpart.qchjc.api.supplier.QchjcSupplierCancelStatementParam;
import cn.superdesk.uniorder.dto.param.thirdpart.qchjc.api.supplier.QchjcSupplierPaymentStatusSyncParam;
import cn.superdesk.uniorder.dto.param.thirdpart.qchjc.api.supplier.QchjcSupplierReceiveInvoiceStatusParam;
import cn.superdesk.uniorder.dto.param.thirdpart.qchjc.invoice.QchjcSupplierInoviceApplyParam;
import cn.superdesk.uniorder.dto.vo.organisation.UnifiedSupplierVo;
import cn.superdesk.uniorder.dto.vo.thirdpart.qchjc.accounting.QchjcAccountingUnifiedSupplierVo;
import cn.superdesk.uniorder.service.base.BaseService;

import java.util.List;

/**
 * @author xc
 * @description
 * @date 2022/4/1 18:35
 */
public interface QchjcSupplierStatementService extends BaseService<QchjcAccountingUnifiedSupplierEntity> {

    /**
     * 集采-接收供应商对账单
     *
     * @param data
     */
    void receive(String data);

    /**
     * 集采-获取待入库状态供应商对账单集合
     *
     * @return
     */
    QchjcAccountingUnifiedSupplierVo getTodoList(Long id);

    QchjcAccountingUnifiedSupplierEntity selectByPrimaryKey(Long id);

    /**
     * 供应商对账单状态同步 集采 -> 结算中心
     *
     * @param toJSONString
     */
    void syncStatus(String toJSONString);

    /**
     * 供应商收票状态同步
     *
     * @param param
     * @return
     */
    void receiveInvoiceStatusSync(QchjcSupplierReceiveInvoiceStatusParam param);

    /**
     * 供应商对账单付款状态同步
     *
     * @param param
     * @return
     */
    void paymentStatusSync(QchjcSupplierPaymentStatusSyncParam param);

    /**
     * 供应商对账单作废接口
     *
     * @param param
     * @return
     */
    void statementCancelSync(QchjcSupplierCancelStatementParam param);

    QchjcSupplierStorageParam doSaveDetail(Long id);

    R<String> remark(Long id, String remark, String token);

    R<List<QchjcAccountingUnifiedSupplierVo>> queryQchjcSupplierStatementList(QchjcSupplierAccountingListRequest request);

    R<QchjcAccountingUnifiedSupplierVo> getQchjcSupplierStatementById(Long id);

    List<Long> getTodoIdList();

    void recordFailLog(QchjcAccountingUnifiedSupplierEntity qchjcAccountingUnifiedSupplierEntity, String toJSONString);

    List<QchjcInvoiceApplySupplierEntity> selectSupplierInvoiceByAccountingOrderSn(String accountingOrderSn);

    QchjcSupplierInoviceApplyParam assembleSupplierInvoiceApplyParam(QchjcInvoiceApplySupplierEntity qchjcInvoiceApplySupplierEntity, AccountingUnifiedSupplier accountingUnifiedSupplier, InvoiceBankInfo invoiceBankInfo, QchjcAccountingUnifiedSupplierEntity qchjcAccountingUnifiedSupplierEntity);

    void saveSupplierInvoiceApplyByPrimaryKeySelective(QchjcInvoiceApplySupplierEntity qchjcInvoiceApplySupplierEntity);

    R<List<UnifiedSupplierVo>> getSupplierList();
}
