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

import cn.superdesk.uniorder.common.enums.accounting.AccountingOrderTypeDimEnum;
import cn.superdesk.uniorder.dubbo.consumer._permission.PermissionDubboCustomerService;
import cn.superdesk.uniorder.dubbo.facade.invoice.customer.DubboInvoiceApplyXGoodsService;
import com.alibaba.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2022/3/2 下午6:57
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/3/2 下午6:57
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class InvoiceApplyXGoodsDubboConsumerService {

    @Reference(version = "1.0.0", timeout = 100000, retries = -1)
    private DubboInvoiceApplyXGoodsService dubboInvoiceApplyXGoodsService;

    @Resource
    private PermissionDubboCustomerService permissionDubboCustomerService;

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

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

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

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

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