package cn.com.countrygarden.bi.main.listener;

import cn.com.countrygarden.bi.main.event.ExcelDownloadEvent;
import cn.com.countrygarden.bi.main.util.SyncErpToPerformanceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * excel下载监听器
 * 用于下载完的ERP数据同步
 */
@Component
public class ExcelDownloadListener implements ApplicationListener<ExcelDownloadEvent> {

    @Autowired
    private SyncErpToPerformanceUtil syncErpToPerformanceUtil;

    @Override
    public void onApplicationEvent(ExcelDownloadEvent event) {

        //Erp数据同步
        syncErpToPerformanceUtil.syncByType(event.getTypeNo());
    }
}
