package com.dxhy.core.job.pojo;

import javax.annotation.Resource;

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

/**
 * 功能描述
 *
 * @author 陈刚扬
 * @date 2020/10/30
 */

public class InvoiceHandle extends Thread {
    @Resource
    private InvoiceInterfaceService invoiceInterfaceService;

    private final String type;
    private final String taxno;
    private final String linkName;
    private final String aceId;
    private final String aceKey;
    private final String company;

    /**
     * 入参，执行接口方法
     *
     * @param type
     *            类型
     * @param taxno
     *            税号
     * @param linkName
     *            mycat标识
     * @param aceKey
     * @param aceId
     * @param company
     */
    public InvoiceHandle(String type, String taxno, String linkName, String aceId, String aceKey, String company) {
        this.type = type;
        this.taxno = taxno;
        this.linkName = linkName;
        this.aceId = aceId;
        this.aceKey = aceKey;
        this.company = company;
    }

    @Override
    public void run() {
        invoiceInterfaceService = (InvoiceInterfaceService)SpringContextUtils.getBean("InvoiceInterfaceService");
        invoiceInterfaceService.sendRequest(type, taxno, linkName, aceId, aceKey, company);
    }
}
