package cn.superdesk.uniorder.dubbo.provider.invoice.customer;

import cn.superdesk.uniorder.common.enums.accounting.AccountingOrderTypeDimEnum;
import cn.superdesk.uniorder.dubbo.facade.invoice.customer.DubboInvoiceApplyXGoodsService;
import cn.superdesk.uniorder.service.invoice.customer.InvoiceApplyXGoodsService;
import com.alibaba.dubbo.config.annotation.Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Slf4j
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboInvoiceApplyXGoodsServiceImpl implements DubboInvoiceApplyXGoodsService {

	@Autowired
	private InvoiceApplyXGoodsService invoiceApplyXGoodsService;

	/****************************************** 工具方法 start ******************************************/

	/**
	 * 根据发票申请Id 获取 关联 积分流水 ids 集合
	 *
	 * @param invoiceApplyId
	 * @return
	 */
	public List<Long> findCreditSetByInvoicApplyId(Long invoiceApplyId) {
		return invoiceApplyXGoodsService.findCreditSetByInvoicApplyId(invoiceApplyId);
	}

	/**
	 * 根据对账单Id 获取 关联 开票申请 ids 集合
	 *
	 * @param accountingOrderId
	 * @param accountingOrderTypeDimEnum
	 * @return
	 */
	public List<Long> findInvoiceApplySetByAccountingOrderId(Long accountingOrderId, AccountingOrderTypeDimEnum accountingOrderTypeDimEnum) {
		return invoiceApplyXGoodsService.findInvoiceApplySetByAccountingOrderId(accountingOrderId, accountingOrderTypeDimEnum);
	}

	/**
	 * 根据发票申请Id 获取 关联 对账单 ids 集合
	 *
	 * @param invoiceApplyId
	 * @return
	 */
	public List<Long> getAffectedAccountingOrderIdsByInvoiceApplyId(Long invoiceApplyId) {
		return invoiceApplyXGoodsService.getAffectedAccountingOrderIdsByInvoiceApplyId(invoiceApplyId);
	}

	/****************************************** 工具方法   end ******************************************/
}
