package com.dxhy.core.service.export.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.api.model.excelExport.TDxExcelExportlog;
import com.dxhy.common.enums.ExcelServiceTypeEnum;
import com.dxhy.common.rabbitmq.RabbitMqSender;
import com.dxhy.common.service.DictdetaServcice;
import com.dxhy.common.service.impl.TabulateRedisServiceImpl;
import com.dxhy.core.dao.CoreTDxInvoiceImgDao;
import com.dxhy.core.dao.TDxOutReasonDao;
import com.dxhy.core.feign.IFeginWebsocket;
import com.dxhy.core.job.dao.LqTdxInvoiceFileCoreDao;
import com.dxhy.core.job.dao.TDxRecordInvoiceJobDao;
import com.dxhy.core.job.dao.TDxSaleRecordInvoiceJobDao;
import com.dxhy.core.service.export.*;
import com.dxhy.core.service.singletable.IExcelExportlogService;
import com.dxhy.core.service.ywgl.YwglService;
import com.dxhy.core.thread.*;
import com.dxhy.jxpt.baseService.config.dao.SysEnterpriseConfigDao;
import com.dxhy.jxpt.baseService.dao.TdxRecordInvoiceDao;
import com.dxhy.oss.config.OssConfig;
import com.dxhy.oss.service.FileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * excel导出的业务逻辑实现类
 *
 * @author jiaohongyang
 */
@SuppressWarnings("AlibabaMethodTooLong")
@Service("excelExportService")
@Slf4j

public class ExcelExportServiceImpl implements IExcelExportService {

    @Resource
    private IExcelExportlogService exportLogService;

    @Resource
    private FileService fileService;

    @Resource
    private RabbitMqSender sender;

    /**
     * 用于导出发票采集列表、异常发票采集列表
     */
    @Resource
    private IFpcjService fpcjService;

    /**
     * 用于导出未补发票明细列表
     */
    @Resource
    private IFpcjmxService fpcjmxService;

    /**
     * 用于导出企业税务信息列表
     */
    @Resource
    private IQyswxxService qyswxxService;
    /**
     * 用于导出发票认证月报列表
     */
    @Resource
    private IFprzybService fprzybService;
    /**
     * 用于导出认证结果清单
     */
    @Resource
    private IRzjgqdService rzjgqdService;

    /**
     * 用于导出签收统计表
     */
    @Resource
    private IQstjbService qstjbService;
    /**
     * 用于导出签收失败统计表
     */
    @Resource
    private IQssbService qssbService;
    /**
     * 已转出进项税导出
     */
    @Resource
    private IExportInvoiceOutService invoiceOutService;
    @Resource
    private IExportCautionService cautionService;
    @Resource
    private IExportElecService elecService;

    /**
     * 查验历史导出
     */
    @Resource
    private IInvoiceQueryService invoiceQueryService;

    /**
     * 查验历史明细导出
     */
    @Resource
    private InvoiceCheckDetailService invoiceCheckDetailService;

    /**
     * 查验综合查询导出
     */
    @Resource
    private InvoiceCheckListService invoiceCheckListService;

    /**
     * 用于导出认证发票查询列表
     */
    @Resource
    private RzFpxxService rzFpxxService;

    @Resource
    private SysEnterpriseConfigDao sysEnterpriseConfigDao;

    @Resource
    private RzFpsgrzService rzFpsgrzService;

    @Resource
    private CpyGxExportService cpyGxExportService;
    @Resource
    private CpyGxCustomsExportService cpyGxCustomsExportService;

    @Resource
    private DkCountExportService dkCountExportService;

    /**
     * 用于导出勾选发票确认查询列表
     */
    @Resource
    private GxfpqrService gxfpqrService;

    /**
     * 用于导出综合查询发票报表
     */
    @Resource
    private FpzhcxService fpzhcxService;

    /**
     * 用于导出报表异常发票报表
     */
    @Resource
    private YcfpcxService ycfpcxService;
    /**
     * 用于导出报表逾期发票报表
     */
    @Resource
    private YqfpcxService yqfpcxService;

    /**
     * 用于异常发票报表导出
     */
    @Resource
    private YcfpbbcxService ycfpbbcxService;

