package cn.superdesk.uniorder.dubbo.consumer.invoice.customer.fundrestream;

import cn.superdesk.uniorder.common.exception.UnifiedOrderRuntimeException;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.invoice.customer.fundrestream.InvoiceBankStatement;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceBankCriteria;
import cn.superdesk.uniorder.dto.vo.unified.UnifiedInvOrderCount;
import cn.superdesk.uniorder.dubbo.facade.invoice.customer.fundrestream.DubboInvoiceBankStatementService;
import com.alibaba.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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


@Slf4j
@Component
public class InvoiceBankStatementDubboConsumerService {

	@Reference(version = "1.0.0", timeout = 30000, retries = -1)
	private DubboInvoiceBankStatementService dubboInvoiceBankStatementService;

	public R<List<InvoiceBankStatement>> findViewByPage(InvoiceBankCriteria fromVO, int pageNum, int pageSize) throws UnifiedOrderRuntimeException {
		return dubboInvoiceBankStatementService.findViewByPage(fromVO, pageNum, pageSize);
	}

	public void importBankStatementExcel(String token, List<InvoiceBankStatement> list) throws UnifiedOrderRuntimeException {
		dubboInvoiceBankStatementService.importBankStatementExcel(token, list);
	}

	public void delete(Map<String, Object> params) throws UnifiedOrderRuntimeException {
		dubboInvoiceBankStatementService.delete(params);
	}

	public void backRegister(Map<String, Object> params) throws UnifiedOrderRuntimeException {
		dubboInvoiceBankStatementService.backRegister(params);
	}

	public List<InvoiceBankStatement> getBankStatementByApplyId(Map<String, Object> params) throws UnifiedOrderRuntimeException {
		return dubboInvoiceBankStatementService.getBankStatementByApplyId(params);
	}

	public void deleteBackRegister(Map<String, Object> params) throws UnifiedOrderRuntimeException {
		dubboInvoiceBankStatementService.deleteBackRegister(params);
	}

	public List<UnifiedInvOrderCount> getInvOrderCount(Long id) {
		return dubboInvoiceBankStatementService.getInvOrderCount(id);
	}
}
