package com.dxhy.core.job.thread;

import javax.annotation.Resource;

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

/**
 * @author user
 */
public class DataPlatformInvoiceHandle extends Thread {
    @Resource
    private DataPlatformCollectService dataPlatformCollectService;

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

    /**
     * 入参，执行接口方法
     *
     * @param type
     *            类型
     * @param taxno
     *            税号
     * @param linkName
     *            mycat标识
     * @param company
     *            集团编码
     *            @param  reqType 数据类型 1进项发票  2 销项发票
     */
    public DataPlatformInvoiceHandle(String type, String taxno, String linkName, String company, String params,
        String reqType, String aceId, String aceKey) {
        this.type = type;
        this.taxno = taxno;
        this.linkName = linkName;
        this.company = company;
        this.reqType = reqType;
        this.params = params;
        this.aceId = aceId;
        this.aceKey = aceKey;
    }

    @Override
    public void run() {
        dataPlatformCollectService =
            (DataPlatformCollectService)SpringContextUtils.getBean("dataPlatformCollectService");
        dataPlatformCollectService.sendRequest(type, taxno, linkName, company, params, reqType, aceId, aceKey);
    }
}
