package org.springblade.audit.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.extern.slf4j.Slf4j;
import org.springblade.audit.dto.CwBalanceDetailDTO;
import org.springblade.audit.dto.StreamDTO;
import org.springframework.stereotype.Component;

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

@Slf4j
@Component
public class CwBalanceDetailListener extends AnalysisEventListener<CwBalanceDetailDTO> {

	public List<CwBalanceDetailDTO> list = new ArrayList<CwBalanceDetailDTO>();

	public boolean sysHead = true;

	public List<String> theMonth = new ArrayList<String>();

	public CwBalanceDetailListener() {
	}

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

	@Override
	public void invoke(CwBalanceDetailDTO t, AnalysisContext analysisContext) {
		Integer rowIndex = analysisContext.readRowHolder().getRowIndex();
		if(rowIndex > 6){
			list.add(t);
		}
	}

	@Override
	public void doAfterAllAnalysed(AnalysisContext analysisContext) {
	}


}
