package com.dxhy.core.job.thread;

import com.dxhy.common.utils.SpringContextUtils;
import com.dxhy.core.job.service.InvoiceDownService;
import com.dxhy.core.job.service.InvoiceInterfaceService;

import javax.annotation.Resource;

/**
 * @author user
 */
public class InvoiceDownHandle extends Thread {
    @Resource
    private InvoiceDownService invoiceInterfaceService;

    private final String taxno;
    private final String db;
    private final String aceId;
    private final String aceKey;
    private String invoiceTypes;
    private String company;
    private String dataType;

    /**
     *
     * @description
     * @author Allen
     * @updateTime 2022/10/31 17:59
     * @param dataType 数据类型1进项数据，2销项数据
     */
    public InvoiceDownHandle(String taxno, String db, String aceId, String aceKey, String invoiceTypes, String company,
        String dataType) {
        this.taxno = taxno;
        this.db = db;
        this.aceId = aceId;
        this.aceKey = aceKey;
        this.invoiceTypes = invoiceTypes;
        this.company = company;
        this.dataType = dataType;
    }

    @Override
    public void run() {
        invoiceInterfaceService = (InvoiceDownService)SpringContextUtils.getBean("InvoiceDownService");
        invoiceInterfaceService.sendRequest(taxno, db, aceId, aceKey, invoiceTypes, company, dataType);
    }
}
