package com.unis.base.server.config;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.unis.base.common.vo.QyxypjDr;
import java.util.List;

public class DataListener extends AnalysisEventListener<QyxypjDr> {
    private List<QyxypjDr> dataList;

    public DataListener(List<QyxypjDr> dataList) {
        this.dataList = dataList;
    }

    @Override
    public void invoke(QyxypjDr data, AnalysisContext context) {
        if (data != null) {
            dataList.add(data);
        }
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        //可以在此处处理数据，例如保存到数据库
    }
}