    /**
     * 用于导出认证日报
     */
    @Resource
    private RzrbcxService rzrbcxService;
    /**
     * 用于发票综合查询导出明细
     */
    @Resource
    private FpzhcxmxService fpzhcxmxService;
    /**
     * 用于发票综合查询导出税率
     */
    @Resource
    private FpzhcxslService fpzhcxslService;

    /**
     * 用于发票签收查询结果导出
     */
    @Resource
    private IFpqsService fpqsService;

    /**
     * 用于发票签收查询结果导出
     */
    @Resource
    private MryxFpqsService mryxService;

    /**
     * 用于进项税额导出
     */
    @Resource
    private JxsemxbbcxService jxsemxbbcxService;
    /**
     * 用于进项税明细额导出
     */
    @Resource
    private JxsebbcxService jxsebbcxService;

    /**
     * 用于运维管理导出
     */
    @Resource
    private YwglService ywglService;

    @Resource
    private SgqsService sgqsService;

    @Resource
    private IFeginWebsocket feginWebsocket;

    @Resource
    private MixedSignService mixedSignService;

    @Resource
    private ICustomsCollectService customsCollectService;
    @Resource
    private JkszhcxService jkszhcxService;

    @Resource
    private TicketService ticketService;

    @Resource
    private TDxOutReasonDao tDxOutReasonDao;
    /**
     * 票池导出
     */
    @Resource
    private PoolPaperService poolPaperService;

    @Resource
    private TtFprzhzService ttFprzhzService;
    @Resource
    private TabulateRedisServiceImpl tabulateRedisService;

    @Resource
    private DictdetaServcice dictdetaServcice;
    @Resource
    private ViolationSearchService violationSearchService;
    /**
     * 发票明细导出
     */
    @Resource
    private FpmxcxService fpmxcxService;

    /**
     * 海关缴款书导出-票池
     */
    @Resource
    private CustomsService customsService;

    @Resource
    private LqFpycxxService lqFpycxxService;
    @Resource
    private LqTdxInvoiceFileCoreDao lqTdxInvoiceFileCoreDao;
    @Resource
    private TDxRecordInvoiceJobDao tDxRecordInvoiceJobDao;
    @Resource
    private CoreTDxInvoiceImgDao coreTDxInvoiceImgDao;

    @Resource
    private TdxRecordInvoiceDao tdxRecordInvoiceDao;

    @Resource
    private TDxSaleRecordInvoiceJobDao tDxSaleRecordInvoiceJobDao;

    @Resource
    private OssConfig ossConfig;

