package cn.superdesk.uniorder.event.invoiceApplyCustomerTrigger;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * @Description: 客户结算 开票申请
 * @Author: linjinyu
 * @CreateDate: 2021/12/28 下午4:06
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/12/28 下午4:06
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Deprecated
@Slf4j
@Component
public class InvoiceApplyCustomerTriggerEventPublisher {

    @Autowired
    private ApplicationContext applicationContext;

//	public void triggerTailUpdateAccountingOrderInvoiceStatus(List<Long> affectedAccountingOrderIds, AccountingOrderTypeDimEnum dim) {
//		log.info("InvoiceApplyTriggerEventPublisher->triggerTailUpdateAccountingOrderInvoiceStatus 事件触发 ...");
//		applicationContext.publishEvent(TailUpdateAccountingOrderInvoiceStatusEvent
//				.builder()
//				.affectedAccountingOrderIds(affectedAccountingOrderIds)
//				.dim(dim)
//				.build()
//		);
//	}

    /**
     * 联动 对账单的 开票申请状态
     * 计划弃用 与 事务有冲突 逻辑是数据库 数据集比对 mark by linjinyu at 20220519
     *
     * @param event
     */
    @Deprecated
    public void triggerTailUpdateAccountingOrderFieldInvoiceStatus(TailUpdateAccountingScoreCustomerFieldInvoiceStatusEvent event) {
        log.info("InvoiceApplyCustomerTriggerEventPublisher->triggerTailUpdateAccountingOrderFieldInvoiceStatus 事件触发 ...");
        applicationContext.publishEvent(event);

    }

    /**
     * 联动 流水的 申请开票状态
     *
     * @param event
     */
    public void triggerTailUpdateUnifiedOrderCreditFieldInvoiceApplyStatus(TailUpdateUnifiedOrderCreditFieldInvoiceApplyStatusEvent event) {
        log.info("InvoiceApplyCustomerTriggerEventPublisher->triggerTailUpdateUnifiedOrderCreditFieldInvoiceMakeStatus 事件触发 ...");
        applicationContext.publishEvent(event);
    }

    /**
     * 联动 流水的 开票状态
     *
     * @param event
     */
    public void triggerTailUpdateUnifiedOrderCreditFieldInvoiceMakeStatus(TailUpdateUnifiedOrderCreditFieldInvoiceMakeStatusEvent event) {
        log.info("InvoiceApplyCustomerTriggerEventPublisher->triggerTailUpdateUnifiedOrderCreditFieldInvoiceMakeStatus 事件触发 ...");
        applicationContext.publishEvent(event);
    }

    /**
     * 联动 流水的 回款状态
     *
     * @param event
     */
    public void triggerTailUpdateUnifiedOrderCreditFieldBackAccountStatus(TailUpdateUnifiedOrderCreditFieldBackAccountStatusEvent event) {
        log.info("InvoiceApplyCustomerTriggerEventPublisher->triggerTailUpdateUnifiedOrderCreditFieldBackAccountStatus 事件触发 ...");
        applicationContext.publishEvent(event);
    }

}
