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.IntProvinceViolationDTO;
import org.springframework.stereotype.Component;

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

@Slf4j
@Component
public class IntProvinceViolationListener extends AnalysisEventListener<IntProvinceViolationDTO> {

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

	public boolean sysHead = true;

	public IntProvinceViolationListener() {
	}

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

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

	@Override
	public void doAfterAllAnalysed(AnalysisContext analysisContext) {
	}


}
