package com.prolog.rdc.tms.service.impl;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.google.common.collect.Lists;
import lombok.Getter;

import java.util.List;
import java.util.Map;

/**
 * @author hongbo.pan
 * @date 2023/3/16
 */
@Getter
public class EasyExcelListener extends AnalysisEventListener<Map<Integer, String>> {

    /**
     * 表头
     */
    private List<Map<Integer, String>> headList = Lists.newArrayList();

    /**
     * 数据
     */
    private List<Map<Integer, String>> dataList = Lists.newArrayList();

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        headList.add(headMap);
    }

    @Override
    public void invoke(Map<Integer, String> integerStringMap, AnalysisContext analysisContext) {
        dataList.add(integerStringMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
