package cn.superdesk.uniorder.common.mq.kafka.producer;

import cn.superdesk.uniorder.common.json.AnJsonUtils;
import cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzScheduleTaskStatementOfAccount;
import cn.superdesk.uniorder.dto.receive.consumer.superdeskappservices.flashdeliver.FlashDeliverOrderPatchUnifiedOrderFieldOutVirt;
import cn.superdesk.uniorder.dto.vo.invoice.customer.invoiced.InvoiceInvoicedExcelExportVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;


/**
 * @Description: 内部用
 * @Author: linjinyu
 * @CreateDate: 2021/8/11 上午10:42
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/8/11 上午10:42
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Service
public class FakeSuperdeskUniOrderProducerHandler {

	@Autowired
	private KafkaTemplate<String, String> kafkaTemplate;

	/****************************************** 服务之窗 楼闪送 内部 proxyclient_order start ******************************************/

	public void kafkaFlashdeliverOrderPatchUnifiedOrderFieldOutVirt(FlashDeliverOrderPatchUnifiedOrderFieldOutVirt flashdeliverOrderPatchUnifiedOrderFieldOutVirt) {
		kafkaTemplate.send("PATCH_FLASHDELIVER_ORDER_FIELD_OUT_VIRT", "patchUnifiedOrderFieldOutVirt", AnJsonUtils.toJson(flashdeliverOrderPatchUnifiedOrderFieldOutVirt));
	}

	/****************************************** 服务之窗 楼闪送 内部 proxyclient_order start ******************************************/


	/****************************************** 统一订单 应收账款 start ******************************************/

	public void kafkaInvoiceInvoicedsOverdueTask(InvoiceInvoicedExcelExportVo invoiceInvoicedExcelExportVo) {
		kafkaTemplate.send("TASK_INVOICE_INVOICEDS_OVERDUE", "invoiceInvoicedsOverdueTask", AnJsonUtils.toJson(invoiceInvoicedExcelExportVo));
	}

	public void kafkaInvoiceInvoicedsExcelImportTask(String messageKey, String json) {
		kafkaTemplate.send("TASK_INVOICE_INVOICEDS_EXCEL_IMPORT", messageKey, json);
	}

	/****************************************** 统一订单 应收账款   end ******************************************/

	/****************************************** 统一订单 对账单 start ******************************************/

	public void kafkaStatementOfAccountDimOrderTask(SysQuartzScheduleTaskStatementOfAccount entity) {
		kafkaTemplate.send("TASK_STATEMENT_OF_ACCOUNT_DIM_ORDER_TASK", "statementOfAccountDimOrderTask", AnJsonUtils.toJson(entity));
	}

	/****************************************** 统一订单 对账单   end ******************************************/

}
