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.IntBalanceDetailDTO;
import org.springblade.audit.dto.IntFzzDisconutDTO;
import org.springframework.stereotype.Component;

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

@Slf4j
@Component
public class IntBalanceDetailListener extends AnalysisEventListener<IntBalanceDetailDTO> {

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

	public boolean sysHead = true;

	public IntBalanceDetailListener() {
	}

	@Override
	public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
		if(headMap.size() != 9){
			sysHead = false;
		}
	}

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

	@Override
	public void doAfterAllAnalysed(AnalysisContext analysisContext) {
	}


}