    @Override
    public void exportExcel(String message) {

        JSONObject jsonObject = JSON.parseObject(message);
        TDxExcelExportlog tDxExcelExportlog = JSON.parseObject(jsonObject.toJSONString(), TDxExcelExportlog.class);
        List<TDxExcelExportlog> list = new ArrayList<>();
        list.add(tDxExcelExportlog);

        // 为了加快导出速度，不同类型的导出业务放入不同的线程中并发执行。此处每个业务启动一个线程
        for (TDxExcelExportlog vo : list) {
            if (ExcelServiceTypeEnum.FPCJ_HZ.getServiceType() == vo.getServiceType()) {
                // 发票采集导出
                new FpcjhzExportThread(exportLogService, list, fpcjService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            }
            if (ExcelServiceTypeEnum.FPCJ_YCPHZ.getServiceType() == vo.getServiceType()) {
                // 异常发票采集导出
                new FpcjhzExportThread(exportLogService, list, fpcjService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.FPCJ_WBMX.getServiceType() == vo.getServiceType()) {
                // 未补发票导出
                new FpcjWbmxExportThread(exportLogService, list, fpcjmxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.FPRZ_QYSWXX.getServiceType() == vo.getServiceType()) {
                // 企业税务信息导出
                new QyswxxExportThread(exportLogService, list, qyswxxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.FPRZ_RZCX.getServiceType() == vo.getServiceType()) {
                // 认证发票查询导出
                new RzFpxxExportThread(exportLogService, list, rzFpxxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.GXFPQR.getServiceType() == vo.getServiceType()) {
                // 勾选发票确认导出
                new GxfpqrExportThread(exportLogService, list, gxfpqrService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_FPZHCX.getServiceType() == vo.getServiceType()) {
                // 报表发票综合查询导出
                new FpzhcxExportThread(exportLogService, list, fpzhcxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_YQFP.getServiceType() == vo.getServiceType()) {
                // 逾期发票查询导出
                new YqfpcxExportThread(exportLogService, list, yqfpcxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_YCFPCX.getServiceType() == vo.getServiceType()) {
                // 异常发票查询导出
                new YcfpcxExportThread(exportLogService, list, ycfpcxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_YCFPBB.getServiceType() == vo.getServiceType()) {
                // 异常发票报表导出
                new YcfpbbcxExportThread(exportLogService, list, ycfpbbcxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_FPZHCXMX.getServiceType() == vo.getServiceType()) {
                // 发票综合查询明细导出导出
                new FpzhcxmxExportThread(exportLogService, list, fpzhcxmxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_FPZHCXSL.getServiceType() == vo.getServiceType()) {
                // 发票综合查询税率导出导出
                new FpzhcxslExportThread(exportLogService, list, fpzhcxslService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_JXSEBB.getServiceType() == vo.getServiceType()) {
                // 进项税额报表导出导出
                new JxsebbExportThread(exportLogService, list, jxsebbcxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_JXDKMXBB.getServiceType() == vo.getServiceType()) {
                // 进项税额明细导出导出
                new JxsemxbbExportThread(exportLogService, list, jxsemxbbcxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_FPRZRB.getServiceType() == vo.getServiceType()) {
                // 认证日报导出
                new FprzrbExportThread(exportLogService, list, rzrbcxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_FPRZYB.getServiceType() == vo.getServiceType()) {
                // 发票认证月报导出
                new FprzybExportThread(exportLogService, list, fprzybService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_RZJGQD.getServiceType() == vo.getServiceType()) {
                // 认证结果清单导出
                new RzjgqdExportThread(exportLogService, list, rzjgqdService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_FPQSTJ.getServiceType() == vo.getServiceType()) {
                // 发票签收统计导出
                new QstjbExportThread(exportLogService, list, qstjbService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_RZFPHZ.getServiceType() == vo.getServiceType()) {
                // 认证发票汇总导出
                new RzfphzExportThread(exportLogService, list, fprzybService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_QSSB.getServiceType() == vo.getServiceType()) {
                // 签收失败导出
                new QssbExportThread(exportLogService, list, qssbService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_YQSWRZ.getServiceType() == vo.getServiceType()) {
                // 已签收未认证导出
                new YqswrzExportThread(exportLogService, list, qstjbService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.YJ_YQYU.getServiceType() == vo.getServiceType()) {
                // 发票预警 逾期预警导出
                new CautionExportExpirationThread(exportLogService, list, cautionService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.YJ_YCFP.getServiceType() == vo.getServiceType()) {
                // 发票预警 异常发票预警导出
                new CautionExportAnomalyThread(exportLogService, list, cautionService, fileService, sender,
                    feginWebsocket, tabulateRedisService, dictdetaServcice).start();
            } else if (ExcelServiceTypeEnum.YJ_PPKND.getServiceType() == vo.getServiceType()) {
                // 发票预警 普票跨年度预警导出
                new CautionExportMaximalThread(exportLogService, list, cautionService, fileService, sender,
                    feginWebsocket, tabulateRedisService, dictdetaServcice).start();
            } else if (ExcelServiceTypeEnum.JXSZC_YZCJXS.getServiceType() == vo.getServiceType()) {
                // 进项税转出 已转出进项税查询导出
                new InvoiceOutExportThread(exportLogService, list, invoiceOutService, tDxOutReasonDao, fileService,
                    sender, feginWebsocket, tabulateRedisService, dictdetaServcice).start();
            } else if (ExcelServiceTypeEnum.DPGL_DPCX.getServiceType() == vo.getServiceType()) {
                // 电票管理 电票查询导出
                new ElecExportThread(exportLogService, list, elecService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CHECK_HISTORY.getServiceType() == vo.getServiceType()) {
                // 发票查验历史导出
                new CheckHistoryThread(exportLogService, list, invoiceQueryService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CHECK_HISTORY_DETAIL.getServiceType() == vo.getServiceType()) {
                // 发票查验历史明细导出
                new CheckHistoryDetailThread(exportLogService, list, invoiceCheckDetailService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.FPQS_QSCX.getServiceType() == vo.getServiceType()) {
                // 签收查询导出
                new FpqsExportThread(exportLogService, list, fpqsService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.MRYX_QSCX.getServiceType() == vo.getServiceType()) {
                // 每日优鲜发票扫描明细导出
                new MRYXqsExportThread(exportLogService, list, mryxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.FPQS_SGQS.getServiceType() == vo.getServiceType()) {
                // 手工签收导出
                new SgqsExportThread(exportLogService, list, sgqsService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CHECK_LIST.getServiceType() == vo.getServiceType()) {
                // 查验综合查询导出
                new CheckListThread(exportLogService, list, invoiceCheckListService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.HUNSAO.getServiceType() == vo.getServiceType()) {
                // 混扫导出
                new MixedSignThread(exportLogService, list, mixedSignService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.TS_AUTH.getServiceType() == vo.getServiceType()) {
                // 退税认证查询导出
                new TaxRebateAuthenticationThread(exportLogService, list, rzFpxxService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CUSTOMS_COLLECT.getServiceType() == vo.getServiceType()) {
                new CustomsCollectThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CUSTOMS_RZCX.getServiceType() == vo.getServiceType()) {
                // 缴款书认证查询导出
                new CustomsRzcxExportThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CUSTOMS_INSERT.getServiceType() == vo.getServiceType()) {
                // 缴款书录入
                new CustomsInsertThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CUSTOMS_MANUAL_SIGN.getServiceType() == vo.getServiceType()) {
                new CustomsManualSignThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.EXPORT_CUSTOMS_RZCX.getServiceType() == vo.getServiceType()) {
                // 出口-海关缴款书查询导出
                new ExportCustomsRzcxExportThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.EXPORT_INVOICE_RZCX.getServiceType() == vo.getServiceType()) {
                // 出口-发票查询导出
                new ExportInvoiceRzcxExportThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CUSTOMS_SIGN_QUERY.getServiceType() == vo.getServiceType()) {
                new CustomsSignQueryThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CUSTOMS_REFUND_VERI_QUERY.getServiceType() == vo.getServiceType()) {
                // 退税认证-海关缴款书认证查询导出
                new CustomsRefundVeriThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.EXPORT_INVOICE_QUERY.getServiceType() == vo.getServiceType()) {
                // 统计报表-转内销发票查询导出
                new ExportInvoiceQueryThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.EXPORT_CUSTOMS_QUERY.getServiceType() == vo.getServiceType()) {
                // 统计报表-转内销缴款书查询导出
                new ExportCustomsQueryThread(exportLogService, list, customsCollectService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CUSTOMS_QUERY.getServiceType() == vo.getServiceType()) {
                // 统计报表-转缴款书综合查询导出
                new JkszhcxExportThread(exportLogService, list, jkszhcxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.QYPCSMKP.getServiceType() == vo.getServiceType()) {
                // 企业票池-实名客票导出
                new QypcsmkpExportThread(exportLogService, list, ticketService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (56 == vo.getServiceType()) {
                // 票池-进项票据采集导出
                new PoolBuyPaperThread(exportLogService, list, poolPaperService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (57 == vo.getServiceType()) {
                // 票池-增值税发票采集导出
                new PoolAddTaxThread(exportLogService, list, poolPaperService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (58 == vo.getServiceType()) {
                // 票池-其他票据导出
                new PoolOtherThread(exportLogService, list, poolPaperService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (59 == vo.getServiceType()) {
                // 票池-销项票导出
                new PoolSaleThread(exportLogService, list, poolPaperService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (60 == vo.getServiceType()) {
                // 头条发票汇总报表导出
                new TtFprzhzExportThread(exportLogService, list, ttFprzhzService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.EXPORT_VIOLATION.getServiceType() == vo.getServiceType()) {
                // 头条发票汇总报表导出
                new ViolationSearchThread(exportLogService, list, violationSearchService, fileService, sender,
                    feginWebsocket, tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.SUPPLIER_RISK.getServiceType() == vo.getServiceType()) {
                // 供应商风险导出
                new RiskSupplierThread(exportLogService, list, violationSearchService, fileService, sender,
                    feginWebsocket).start();
            } else if (ExcelServiceTypeEnum.INVOICE_RISK.getServiceType() == vo.getServiceType()) {
                // 风险发票导出
                new RiskInvoiceThread(exportLogService, list, violationSearchService, fileService, sender,
                    feginWebsocket).start();
            } else if (ExcelServiceTypeEnum.RZJGQD_PDF.getServiceType() == vo.getServiceType()) {
                // 认证结果清单导出
                new RzjgqdPdfExportThread(exportLogService, list, rzjgqdService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.BB_FPMX.getServiceType() == vo.getServiceType()) {
                // 发票明细导出
                new FpmxExportThread(exportLogService, list, fpmxcxService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.CUSTOMS_PC.getServiceType() == vo.getServiceType()) {
                // 票池海关缴款书导出
                new CustomExportThread(exportLogService, list, customsService, fileService, sender, feginWebsocket,
                    tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.LQ_FPYCXX.getServiceType() == vo.getServiceType()) {
                // 乐企，异常发票信息导出
                new LqFpycxxExportThread(exportLogService, list, lqFpycxxService, fileService, sender, feginWebsocket,
                        tabulateRedisService).start();
            } else if (ExcelServiceTypeEnum.PC_DOWNLOAD_SOURCE.getServiceType() == vo.getServiceType()) {
                // 票池下载电子源文件
                new PcDownloadSourceThread(exportLogService, list, lqTdxInvoiceFileCoreDao,tDxRecordInvoiceJobDao,coreTDxInvoiceImgDao, tDxSaleRecordInvoiceJobDao,fileService, sender, feginWebsocket,
                        tabulateRedisService).start();
            }else if (ExcelServiceTypeEnum.YWGL_FPSLTJB.getServiceType() == vo.getServiceType()) {
                // 运维管理发票数量统计表导出
                new FpsltjbExportThread(exportLogService, list, ywglService, fileService, sender, feginWebsocket,
                        tabulateRedisService).start();
            }else if (ExcelServiceTypeEnum.FPRZ_SGRZ.getServiceType() == vo.getServiceType()) {
                // 发票认证--手工认证页面导出
                new RzFprzExportThread(exportLogService, list, rzFpsgrzService, fileService, sender, feginWebsocket,
                        tabulateRedisService).start();
            }else if (ExcelServiceTypeEnum.CPY_GX_EXPORT.getServiceType() == vo.getServiceType()) {
                // 成品油勾选--发票页面导出
                new CpyGxExportThread(exportLogService, list, cpyGxExportService, fileService, sender, feginWebsocket,
                        tabulateRedisService).start();
            }else if (ExcelServiceTypeEnum.CPY_GX_CUSTOMS_EXPORT.getServiceType() == vo.getServiceType()) {
                // 成品油勾选--缴款书页面导出
                new CpyGxCustomsExportThread(exportLogService, list, cpyGxCustomsExportService, fileService, sender, feginWebsocket,
                        tabulateRedisService).start();
            }else if (ExcelServiceTypeEnum.CPY_GX_CUSTOMS_EXPORT.getServiceType() == vo.getServiceType()) {
                // 成品油勾选--缴款书页面导出
                new CpyGxCustomsExportThread(exportLogService, list, cpyGxCustomsExportService, fileService, sender, feginWebsocket,
                        tabulateRedisService).start();
            }else if (ExcelServiceTypeEnum.DK_COUNT_EXPORT.getServiceType() == vo.getServiceType()) {
                // 抵扣统计页面，下载认证明细
                new DkCountExportThread(exportLogService, list, dkCountExportService,sysEnterpriseConfigDao, fileService, sender, feginWebsocket,
                        tabulateRedisService).start();
            }

            try{
                Thread.sleep(1000);
            }catch (Exception e){
               log.info("业务处理异常：{}", e);
            }

        }

    }

}
